Posts

Showing posts from April, 2010

java - GridPane in JavaFX -

i have questions grid pane. have this grid pane . how delete vertical line between first , second columns in 0 row? how change colors , size of grid lines? gridlines in gridpane development purposes. not meant used in production. in http://docs.oracle.com/javafx/2/api/javafx/scene/layout/gridpane.html 1 can read: gridlinesvisible - debug purposes only: controls whether lines displayed show gridpane's rows , columns.

Workflow stuck on "Wait for field to equal value" step - Sharepoint 2013 -

i have tasklist 20 columns , trying achieve following process using workflow: a user creates task filling fields 1, 2, 3 department manager receives notification new task has been created , assigns engineer assigned eng receives notification. i seems have problem point 3. far tried 2 things: enabling email notification "assigned to:" (default column) seems work if "assigned to:" filed filled when task created, not when task modified. i introduced new column called "eng assigned" check box yes/no values. when manager has assign eng, fills "assigned to:" , ticks "eng assigned" filed. unfortunately doesn't work either , workflow gets stuck on wait step. workflow: wait eng assigned equal yes if current item:eng assigned equals yes email currentitem:assigned to: i tried without if xxx result same... can please advise? thank in advance!

boost program options - how to automatically store the value of a simple flag into a variable? -

the boost option parser allows 1 assign variable store option value, instead of using so_long["typing"].as<bool>() way: bool flag_value; entries.add_options() ("flag", value<bool>(&flag_value), "a simple flag value"); ...... cout<<"flag value is: "<<flag_value<<endl; however, above option declaration not create simple flag option. requires enter value (--flag true|false|on|off|yes|no|1|0), not want. so, there way store result inside boolean value, , still keep option simple flag? to have option no value (passing means set true ) should create this : options_description desc; desc.add_options() ("help", "produce message") to use notifier such option can use following type semantics: boost::program_options::bool_switch() it can have true or false values , no value can explicitly taken option command line. if option passed value true . if not passed - value fals

android - Is it safe to assume that a thread created from the main thread is running in the background? -

for app i'm developing, created thread main thread follows: thread background = new thread(new runnable() { public void run() { log.d ("thread", "thread has started"); processimage(data, size.width, size.height, camera); camera.addcallbackbuffer(data); log.d ("thread", "thread has ended"); } }); if (!background.isalive){ background.start(); } now, safe assume newly created thread running along main thread (in backgroud)? yes, safe, after called start. can use isalive() method check whether thread executing. why need such assumption, anyway?

MySQL Sorting using order by not working using unio -

i'm using union statement in mysql i've problems sorting results. order statement doesn't works @ all, results comes out sorted id field. here example query: select a.* ( ( select * ticket_ticket t1 ticket_active=1 order t1.ticket_date_last_modified desc ) union ( select * ticket_ticket t2 ticket_active=0 order t2.ticket_date_last_modified desc, t2.ticket_status_id desc ) ) limit 0,20; i want order results of first select last_modified time, , second select time , status. order statement skipped. results come out ordered ticket_id ( primary key ). what's wrong in query ? thanks! ok, i've fixed writing query way: select a.* (select * ticket_ticket ticket_active=1 order ticket_date_last_modified desc) union select b.* (select * ticket_ticket ticket_active=0 order ticket_date_last_modified desc, ticket_status_id desc) b limit 0, 20;

ios - How to pass Data to a ViewController created using instantiateViewControllerWithIdentifier? -

i've created app uses bunch load of container views. today i've found out embedded segues not supported in ios 5 (thanks xcode letting me know.) right have lot of embedded segues passes data between 1 another. i'm using code load viewcontrollers inside uiview instead of container ib: rootviewcontroller: - (void)viewdidload { [super viewdidload]; uistoryboard* storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; newsviewcontroller *news = [storyboard instantiateviewcontrollerwithidentifier:@"newsviewcontrollerid"]; news.view.frame = self.newssection.bounds; [self.newssection addsubview:news.view]; [self addchildviewcontroller:news]; [news didmovetoparentviewcontroller:self]; // additional setup after loading view. } how can use above , still pass data newsviewcontroller (something prepare segue) i've tried inserting in above like newsviewcontroller *news = [storyboard inst

php - Automatically adding a unique number to a PDF download -

i have client sells gift vouchers online - have piece of software use allocate numbers certificates, can't used more once - when hands in voucher enter number on computer, means if else has same number it's not going accepted. this easy enough when selling @ shop, want sell them online *using paypal payment gateway). have design of certificates, need able following: allow users buy via paypal (easy enough) re-direct users download page (again easy) this gets hard, need every download have unique number on somewhere - when print number on i.e. not file name. this easy enough on webpage, add 1 number on every view, ideally in pdf format. i can use numbers (in order) 100 - 10,000. does know best way go this? firstly want atleast add check digit top stop people guessing next number in sequence. $gift_code = $random_number . check_digit( $random_number ); this not foolprof, idally should generate set of numbers existing software , go though list. store i

2 Worker Roles in one Azure Package -

i have 2 worker roles in 1 azure package. getting error: the port '3389' used both endpoint microsoft.windowsazure.plugins.remoteforwarder.rdpinput in role workerrole1 , endpoint microsoft.windowsazure.plugins.remoteforwarder.rdpinput in role workerrole2. but dont find reference microsoft.windowsazure.plugins.remoteforwarder.rdpinput in cloud service configuration(cscfg) file verify 1 of workerroles has "microsoft.windowsazure.plugins.remoteforwarder.enabled" setting in service configuration. if both of them have setting believe plug in attempt set endpoint both of them. need 1 of roles serve remote forwarder. there tunnels remote access of other roles have microsoft.windowsazure.plugins.remoteaccess.enabled set true. if case should giving error if attempt package or publish.

Error exporting data into Excel file using R tool -

i imported .csv file excel using excel in first task. now imported .csv r , exported r data excel file using command write.table(aviation,"d:\00projects\r\data\ aviation.xls",sep="\t") the problem facing .csv converted excel using excel event id investigation type accident number event date 20130710x74631 accident wpr13la321 07/10/2013 20130709x10955 accident wpr13la317 07/08/2013 this .csv converted excel using r tool. data has been shifted 1 column. not getting why ? event.id investigation.type accident.number event.date 1 20130710x74631 accident wpr13la321 07/10/2013 2 20130709x10955 accident wpr13la317 07/08/2013 why eventid column data has been shifted , replaced 1 , 2 numbers. check ?write.table , try this: write.table(aviation,"d:\00projects\r\data\ aviation.xls",sep="\t", row.names=f

asp.net mvc - MVC: Set action name using javascript fails -

i need set action form posts using javascript. tried this: $('form').get(0).setattribute('action', formaction); and $("#form").attr('action', formaction); in both cases, query malformed, this:localhost:xxxx//controller/action1/action2 why happen? how can correctly set action form posts ? complete javascript function this function getnotiftype() { formaction = "editwithdifferenttype"; $("#form").attr('action', formaction); $("#form").submit(); } i used @url.action() qualified url action, , worked: formaction = '@url.action("editwithdifferenttype", "notifications")'; $("#form").attr('action', formaction); $("#form").submit();

php - MongoDB get the id of a subdocument with ought loading the document -

an attribute in collection references collection's document looks this collection { "reffeddoc": { "$ref": "myclass", "$id": objectid("4e171cade3a9f23359e98206") }, .... } so, how select reffeddoc.$id in fields? can fetch withought fetching entire subdocument? i've tried reffeddoc.$id db.collection.find({}, {"reffeddoc.$id"}); and following error positional operator not match query specifier

Can not apply EAP pattern to WCF Service Client on Windows Phone 8 -

i trying apply eap pattern call wcf service. same code runs smoothly on windows console application hangs on indefinetely on task.wait on windows phone application. any ideas problem highly appreciated. thanks in advance here extension method , helper function: public static class serviceextensions { public static task<string> doglobalizationresourcesinquiryasynctask( service1client serviceclient, int request) { var tcs = new taskcompletionsource<string>(); eventhandler<getdatacompletedeventargs> handler = null; handler = (sender, e) => eaphelpers.transfercompletion( tcs, e, () => e.result, () => serviceclient.getdatacompleted -= handler); serviceclient.getdatacompleted += handler; try { serviceclient.getdataasync(request, tcs); } catch { serviceclient.getdatacompleted -= handler;

php ini class cannot see whats going wrong -

im trying create php class transform ini in array ie: example.ini... [helloworld] testing=1234 the array should like: array { "helloworld" = array { "testing" = "1234" } } my code fo far this: <?php require_once "usefullfunctions.inc.php"; class ini { protected $keys = array(); protected $values = array(); public function __construct($filename) { if (!file_exists($filename)){ throwexception('file not found',$filename); } $file = fopen($filename, 'r'); $isin = ""; while (($line = fgets($file)) !== false) { if(!startswith($line,'#')){ // checks if line comment if(startswith($line,'[')){ $isin = trim($line,'[]'); $this->keys[$isin] = ''; $t

dependencies - Get makefile to build two targets from the same file but with different flags -

i'm changing project makefile in order build executable same passing different flag compiler. before changing it, makefile this: targets = elilo.efi : check_gcc $(subdirs) $(targets) elilo.efi : elilo.so elilo.so : $(files) elilo.o : elilo.c $(arch)/sysdeps.h ... $(subdirs): dummy $(make) -c $@ ... include make.rules where: $(subdirs) stores subdirs of project $(files) , store .o files must created in order link elilo.so and check_gcc checks compiler version , exits if needed additionally, make.rules contains general rules compile , link files: %.efi: %.so $(objcopy) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ -j .rela -j .reloc --target=$(format) $*.so $@ %.so: %.o $(ld) $(ldflags) $^ -o $@ $(loadlibes) %.o: %.c # rule number 1 $(cc) $(incdir) $(cflags) $(cppflags) -c $< -o $@ # rule .s %.o: %.s $(cc) $(incdir) $(cflags) $(cppflags) -c $< -o $@ my t

php - Paypal API - GetVerifiedStatus - Invalid request -

i'm trying integrate paypal api in php application. use curl call remote method getverifiedstatus , i'm getting error 580023 - invalid request. my request: 'requestenvelope.errorlanguage=en_us&requestenvelope.detaillevel=returnall&emailaddress=email%40address.com&firstname=john&lastname=doe&matchcriteria=name' response after converting json: { "responseenvelope.timestamp":"2013-07-25t05:36:26.695-07:00", "responseenvelope.ack":"failure", "responseenvelope.correlationid":"e540c8c04a5b4", "responseenvelope.build":"6679946", "error(0).errorid":"580023", "error(0).domain":"platform", "error(0).subdomain":"application", "error(0).severity":"error", "error(0).category":"application", &quo

iphone - How to pop from one view controller to another view controller -

using ios have 15 viewcontrollers want pop 1 viewcontroller view controller. i using code: secondviewcontroller *sec=[secondviewcontroller alloc]init]; [self.navigationcontroller popviewcontroller:sec animated:yes]; this shows error this viewcontroller not exist , using code: nsarray *array = [self.navigationcontroller viewcontrollers]; [self.navigationcontroller poptoviewcontroller:[array objectatindex:1] animated:yes]; this code right pop thirdviewcontroller secondviewcontroller. happened when pop ninth(9th)viewcontroller fifth(5th)viewcontroller using code in ninth(9th)viewcontroller: nsarray *array = [self.navigationcontroller viewcontrollers]; [self.navigationcontroller poptoviewcontroller:[array objectatindex:4] animated:yes]; it not pop ninth(9th)viewcontroller fifth(5th)viewcontroller apart pops ninth(9th)viewcontroller eight(8th)viewcontroller. don't know happened when use line: nsarray *array = [self.navigationcontroller viewcontrollers]; nslog(@&qu

sql - Use as in select statement on select statement -

i have request select statement works in oracle, when execute in sql server throws exception; request : select non_existant (select rownum non_existant ,cab, validite tmp_rapprochement) validite '%non_existant%' the error : msg 207, niveau 16, État 1, ligne 2 nom de colonne non valide : 'rownum'. thank you. the error says rownum not valid column name (i'm glad google translate there help) msg 207, level 16, state 1, line 2 invalid column name 'rownum'. you need fix error first - make sure columns select 's list defined in table. once out of way, need provide alias inner select, this: select non_existant (select rownum non_existant ,cab, validite tmp_rapprochement) x -- x above alias, mandatory in sql server syntax. validite '%non_existant%' edit appears porting query oracle, rownum not real column. in case should replace row_number function, this: select non_existant (select row_number() on (

arrays - VB.net Alternative way of ReDim Preserve -

my program work think suffers performance issues, consuming upto 40% of total cpu usage while looping array. programs consume under 5% of cpu usage, think redim preserve causing looping around 100,000+ of lines. here code. dim sarray string() dim fstream new system.io.filestream("messages.txt", io.filemode.open) dim sreader new system.io.streamreader(fstream) dim index integer = 0 while sreader.peek >= 0 redim preserve sarray(index) sarray(index) = sreader.readline index += 1 loop fstream.close() sreader.close() is there alternative way of placing values array aside redim preserve? in advance, trapped problem right now. here updated code using list. dim sarray string() dim slist new list(of string) dim fstream new system.io.filestream("messages.txt", io.filemode.open) dim sreader new system.io.streamreader(fstream) dim index integer = 0 while sreader.peek >= 0

database - Display appointments on specified date in access -

thank of previous help. i have produced database in access (specified course) , wondering if possible produce query/report asks user input date , display appointments on specified date. e.g. 09/05/2013 (british date system) googled hours , not found looking for. thank in advance. this possible in access. can create form search field @ top, , display results accordingly. a first step build query displays appointments date. this link has great tips on that. here's link walk through using query source data in form: http://office.microsoft.com/en-us/access-help/use-a-query-as-the-record-source-for-a-form-or-report-ha010096318.aspx edit: if don't require pretty form, can skip part. query can written asks user input date criteria

T4 generated JavaScript constructor from a .Net Type -

sometimes may need generate javascript constructor in order apply strong typing/intellisense in javascript in javascript developer tool. possible generate javascript constructor function normal .net type using t4? there utility class this? thanks! there's no utility class, , if types in different assembly t4 make easier. you have use system.reflection or envdte in cases.

java - why won't my client side accept anymore input -

why won't client side accept anymore input, after inputing 1 fix message. client send fix message server side, , server check errors, , send message client if has errors or not on fix message. the problem comes when try send fix message client side, prior sending one, won't allow me send anything. client program public class tcpclient { public static void main(string[] args) throws ioexception { string serverhostname = new string ("wa1235"); //127.0.0.1 if (args.length > 0) serverhostname = args[0]; system.out.println ("attemping connect host " + serverhostname + " on port 57634."); socket echosocket = null; printwriter out = null; bufferedreader in = null; try { // echosocket = new socket("taranis", 7); echosocket = new socke

objective c - Core Data not updating, updated model -

i have weird problem has stumped me rather! i have core data entity have added new attributes to: deleted - boolean deleteddate - date i have following code, upon pressing sets both values on core data object: - (ibaction)deletebuttonintable:(id)sender { //get id of selected item in table nsinteger selected = [self.tweettableview rowforview:sender]; //create predicate , fetch objects core data nsfetchrequest *request = [[nsfetchrequest alloc] init]; nspredicate *testfortrue = [nspredicate predicatewithformat:@"approved == no"]; nssortdescriptor *sortdescriptor1 = [[nssortdescriptor alloc] initwithkey:@"postdate" ascending:no]; nsarray *sortdescriptors = [[nsarray alloc] initwithobjects:sortdescriptor1, nil]; [request setpredicate:testfortrue]; [request setsortdescriptors:sortdescriptors]; [request setentity:[nsentitydescription entityforname:@"tweet" inmanagedobjectcontext:_managedobjectcontext]];

sql - MS Access - alternative to performing a "full join" for columns with same name -

i have problem using access: using right + left outer joins overcome fact access not support full join. select * t1 right outer join t2 on t1.xxx = t2.xxx union select * t1 left outer join t2 on t1.xxx = t2.xxx on these tables: t1: id1 | xxx | fielda 1 x b 2 y c 3 z t2: id2 | xxx | fieldb d 2 k e 3 j f 4 h as result obtain table structure t1.xxx | t2.xxx | fielda | fieldb | id1 | id2 1 x 2 2 y k b d 3 3 z j c e 4 h f xxx not primary key has same name , numerical type (integer) i saw many other places should work collapsing 2 tables! here not (the elements on same rows, when non blank, of course same) my expectation final table: xxx | id1 | id2 |fielda | fieldb 1 x 2 b d y k 3 c e z j

javascript - Dialog Boxes and Controls implementation -

for now, i'm working on users managment page. when admin chooses delete user, did create alert , confirmation popups sure actions done. i have form, , 2 buttons <td colspan="2"> <input type="submit" value="modifier" name="modifier" onclick="return sure()"> ou <input type="submit" value="supprimer" name="supprimer" onclick="return sure2()"> </td> and several js functions : <script> function sure(){ alert("l'utilisateur <?php echo $nom->nom ;?> <?php echo $prenom->prenom ;?> bien été modifié."); } function sure2(){ var result=confirm("etes-vous sur de vouloir supprimer <?php echo $nom->nom ;?> <?php echo $prenom->prenom ;?> ?") if (result==true) { alert("suppression effectuée") close window.open ("admin_modif_use

c# - Running HttpUtility.JavaScriptStringEncode on all references to Resources translations? -

long version in web app work on, put our translations .resx files refer calling resources.filename.keyname (as specified in "to retrieve global resources using strong typing" section of http://msdn.microsoft.com/en-us/library/ms227982%28v=vs.100%29.aspx ). in places retrieve value directly, in lot of cases retrieve value used in javascript, need this: httputility.javascriptstringencode(resources.filename.keyname) the problem there thousands of these kinds of lines need wrapped call httputility.javascriptstringencode retroactively. there has better way rather going through entire source code , manually wrapping each reference resources. tl;dr version i need better way of wrapping each resources.filename.keyname call httputility.javascriptstringencode() manually going each reference , adding myself. i unable come true solution decided solve using regular expressions. now, problem still using visual studio 2010, has it's own subset of regex not

r - How do I split a column of factors into multiple columns of multiple factors? -

say have data frame looks this: factor value ====== ===== 1a.in 1.0 1a.out 2.6 1b.in 0.5 1b.out 3.4 2a.in 5.5 etc. my goal add columns data frame extract information single factor column, such: factor value fact1 fact2 fact3 ====== ===== ===== ===== ===== 1a.in 1.0 1 in 1a.out 2.6 1 out 1b.in 0.5 1 b in 1b.out 3.4 1 b out 2a.in 5.5 2 in i cannot figure out how without using subset ad nauseum. i'm relatively new r, , don't have background in programming, advice appreciated. see ?substr . within(df, { fact1 <- substr(factor, 1, 1) fact2 <- substr(factor, 2, 2) fact3 <- substr(factor, 4, 999) }) i'm making assumptions here how many characters use each new variable. more generality, should have kind of regular structure in factor , eg dots separators variables.

Pointer giving me rubbish in C although correct in another function -

so have list: struct list_elem { char* key; void* value; struct list_elem *prev; struct list_elem *next; }; and when try @ key , value of 2 different functions use same code try , see values are, 1 gives me correct answer , 1 doesnt. i add elements list : xpoint xpts[npts + 1]; ...do stuff ... xpoint *pointr = (xpoint*) calloc(npts, sizeof(xpoint)); pointr = &xpts; list_insert(&w->qr_coord, data, pointr); i try , key , value in 1 function (functiona): void list_insert(struct list *list, char* key, const void *value) { struct list_elem *elem = list_start(list); while (has_next(elem)) { xpoint pointr = (xpoint*) elem->value; printf("%s\n", elem->key); //this right printf("(%i,%i)\n", pointr->x, pointr->y); //this right //more code } } and in function(functionb) this: struct list *qr_list = &proc->window->qr_list; st

actionscript 3 - Actionscript3 difference between singleton and static -

in as3 have seen alot of people creating singleton classes using internal class n getinstance. i know whats basic difference in singleton , keeping public functions/vars static??? singleton in as3 can implement interface . (power of polymorphism) you can inherit or extend other class. can passed parameter other method. its methods can passed parameters other methods. ( almost unique ) lazy instantiation support * one instance, this keyword * static in as3 simple reach no instance, no this keyword * *updated/added due meaningful comments

c# - Inserting Multiple Inherited Entities Gives - Unable to determine the principal end of the relationship -

i'm using ef5 , i'm having issue can add 1 instance of inherited entity , save successfully, if add 2 or more instances of type, run issue below. these entities inherited types base type. fkessayitemcontent fk relationship ties type, essayitem , it's base, content . unable determine principal end of 'tdsmodel.fkessayitemcontent' relationship. multiple added entities may have same primary key. what missing here, such 1 entity insert fine, 2 of them inserted @ once cause problem when using inheritance? thanks! i ended answering myself. turns out in addition inheritance relationship, model had association between essayitem , `content'. removing association , maintaining inheritance fixed issue.

sql - Access 2010 query to Delete where exists not working -

i have join 2 tables , delete 1 table rows not exists in second table. trying query below. should delete 7 records deletes entire persons table. delete persons.* persons exists ( select persons.[ir number], persons.[last name], persons.[first name], persons.dob, persons.[name type] 1 tblperson right join persons on ( iif(isnull([1tblperson].dob) = true, "01/01/9999", [1tblperson].dob) = iif(isnull(persons.dob) = true, "01/01/9999", persons.dob) ) , ([1tblperson].firstname = persons.[first name]) , ([1tblperson].lastname = persons.[last name]) , ([1tblperson].nametypelit = persons.[name type]) , ([1tblperson].incinmbr = persons.[ir number]) ( ( (persons.[ir number]) in ( select [qryincinmbrsfordelete] ! [incinmbr] [qryincinmbrsfordelete] ) ) , ( (persons.[last name]) n

javascript - escape single quote from last name in jquery -

i have ajax call in jquery code doing lookup c# web method. the call works of time, user needs enter last name , results last name. the problem happens when user enter last name single quote included such o'leary . this jquery line using: data: "{selectedagent: '" + $('#<%=txtagentnametext.clientid %>').val() + "', companyid: '" + $('#<%=ddlcompany.clientid %>').val() + "'}", the problem happens txtagentnametext.clientid value. it looks passing json string jquery ajax method. why not pass javascript object? var data = { selectedagent:$('#<%=txtagentnametext.clientid %>').val(), companyid: $('#<%=ddlcompany.clientid %>').val() }; $.ajax({...data:data...})

node.js - NodeJs Convert string to BSON object -

how can convert string (_id) bson object? as driver i'm using monk . monk defines id , oid (alias) methods casting objectid : users.id() // returns new generated objectid users.id('hexstring') // returns objectid users.id(obj) // returns objectid though seems capable of working string well: users.findbyid('hex representation', function(err, doc){}); users.findbyid(oid, function(err, doc){});

c++ - size of off_t at compilation time -

after reading numerous report on stackoverflow, decide go file* (over std::fstream) manipulate binary files. furthermore, needed truncate file during process (_chsize or ftruncate), work file descriptor (fileno call). so trying have working (c++): #define _file_offset_bits 64 #include <stdio.h> static inline off_t ftello(file *stream) { #if _win32 #if defined(__mingw32__) return ftell( stream ); // 32bits #else return _ftelli64( stream ); #endif #else return ftello( stream ); #endif } however not working on visual studio. not find anywhere in documentation way change size of off_t @ compilation time. it tempting have signature (i assume have c99: stdint.h): static inline int64_t ftello(file *stream) what others have been doing ? for reference, here have been reading, seems indicate file* provide better performance: writing binary file in c++ fast if enforcing large file support, define ftello() return int64_t. you might find inttypes.h more

itextsharp - How to stamp and sign a pdf ALREADY signed without invalidating previous signature -

some plugins , programs can this; there example or tutorial how using .net , itextsharp?? i need take signed pdf , stamp imagen on pages , add signature. first signature on document must valid when open file. thanks in advance. when require first signature on document must valid when open file, assume foremost talk opening in current adobe reader version. in case first of must aware allowed , disallowed changes depend on first signature itself. have @ this answer information on "allowed , disallowed changes" considered adobe since version 9 of acrobat & reader. thus, to take signed pdf , stamp image on pages , add signature , not invalidate (in eyes of adobe software) initial signature in process, signed pdf must either uncertified (i.e. initial signature merely approval signature) or certified annotations, form fill-in, , digital signatures, allowed (i.e. initial signature certification signature types of changes allowed) , have empty signat

statistics - Weighted average in graphite/statsd -

a follow this question give context here. i using statsd report aggregated metrics graphite: 1/1/2000 metric1 12 2/1/2000 metric1 10 (each value average of metric1 in period) now when want calculate average on period, need consider number of events in each period (e.g period 10 events affect average more 1 3 events). plan report number of events metrics separately , weighted average. i expected many people need not find online on approach. have wrong requirement in statistical aspect? there better ways achieve it? on system, collect 2 metrics, average , number of calls (count). both pieces of data useful independently. use average diagnose performance issues , count find trends in usage. these 2 may give need. so, if can, i'd suggest start collecting 'count' data too.

objective c - Custom TableViewCell is not called (programmatically) -

i´ve been searching long time through lot of code here nothing helped me.... i created custom tableviewcell programatically , want connect them view. here code. the .h file // gtcustomcellview.h #import "gtview.h" @interface gtcustomcellview : uitableviewcell @property (nonatomic, retain) gtview* containerview; @property (nonatomic, retain) gtimageview* commentimageview; @property (nonatomic, retain) gttextview* commentview; @property (nonatomic, retain) gttextview* dateview; @property (nonatomic, retain) gttextview* authorview; @property (nonatomic, retain) gtview* groupview; @property (nonatomic, retain) uilabel* mainview; @end the .m file @implementation gtcustomcellview - (id)initwithframe:(cgrect)frame { self = [super initwithframe:frame]; if (self) { self.layout = [[[gtflowlayout alloc] initwithspacing: 0] autorelease]; self.backgroundcolor = gtdefaultbackgroundcolor; self.containerview = [[[gtview alloc] initwithframe:cgrectmake(0.0, 0.

asp.net - Jquery shows image for few seconds then hides -

i trying use jquery display image when button clicked. displays image page refreshes , image gone. pretty sure issue when button clicked form.submit refreshes page, need because updating dropdown list values hidden text box text of button being pasted (the page refreshes user not have hit enter, automatically them). wondering how can both when button clicks shows image , page refreshes , image still there. here 2 versions of function have tried , have not worked: function movetext(text) { document.getelementbyid("result").value=text; } function showimage() { $("#loadingimage").show(); return false(); } and other one: function movetext(text) { document.getelementbyid("result").value=text; } function showimage(event) { $("#loadingimage").show(); event.preventdefault(); } additional info: here button code: <input name="failure analysis lab" style="w

jquery - Search-by-tag results returned on a single line -

i searching text <div> tag. problem when search, <div> data come 1 line. here fiddle. http://jsfiddle.net/fc4sg/ in fiddle, type break press search. why don't <div> contents keep formatting? here's code: var searchindex = -1; var searchtermold =''; $(document).ready(function(){ $('.searchbox').on('change',function(){ if($(this).val()===''){ var selector = "#realtimecontents"; $(selector+' span.match').each(function(){ $(this).replacewith($(this).html()); }); } searchindex = -1; $('.searchnext').attr("disabled", "disabled"); $('.searchprev').attr("disabled", "disabled"); searchtermold = $(this).val(); }); $('.searchbox').on('keyup',function(){ var selector= "#realtimecontents"; if($(this

http - Angularjs $httpd assign variable onSuccess to $scope empty -

i have controller: .controller('mycontroller', ['$scope','$http', function ($scope,$http,) { $scope.saveit = function () { $scope.key = ''; $http.get('/gethash',{"key": $scope.key}) .success(function(response, status, headers, config){ $scope.key = response.key; }); } console.log ($scope.key) // key empty } why @ end $scope.key empty? it won't set until call saveit() , won't have done yet when log statement executed. you've defined function sets key , haven't invoked it.

c# - Play sound slowing down application XNA -

i'm writing application randomly generates musical tone rows played system. there graphics involved. as far aware, sound , graphics entirely in different threads. however, number of sound effects in project build up, graphics animations slow down hugely. the sound effects never triggered more 150 ms (and of time less this), there 5 or 6 sound effects being played simultaneously different sources. past 3 sources, starts getting slowed down , @ 6 being redrawn slowly. is there hidden part of soundeffect.play() might somehow executing in main thread , slowing down? i've tried things like: public void play() { mysoundeffect.play(volume, pitch, pan); } public void playsound() { thread t = new thread(play); t.start(); }

Android: Workaround for light sensor firing every time the Power button is pressed? -

i'm working on android app turns device's screen off when light sensor value below threshold value , turns screen on again when light sensor value rises above threshold value. threshold value decided user through one-time calibration. works great, screen turns on , off when it's supposed , i've dealt constant fluctuations in light sensor's values screen doesn't keep turning on , off randomly. the issue i'm facing when power button pressed, light sensor's "onsensorchanged" event triggered reason. means if user presses power button turn screen off, it's automatically turn on if it's in right lighting. the solution thought of keep flag variable won't allow code in service execute if power button pressed issue there android not allow me detect power button key press service. is there possible (perhaps more logical) workaround issue? i don't think helpful post code let me know if need me post it. thanks. instea

jquery - Javascript Geo Redirection not working -

my code gives blank page. no redirection occurs <script src="http://code.jquery.com/jquery-latest.js"></script> <script language='javascript'> $.getjson( "http://smart-ip.net/geoip-json?callback=?", function(data){ if (data.countrycode == "ca") { window.location = 'canada.php'; } else { window.location = 'usa.php'; } </script> you script missing termination code. place }); right before </script> . so code should this... <script src="http://code.jquery.com/jquery-latest.js"></script> <script language='javascript'> $.getjson( "http://smart-ip.net/geoip-json?callback=?", function(data){ if (data.countrycode == "ca") { window.location = 'canada.php'; } else { window.location = 'usa.php'; } }); </script>

datagridcomboboxcolumn - State, County, and City cascading comboboxcolumns in Datagridview -

state, county, , city cascading comboboxcolumns. created simple form datagridview. datagridview contians 3 comboboxcolumns (state, county , city). when select state county combobox should show counties within state, when select county, city column should show cities within selected state , county. need able change state , county @ point, should reset other corresponding columns. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace statecountycitydatagridviewcomboboxcolumnissue { public partial class form1 : form { private datatable dtstatecountycity = new datatable(); public form1() { initializecomponent(); dtstatecountycity = createdatatable_statecountycity(); var statelist = (from scc in dtstatecountycity.asenumerable()

java - Missing directory in IntelliJ IDEA 12 -

i'm project tree, compilation directory tomcat '/web-inf/classes' not visible. access can deploy specific compiled *.class files remote host. i've checked both file types -> ignored files , compiler -> excludes , there's nothing there hide directory. checked git , it's not excluded there. does intellij hide compilation directory default in project tree? there way make visible?

c# - Creating a list filled with new instances of an object -

what's best way create list arbitrary number of instances of same object? i.e there more compact or efficient way following? static list<myobj> myobjs = enumerable.range(0, 100) .select(i => new myobj()) .tolist(); ( enumerable.repeat give me ten references same object, don't think work.) this wouldn't hard implement iterator: ienumerable<t> createitems<t> (int count) t : new() { return createitems(count, () => new t()); } ienumerable<t> createitems<t> (int count, func<t> creator) { (int = 0; < count; i++) { yield return creator(); } }

delphi - Windows Service Application Dependent that uses WINE for Linux -

i developing custom office application uses custom service authenticates users. my doubts are: will work in mac if client ask me compile osx using delphi-xe3? will work in linux if use wine port application , service? if using vcl's tservice framework, work on windows, includes use of wine.

will paginate - Rails 4 - will_paginate -

this first attempt using will_paginate (i know! have been??) titles_controller.erb def index @titles = title.active.sorted.paginate(:page => params[:page]) end index.html.erb <% will_paginate @titles.each |title| %> error: undefined method `total_pages' #<enumerator:0x00000002bacaf0> wtf doing wrong? in advance. please read paginate docs . need write: <%= will_paginate @posts %> there no need adding each . so entire view like: <% @titles.each |title| %> <!-- smth title --> <% end %> <%= will_paginate @titles %>

Jquery mobile losing formatting on a ul listview -

this listview element: <ul data-role="listview" data-inset="true" id="acceptedcontent" data-theme="c"> </ul> create process works fine first time through , listview looks supposed , appears working great: $('#acceptedcontent').append('<li><a href="#info' + results.rows.item(i).infoid + '" data-transition="flow">' + results.rows.item(i).info + '</a></li>'); i call empty div, works , clears div out: $('#acceptedcontent').empty(); refresh page ajax post, when data read database rebuild pages. list page loses formatting. call same function built page first time with. rebuilding section data populated loose formatting $('#acceptedcontent').append('<li><a href="#info' + results.rows.item(i).infoid + '" data-transition="flow">' + results.rows.item(i).info + '</a></li>

php - symfony2 unable to send email via gmail -

i have been trying send email using swiftmailer, not able so, getting following exception request.critical: uncaught php exception swift_transportexception: "failed authenticate on smtp server username "myusername@gmail.com" using 1 possible authenticators" @ /home/ubuntu/symfony/vendor/swiftmailer/swiftmailer/lib/classes/swift/transport/esmtp/authhandler.php line 184 [] [] can tell missing here? looks authentication failing reason. here snippet config file: swiftmailer: transport: gmail encryption: ssl auth_mode: login host: smtp.gmail.com username: myusername@gmail.com password: password my dev server has ubuntu v13 os try removing config_dev.php encryption: ssl auth_mode: login there no need specify encryption: , auth_mode: if you're using transport: gmail see symfony2.3 cookbook how use gmail send emails quick , dirty way test email options. init new symfony 2.3 project , in default controller