Posts

Showing posts from May, 2014

javascript - can we have a pop up without the use of alert or windows.alert -

ideally when click action item in table shows "show message" on clicking on need popup without use of window.alert or alert instead show pop based on website design function showfailedwarning(){ dijit.byid('validationsform').clearmessages(); dijit.byid('validationsform').popup(alert("upload correct file ")); } method #1 - pure javascript you can build own pop-up whatever design want. either hardcode elements in html , set display:none container in css, or dynamically append container. note: why used innerhtml in place of appendchild() . live demo html <button id="error">click error</button> javascript document.getelementbyid('error').onclick = function (event) { event.preventdefault(); /*creating , appending element */ var element = '<div id="overlay" style="opacity:0"><div id="container">'; element += "<h

ios - Animate UIButton Down - Xcode -

i wanted know how go animating uibutton down when clicked via -(ibaction) thanks in advance! inside ibaction uibutton *button = (uibutton*)sender; //animates button 25 pixels right , 25 pixels down. customize cgrect newframe = cgrectmake(button.frame.origin.x + 25, button.frame.origin.y + 25, button.frame.size.width, button.frame.size.height); [uiview animatewithduration:0.3f delay:0.0f options: uiviewanimationoptioncurvelinear animations:^{ [button setframe:newframe]; } completion:nil]; edit - toggle between frames initialize boolean clicked no somewhere if (!clicked){ //animates button 25 pixels right , 25 pixels down. customize cgrect newframe = cgrectmake(button.frame.origin.x + 25, button.frame.origin.y + 25, button.frame.size.width, button.frame.size.height); [uiview animatewithduration:0.3f dela

python - Django Query only one field of a model using .extra() and without using .defer() or .only() -

i'm using django orm's exact() method query selected fields set of models save ram. can't use defer() or only() due constraints on orm manager using (it's not default one). the following code works without error: q1 = model.custom_manager.all().extra(select={'field1':'field1'}) # want 1 field model however, when jsonify q1 queryset, every single field of model.. extra() must not have worked, or doing wrong? print safestring(serializers.serialize('json', q1)) >>> '{ everything!!!!!}' to more specific, custom manager using django-sphinx. model.search.query(...) example. thanks. so, im not sure if can want do. however, if want values particular field or few fields, can values it full query, result have values want. using example: q1 = model.custom_manager.values('field1', 'field2').all() this should return valuesqueryset. not able use serializers.serialize have this: from django.ut

jaxb - how declare xml-element in xsd-schema -

i have xml elements: <attribute name="attributename1" type="typename1">value1</attribute> ... <attribute name="attributename2" type="typename2"> <row order="1"> <attribute name="attributename3" type="typename3">value3</attribute> ... </row> ... </attribute> how these elements can declared in xsd-schema? you define attribute element has type mixed content. following: <xsd:element name="attribute"> <xsd:complextype mixed="true"> <xsd:sequence> <xsd:element name="row" minoccurs="0" maxoccurs="unbounded"> <xsd:complextype> ... </xsd:complextype> </xsd:element> </xsd:sequence> </xsd:com

javascript - Set and change Jcrop image with an ajax query -

i want use jcrop on image obtained , changes ajax query. don't find way script work. @ moment script looks this: <script> $(function () { function jcrop_show_coords(c) { $('#roi_x1').val((c.x).tofixed(1)); $('#roi_y1').val((c.y).tofixed(1)); $('#roi_x2').val((c.x2).tofixed(1)); $('#roi_y2').val((c.y2).tofixed(1)); }; var jcrop_api; // holder api $('#img_ref').jcrop({ truesize: [100, 100], setselect: [1.0, 1.0, 99.0, 99.0], onchange: jcrop_show_coords, onselect: jcrop_show_coords },function(){ jcrop_api = this; }); function get_img() { $.ajax({ url: '/ajax/get_img.php', type: "post", data: { idref: $("#idref").val() },

css - Web Parallax Scrolling Background Image and Text -

fiddle of issue: http://jsfiddle.net/vy365/3/ i'm trying create sections on page have parallax scrolling effect. the main css i'm using achieve background-attachment: fixed background image, , position: fixed text on top of image. i have multiple div's effect on page, , want each section cover come before it. html: <section> <div id="parallax-1" class="parallax"> <div class="title"> <h1>fixed text 1</h1> </div> </div> </section> <section class="scrolling-content">scrolling content</section> <section> <div id="parallax-2" class="parallax"> <div class="title"> <h1>second fixed text</h1> </div> </div> </section> <section class="scrolling-content">scrolling content</section> css: .paralla

ios - ReloadData vs ReloadRowsAtIndexPaths (Specifically regarding Video Data from Files) -

why downloading video filepath require [tableview reloaddata] in order seen on tableview? i have been stuck on problem 3 days, , quite perplexed, , it's bad devforums down. basically, have tableview. each table view cell has avplayer , given remote url. in cellforrowatindexpath, if video data not stored locally, downloads it, , saves file, , avplayer attempts play video @ saved file location. the problem is, nothing ever gets played. unless call [tableview reloaddata] in each cellforrowatindexpath in order videos rendered. realize may quite bad performance, as, not nice user, try using reloadrowsatindexpath each cell, not work. why app need call reloaddata in order load data given local file location? , why doesn't reloadrowsatindexpath work? what's difference between two, in terms of getting video data has been written file path. i'd rather not reload anything, it's app unaware of new data in given file path if not reload tableview. code

ember.js - EmberJS - Access Controller value from application template -

learning emberjs in trial fire , 1 issue comes generated linkto's in application header. have paginator on resource such url becomes #/page/n. linkto not capable of picking on n application template, (because i'm not in pagecontroller context), link #/ if page set. what best way solve this? i'm using http://hawkins.io/2013/07/pagination-with-ember/ base paginator. if understood correctly, want access pagecontroller , it's pagination helpers different controller. can using needs access pagecontroller . needs: 'page', pagebinding: 'controllers.page' now can access pagecontroller within controller using this.get('page') , , use other methods on. in template can bind page.foo properties.

java - Hibernate optional dependencies -

i downloaded hibernate 4.2.3 final , see has several optional libraries, though i'm not sure uses them or under circumstances needed/desired: jboss-logging-3.1.0.ga.jar - native slf4j binding? there way have hibernate not use logging, , instead use slf4j , different binding? if so, how? c3p0 , proxool jars optionally included; these 2 connection pool frameworks hibernate can configured use? if wanted use, day, bonecp? if wanted let jndi (tomcat/dbcp) decide connection pool use? what hibernate-entitymanager ? what hibernate-envers ? thanks in advance! hibernate uses jboss-logging, refer to: how configure logging in hibernate 4 use slf4j i never heard of others, i'm sure of use cases. if want use tomcat/dbcp can use jta datasource. don't think there connection provider hibernate 3 or 4. source: http://wiki.apache.org/commons/dbcp/hibernate if want use hibernateentitymanager instead javax.persistence.entitymanager, can have jar on classpath , code it

c# - How to cancel a task from a TaskCompletionSource? -

i'm trying create async producerconsumercollection , that, i'm using msdn page ( http://msdn.microsoft.com/en-us/library/hh873173.aspx (bottom of page)). i'm trying add timeout, here : public async task<t> takewithtimeout(int timeout) { task<t> taketask = this.take(); if (timeout <= 0 || taketask == await task.whenany(this.tasks.take(), task.delay(timeout))) { return await taketask; } else { // timeout return default(t); } } } the problem code that, in case of timeout, not cancel task created take() method. since task has been "created" taskcompletionsource, cannot give cancellationtoken? so, how proceed cancel , implement take timeout ? thanks :) writing cancel-safe async -friendly producer/consumer collection non-trivial. need change take accept cancellationtoken parame

time - Convert seconds(float) into mm:ss:ms in php -

i have below php function takes time argument in seconds database. seconds of type float(6,1) in database. pass value function below. problem have if have 1655.5 seconds can hour, minutes , seconds. how milliseconds remain. ie 1655.5 = 27m:35s.5ms thanks in advance. <?php function convertto($init) { $hours = ($init / 3600); $minutes = (($init / 60) % 60); $seconds = $init % 60; if($minutes < 10) { $minutes = "0".$minutes; } if($seconds < 10) { $seconds = "0".$seconds; } $milli = /* code ret remaining milliseconds */ $stagetime = "$minutes:$seconds.$milli"; return $stagetime; } ?> possibly counter-intuitively, easiest way extract milliseconds first step. simply floor() initial value, , subtract result input. give right-hand side of decimal po

Hibernate Custom Order By Query -

public list<t> findrange(int start, int duration) { session hibernatesession = this.getsession(); list<t> results = null; try { hibernatesession.begintransaction(); query q = hibernatesession.createquery("from " + type.getsimplename() ); q.setfirstresult(start); q.setmaxresults(duration); results = q.list(); hibernatesession.gettransaction().commit(); } { hibernatesession.close(); } return results; } i have above query gets row range database me, need retrieve them ordered on jobstatus column, , not alphabetically or numerically following importance: case "open": return 1; break; case "on hold": return 2; break; case "offer extended": return 3; break; case "closed": return 4; break; how can rework hibernate query if want rows 10 through 20, retrieve them table in order? to generically, don&

ios - Unwind Segue Programmatically - New twist -

context: have 2 vc, , b. vc contains several buttons , several labels. when pressing button in vc a segue display vc b/c/ , forth. now, when finished vc a/b/c forth, segue being unwind vc appears. of vc b/c/d forth, using unwind method trigger through button in vc (ctrl + drag "exit" icon). works perfect, because upon returning vc a, following action being called automatically: - (ibaction)returned:(uistoryboardsegue *)segue { // here stuff } problem: now, in 1 of secondary vcs (e.g. d), things bit special. in vc generate hundred buttons through loop programmatically, detect button being pressed , unwind vc (without specific button; of buttons trigger unwind). know can eg using this [self dismissviewcontrolleranimated: yes completion: nil] but not trigger above action when returning vc a, or using this [self performseguewithidentifier:@"unwindsegueidentifier" sender:self] but generate new instance of vc a, not want (because labels in instance of vc

asp.net - How can we access read and write XML at same time -

in application creating xml file every 15secs @ admin side. creating xml have used string builder xml. file.writealltext("d:\\fe_display.xml", stringbuilder.tostring()) the same file used display in grid on front end every 15 secs. file minimum 10memebrs using @ same time @ front end.the below code used front end. dim ds new dataset() ds.readxml("d://fe_display.xml") try if ds.tables(0).rows.count > 0 grid1.datasource = ds.tables(0) grid1.databind() end if catch ex exception end try if both events(read , write) happens @ same time getting below error the process cannot access file 'fe_display.xml' because being used process use fileshare.readwrite option when opening file writing. allows subsequent opening of file reading or writing. if flag not specified, request open file reading or writing (by process or process) fail until file closed. however, if flag specified, additional permissions might

actionscript 3 - How to make a movie clip visible if only five movie clips (not more) are clicked -

i have 25 movie clips on stage , can clicked , colored. want movie clip named text_mc became visible if 5 specific buttons clicked , colored - not more. if user choose more 5 movie clips (even thought 5 movie clips included) movie clip named text_mc should stay invisible. can' t last part: if more 5 specific movie clips clicked text_mc should stay invisible. can please me? code stop(); import flash.display.movieclip; var sximata:movieclip = square1; import flash.display.movieclip; import flash.events.mouseevent; import flash.geom.colortransform; text_mc.visible=false; square1.addeventlistener(mouseevent.click, onsquare1); function onsquare1(e:mouseevent):void { sximata = square1; } square2.addeventlistener(mouseevent.click, onsquare2); function onsquare2(e:mouseevent):void { sximata = square2; } square3.addeventlistener(mouseevent.click, onsquare3); function onsquare3(e:mouseevent):void { sximata = square3; } square4.addeventlistene

c - add_custom_command from another target -

i'm trying setup cmake project 2 executables, 1 of simple utility used generate code other. relevant bits of cmakelists.txt: add_executable(lua2c lua2c.c) add_custom_command(output lcode.c command lua2c lcode.lua lcode.c main_dependency lua2c) ... add_executable(darpem ... lcode.c) with setup, target lua2c winds no dependencies, causes cc complain no input files. if remove add_custom_command line, lua2c built properly, doesn't generate file lcode.c . possible in cmake? need add subdirectory dependency of sorts? using cmake version 2.8.1 on ubuntu 13.04, x86-64. note: particular case, because lua2c simple enough, can use different language. am, however, still curious how might possible (for more complex setups). from documentation : note main_dependency optional , used suggestion visual studio hang custom command. maybe should solve problem : add_executable(lua2c lua2c.c) add_custom_command(output lcode.c command lua2c lcode.lua lcode.c depe

java - Only capture digits instead of the other text in input for a regex like below -

currently regular expression: ^(?:\\s+\\s+)*?(\\s+)\\s+(?:no\\.\\s+)?(\\s+)(?:\\s+\\(.*?\\))?$ captures 418&mdash;final in group number 2 input like: string text="h.b. 418&mdash;final version"; how change regular expression capture number (digits) of "418" in group2 ? edit: i'd still capture "h.b." in preceding group. just change boundaries of second group include digits. save "h.b." part, add paranthesis around part too: ^(?:(\\s+)\\s+)*?(\\d+)\\s+\\s+(?:no\\.\\s+)?(\\s+)(?:\\s+\\(.*?\\))?$

Only add NEW JSON entries from a URL to a CouchDB using PHP (don't store duplicates) -

server produces json, exposes via url. my server, b, queries url, grabs json, via php. i want stick in couchdb, running on b, via php. the issue way works gives last, say, 200 entries. if query on monday, , 200 entries, , query tuesday , 200 more, it's possible 50 of "new", don't want stick other 150 (that same) in db. what's best way of going this, using php , couchdb/json? the json entries [that url exposes] have systemid field, increases each element. if query url , receive 200 entries, last element in array should have highest systemid (not confused couchdb _id). can add fields (microtime?) json before stick in couchdb, still need know query in db make sure don't store duplicates. i think need create view based on these systemids, sort descending, , see of incoming json has systemid greater last element of view, i'm not entirely sure how this. any appreciated! edit: so, let's couchdb has @ moment: [ { "authorname

c++ - Static member array of pointers to member functions -

i trying define in .cpp file attribute should array of pointers member functions of class named hand. both array , functions members of hand , array static(please correct me if should not). this reached: static bool hand::*(hand::hfunctions)[] ()= {&hand::has_sflush,&hand::has_poker,&hand::has_full,&hand::has_flush, &hand::has_straight,&hand::has_trio,&hand::has_2pair,&hand::has_pair}; i error: hand.cpp:96:42: error: declaration of ‘hfunctions’ array of functions. i guess type definition worng need know how can make definition right the syntax rather convoluted one: class hand { bool has_sflush(); static bool (hand::*hfunctions[])(); ... }; bool (hand::*hand::hfunctions[])() = {&hand::has_sflush, ...}; a way gradually increasing complexity, using cdecl.org check @ each step: int (*hfunctions)() declare hfunctions pointer function returning int int (hand::*hfu

javascript - Loop through all descendants of a div - JS only -

i've been using jquery this: $element.find("*").each(function() { var $this = $(this); $this.removeattr("style width align"); if ($this.is("embed")) { $element.append("<div class='video'></div>"); $this.attr("width", 640).attr("height", 360).parent().appendto("#" + element + " .video"); }; }); but i've been reading jquery's .each() method quite slow when compared simple loop ( jsperf ). question how can mimic pure js? find elements within div , loop through nodes. i've tried search can seem find jquery answers - everywhere. i've tried other things close got selecting descendants: var children = document.getelementbyid('id').getelementsbytagname('*'); for( var = 0; i<children.lengtth; i++){ children[i].removeattribute("style"); console.log(children[i]); } you're doing ri

jquery how to get html of image in nested div? -

i have following html <a class="lid" id="1"> <div class="map_image"> <img width="220" height="145" alt="" src="photo.jpg" typeof="foaf:image"> </div> </a> im using following jquery id of link. function onlid { .setcontent($(this).attr("id")); } $('.lid').on('mouseover', onlid); so in case content set 1, id of class lid 1. what whole html of , set after 1. so content 1 <img width="220" height="145" alt="" src="photo.jpg" typeof="foaf:image"> im trying like .setcontent($(this).attr("id") + $(this.map_image).html()); any appreciated. thanks from question it's not entirely clear you're trying html. this code should find html inside of map_image class relative anchor tag , alert it: function onlid (event)

javascript - Making a position of an object fixed -

i trying make #two fixed when scrolled between: ($(this).scrolltop() > 1310 && $(this).scrolltop() <9000 ) this have tried: $(window).scroll(function () { if ($(this).scrolltop() > 1310 && $(this).scrolltop() <9000 ) { $('#two').css({positon:'fixed',bottom:'100'}); } else { $('#two').css({positon:'absolute'}); } }); but seems not working.. help? try {position:'fixed', bottom:'100px'} . if close you'll see {positon:'fixed',bottom:'100'} contains typos.

python - Recursively Identifying Sorted Lists -

as recursion practice exercise, writing python function recursively identifies if input list sorted least greatest, real numbers only, , returns boolean value. my code is: def det_sorted(lista): if len(lista) == 1: return(true) else: if lista[0] <= det_sorted(lista[1:]): return(true) elif lista[0] > det_sorted(lista[1:]): return(false) this function returns 'false.' general question: how iterate recursively through list correctly? specific question: have done wrong here? you close , want call recursion return else: if lista[0] <= lista[1]: return sorted(lista[1:]) or combine both statements return (and rid of else) return lista[0] <= lista[1] , sorted(lista[1:])

jquery - How to position a link near bootstrap icon? -

Image
i have span12 container , have 3x span4 i put icon , link each span3 . however, couldn't position link center of image. this code <div class="span3"> <div class="span4"><i class="icon-print icon-4x"></i></div> <div class="span8"><a href="#">keŞİf formu</a></div> </div> this image i want vertically align link icon. think tried every method couldn't succeed. this website view live demo. try adjust link line-height: line-height:4; or along lines, fiddle around it

Understanding Python HTTP streaming -

i'm struggling access streaming api using python , requests. what api says: "we’ve enabled streaming endpoint requesting both quote , trade data utilizing persistent http socket connection. streaming data api consists of making authenticated http request , leaving http socket open continually receive data." how i've been trying access data: s = requests.session() def streaming(symbols): url = 'https://stream.tradeking.com/v1/market/quotes.json' payload = {'symbols': ','.join(symbols)} return s.get(url, params=payload, stream=true) r = streaming(['aapl', 'goog']) the requests docs here show 2 things of interest: use generator/iterator use chunked data, passed in data field. streaming data, suggests using code such as: for line in r.iter_lines(): print(line) neither seem work, although i've no idea put in generator function, since example unclear. using r.iter_lines(), output: "b'{&q

java - Why this if statement is being skipped? -

Image
can anyway tell me why following if statement being skipped? want check if malphabetcode contains 0-9 literal, not 0 9. // check if alphabet code numeric if (malphabetcode.equals("0-9")){ malphabetcode = "-"; } here whole code: public void onitemclick(adapterview<?> parent, view view, int position, long id) { if (parent.getid() == r.id.lv_gl_content) { // store data pass intent mintent = new intent(this, achlist.class); mintent.putextra("mpageurl", mgamelist.get(position).getitempageurl()); mintent.putextra("mgametitle", mgamelist.get(position).gettitle()); // start activity , page animation startactivity(mintent); mpagetrans.slidein(); } else if (parent.getid() == r.id.lv_alphabet_content) { // alphabet code string malphabetcode = parent.getadapter().getitem(position).tostring().tolowercase(); // che

C programming processing va_args using sprintf? -

i trying learn how va_args work, want merge list of args format string inside of function im making. way im doing results in jiberish. there way let me avoid having write massive processing function? va_start( listpointer, msg ); #ifdef debug fprintf(stderr, msg, listpointer); #endif str = (char *)calloc(sizeof(max_line_size), sizeof(char)); if(str == null){ fprintf(stderr, "out of memory exception"); return; } snprintf(str, max_line_size, listpointer); printf("testing: %s\n", str); ret = write(logger, str, strlen(str)); if(ret == -1){ fprintf(stderr, "could not write file error: %s\n", strerror(errno)); fprintf(stderr, "cannot continue error logging"); } va_end( listpointer ); use vsprintf or vsnprintf function. rather taking list of parameters takes va_list parameters. you call as: vsnprintf(str, max_line_size, listpointer);

pointers - Wrong common expression substitution in C compiler? -

double *p; apparently, gcc 4.6.3 increments p 1 in following line under -o3 . myfunc (*(p++), *(p++)); is bug? *(p++) doesn't increment value pointer points to. if want value incremented (*p)++ ; another thing is, aren't guaranteed order in parameters evaluated. depends on compiler. left side incremented first, incremented second. regardless 1 parameter sent in original value , next original value + 1 (due nature of post increment); outside function, if didn't modify *p inside it, *p should have been incremented twice.

javascript - Dynamically added DIV with both dragging and resizing capabilities -

var total = 0; function add() { total++; document.body.innerhtml = document.body.innerhtml + '<div id="'+total+'" class="drag"></div>'; $('.drag').draggable().resizable(); } add(); add(); add(); http://jsfiddle.net/zvzfq/631/ the script revised works (sorta) problem last div class .drag dynamically added body element using javascript function add() replaces sizable() functionality of other divs class .drag not reason, draggabble() functionality this works: var t = 0; function add() { $('body').append('<div id="d'+t+'" class="drag"></div>'); $('#d'+t).draggable().resizable(); t++; } here's jsfiddle: http://jsfiddle.net/zvzfq/634/

java - Data Structure for storing several thousand objects with unique index -

i reading huge xml file java sax parser: http://api.steampowered.com/ieconitems_440/getschema/v0001/?format=xml (2.82 mb) this file contains several thousand 'items', each properties 'name', 'level', etc. 1 of properties unique integer identifier called 'defindex'. creating pojos each of these items of properties mentioned above fields (defindex 1 of them). i need read these item objects lot searching defindex i won't change data fields of objects though my question is: how should store these item objects? my first thought storing them in array , use defindex actual array-index, array huge , not defindexes used, e.g. jumps 2k 30k @ 1 point. use map . map objects store relationships between unique "keys" , values. implementations of map hashmap , treemap , among others. generic, type parameter key , value. you use following. pseudocode; adapt going manipulating these objects. did not take sax api account; d

java - Object Oriented Design/How to set up class structure -

i new object oriented programming , curious know @ high level how solve problem. if have list of different calendars i.e. work calendar, personal calendar, sports calendars, etc , each of them have there own respective events. assume have calendar class , nested class event class. since want display of events calendars on 1 list go on sorted array. lets wanted delete 1 of calendars work calendar how ensure work events deleted list/array. curious how class structure set @ high level. appreciated. here how go it, highlighted parts pick on: if have list of different calendars i.e. work calendar , personal calendar , sports calendars , etc , each of them have there own respective events . since want display of events calendars on 1 list go on sorted array. lets wanted delete 1 of calendars work calendar how ensure work events deleted list/array. that gives me: emum calendartype { work, personal, sport, } class event { // event data, time, pla

php - Custom Wordpress Page With Contact Form -

Image
i trying create contact form wordpress site. fyi: client wants form static don't need able change in future. found form online. put custom page in wordpress. put mail.php file on server. when click submit hijacks me homepage/main theme page , message never sent. don't understand why takes me homage how fix this. <table width="400" border="0" align="center" cellpadding="3" cellspacing="1"> <tr> <td><strong>contact form </strong></td> </tr> </table> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td><form name="form1" method="post" action="mail.php"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="16%">subject</td> <td width="

cURL isn't working, returning an error -

i'm trying pass variables through url generate xml data, pass variables , grab xml data curl , bring webpage can parse data , use 1 of elements attribute values , put php variable display on page. so seems i've been @ forever have following code, (fyi. put 'password' in place of real password. 'shipper number in here' in place of real shipper number , 'token here' in place of real token thread) $xml = ' weight_system="imperial" shipper_number="shipper number in here" destination_postal_code="'.$data5['zip'].'" service_type="1" '; $xml2 = ' total_pieces="'.$value.'" total_weight="'.$weight.'" '; $token = 'token here'; $base_url = 'https://www.shippingco.com/xml/ratingxml.jsp'; $request_url = $base_url . '?' . http_build_query(array( 'shipment' => '<shipment ' . $xml . '><tot

node.js - Socket.io firing callback function multiple times -

i'm working on multiplayer canvas game using node.js , socket.io , i'm having problems node server throwing ton of same error after client handshake established. here's copy/paste console: info - handshake authorized gedlfwyedfeijxgvozjg new player connected: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwyedfeijxgvozjg 22:3:26 - (onmoveplayer) player not found: gedlfwy

jni - Fatal signal 11 (SIGSEGV) in Android -

i'm working on project needs convert images gif. i'm using opensource( using jni) have problem devices (such google galaxy nexus, nexus 7). source link here : http://www.mediafire.com/?mvn31u3ht8nod39 thanks attention.

r - Is there a way to increase the height of the strip.text bar in a facet? -

Image
i grey bar @ top wider, in, have edges of little further top , bottom of letters (the strip.text - a, b, c etc). have thought lineheight have acted padding doesn't. ggplot(diamonds, aes(carat, price, fill = ..density..)) + xlim(0, 2) + stat_binhex(na.rm = true)+ facet_wrap(~ color) + theme(strip.text = element_text(lineheight=20)) first, modify levels include linebreak: levels(diamonds$color) <- paste0(" \n", levels(diamonds$color) , "\n ") then adjust necessary. eg: p <- ggplot(diamonds, aes(carat, price, fill = ..density..)) + xlim(0, 2) + stat_binhex(na.rm = true)+ facet_wrap(~ color) p + theme(strip.text = element_text(size=9, lineheight=0.5)) p + theme(strip.text = element_text(size=9, lineheight=3.0))

Typehead in bootstrap not working -

i can't figure out wrong in below code. it's not showing me dropdown if type alphabet. thankful if can throw light on this. <!doctype html> <html> <head> <meta charset="utf-8" /> <title>bootstrap typeahead example w3resource</title> <link href="bootstrap.css" rel="stylesheet" type="text/css" /> <script src="jquery.js"></script> <script src="bootstrap-typeahead.js"></script> </head> <body> <div class="well"> <input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="["ahmedabad","akola","asansol","aurangabad","bangaluru","baroda","belgaon","berhumpur","calicut","chennai","chapra","c

How to set dynamic url in sencha touch using store? -

i new platform, unable set dyanimic url using category id , token. what want: have list different items, have different ids same token, token(tokent same 1 user) getting login phase. want value accorading category id server. here model: ext.define('myapp.model.categorydisplaymodelmenu', { extend: 'ext.data.model', config: { fields: [ /*'cat_id',*/ 'category', 'name', ], belongsto: "myapp.model.categorydisplaymodel" } }); and another related model is: ext.define('myapp.model.categorydisplaymodel', { extend: 'ext.data.model', requires: ['myapp.model.categorydisplaymodelmenu'], config: { fields: [ {name:'data', mapping: 'data'}, {name:'name'}, {name: 'category'}, {name: 'author'}, ], } }); what set in store, not work:

class diagram - Does association in UML associate objects or classes? -

on wikipedia, i'm reading association relationship instance level relationship talking relationship between objects of 2 classes. when draw class diagram, why use association on class elements or blocks rather objects? , there class level relationships again use class elements. since don't have way show if talking objects or classes find confusing. example: i've heard people saying "associate these 2 classes" doesn't sound wrong? links associations objects classes . a class abstraction describes many specific objects. similarly, association abstraction describes many links between objects. so statement an association relationship instance level relationship isn't strictly correct because mixes abstraction (association relationship) instances represents. hth.

c# - An object reference is required for the non-static field, method, or property 'Microsoft.Xna.Framework.Input.MouseState.X.get'? -

so, want draw texture in front of cursor. here's code: private void drawcursor() { //draws cursor vector2 mouseplace = new vector2(mousestate.x, mousestate.y); spritebatch.draw(cursor, mouseplace, color.white ); } and error: error 1 object reference required non-static field, method, or property 'microsoft.xna.framework.input.mousestate.x.get' , this: error 2 object reference required non-static field, method, or property 'microsoft.xna.framework.input.mousestate.y.get' how fix those? (sorry if noob question) mousestate isn't static class.. you'll need this: var mousestate = mouse.getstate(); vector2 mouseplace = new vector2(mousestate.x, mousestate.y); etc. x , y public properties of mousestate instance .

C# generic constraint for Type to be castable -

is there way c# generics limit type t castable type? example : lets saving information in registry string , , when restore information have function looks that: static t getobjectfromregistry<t>(string regpath) t castable string { string regvalue = //getting regisstry value... t objectvalue = (t)regvalue; return objectvalue ; } there no such type of constraints in .net. there 6 types of constraints available (see constraints on type parameters ): where t: struct type argument must value type where t: class type argument must reference type where t: new() type argument must have public parameterless constructor where t: <base class name> type argument must or derive specified base class where t: <interface name> type argument must or implement specified interface where t: u type argument supplied t must or derive argument supplied u if want cast string type, can casting object first. can't put constraint on type param

node.js - Array.forEach / .map returning error when used with path.resolve -

i'm using nodejs 0.10.13. i'm curious behavior of following code snippet: > var = ['1','2','3'] undefined > a.map(function(){return path.resolve(arguments[0])}) [ '/users/user/1', '/users/user/2', '/users/user/3' ] > a.map(path.resolve) typeerror: arguments path.resolve must strings @ exports.resolve (path.js:313:15) > a.map(path.resolve.bind(path))) typeerror: arguments path.resolve must strings @ exports.resolve (path.js:313:15) why 2nd , 3rd map calls return error when array has strings? going relevant line in nodejs's source code yields this: if (typeof path !== 'string') { throw new typeerror('arguments path.resolve must strings'); } else if (!path) { continue; } which makes no sense why arguments not strings. have clue? this happens because parameters passed each call of mapped function not actual elment, array index , whole array. to see parameters

controls - openlayers refresh only feature, undo dragging -

im working on solution drag features. after drag created window ask users if want let feature on position or put on original location? there current solution: first of coordinates(left, bottom, right, top) original position of feature. drag feature , place it. in moment coordinates of new position. if dont want place here , put on original location, add original coordinates feature. , here problem. coordinates rewrite feature not located on original position. if use refresh method, doesnt help, because refresh method refresh whole layer, want refresh (if it's possible) current feature. best regards gabriel here do: make copy of original feature (serialize) before dragged to undo dragging, deserialize original feature , load it, if worked remove dragged version also have @ cancel method, maybe help: http://dev.openlayers.org/docs/files/openlayers/control/dragfeature-js.html#openlayers.control.dragfeature.cancel

php - How to create regex with following conditions? -

i have regexp dollar validation using regexp in javascript. /^\$?\d{1,3}(,?\d{3})*\.?(\d+)?$/ but doesn't work $.01 greater 0 (as dollar sign optional) , valid amount. requirements are- 1.$2000 2.2000 3.$2000.00 4.$2,000 5.2000.00 6.2,000.00 7.$.04 please suggest changes in current regexp. thanks john found solution::-- ^\$?([1-9]{1}[0-9]{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\-?\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\(\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))\)$ following regex should work you: ^\$?(?=.)(?:\d{1,3})?(?:,?\d{3})*(?:\.\d+)?$ live demo: http://www.rubular.com/r/0qqbwtrmol just remember make digits before dot optional match , enforces use of positive lookahead make sure there @ least 1 digit after optional $ sign. here non-regex based solution validate currency (usd): $fmt =

python - Django template not iterating through list -

tried looking @ other solutions cannot resolve issue. have problem django template iterate through {% cr in courses %} once outputting multiple lines together. e.g. given list [['3000', '1', '2458'], ['3000', '0', '2821']] , 1 iteration whole list , not 2 items in list. in django template have: <table> <tr><th>course</th><th>payment status</th><th>unit</th><th>action</th></tr> {% course in comp_course %} <tr><td>{{ course }}</td><td></td><td></td><td></td></tr> {% cr in courses %} {% if course == cr.0 %} <tr> <td></td> <td> {% if cr.1 == "1" %} paid {% else %}

arrays - Using streamreader in c# -

how guys use streamreader read .txt file , match 2 of combobox's text such sgd - singapore dollar , usd - dollar writes on label shows number of 1.26? exchange.txt: sgd - singapore dollar || usd - dollar = 1.26 here's code: private void getexchangerate() { using (streamreader sr = new streamreader("exchange.txt")) { string[] store = new string[100]; int index = 0; string line; while ((line = sr.readline()) != null) { store[index] = line; index++; lblexchange.text = sr.readline(); } } } private void tocountry_selectedindexchanged(object sender, eventargs e) { btnupdate.enabled = true; txtvalue.enabled = true; getexchangerate(); } in end, label did not show value of 1.26. don't know what's wrong it. need help you can private void getexchangerate() { string[] lines = file.readalllines("exchange.txt"); forea

Oracle Package inside a CLOB with length > 32767 characters. How to "execute immediate" it? -

please suppose have package creation script stored inside table alpha, in column beta of type clob. clob length > 32767 characters. using pl/sql code, "execute immediate" package creation script. i achieve this? thank in advance kind help. i using oracle 10g execute immediate didn't support clobs until 11gr2 . can use dmbs_sql handle larger statements. in earlier versions build statement, 11g allows parse clob . there example here . creating package dynamically seems odd requirement though. since you're on 10g, need use version of dbms_sql.parse lets build large statements : the parse procedure supports following syntax large sql statements: dbms_sql.parse ( c in integer, statement in varchar2s, lb in integer, ub in integer, lfflg in boolean, language_flag in integer); note: procedure concatenates elements o

google drive download document using javascript :can't download files -

i have download documents google drive using google drive api java. want use javascript instead of java. using drive api client libraries java script code. using below code achieving this function downloadfile(file, callback) { if (file.downloadurl) { var accesstoken = gapi.auth.gettoken().access_token; var xhr = new xmlhttprequest(); xhr.open('get', file.downloadurl); xhr.setrequestheader('authorization', 'bearer ' + accesstoken); xhr.onload = function() { callback(xhr.responsetext); }; xhr.onerror = function() { callback(null); }; xhr.send(); } else { callback(null); } } my problem can able display file names , contents. can't download files. need code? how can save files in local system. suggestions ? note: can value in file.downloadurl if paste downloadurl in browser won't give result ,just show blank page. "if paste downloadurl in browser won't give result" co

java - How to get a DataSource? -

i'm not how datasource object. able use drivermanager method obtain connection sql database running on localhost, every time try use datasource method wind getting exceptions (mostly naming). what wondering is: is possible datasource object local hosted databases? does datasource class need published, or drivermanager connection no new class creation? could show example? a datasource allows getting jdbc connection pool of connections. datasource object represents particular dbms or other data source, such file. if company uses more 1 data source, deploy separate datasource object each of them. datasource interface implemented driver vendor. externalize db connection properties file , fetch object using jndi. using datasource need know jndi name. application server cares details. it can implemented in 3 different ways: a basic datasource implementation produces standard connection objects not pooled or used in distributed transaction. a dataso

mysql - Computed field value based on other column while insertion -

i have table have id column(primary key auto increment) , 1 more column name. i want fill name column's value automatically while insertion based on generated id column value in format <idcolumnvalue>_school i aware of 2 ways this using trigger inserting row first , update column value based on inserted row id column value but want make field non nullable use second option have make nullable. is there direct way while inserting row can have field non nullable? as said in comment, can use temporary value name column. can use request : insert `table` values('', 'name') /*let's assume name real name want insert*/ i'm not sure how use trigger, may want write : delimiter # create trigger update_name_after_insert insert on `table` each row begin update `table` set name = concat_ws("_", id, name) end#