Posts

Showing posts from February, 2010

Elasticsearch mongodb river tailable curosr issue -

i using elasticsearch, mongodb , elasticsearch mongodb river https://github.com/richardwilly98/elasticsearch-river-mongodb when observe mongodb logs river keeps on querying oplog of elasticsearch when not indexing documents , taking long time finish indexing collection. any guidance on above mentioned issues? elasticsearch mongodb river [1] uses recommended way [2] query tailable cursor in mongodb if observe query in oplog.rs i'd suggest try contacting mongodb , mongodb java driver [3]. i happy fix issue in elasticsearch mongodb river. [1] - https://github.com/richardwilly98/elasticsearch-river-mongodb/blob/master/src/main/java/org/elasticsearch/river/mongodb/mongodbriver.java#l1326 [2] - https://github.com/mongodb/mongo-java-driver/blob/master/examples/readoplog.java#l47 [3] - https://github.com/mongodb/mongo-java-driver

iphone - Identifying incoming calls - iOS -

i create app uses incoming call trigger. meaning once there's incoming call (user has not asnwered yet), app notified. have found this . will solve issue or there other solution? hope it's obvious the question non-jailbroken phones. is possible caller id in such scenario? is there way identify text or imessage once have been received in phone? ctcall option. allow app receive notification if it's in foreground , won't give details caller identity, call state. it isn't possible information on sms /imessages.

objective c - Launching executable with NSTask - Sandboxing problems? -

i have mac osx application launches executable located in /contents/resources. application not intended released on app store , don't have sandbox turned on. the launch code: toolpath = [[[nsbundle mainbundle] pathforresource:@"myexecutable" oftype:@""] copy]; task = [[nstask alloc] init]; [task setlaunchpath: toolpath]; pipe = [[nspipe alloc] init]; [task setarguments:[nsarray arraywithobjects:@"-somearg", somevariable, nil]]; file = [[nsfilehandle alloc] initwithfiledescriptor:[pipe filehandleforreading].filedescriptor]; [task setstandardoutput: stderrpipe]; [task launch]; the thing - works fine when running in xcode. works fine when exporting application desktop , running it. however, if zip application, upload webserver, , download on same computer (or dropbox mac), task no longer launches! no error in system console or anything. i researched on problem , found osx mark new applicaton "quarantined" special permission right.

perl - XML::LibXML: doc - root -

is here call of documentelemtent in first example superfluous? #!/usr/bin/env perl use warnings; use strict; use xml::libxml; my $file = 'xml_file'; $doc = xml::libxml->load_xml( location => $file ); $root = $doc->documentelement(); $xpc = xml::libxml::xpathcontext->new( $root ); # ... $_->nodename $xpc->findnodes( '/' ); outputs #document $doc = xml::libxml->load_xml( location => $file ); $xpc = xml::libxml::xpathcontext->new( $doc ); # ... $_->nodename $xpc->findnodes( '/' ); outputs also #document any prefixes defined in topic node adopted xpc, 2 different if there prefixes defined on root node. use warnings; use strict; use feature qw( ); use xml::libxml qw( ); $xml = <<'__eoi__'; <root xmlns:foo="uri:xxx"> <foo:bar/> </root> __eoi__ $doc = xml::libxml->load_xml( string => $xml ); $root = $doc->documentelement(); { $xpc = xml::libxml

Complex scroll android -

i'm begin learning android , want code function http://www.youtube.com/watch?v=sccj40ugxfw.i intend use 2 scroll ( superview listview scroll left , right, child listview scroll upd , down each page of scroll left , right. ok? see this: http://developer.android.com/training/animation/screen-slide.html , http://www.edumobile.org/android/android-beginner-tutorials/view-pager-example-in-android-development/ maybe, can you

android - Customizing List View -

i new android development , using big nerd ranch guide me learn android development. playing around list's via array adapters , want customize how list looks. i want list view card style ui have tried far has prevented me doing so. able card style ui event when user digs list , have pasted code below. unable list card style ui here xml event looks card style ui: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:divider="#00000000" android:dividerheight="25dip" android:paddingtop="25dp" android:paddingleft="16.0dp" android:paddingright="16.0dp" android:layout_marginleft="16dp" android:layout_marginright="16dp" android:layout_margintop="16

c# - How to replace the entity that the objectstatemanager is tracking -

i getting "an object same key exists" on update attempt while trying attach entity.lazy loading turned on. googled, , found no real solution problem. best solution replace entry in object state manager, can not find anywhere how replace it. possible @ all? the problems occurs when create instance of object (has collection of object b) in 1 context, , b objects in context. when try attach both of them breaks. there way tell ef when replace entry tracking. maybe possible allow replacement when set duplicated entitykey entries objectstate modified. there 2 parts problem. 1. detecting if entity being tracked context. if have 2 references same instance of entity easy see if being tracked. boolean istracked = context.myentities.local.contains(myentity); if instead have 2 instances of entity conceptually same because have same key things can more difficult. boolean istracked = context.myentities.local.any(x=>x.id == myentity.id); or alternatively using

java - Call JS function in webview from Static fragment -

i trying have tabular activity automatically setup me when creaked project selecting navigation type of "fixed tabs + swype". in each tab load webview changes url based on tab. in 1 tab though want call js function lives on page webview going to. tried sorts of things no luck, js function works reason not being called. the url in code below not url i'm using, reference here js function function callfromactivity(msg){ document.getelementbyid("mytext").innerhtml = msg; } public class mainactivity extends fragmentactivity implements actionbar.tablistener { /** * {@link android.support.v4.view.pageradapter} provide * fragments each of sections. use * {@link android.support.v4.app.fragmentpageradapter} derivative, * keep every loaded fragment in memory. if becomes memory * intensive, may best switch * {@link android.support.v4.app.fragmentstatepageradapter}. */ sectionspageradapter msectionspageradapter; /** * {@link viewpager} host section con

class - PHP Function producing two iterations of an array, in the same array -

i've got function gets data nosql database, , if it's not available goes mysql database data issue is, function putting data array twice , can't figure out why. expected result array(2) { ["id"]=> string(2) "30" ["username"]=> string(8) "username" } actual result array(4) { [0]=> string(2) "30" ["id"]=> string(2) "30" [1]=> string(8) "username" ["username"]=> string(8) "username" } code code irrelevant problem removed , replaced pseudo code comments. $connection = $this->connect("mysqli"); $data = mysqli_fetch_array( mysqli_query($connection["mysqli"], $options["query"]) ); echo "got array (mysqli)."; it's worth noting string "got array (mysqli)." appears once. mysqli_fetch_array() takes parameter, resulttype , default s

php - What's wrong with this onClick? Javascript -

i've been dealing half day this. function not working. worked @ 1 point , can't figure out how go back. html code <a href="#" onclick="updatedb('<?php echo $a; ?>','<?php echo $b; ?>','<?php echo $c; ?>','<?php echo $d; ?>','<?php echo $e; ?>','<?php echo $f; ?>','<?php echo $g; ?>','<?php echo $h; ? >','<?php echo $i; ?>','<?php echo $j; ?>','<?php echo $k; ?>')">test</a> here javascript code <script> $(function() { function updatedb(a,b,c,d,e,f,g,h,i,j,k) { $.post("update.php", { a:a,b:b,c:c,d:d,e:e,f:f,g:g,h:h,i:i,j:j,k:k }); alert("finally"); } } </script> i can't finally. any appreciated. thanks, because using <a> tag, need stop default execution of such link. easiest be:

How to execute code when a Python script is closed out? -

i have raspberry pi records temperature , stores them in mysql database on website. toy script, hitting ctrl+c on running script , re executing it. issue close() on database connection. how can run line of code when script exited in python? import mysqldb con = mysqldb.connect(...) cursor = con.cursor() # ... #if script closes: #con.close() import mysqldb con = mysqldb.connect(...) cursor = con.cursor() try: # stuff db finally: con.close() the finally clause executed on success on error (exception). if hit ctrl-c, keyboardinterrupt exception.

css - How to alter the color of an HTML link when hovering over a list? -

in html5 code using lists create tabs in navigation bar. <div id="nav_tabs"> <ul> <a href="index_v2.html"> <li> home </li> </a> <a href="#media"> <li> media </li> </a> <a href="#agenda"> <li> agenda </li> </a> </ul> </div> when user hovers on 1 of tabs background color , text color changes. however, media tab in list added drop-down menu. html is: <a href="#media"> <li> media <ul class="submenu"> <a href="media_music.html"><li>music</li></a> <a href="media_photo.html"><li>photo</li></a> <a href="media_video.html"><li>video</li></a> <a href="media_band.html"><li>band</li></a> <a href="media_interview.html&quo

com - Signing an F# Assembly (Strong name component) -

i found article on codeproject: http://www.codeproject.com/articles/512956/net-shell-extensions-shell-context-menus and thought nice give try, in f#. came following code: open system open system.io open system.text open system.runtime.interopservices open system.windows.forms open sharpshell open sharpshell.attributes open sharpshell.sharpcontextmenu [<comvisible(true)>] [<comserverassociation(associationtype.classofextension, ".txt")>] type countlinesextension() = inherit sharpcontextmenu.sharpcontextmenu() let countlines = let builder = new stringbuilder() base.selecteditempaths |> seq.iter (fun x -> builder.appendline(sprintf "%s - %d lines" (path.getfilename(x)) (file.readalllines(x).length)) |> ignore ) messagebox.show(builder.tostring()) |> ignore let createmenu = let menu = new contextmenustrip() let itemcountlines = new toolstripmenuitem(text = "coun

mysql - FORCE INDEX in django -

is there way following: select * `title_mediaasset` force index(upload_id_2) upload_id not null order `upload_date` desc it like: mediaasset.objects.exclude(upload__isnull=true).force_index('upload_id_2).order_by('-upload_date') is there way this, outside of using .raw() ? no, it's not possible using orm without using raw querysets. there ticket #11003 add functionality, closed won't fix.

Youtube API how to play video from 0 seconds when video ends? Iframe, Javascript -

so have code detects when player has stopped problem can't play 0 seconds when end has come i'm using iframe embed holds html5 video, here code! <div id="youtube-fs"><iframe id="youtube-iframe" type="text/html" src="http://www.youtube.com/embed/lyl0lzmrvk8?enablejsapi=1&html5=1&autoplay=1&showinfo=0&controls=0&rel=0&wmode=transparent&vq=hd1080&hd=1&loop=1" frameborder="0" wmode="opaque" ></iframe> <script type="text/javascript"> <!-- var tag = document.createelement('script'); tag.src = "http://www.youtube.com/player_api"; var firstscripttag = document.getelementsbytagname('script')[0]; firstscripttag.parentnode.insertbefore(tag, firstscripttag); var player; function onyoutubeplayerapiready() { player = new yt.player('youtube-iframe', { events: { 'onstatechange'

javascript - Django static files are not updated -

in django project application my_app has template references javascript static file: <script src="{% static 'my_app/my_script.js' %}"></script> once installed my_script.js in my_app/templates/my_app, seemed work. @ point overwrote my_script.js different script, such my_script.js has different content now. however, when load my_app browser, loads old my_script.js, although not exist anymore. how can resolve it? thanks. i use ?v=00001 or define number force clear cache in browser. in case be: <script src="{% static 'my_app/my_script.js?v=00001' %}"></script> or: <script src="{% static 'my_app/my_script.js' %}?v=00001"></script> next time change script, increase number 00002. of course there many ways still prefer method.

javascript - Put js variable in jquery -

i trying make code tells status of api <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="generator" content="coffeecup html editor (www.coffeecup.com)"> <meta name="dcterms.created" content="sun, 21 jul 2013 22:43:28 gmt"> <meta name="description" content=""> <meta name="keywords" content=""> <title></ title> <script type="text/javascript"> <!-- var xhrprint="" function blahblahblah(par){ var xhr = new xmlhttprequest() xhr.open("get" par) xhr.send() xhrprint = xhr.statustext } var por= prompt("type in website") blahblahblah(por) $(document).ready(function(){ $("#marker").append() }); --

javascript - Caching JS with config.cache_classes -

i'm working rails 4 live streaming future (for sse). , have set in development.rb (if set false, page hanging out): config.cache_classes = true config.assets.debug = true #config.serve_static_assets = true #config.eager_load = true config.action_controller.perform_caching = false #(!!!) but! anytime when editing js files, had reload server test in browser. it's hard! can disable js caching? would grateful ideas! uncomment assets debug mode. config.assets.debug = true

ruby - How do I set the language mode for Rubinius? -

i'm trying set language mode in rubinius, , doesn't seem work. tried using switch suggested rubinius team in april 2012 in https://stackoverflow.com/a/10165964/38765 $ ruby --version rubinius 2.0.0.n203 (1.9.3 4d75a146 2013-07-22 ji) [x86_64-apple-darwin11.4.2] $ ruby -x18 irb(main):001:0> ruby_version => "1.9.3" irb(main):002:0> exit $ ruby -x20 irb(main):001:0> ruby_version => "1.9.3" is possible set language mode more rubinius? you have enable language modes when compiling rubinius. docs : for example, enable both 1.9 , 2.0 modes, 1.9 default, use follwing configure options: ./configure --enable-version=1.9,2.0 --default-version=1.9

ember.js - Ember Data - destroy model from controller -

i have lead model defined ds.model , noticed weird when working creating app. when rest resource doesn't return resource in subsequent calls, old data stays around. tried solve doing: var model = this.get('model'); model.foreach(function(model) { model.destroy(); }); however, nothing happens. have searched around can't find proper way clear out specific model cache , refresh find(). using ember data 0.13 please try this: model.deleterecord();

php - How to output the methods from class -

<?php class { public $attribute1; function operation1() { echo 'operation1'; } } $a = new a(); var_dump($a); it shows: object(a)[1] public 'attribute1' => null question: it outputs property in class a , if want see methods/functions in class a , how do? you can gets class methods' names $class_methods = get_class_methods('a'); // or $class_methods = get_class_methods(new a()); foreach ($class_methods $method_name) { echo "$method_name\n"; }

java - Drawing partially transparent PNG onto JPanel -

Image
how go drawing partially transparent image onto jpanel overriding void paint (graphics g) method? i've tried obvious way, load image , use ((graphics2d)g).drawimage(...) didn't work, , internet isn't telling me much. jlabel capable of doing this, if want else panel/image, using paintcomponent , graphics#drawimage option. using base... i able render this... import java.awt.borderlayout; import java.awt.color; import java.awt.dimension; import java.awt.eventqueue; import java.awt.graphics; import java.awt.graphics2d; import java.awt.lineargradientpaint; import java.awt.point; import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.uimanager; import javax.swing.unsupportedlookandfeelexception; public class transparentpng { public static void main(string[] args) { new transparentpng(); } public tr

vb.net - If Background Worker is a background thread how come I can executed this code? -

researching found out background worker background thread , when run following code background worker still runs until end when main procedure exited. isn't feature reserved foreground threads ? code: public class form1 private sub form1_load(sender object, e eventargs) handles mybase.load 'run background worker backgroundworker1.runworkerasync() 'display exit message msgbox("main procedure exited") end sub private sub backgroundworker1_dowork(sender object, e system.componentmodel.doworkeventargs) handles backgroundworker1.dowork 'wait 10 seconds threading.thread.sleep(10000) 'modify numbers dim variable = 3 variable -= 1 'display exit message msgbox("background thread " & variable & " exited") end sub end class the form1_load method not "main procedure", message box you're displaying @

wordpress - How can widget show image -

i writing widget showing image via input local path of image. stuck @ phase of showing image. probably, problem exists in function: widget. tried many ways, (you can see code in widget function), still not working. 1 point me error? <?php class osebadgewidget extends wp_widget{ public function osebadgewidget(){ $widget_ops = array( 'classname' => 'ose-badge-widget', 'description' => 'show ose firewall badget' ); $control_ops = array( 'width' => 200, 'height' => 250, ); $this->wp_widget('ose_badge_widget', 'ose badge widget', $widget_ops, $control_ops); } public function __construct(){ parent:: __construct( 'ose_badge_widget', 'ose badge widget', array('description' => _

jquery - I need that barcode to be used as soon as its scanned (no user "ok" button) -

i have asp web page , need scan product barcodes , event after each scan, mean add product grid. problem how call event after barcode scanner scan barcode 'textbox' (no user "ok" button). barcode scanner write new line after each scan not real 'enter key code:13' can program barcode scanner key combination after data set in grid? key combination after scan combination saves grid data. replace code 13 new combination. have in barcode firmware setup.

json - ASP.NET WebService test form -

Image
is possible configure default asp.net webservice test form support json? mean test form built in in .net framework... currently have webservice decorated [scriptservice] , when testing using built in test form page, returns xml...i assume, happens because test page sends content-type xml default. thanks edit (example) : have class: public class person { public string firstname { get; set; } public string lastname { get; set; } } now have asp.net webservice: [scriptservice] public class personservice : webservice { [webmethod] public person getdave() { person dave = new person(); dave.firstname = "dave"; dave.lastname = "test"; return dave; } } when call webservice web page using jquery ajax, receive json person object {"firstname":"dave","lastname":"test"} (not string) in javascript, when invoking webservice asp.net webservice test form (when right click on asmx file , use &qu

ios6 - Payment method for iPhone app -

i have iphone app like https://itunes.apple.com/us/app/coupons.com/id338380654?mt=8 in app user upload coupon(it form in user fill coupon information) through iphone app , uploading coupon charged money. my question in app feature can use payment? in-app purchase or paypal gateway? as think not digital product in-app purchase can not used have user paypal or zooz third party payment. please share advice. thanks u can use paypal or third party only, because sell goods not used in iphone. explain services in app metadata when submit, can app approved.

Why are some constants public and other private in an Android library code -

problem why constants under public modifier while other private ? under public can called applications use library? if so, how call constant app, this: certainlibraryclass.activityresultcode.code_a ? code public class certainlibraryclass { public class activityresultcode { public static final int code_a = 0x02; public static final int code_b = 0x03; public static final int code_c = 0x04; } public class versioncode { private static final int version_major = 1; private static final int version_minor1 = 0; private static final int version_minor2 = 2; } // .... } why constants under public modifier? ans: other classes can access e.g. result_ok , success . why constants under private modifier? ans :so class can access it e.g. consider calling getid() libarary function class public class certainlibraryclass { private static int id=0; public static int getid() { return id+1; } here not accessin

dojo - How to launch GridX column width recalculation after the grid has been started up? -

according documentation: https://github.com/oria/gridx/wiki/create-the-simplest-gridx never forget call grid.startup(), since column width calculation , layout rendering need access geometry information of grid dom nodes. if have grid columns, have no width specified, , autowidth set false , startup() calculates size of columns so, fill whole viewport horizontally. however, if viewport expanded, , empty space inserted after last column. if viewport narrowed, last columns not more visible (and no scroll rendered). so think best workaround launch recalculation of columns sizes manually, after viewport resized. can't find api method that. how call column width recalculation , layout rendering on existing grid? what i've done situation setup event handler watch window resize events, set width current grid width. when creating grid: function _resizetowindow(grid, gridid) { grid.resize({w: dom.byid(gridid).offsetwidth, h: undefined}); } on(window

html5 - How to access local directory files using WAMP server? -

i new in html programing , self-taught. found piece of software let me pre-render videos 60 fps. i thought why not share results world. read how code in html5. created simple looking site , worked when start html5 file (videos playing). read wamp server give me opportunity share rest of world. but everytime start wamp , try view page neither videos or tumbnails of videos load. else margins placement of players text works wamp somehow blocks every content loaded in html5 file this: "d:/downloads/pixar short film collection........ " . i repeat html5 works perfect if start index file browser loaded through wamp can't load anything. in ie10 under videos showing being blocked in chrome blank. it works when make html5 file load video directory "www", problem me because going video library site. "c:" drive filled if knows how fix awesome. ps(one week ago had no such problem appeared. since i've been installing , uninstalling wamp, no l

c# - Unity3D Changing Ball Direction When Hitting a Cube -

Image
i'm working on simple paddle game project nowadays. in begining, everything's looking good. but, when complete level design , publish game, see gameobjects in scene moving slow. think, pass on unity3d's physics limit. if try math instead of unity3d's colider, can finish first project. (i tried use separating axis theorem , can't handle x , y coordinates on unity3d.) i need help. lot time. (and if can handle problem, share project on internet, beginner people me.) in project, achieved simulation using boxcolider, because of unity3d physics limit, don't want use colider in project. you can't not detect collision. i'd recommend using unity's colliders that, since they're not bad. first thing notice in first simulation, have 4 box colliders, when instead should have one. use oncollisionenter event (on spheres) reflect them off box.

android - Adding Image to an XML Gradient Button -

i have created gradient button using bstyle.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:radius="14dp" /> <gradient android:angle="45" android:centerx="35%" android:centercolor="#a8a8a8" android:startcolor="#e8e8e8" android:endcolor="#ebfeff" android:type="linear" /> <padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> <size android:width="60dp" android:height="55dp" /> <stroke android:width="3dp" android:color="#919089" /> </shape> in layout have set background of button this,it works want want put image on top of gradient button(like image button),how can it?

java - camera app rotates images by 90 degrees -

my custom camera app developing rotates images 90 degrees time, onscreen view of camera distorted , in 90 degrees anti-clockwise, when saves image, if have taken photo phone 90 degrees left when im holding portrait, takes landscape photos. here code camera activity, can rotate onscreen view of camera? package fr.altimer.lost.collect.client; import java.io.file; import java.io.fileoutputstream; import java.io.ioexception; import java.text.simpledateformat; import java.util.date; import java.util.list; import android.app.activity; import android.content.componentname; import android.content.context; import android.content.intent; import android.content.serviceconnection; import android.graphics.pixelformat; import android.hardware.camera; import android.hardware.camera.size; import android.location.location; import android.os.bundle; import android.os.environment; import android.os.ibinder; import android.view.keyevent; import android.view.surfaceholder; import android.view.surfa

php gd - How to get and save THIS transparent image with PHP -

i trying image url, , save server. simple task, yeah, image has transparency... thing is, when save file pc or when try , save via php server, same result: image gets messed transparency set black. url of image is: http://cellufun.com/p/avatarimage/agb.aspx?i=body|m04001|shirt|m10020| another weird thing browser says image mime type image/png can't use imagecreatefrompng(); because "image not valid png" error... here code (i did try other solutions, tryed last time): <?php $result=file_get_contents("http://cellufun.com/p/avatarimage/agb.aspx?i=body|f04001|shirt|f10020|pants|mo55|"); $img = imagecreatefromstring($result); imagealphablending($img, true); imagesavealpha($img, true); imagecolortransparent($img); header("content-type: image/png"); imagepng($img); ?> oh, , tryed image against copy() function, , still same result... looks image smaller in size original image... tryed this: file_put_contents("files/test.png",

How to play YouTube video inside Android WebView? -

Image
i making rss reader application, , rss data url, , rss data can contain link youtube video. here example how link youtube vide looks like: div class="video-shortcode"><iframe title="youtube video player" width="600" height="350" src="http://www.youtube.com/embed/hxrcuycva6c" frameborder="0" allowfullscreen></iframe></div> and when run application, there no video, black, , can't play it. how can play video inside webview? edit: here result: here code: // set webview properties websettings ws = desc.getsettings(); ws.setlayoutalgorithm(layoutalgorithm.single_column); ws.getpluginstate(); ws.setpluginstate(pluginstate.on); ws.setjavascriptenabled(true); ws.setuseragent(0); ws.setjavascriptcanopenwindowsautomatically(true); desc.setwebchromeclient(new webchromeclient() { }); desc.loaddatawithbaseurl("http://www.balkanandroid.com/", f

visual c++ - How to add handler to the format function of CString -

first have cstring(mfc) cstring cssql when format sql string, example cssql.format( szformat, sztablename, szcolumn, szvalue, intvalue ) i need handle special char in szvalue, need write new class mysqlstring mysqlcs.formatsql( szformat, sztablename, szcolumn, szvalue, intvalue ) which has functionality cssql.format( szformat, sztablename, szcolumn, handlespecialchar(szvalue), intvalue ) but because parameter format function accept not fixed. found difficult. there solution? you don't add handler cstring class. you write (new) function cstring formatsqlstring(cstring const& format, cstring const& tablename, cstring const& columnname, cstring const& value) { cstring cssql; return cssql.format(format, tablename, columnname, handlespecialchar(value)); } and wrap function further (e.g. cstring getupdatestmt(tablename, columnname, value) ) don't have sprinkle format strings on code. when write code use input sql statement in

cordova - JQuery Mobile & URL Parameters white flash on reload -

i using query mobile phonegap application, passing through parameters through url next page. for example: main.html?id=1, menu.html?id=2 etc to allow have turn ajaxenabled false allow pass through information need. in doing unable use transitions page page means white flash page reloads. i generating these links dynamically. $.ajax({ url: 'urlto webserver', datatype: 'jsonp', jsonp: 'jsoncallback', timeout: 5000, success: function(data, status){ $.each(data, function(i,item){ var list = '<li><a href="menu.html?idcat='+item.id_cat+'">'+item.category_cat+'</li>' output.append(list); }); }, error: function(jqxhr, textstatus) { alert( "request failed: " + textstatus ); output.text('there error loading data.') } }); is there solution? you can use method jquery serialize data paramater. via changepage method in jquery hope solved :d

.net - expression expected '{' - having string and int together -

making table, when added rows, got error, code is: each row datarow in table.rows table2.rows.add ({row(0), row(1)}) next expression expected table2.rows.add (***{****row(0), row(1)}) am having error saying expression expected on "{" i think no why is, because row(0) string , row(1) int. therefore how apply 1 being string , 1 being int. datatable.rows.add method requires array of objects (one object each column) code simply table2.rows.add (row(0), row(1)) by way, if trying copy 1 table take @ built-in methods datatable.merge or datatable.copy datatable.loaddatarow , datatable.importrow

Incorrect syntax near 'CAST' in sql server -

Image
i have table pin_mst below but following query showing error msg 102, level 15, state 1, line 1 incorrect syntax near 'cast'. .. plz help. select top cast(1 varchar(3)) pin_id pin_mst try 1 - select top 1 pin_id pin_mst or - select top 1 cast(1 varchar(3)), pin_id pin_mst

websphere commerce - How to have SEO URLs incorporate more than just the name of the product? -

when generate seo urls according ibm tutorials, end urls book called "death wears green hat": http://www.shop.com/mystore/shop/thrillers/death-wears-a-green-hat how configure generate urls incorporate more title, eg. author name: http://www.shop.com/mystore/shop/thrillers/john-doe-death-wears-a-green-hat i can hack seourlkeywordgen batch file, delta updates new products? there xml file controls default seo generation. see http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.seositemap.doc/concepts/csdseourlconstruction.htm

XCode style file handling in visual studio -

is possible let visual studio 2010/2012 behave xcode when selecting files in project explorer? although work vs since 13 years, still hate fact selection in project explorer not in sync selected files / tabs in document pane. have check file have opened. in xcode @ project-tree , know are. is there option activate single-click selection / single-document behaviour in visual studio? thanks visual studio 2012 available. clicking file in solution explorer opens right-aligned tab. double clicking permanently opens it, standard tab, aligned left.

ruby on rails - Heroku fails to perform clockwork delayed tasks -

i having clockwork configuration file(inside lib folder) queues file's methods perform delayed tasks. require_relative "adwords/extractor" it working fine on local machine (webrick running on win8). on heroku, failing following error: 'app[web.1]: /app/lib/clock.rb:5:in `require_relative': cannot load such file -- /app/li b/adwords/extractor (loaderror)' the extractor.rb script located @ same place mentioned error statement. try out require "#{rails.root}/app/lib/adwords/extractor" use relative path rails app.

highcharts - Max number of flags on highstock control -

it seems when number of flags exceeds 1000, flags not displayed on control. bug or behavior can changed somehow? see jsfiddle example: http://jsfiddle.net/sdknv/ when ran is, code not show flags on series. if change line var flagscount = 1001 var flagscount = 1000 , run example again, 1000 flags displayed. you should increase turbothreshold parameter: http://api.highcharts.com/highstock#plotoptions.series.turbothreshold

neo4j - create unique node or create unique index -

how create unique node in neo4j ? have model user, , has property userid , sername , emailid , mobile , address , zipcode ect... i want create unique node above user. have userid , username , emailid , mobile unique field. so, when same userid or field mention here trying enter again, should return error. it possible? i'm assuming stable version of neo4j(1.9) 2.0 change how indexing presented. you're saying user node have several properties, each unique, these used composite key, or username used key? neo4j has special class doing type of "get or create" node, works on 1 key, if creating composite key, you'd have concatenate yours keys. look documentation here . here example: public node getorcreateuserwithuniquefactory(string username, graphdatabaseservice graphdb) { uniquefactory<node> factory = new uniquefactory.uniquenodefactory(graphdb, "users") { @override protected void initialize(node create

javascript - Many css ids to the same jquery function -

$("#myinputid1").blur(function() how can do: #myinputid1, #myinputid2, #myinputid3 -> same blur function i believe that's not hard, tried many things , cant! try this: $("#myinputid1, #myinputid2, #myinputid3").blur(function(){ //your code }); or other way can check id starts myinputid : $('input[id^=myinputid]').blur(function(){ //your code });

validation - jquery mobile validate "data-native=false" selectbox on change not working -

i'm running odd problem. i'm using jquery mobile , know validate plugin. works fine except when turn false data-native attribute. error message appears on submit, never disappears onchange. i'm missing something? update1: more weird, updates when click on error message, or on submit button html code: <div id="invalid-id_form_choose" class="errors"></div> <select id="id_form_choose" name="question" data-theme="b" data-native-menu="false" class="question"> <option value="">veuillez choisir</option> <option value="first_pet_name">quel est le nom de votre premier animal de compagnie ?/option> <option value="mother_place_of_birth">dans quelle ville est née votre mère ?</option> </select> js code: jquery.validator.addclassrules({ question:{ required: true } }); jquer

apache - PHP: Serving files hosted on a different server -

i have following problem: have big files on server runs under plesk, , want exclude them regular plesk backup, far i've seen not possible. so store these big files on server , serve them through web app runs on first server. the problem url of files should hidden user. have implemented php's header(). of course should served directly user , not through first server, files big! in short, need is, when user clicks file download link, should receive file second server, file url should not visible him. im using php application , apache webserver, grateful suggestions on how approach problem, harry edit: forgot mention user has acceptance first server download file. why need url of file hidden. you can use include or require_once function data files without "viewing" file.

vba - Excel 2010 chart axis number format doesnt update -

Image
i have annoying problem updating decimal separator in chart axis after changing international settings, example when switching "." ",". decimal separator changes in cells normally, not change in labels of chart axis. restarting excel solves problem. but necessary restart excel? happy without restart, because creating utility allowing other users print under english or czech language settings , restarting excel unwanted here. i found several discussions related topic, not need , did not find solution there (hope did not miss anything), example chart axis custom number format localization in excel 2010 excel chart won't update wrong decimal separator in charts what more surprising if create whole new chart displays original decimal separator, not new 1 set. thanks advice, p.

qt - How to add an Item to the specific index in the layout -

i following example create flow layout: http://doc.qt.io/qt-4.8/qt-layouts-flowlayout-example.html this doesn't have addtoindex(int _index) function, implement this. since layout uses qlayoutitems, create function can insert item after specific index. how can index of item integer , insert layout? update: flowlayout.cpp flowlayout *flowlayout = new flowlayout; void flowlayout::insertitem(int index, qlayoutitem *item) { if(itemlist.size() < index) { itemlist.append(item); } else { itemlist.insert(index,item); qrect tmp = this->geometry(); } update(); } flowwindow.cpp void flowwindow::addlinebreak() { flowbreak = new flowlayoutbutton(null); qlayoutitem *item = new qwidgetitem(flowbreak); flowlayout->insertitem(index, item); //flowlayout->addwidget(flowbreak); } flowlayoutbutton.cpp constructor flowlayoutbutton::flowlayoutbutton(qwidget *_parent):qwidget(_parent) { qboxlayout *layout = new qhboxla

android translate animation clips the part of view not shown on screen -

i have relative layout containing textviews floats on gridview. when select item in grid, layout moves down end of screen , 1/5th of visible. done using simple translate animation. when click button in grid, need relative layout move original position on top of gridview. did translate animation , happnening, portion of relativelayout visible when collapsed translating (moving) , other portion becomes visible after animation has ended. looks ugly. i know android doesnt draw portion of view not visible on screen. there way force draw full portion ? my animation code given below: public void smoothexpanderanimate(final int finaltarget,final relativelayout expander,final int animatetoy,final boolean setexpanded,final boolean refreshgrid) { final relativelayout.layoutparams head_params = (relativelayout.layoutparams)expander.getlayoutparams(); translateanimation anim = new translateanimation(0f, 0f, 0f, animatetoy); anim.setduration(400); //timelistheight = list