Posts

Showing posts from January, 2013

javascript - Checkbox to button focus -

i've got multiple forms on page. in 1 form i've got 3 text fields check box , button. when tab key pressed, goes 3 text fields , checkbox , no where. how can focus button ( submit ) after checkbox ( maths ) , first text field ( user_id ). <form id="form13"> user id :<input type="text" id="user_id" /><br> password: <input type="password" id="password" /><br> department: <input type="text" id="department" /><br> <input type="checkbox" id="maths" value="on"> maths <input type="submit" id="submit" value="submit" /> </form> $('#maths').keydown(function(e){ if (e.which == 9){ $('#submit).focus(); } }); if need handle tabbing in html forms. may need handle html attribute tabindex article learning purpose : <input id="

c++ - Copy doesn't work in my string::copy implementation -

following on https://codereview.stackexchange.com/q/126242/23788 . i wrote string class , according feedback have changed stuff. there more should fixed? +operator doesn't work , not know i've done wrong. have segfault when "str+str". process finished exit code 139 and str.h class str { friend std::istream &operator>>(std::istream &, str &); friend void swap(str &s, str &t) { std::swap(s.data, t.data); std::swap(s.length, t.length); std::swap(s.alloc, t.alloc); } public: typedef char *iterator; typedef size_t size_type; str() : data(nullptr), length(0), capacity(0) { } str(size_type length, char char_to_fill) : str() { create(length, char_to_fill); } str(const char *s) : str() { create(s); } template<class in> str(in b, in e) : str() { create(b, e); } ~str() { if (data) alloc.deallocate(data, capacity); data = nullptr; } s

python - BeautifulSoup returns an empty string? -

i don't know if question has been asked before, couldn't find solve problem (hopefully didn't misunderstand anything). i'm learning python @ moment, using python 3.5 ipython, , ran trouble using beautifulsoup. shown below, import bs4 examplefile = open('example.html') examplefile.read() >>> '<html><head><title>the website title</title></head>\n<body>\n<p>download <strong>python</strong> book <a href=“http://inventwithpython.com”>my website</a>.</p>\n<p class=“slogan”>learn python easy way!</p>\n<p>by <span id=“author”>al sweigart</span></p>\n</body></html>' examplesoup = bs4.beautifulsoup(examplefile.read(), 'html.parser') examplefile.read() >>> '' elems = examplesoup.select('#author') print(elems) >>> [] i'm able open , read example.html, after use beautifulsoup, when try

ios - How to wait for a nested Alamofire request to complete -

i have 2 alamofire requests. both work fine on own. func getpatientid() { //puts patientid patientid variable usingoauth2(drchronooauth2settings, performwithtoken: { token in router.oauthtoken = token apicalltext = "last_name=" + self.lastname.text! + "&" + "first_name=" + self.firstname.text! alamofire.request(router.getpatientswithfilter()) .responsejson(completionhandler: { (result) -> void in if let data = result.data { let response = nsstring(data: data, encoding: nsutf8stringencoding) self.result.text = "\(response)" json = json(data: data) } self.result.text = "" if json!["count"].intvalue > 1 { self.result.text = "more 1 patient" patientid = "-1"

How to delete a common row from multiple tables using SQL -

i understand can delete multiple tables using joins. but, i'm not sure how that. tried using statement , didn't work either. delete trm, val mcs.stg_mdcr_trmntn_rpt trm, mcs.stg_mdcr_vldtn_rpt val trm.import_proc_id = 156; what's wrong with delete mcs.stg_mdcr_trmntn_rpt import_proc_id = 156; delete mcs.stg_mdcr_vldtn_rpt import_proc_id = 156; commit;

javascript - JQuery Filter Table for Start and End Date input fields -

i have table. table contains rows , 1 of columns in each row date. there 2 input text boxes above table; 1 input box represents date , other represents date. let's user enters in date, table display every row contains date , after. opposite goes if user enters date in input field; show rows dates leading date. along if user has , date. catch dates date , date along every row contains date in between those. what have completed far input field search entire body of table , output row whichever characters user has entered. jquery <script> $("#searchinput").keyup(function () { //split current value of searchinput var data = this.value.split(" "); //create jquery object of rows var jo = $(".fbody").find("tr"); if (this.value == "") { jo.show(); return; } //hide rows jo.hide(); //recusively filter jquery object results. jo.filter(function (i, v) { var $t

java - Server is not connecting -

i have void method called startserverconnection() connects server port, in case 7777. method called inside action listener button in class, clientgui . i'm pretty sure code correct, reason output "waiting connection..." public void startserverconnection(){ try{ serversocket = new serversocket(portnumber); while(true){ system.out.println("waiting connection..."); socket clientsocket = serversocket.accept(); system.out.println("connection established on port: "+clientsocket.getlocalport()); clientconnection clientconnection = new clientconnection(clientsocket); thread thread = new thread(clientconnection); thread.start(); } } catch(exception e){ e.printstacktrace(); return; } } edit client class, connectclient method: public void connectcl

parse.com - Query Relational data on Parse -

i have seen other questions relating querying relational data on parse , don't quite meet need. i have 3 related classes: teacher (1->many) course (many<-1) category given above structure, want query instructors have courses fall under category. here have far: var category = parse.object.extend("category"); var category = new category(); category.id = "shdh43ay"; var course = parse.object.extend("course"); //there pointers on course both teacher , category var coursequery = new parse.query(course); coursequery.equals('category', category); var teacher = parse.object.extend("teacher"); var teacherquery = new parse.query(teacher); teacherquery.matchesquery(); //here stuck it doesn't me matchesquery trick, ideas welcome

c++ - Is it possible to get file path from cpp file in IOS project -

hi developing ios app , have cpp file in need read binary file. sending path .mm file cpp file via function call not option unfortunately. way see cpp file somehow should call function in .mm file return exact path binary file. how may that? sounds calling objectivec method (returning file path application bundle) c / c++ want achieve. question has answer how call objective-c method c method? to obtain actual path of binary file add xcode project , make sure add "build phases" > "copy bundle resources" phase inside xcode project setting. call [[nsbundle mainbundle] resourcepath] to path directory should contain binary file. don't forget helper methods [nsstring stringbydeletinglastpathcomponent]; when working file paths.

subprocess - Execute files in windows with Python -

this question has answer here: open document default application in python 13 answers i want make python program execute file in windows. means if try execute .txt file, open default .txt viewer. possible? i tried subprocess.call , windowserror: [error 193] %1 not valid win32 application . file i'm trying run .png file. os.startfile("mytext.txt") #open text editor os.startfile("mytext.pdf") #open in pdf viewer os.startfile("mytext.html") #open in webbrowser is how should however os.startfile("my_prog.py") is bad idea because there no way know if python set default open *.py or if texteditor or ide set default open *.py

mysql: how to query when id in another table record's field -

this question has answer here: query multiple values in column 4 answers say have 2 tables doctors , patients assume patients has 2 columns: id , name assume doctors has 3 columns: id, npi, patientids each patientids field can have multiple patient's id value. how can query patients belong doctor if given id of doctors table. i have tried following sql, not return anything select p.name patients p p.id in (select patientids doctors d d.id=@id); with small data set, fast enough: select p.name patients p join doctors d on d.id=@id , find_in_set(p.id, d.patientids) ; but really, commenters have said, want join table mediating relationship between patients , doctors .

python - Django deleting a model instance with no more related ForeignKey items in another model? -

in model below, when artist deleted through admin, it'll confirm , delete related songs. however, when delete song through admin, i'd delete artist if artist has no more related items in song. there model option in admin? how should done in custom view not inside of modeladmin? class artist (models.model): name = models.charfield(max_length=100) def __str__(self): return self.name class genre (models.model): name = models.charfield(max_length=100) def __str__(self): return self.name class song (models.model): artist = models.foreignkey(artist, on_delete=models.cascade) genre = models.foreignkey(genre, null=true, blank=true, on_delete=models.set_null) title = models.charfield(max_length=100) mix = models.charfield(max_length=100, blank=true) def __str__(self): return self.title could through delete method of song . def delete(*args, **kwargs): artist = self.artist super(song, self).dele

msmq - How do you wait to receive one of several MessageQueue's in .NET? -

i porting older c++ component c#. it's job sit idle, until message arrives on 1 of several queues, deal it. in c++ used waitformultipleobjects, passing array of handles each of queues we're monitoring. in .net, messagequeue class has .receive() method blocks until message arrives, not see obvious way block until message of several queues arrives. ideally not want use asynchronous api. .net program using native libraries not thread safe.

javascript - Slice a string from second space to a special character? -

var name_rawstring = 'a. john doe-john (class of 2010)'; i'm trying extract substring occuring after second space , before ( . in case: "doe-john". so far i've tried: var getstr = name_rawstring.slice(name_rawstring.substr(0, name_rawstring.indexof(' ', name_rawstring.indexof(' ') + 1)), name_rawstring.indexof(' (')); and var strsplit = name_rawstring.split(' '); var getstr = name_rawstring.slice(name_rawstring.indexof(strsplit[1]) + 1)), name_rawstring.indexof(' (')); you give regular expressions try: name_rawstring.match(/^(?:\s+\s){2}(.+?) \(/)[1]; or, if prefer more verbose solution: var haystack = 'a. john doe-john (class of 2010)'; var firstspaceindex = haystack.indexof(' '); var secondspaceindex = haystack.indexof(' ', firstspaceindex + 1); var openparenindex = haystack.indexof('('); var needle = haystack.slice(secondspaceindex + 1, openparenindex - 1)

c - Random number generation in my implementation -

is implementation of random number generation wrong? int random_number(int l, int u) { int num; num = rand()%u; if (num<l && num>u) { while(num<l && num>u) { num = rand()%u; } } return num; } this not giving me correct answer. if try random_number(4,8); generates numbers 0,1,2 etc. assuming u means upper , l means lower, wrong. try this: int random_number(int l, int u) { int num = rand() % (u - l); return num + l; }

web services - How can I set up a from home hosted website without buying a static IP? -

so know somesites allow host web content you, can start charge arm , leg based on how want update it, how have, , other things. pretty want host personal site , me. access things need rpg characters , references, cosplay stuff, gaming stuff, , ilk. i'm going investing in small box more or less on , online, unless loose internet reason or have restart router etc, i'm running issue of need buy static ip around $60 month. that's $60 don't have or want spend on little pet project. , before suggest or ask, no don't want site blogger or w/e me. my question is, , know i've been told before friend can't seem remember said, there way can done without using static ip address , hosting site home still? oh should add i'd can host own restful webservice on small little 1 off personal apps i'd use myself too. actually live in elastic cloud century, there no need buy static ip. can try these things follows. amazon web service . can 1 yea

php - how to count together the size of files when they are created in foreach loop -

i using folder in user can upload files. these files outputted name , size. $dir = "users/$username"; $files = scandir($dir); foreach ($files $file) { if ($file != '.' && $file != '..') { echo sizeformat(filesize($dir . '/' . $file)); } so output looks this: koala.jpg => 600kb jellyfish.jpg => 600kb tulips.jpg => 500kb how can count sizes together? something like: toal size files: 1700kb like this: $dir = "users/$username"; $files = scandir($dir); $total = 0; foreach ($files $file) { if ($file != '.' && $file != '..') { $total += filesize($dir . '/' . $file); echo sizeformat(filesize($dir . '/' . $file)); } } echo $total;

java - ImageArray not populating when the fields are passed to it -

so have imagearray finds 17 fields. not populate them array @ end. says image array empty. debugger shows log populated 17 fields database. array fails include them @ imagearray.add(rn); java oncreate @override protected void oncreate(bundle savedinstancestate) { requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_myreceipts); receiptsoperations ro = new receiptsoperations(this); list<receipt> receipts = ro.getreceipts(); for(receipt rn : receipts){ string log = "receiptid:" + rn.getreceiptid() + "receipturi:" + rn.getreceipturi(); log.d("result: ", log); imagearray.add(rn); } receipt list initialised public list<receipt>getreceipts() { // code retrieve images database. list<rec

python - Combine elements in list of Tuples? -

i'm working on program takes in imdb text file, , outputs top actors (by movie appearances) based on user input n. however, i'm running issue i'm having slots taken actors in same amount of movies, need avoid. rather, if 2 actors in 5 movies, example, number 5 should appear , actors names should combined , separated semicolon. i've tried multiple workarounds , nothing has yet worked. suggestions? if __name__ == "__main__": imdb_file = raw_input("enter name of imdb file ==> ").strip() print imdb_file n= input('enter number of top individuals ==> ') print n actors_to_movies = {} line in open(imdb_file): words = line.strip().split('|') actor = words[0].strip() movie = words[1].strip() if not actor in actors_to_movies: actors_to_movies[actor] = set() actors_to_movies[actor].add(movie) movie_list= sorted(list(actors_to_movies[actor]))

Grails - combine errors in command object and subobjects -

i checked out grails: how combine domain objects' errors command objects' errors? , reason solutions aren't working me. it's possible they're grails 1.3.7 , not grails 2.2.1. i have command object outerobjectcommand contains list of innerobjectcommand. i'm populating manually in controller, , calling validate. calling validate() on outerobjectcommand not appear validating innerobjectcommand list, validate elements of list separately. want add errors of innerobjectcommand objects , outerobjectcommand object flash.errors. how can this? have @ last example in validator page. vaguely, need below: class parentcommand { list<childcommand> childcommands static constraints = { childcommands validator: {val, obj -> def errors = [] val.each{ errors << (!it.validate() ? it.errors.allerrors : []) } errors?.flatten() } } }

mysql - INSERT IGNORE for date while ignoring time -

i'm inserting data unique 3 columns using insert ignore. how can exclude time , check date if unique other 2 columns below? unique index columns: timestamp, action, value time stamp format: 2016-04-21 13:33:47 my table sample: 2016-04-21 13:33:47, send, email 2016-04-20 11:21:32, send, email 2016-04-19 17:32:65, send, email what i'm trying do: if try insert data below, should ignored because there's existing data 2016-04-21, send, email. 2016-04-21 19:33:47, send, email the way ignore work if have 1 or more columns in unique index. in case need date field that's derived datetime . for example: alter table my_emails add column sent_date date create unique index idx_sent_date on my_emails (sent_date) then can populate it: update my_emails set sent_date=date(sent_datetime) with whatever columns are. point forward you'll need sure populate both fields.

oracle - PLSQL Function that doesn't raise exception properly -

i writing function return student's name when id entered. if id entered, doesn't exist in database, want exception raised. instead when enter incorrect student ids either returns nothing if have basic exception thrown or returns error message exception declared: 6503. 00000 - "pl/sql: function returned without value" *cause: call pl/sql function completed, no return statement executed. *action: rewrite pl/sql function, making sure returns value of proper type. here's function: create or replace function student( s_num in number) return varchar2 student_name varchar2(50); notexists exception; cursor s_cur select s_name roster s_num = s_id; begin open s_cur; fetch s_cur student_name; if s_cur%notfound raise notexists; end if; close s_cur; return student_name; exception when notexists -- handle error dbms_output.put_line('no student found.'); end; any ideas? when excepti

html - How to detect last update in Javascript? -

have 2 labels in html allows user choose 1 number in each. how check box entered last , value entered in javascript? also, how can change value of user entered if want to? <div class="text1"> <%: html.editorfor(x => x.decimal) %> </div> <div class="text2"> <%: html.editorfor(x => x.decimal) %> </div> how can find textbox latest changed? doing right? var change1 = document.getelementbyid('text1').lastmodified; var change2 = document.getelementbyid('text2').lastmodified; if(change1.value > change2.value) //do like this window.onload = function(){ var 1 = document.getelementsbyclassname("text1")[0].children[0]; var 2 = document.getelementsbyclassname("text2")[0].children[0]; var lastchanged = null; var input1value, input2value; one.onkeypress = function(e){ input1value = e.target.value; lastchanged = 1; console.log("lastchanged &

javascript - Meteor - Can't submit user after adding routes with iron.Router to the login and register form -

i want create simple login, register , logout menu meteor , iron router . before used iron router package submit new user , login or logout. therefore had code in html document: <body> {{#if currentuser}} {{> dashboard}} {{else}} {{> register}}<br> {{> login}} {{/if}} </body> now want route login , register form. if press login button should get: lochalhost:3000 login (which works fine). but don't know: why can't submit new user anymore how can change successful login route dashboard route and how can logout (couldn't test yet) i'm new js , meteor. still didn't find solution in internet or way fix on own. my complete document looks like: main.html: <head> <title>routing</title> </head> <body> {{#if currentuser}} {{> dashboard}} <!--{{else}} {{> register}}<br> {{> login}} --> {{/if}} </body> <template name="ma

python imaplib search with multiple criteria -

i'm trying use search function , running issue. can download attachments gmail account , sort them according file extension. have of code working right except when add criteria search. search criteria unseen emails, works , flags email seen , moves trash. decided add it. here example: original: resp, items = m.search (none, 'unseen') new: resp, items = m.search (none, '(from "email" subject "some text")', 'unseen') it results emails moved trash, still unread , none of attachments downloaded. have idea may doing wrong here? thanks. to build on jithps comment right syntax this: result, data = mail.search(none,'(from "email" subject "the subject" unseen)') the clauses passed capital letters , criteria within quotes.

blur - svg feGaussianBlur: correlation between stdDeviation and size -

when blur object in inkscape let's 10%, get's filter fegaussionblur stddeviation of 10% * size / 2. filter has size of 124% (it big, inkscape doesn't add bit on safe-side). where number come from? guess 100% + 2.4 * (2*stddeviation/size) , 2.4 come from? from the svg 1.1 spec: this filter primitive performs gaussian blur on input image. gaussian blur kernel approximation of normalized convolution: g(x,y) = h(x)i(y) h(x) = exp(-x2/ (2s2)) / sqrt(2* pi s2) , i(y) = exp(-y2/ (2t2)) / sqrt(2 pi*t2) with 's' being standard deviation in x direction , 't' being standard deviation in y direction, specified ‘stddeviation’. the value of ‘stddeviation’ can either 1 or 2 numbers. if 2 numbers provided, first number represents standard deviation value along x-axis of current coordinate system , second value represents standard deviation in y. if 1 number provided, value used both x , y. even if 1 value provided ‘stddeviation’

How to get a jquery error div to fade out when all errors are cleared -

i've got code i've been using show form errors @ top of form change. code fades in error box when errors have been cleared snaps shut. prefer either have fade away or slide transition isn't jarring can't figure out how accomplish , appreciate helping hand. below code i'm using create error block. in advance. errorelement: "div", errorplacement: function(error, element) { offset = element.offset(); error.addclass('message'); // add class wrapper error.css('position', 'absolute'); error.css('left', offset.left + element.outerwidth()); error.hide().insertbefore(element) }, onfocusin: function( element, event ) { this.lastactive = element; // hide error label , remove error class on focus if enabled if ( this.settings.focuscleanup && !this.blockfocuscleanup ) { if

css3 - Use ease-in-out with steps() in CSS -

i'm creating loading spinner , having issues animation. the sprite sheet runs through 22 steps. i'd use easing effect @ start , end of animation. when add easing, animation goes static. jsfiddle: https://jsfiddle.net/flignats/aaaaaf6h/3/ .hi { width: 68px; height: 68px; background-image: url("data:image/png;base64, ... "); -webkit-animation: play 1s steps(23) infinite; -moz-animation: play 1s steps(23) infinite; -ms-animation: play 1s steps(23) infinite; -o-animation: play 1s steps(23) infinite; animation: play 1s steps(23) infinite; } @-webkit-keyframes play { { background-position: 0px; } { background-position: -1564px; } } @-moz-keyframes play { { background-position: 0px; } { background-position: -1564px; } } @-ms-keyframes play { { background-position: 0px; } { background-position: -1564px; } } @-o-keyframes play { { background-position: 0px; } { backgro

Concurrency with scala.sys.process.ProcessBuilder -

i'm using spdf's run method render html pdf file. run uses scala.sys.process.processbuilder , it's ! method: /** starts process represented builder, blocks until exits, , * returns exit code. standard output , error sent console. */ def ! : int my controller using future asynchronously execute conversion won't spdf block other interim executions? future { pdf.run(sourceurl, outputstream) } map { exitcode => outputsteam.tobytearray } update thanks answer paul did little test , yeah looks way :) if update spdf's run so: def run[a, b](sourcedocument: a, destinationdocument: b)(implicit sourcedocumentlike: sourcedocumentlike[a], destinationdocumentlike: destinationdocumentlike[b]): int = { println("start/ " + system.currenttimemillis) < ... code removed ... > val result = (sink compose source)(process).! println("finish/ " + system.currenttimemillis) result } and

javascript - Fetch Span Value on specific Website -

so have java code fetch values span. values comes null. not sure might issue. if span written in javascript, possible extract values span using java on eclipse? here code , using jsoup: public static void main(string[] args) throws ioexception{ document document = jsoup.connect("https://www.binary.com/trading?l=en").useragent("mozilla").get(); elements elements = document.select("span#spot"); (element element : elements) { system.out.println(element.text()); } } } as mentioned earlier, no values on console. if try on other websites, data no issues. there anyway fetch these values? your problem if span added using javascript, it's not present part of response code gets. you need ensure code can run js browser obtain result , trigger actions lead obtaining result if any. i recommend against doing this, , reside obtaining proper api source this.

android - SetFitsSystemWindow programmatically doesn't work as expected -

i'm trying work different appbarlayouts in 1 activity. when fragment loaded, can call "toolbarmanager", handles replacing of active toolbar (namely appbarlayout). of these toolbars (using collapsingtoolbarlayout) want them draw behind statusbar. works fine when setting "fitssystemwindow" true in xml. when using toolbar layout_scrollflags="scroll" , toolbar title displayed behind statusbar. to avoid this, want disable "fitssystemwindow" when loading such toolbar using setfitssystemwindow(false) . disabling works fine, when re-enabling setfitssystemwindow(true) using collapsingtoolbarlayout, statusbar colored , toolbar placed below statusbar padding in size of statusbar on top. image: drawn below statusbar instead of behind when don't use setfitssystemwindow(true) , set true in xml layout, display of collapsingtoolbarlayout fine. is bug in setfitsystemwindow or method different xml attribute? here layouts use: activit

Android WindowManager position like Facebook Reactions Behavior -

Image
this sequence of question i'm trying replicate implementation of facebook reactions vertically, answered made windowmanager. i've created layout buttons, set setontouchlistener take motionevent.action_donw, when rviv1 pressed on cardview catch catch event.getrawx , event.getrawy,this code have. vholder.rviv1.setontouchlistener(new view.ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { int evex =(int) event.getrawx(); int evey =(int) event.getrawy(); int measureheight = (vholder.ivhappy.getmeasuredheight()); if(vholder.mviewexpressions == null) vholder.mviewexpressions = new expressionsview(activity); if (event.getaction() == motionevent.action_down) { log.d("pressed", "button pressed"); /// createfloatview(); if(vholder.mviewexpressions.getwindowtoken() == null){

identityserver3 - subdivide web api authorization in machine to machine scenario -

i need advice coming proper configuration scenario using identiyserver. the scenario machine machine communication. single web api divided 2 parts. 1 part allows notifications posted (write). second allows information queried (read). i envision protecting endpoints [authorize("write")] , [authorize("read")] . can tell, scopes api wide... if can used clarify access in way, haven't figured out... or simple brain. suggestions? scopes can used @ finer grained level app wide. normal claims check in api scope require api. perhaps work: https://github.com/identitymodel/thinktecture.identitymodel/blob/master/source/webapi.scopeauthorization/scopeauthorizeattribute.cs

r - Grading students' exams -

i think there's single line of code grades students' responses, can't quite find it. here's example 3 questions , 2 students. thanks in advance #the correct answers key = t(c(1,2,3)) #the student responses responses = t(data.frame(c(1,2,3),c(1,3,3))) colnames(responses) =c('v1','v2','v3') rownames(responses) = c('student1', 'student2') #the desired graded matrix graded = t(data.frame(c(t,t,t),c(t,f,t))) dimnames(graded) = dimnames(responses) graded i'd way: responses == key[col(responses)]

quartz.net - ServiceStack.Funq.Quartz cannot instantiating type? -

servicestack.funq.quartz sample code public class myservices : service { public object any(hello request) { return new helloresponse { result = "hello, {0}!".fmt(request.name) }; } } public class hellojob : ijob { private myservices myservices { get; set; } public hellojob(myservices myservices) { myservices = myservices; } public void execute(ijobexecutioncontext context) { var response = myservices.any(new servicemodel.hello { name = "coderevver" }); response.printdump(); } } the above works fine. if in myservices class, removed function, , comment execute inner code. public class myservices : service { } the quartz.net error: [quartz.core.errorlogger】 error occurred instantiating job executed. job= 'jobgroup1.getuserjob111' problem instantiating type 'servicestackwithquartz.hellojob' why class must have public object any(hello req

android - Deleting custom objects from a listview within a fragment using onClick XML -

i'm still learning lot programming. i've set own listview item layout display custom object. within custom listview layout, there's image button has onclick method associated it. i've realised onclick passed parent activity, i'm not sure how remove listview item arraylist of custom object within fragment. i'm not explaining myself well, here code snippets go it. image button xml within custom listview layout: <imagebutton android:layout_width="0dp" android:layout_height="match_parent" android:src="@drawable/deleteitem" android:scaletype="fitcenter" android:background="@null" android:adjustviewbounds="true" android:layout_weight="0.15" android:layout_marginend="5dp" android:id="@+id/deleteitembutton" android:onclick="delitem"/> onclick method in parent activity:

php - Amazon S3 presigned url - Invalidate manually or one time upload -

i using s3 accept direct uploads user s3. therefore using pre-signed urls. after successful upload, aws lambda make sure file upload image, , client tell server has finished uploading. then server check if file exists in s3 (if lambda detects invalid image, deletes it). if does, rest of application logic follow. however, there loophole in mechanism. user can use same url upload malicious file after telling server has finished uploading (and passing valid file). lambda still delete file, server think file exists whereas not. is there way generate one-time upload pre-signed url, or possible forcefully invalidate url generated has not yet expired? turning answer... once file uploaded, have lambda move (using copy object api ), i.e. uploads/123.png received/123.png or similar. if malicious user attempts re-use signed url, it'll go uploads/123.png . worst-case, lambda checks again , rejects new file. since server's looking in received/ instead of upload

email - How to select menus in Mail.app using Apple Script -

what i'm trying set smart mailbox take list of companies mailboxes i'm assigned per day (ranges anywhere between 8 30 depending on size of account , number of people working) can watch , assist companies. ideally script accept list of companies , go through mailboxes , add them smart mailbox "messages in mailbox" "company a" company in mailbox > letter > company. here have far. set customernames {"example, a"} set customernumber 1 display dialog "what customer's names?" default answer "" set customernames text returned of result tell application "mail" activate tell application "system events" tell process "mail" tell menu bar 1 tell menu bar item "mailbox" tell menu "mailbox" click menu item "new smart mailbox…" end tell end tell end tell end tell k

c - Array of Swift Strings into const char * const * -

i having trouble converting array of swift strings array c function signature: pgconn *pqconnectstartparams(const char * const *keywords, const char * const *values, int expand_dbname) in swift, const char * const * shows as: <unsafepointer<unsafepointer<int8>> so try convert contents of dictionary [string:string] called 'options' , feed function follows: var keys = [[int8]]() var values = [[int8]]() (key, value) in options { var int8array = key.cstringusingencoding(nsutf8stringencoding)! keys.append(int8array) int8array = value.cstringusingencoding(nsutf8stringencoding)! values.append(int8array) } pgconnection = pqconnectstartparams(unsafepointer(keys), unsafepointer(values), 0) it compiles , runs, function not work. any insight appreciated. that's not perfect @ least works. let options = ["key1": "value1", "key2": "value2", "key3": "value3", &qu

xamarin.forms - How to properly use an AbsoluteLayout inside a StackLayout inside a ScrollView in Xamarin? -

ok, give up. 3 days spent trying accomplish simple thing. here scenario (not on same xaml file): <tabbedpage> <navigationpage> <contentpage/> <contentpage/> <carouselpage> <carouselcontentpage> this carouselcontentpage : <contentpage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:class="myapp.layouts.pointinfodatatemplate" > <contentpage.content> <scrollview orientation="vertical" backgroundcolor="navy" verticaloptions="fill"> <stacklayout x:name="mystacklayout" horizontaloptions="startandexpand" verticaloptions="start" backgroundcolor="gray"> <label x:name="namelabel" fontsize="medium" horizontaloptions="center"/> <label x:name="d

SQL Server : how to use SQL statements to get the desired results -

i can use cursors, it's inefficient. there better way use sql statements these results? table: a a1 id a2 -------------------- aaa 8:30 bbb 9:30 ccc 10:00 table: b id ​b2 ---------- 8:30 9:00 9:10 9:30 9:50 10:01 12:00 desired results: id b2 ​ ​a1 --------------------- 8:30 ​ ​aaa 9:00 ​ ​aaa 9:10 ​ ​aaa 9:30 ​ ​bbb 9:50 ​ ​bbb 10:00 ​ ​bbb 10:01 ccc 12:00 ccc although not have method achieve, because explanation not enough.you should explain why 9:30 ​bbb , why 10:00 bbb i tried using sql server 2012+ declare @t table(a1 varchar(50),id varchar(50), a2 time) insert @t values ('aaa','a','8:30') ,('bbb','a','9:30') ,('ccc','a','10:00') --select *,lead(a2,1)over(order id ) a2_endtime @t declare @t1 table(id varchar(50), ​b2 time) insert

codenameone : Custom calendar button background -

i need create calendar different background colors depending on content of daybuttons, how can make colors fix : unchanged when selecting date using codenameone. i tried simple modification when selecting button colors turn white configured in theme (i use ui builder) @override protected void updatebuttondaydate(button daybutton, int year, int currentmonth, int day) { //daybutton.setuiid("container"); daybutton.getallstyles().setpaddingtop(3); daybutton.getallstyles().setpaddingbottom(3); daybutton.getallstyles().setbgcolor(colorutil.blue); } try setting setchangesselecteddateenabled(false) make sure button doesn't have border , it's opaque doing this: style s = daybutton.getallstyles(); s.setpaddingtop(3); s.setpaddingbottom(3); s.setbgcolor(colorutil.blue); s.setbgtransparency(255); s.setborder(null);

vb.net - trigger an event from another control -

i'm using vb.net , winform. coming across issue i'm pounding head against past few hours. i have main usercontrol added groupbox , inside groupbox, added control this: main usercontrol me.groupbox1.controls.add(me.ctlwithdropdown) user control ctlwithdropdown me.controls.add(me.ddlist) private sub ddllist_selectionchanged(byval sender object, byval e system.eventargs) handles ddllist.selectionchanged 'some simple logic here check if value changed end sub the main usercontrol inherits base class has event set value true or false so: public event setflag(byval value boolean) i want know how can trigger/set boolean value dropdownlist when selectionchanged event trigger. on issue? wire event handler drop down list: addhandler me.ctldropdown.selectedindexchanged, addressof ddlselectedindexchanged me.groupbox1.controls.add(me.ctldropdown) make sure create ddlselectedindexchanged in control , have fire setflag event: protected sub ddls

php - Data Only Returned For 1st DB Call -

i populating 4 selects same query 1st select gets populated , sub-sequent ones not. matter of fact once reaches second select page_load() stops. questions: 1) causing page_load stop? 2) there way re-use code not have make multiple db calls return same data? here syntax: <div id="orderinfo" runat="server"> <table id="orderinginfo"> <tr> <td> <label for="labelselect">choose item</label> <select> <option value="null" selected="selected"></option> <?php include 'phpquery.php'; $sql = "select item items"; echo get_items($sql); ?> </select> </td> </tr> <tr> <td> <label for="labelselect1">choose item:</label> <select> <option value="null" selected="selected"

javascript - Cannot access endpoints API from chrome extension -

i using chrome extension calls chrome.identity api access token (using google plus login scope). i try call google endpoints api token. this, set request header 'authorization'='bearer <token>' format. i have added client_id manifest.json of chrome extension list of allowed client ids endpoints api. but, still cannot connect it, when run api on localhost. the allowed list of client ids includes clients defined on api credentials page on google developers console. chrome extension present client in list, it's client_id different. the error keep getting on server side: warning 2016-04-22 03:01:35,068 users_id_token.py:372] oauth token doesn't include email address. can please give me pointers try? please let me know if clarification necessary. the google oauth2 apis commons of types of clients, answer in general applies all. the google plus login scope( plus.login or plus.me ) not return email address, in order authenticated