Posts

Showing posts from March, 2014

sql - Substring only if string length > 2 -

i wondering if possible substring if string length > 2? here sample statement: select substring(abresc, 1, 2) + '-' + substring(abresc, 3, 5) abresc table however, fields 2 chars long wondering if possible substring when longer 2 chars? you use case select abresc = case when len(abresc) > 2 substring(abresc, 1, 2) + '-' + substring(abresc, 3, 5) else abresc end table

Moving element in array with C# -

is there way move items inside array? example: int[] myarray = {1,2,3,4}; 2nd element becomes last: int[] myarray = {1,3,4,2}; p.s.: no that's not homework. can think of @ least 1 solution requires rather difficult implementation: first save second element int then remove element array then add new element @ end of array any other (read - easier) way this? there no easy way using array. you'll have loop through array shifting every element index that's moving, , re-insert element @ end. use list<int> it. list<int> list = myarray.tolist(); int value = list[1]; list.removeat(1); list.add(value); myarray = list.toarray();

c# - Delegate in method using variables in scope of method but outside delegate scope -

i wrote sample code have action delegate declared in method body 2 params passed , consumed delegate code without params being passed delagte. seems cleaner me explictely pass in these params delegate too, in case not, , code work fine. i wondering how .net keeps these references available in export delegate running on new thread. public void mymethod(string name, complexobject myobj) { action export = () => { //do name name = name + name; //do complex reference object myobj.somemethod(name); }; // more work // example launch export on new thread system.threading.thread newthread = new system.threading.thread(new system.threading.threadstart(export)); newthread.start(); } the compiler creates special type keeps variables. then, instead of storing variables on stack, instantiates instance of type every time call method. then, anonymous delegates use reference new instance access variables.

java - Navigating between multiple panels -

can tell me how go coding navigation between multiple jpanel classes taking event trigger jbutton objects (panels) themselves? have read cardlayout . panel can swapped events happening in parent panel. want achieve on click of button embedded in panel, should should disappear or desired panel should displayed. can't seem find solution. there nothing cardlayout prevents switching cards actions of children within cards. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class testing extends jframe { private jpanel cardholder; private cardlayout cards; private static final string carda = "a"; private static final string cardb = "b"; private class switcher implements actionlistener{ string card; switcher(string card) { this.card = card; } @override public void actionperformed(actionevent e) { cards.show(cardholder, card); } } private vo...

charts - Highcharts column color -

i'm building charts using highcharts my problem is: my attribute "size" on pie chart 100%. div's height , width 234 , 424px, pie smaller , doesn't bigger 130px both attributes... is there properties use? thanks update: ok guys, found answer, got newer version of highcharts plugin, problem column chart black lol, ideas? update 2: my code column's chart is: //the colorbar parameter modifies 'hover' of bars function graficobarrasimples_init(paramx, paramy, colorbar, container, title) { var options = { chart: { renderto: container, defaultseriestype: 'column' }, title: { text: '' }, subtitle: { text: '' }, yaxis: { min: 0, title: { text: 'unidade' }, tickpixelinterval: 50 }, tooltip: { formatter: function() { return '' + this.x +': '+ this.y ; ...

c# - What is the best way to decouple one MVVM application into webservice and a client -

what best way decouple 1 mvvm application webservice , client. the application @ age , being developed mvvm light. born need business logic webservice available mobile client (android, bb). there "how to" or guide can guide me correctly the mvvm pattern presentation pattern used on client side. shouldn't affect system architecture. usually, view model repsonsible handling behavior of view. in view model want interact services. i suggest extract business logic , make them services multiple clients can use, including wpf client.

html - Div grid cell-type alignment -

Image
i aiming setup similar this: unfortunately end this: here specs: i'm trying divs image set without borders, , divs text have 1 px border. here divs set up: <section id="row2"> <div id="textbox1" class="column left"> <p> text box 1 </p> </div> <!--#textbox1 .column.left--> <div class="column right"> <img src="assets/top-right-image.png"/> </div> </section> <!--#row2--> <section id="row3"> <div class="column left"><img src="assets/bottom-left-image.png"/></div> <div id="textbox2" class="column right"> <p> text box 2 </p> </div> </section> <!--#row3--> as can see, set text divs id "textbox1" , "textbox2". unfortunately, blows them , makes div.column...

Controlling VLC\MediaMonkey Using C#? -

i'm writing application allows control vlc and\or media monkey without having interact application itself. problem have method using right uses wm_appcommand works windows media player. i have searched lot, , cannot seem find solution let me send global media key (as in vk_media_play_pause) globally within console application. people have said make happen foreground application first. here have far: public static extern intptr sendmessagew(intptr hwnd, int msg, intptr wparam, intptr lparam); sendmessagew(handle, wm_appcommand, handle, (intptr)appcommand_media_play_pause); i should note hacking personal use, doesn't need simple fix, 1 works. thanks in advance edit: in case looking solution, here had do: private const int wm_keydown = 0x0100; [dllimport("user32.dll")]public static extern intptr postmessage(intptr hwnd, uint msg, intptr wparam, intptr lparam); [dllimport("user32.dll", setlasterror = true)] static extern intptr findwindow...

objective c - CABasic doesn't rid of image after completing the animation -

i have button in nib file plays sound , calls method below. -(void) animateheart { heartlayer = [[calayer alloc] init]; [heartlayer setbounds:cgrectmake(0.0, 0.0, 85.0, 85.0)]; [heartlayer setposition:cgpointmake(150.0, 100.0)]; uiimage *heartimage = [uiimage imagenamed:@"heart.png"]; cgfloat nativewidth = cgimagegetwidth(heartimage.cgimage) / 3; cgfloat nativeheight = cgimagegetheight(heartimage.cgimage) / 3; cgrect startframe = cgrectmake(165.0, 145.0, nativewidth, nativeheight); heartlayer.contents = (id)heartimage.cgimage; heartlayer.frame = startframe; [self.view.layer addsublayer:heartlayer]; cabasicanimation *theanimation; theanimation=[cabasicanimation animationwithkeypath:@"opacity"]; theanimation.duration=2.5; theanimation.repeatcount=2; theanimation.speed = 1.85; theanimation.autoreverses=yes; theanimation.timingfunction = [camediatimingfunction functionwithname: kcamediatimin...

jquery - Animate loaded data with ajax -

i want animate data loaded page ticker effect. i managed 1 example found online. my issue here is, want make effect work when ajax loaded. so tried putting ajax code inside .when , ticker effect in .done but did not work this. what else can try? $(document).ready(function() { $(function checkinmap() { $.when($.ajax({ type: "get", url: "default.cs.asp?process=viewcheckins", success: function(data) { $(".newsfeed").append(data); }, error: function(data) { $(".newsfeed").append(data); } })).done(); }); }); var delay = 2000; // can change var count = 5; // how items animate var showing = 3; //how items show @ time var = 0; function move(i) { return function() { $('#feed'+i).remo...

c++ - Can I safely memmove around a boost variant? -

i have class wrapping boost variant contains memmovable types (qlist, qstring, int etc). may declare wrapper class memmovable qt containers? a boost::variant contains integral index , aligned_storage , guaranteed standard pod. has no virtual members, has user-defined constructors , destructor. consequence, boost::variant not pod , trying memmove ub (well, think ub, don't find definitive reference in standard). however, same can said qlist , qstring , etc. apparently , qt assumes non-pod types can safely memmoved, , makes distinction between pod (so-called "primitive types") , "movable types". consequently, if think safe memmove qlist , can consider safe memmove boost::variant containing memmovable types.

android - Custom ImageView doesn't display a Bitmap -

i'm making simple compass view that's displayed on top of mapview . layout mapview , other views declared in layout xml file. i'm using this article example. i've written ondraw method compass view doesn't display anything. compass object gets invalidated in onsensorchanged method. why isn't picture displayed? xml layout <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/main_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <com.mapviews.mycompass android:id="@+id/compass" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true...

Java Graph Visualisation Library: Nodes with multiple connect points -

can recommend java graph visualisation library in graph nodes can rendered multiple connect points? for example, supposing graph node represents processor takes input 2 sources , produces output. visualised 3 vertices. however, each vertex has defined role in workflow , therefore ideally node appear 3 distinct connection points user attach vertices to. i've taken @ jung don't think suit needs. any recommendations welcome; either on specific libraries or alternative approaches can take. you try jgraph's java library jgraph it has amount of functionality , have used success before. thing documentation bit lacking, if read through examples , code pretty when hang of it.

active directory - How to get a list of all Distinguished Names (DNs) from AD (LDAP) using PHP? -

i list of dns inside active directory while having base dn. also list of groups , group members. the language used php. if php bad choice task, language recommend? cheers, php has ldap extension . long php installation has extension enabled, should able effortlessly connect ad server , perform queries. after that, it's matter of performing basic function calls : ldap_connect() , ldap_bind() , ldap_search() , ldap_get_entries() , iterating on result set. keep in mind if wish perform changes ad (which doesn't seem case here), you'll have connect through ssl, might have few gotchas involving making php see ad's ssl certificate trusted.

javascript - <a> onClick event but still proceed to href target -

i have link follows: <a onclick="runsomejsonpcall();" href="www.goherenext.com"> make work </a> the javascript method basic jsonp call, this: function runsomejsonpcall() { var script = document.createelement("script"); script.src = "http://jsonpurl.com?parameter1=" + "someparam"; document.body.appendchild(script); } my jsonp call never executes, unless put in return false onlick event, of course href doesn't navigate target. how both things work? note: can use pure javascript only, no libraries you should prevent default event ... there : event.preventdefault ... function runsomejsonpcall(event) { if (!event) var event = window.event; if (event.preventdefault) { event.preventdefault(); }else{ // ie event.returnvalue = false; } var script = document.createelement("script"); script.src = "http://jsonpurl.com?parameter1=" + ...

.net - Why the SaveChanges() can't work when I try to finish the SportStore Demo in the book of Pro ASP.NET MVC3? -

public void saveproduct(product product) { if (product.productid == 0) { context.products.add(product); } //oops~~~ context.savechanges(); } [httppost] public actionresult edit(product product) { if (modelstate.isvalid) { repository.saveproduct(product); //i can see msg int view page. database never changed.!! tempdata["message"] = string.format("{0} has been saved", product.name); return redirecttoaction("index"); } else { // there wrong data values return view(product); } } i got stuck problem , don't know how make data stored database. problem occurs when try save changes existing product. can tell me why savechanges() method called , datas never saved db? thx the entity product constructed model binding not automatically attached context. context therefore not aware of change save. have attach product first , set ...

numpy - Computing the Fiedler Vector in Python -

how find fielder vector of laplacian (l) in python? i can eigenvalues , eigenvectors using: eigenvalues, eigenvectors = linalg.eig(l) i assume python not return eigenvalues in order. do take 2nd largest eigenvalue , match corresponding eigenvector (matching in index)? when ordering eigenvalues, how deal negative values? ordering absolute magnitude? thanks help well, don't know math involved, i'll best. if check documentation , linalg.eig in fact return eigenvectors in same order corresponding eigenvalues. i might like: w, v = linalg.eig(l) seen = {} unique_eigenvalues = [] (x, y) in zip(w, v): if x in seen: continue seen[x] = 1 unique_eigenvalues.append((x, y)) fiedler = sorted(unique_eigenvalues)[1][1] by default python sorts tuples first element, second , on, , numbers ordered way you'd expect (-2 < -1 etc.). assumes eigenvalues aren't complex of course. also, i've assumed there might duplicate eigenvalues ...

regex - Insert exactly one space between pattern of one or more characters using Ruby -

i have string. 'abcxdefxabcyxyabc' i want have them separated 1 space. known patterns in string are: abc x def y the resulting string should be 'abc x def x abc y x y abc' = 'abcxdefxabcyxyabc' b = a.gsub(/[^ ]\((abc|def|x|y)\)[^ ]/,' \1 ') i not having luck gsub regex. thanks help. you're making complicated: 1.9.3p194 :001 > = 'abcxdefxabcyxyabc' => "abcxdefxabcyxyabc" 1.9.3p194 :002 > a.gsub(/abc|def|x|y/, '\0 ').strip => "abc x def x abc y x y abc"

c# - Custom event on cancel the setup in wix -

i trying add custom events on wix installer. succeed add events on installation complete. using following code: <installexecutesequence> <custom action='acquirelaunchlock' before='checkformediaplayer'>notinstalled</custom> <custom action='checkformediaplayer' before='launchconditions'>not installed</custom> . . . <custom action='updatesyncstatus' after='copyhelpervideos2'></custom> </installexecutesequence> need 1 custom event on cancel also.(if user cancel setup in between) new c#. can tell me how this? first need determine main button id package cancel dialog. after that, can create binary custom action , execute when button pressed through doaction control event . here thread example: how link custom action control event

android - how to sign an already compiled APK -

i've decoded apk apktool (as original source code lost) fix issues layout xml files. i've rebuilt apktool , when tried install on device (using adb: adb install appname.apk) gave me error: [install_parse_failed_no_certificates] the original apk signed keystore (on eclipse ide), 1 isn't, how can sign it's original keystone file outside eclipse!? create key using keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg rsa -keysize 2048 -validity 10000 then sign apk using : jarsigner -verbose -sigalg sha1withrsa -digestalg sha1 -keystore my-release-key.keystore my_application.apk alias_name check here more info

drupal - Problems with PHP explode -

i'm using code: $imageurl = "http://siteadress/sites/default/files/bjorn_4.jpg"; $pieces = explode('/', $imageurl); print_r($pieces); to split url. the print_r gives me result = array ( [0] => http://siteadress/sites/default/files/bjorn_4.jpg ) shouldn't split url after each /? array ( [0] => http:/ [1] => / [2] => siteadresses or that? i think should try : $imageurl = [node:field_banner_image]; because quotes explode think string [node:field_banner_image] , not string inside.

drupal 6 - In ubercart module, how can we change currency sign $ to Rs.? -

in ubercart module, how can change currency sign $ rs.? want give product price in rs., ubercart module takes $ default. you can set default currency , sign : (admin/store/settings/store/edit/format)

Is there an equivalent to static of C in C#? -

in c can void foo() { static int c = 0; printf("%d,", c); c ++; } foo(); foo(); foo(); foo(); it should print 0,1,2,3 is there equivalent in c#? something like: class c { private static int c = 0; public void foo() { console.writeline(c); c++; } }

c++ - OpenMP performance -

firstly, know [type of] question asked, let me preface saying i've read as can, , still don't know deal is. i've parallelized massive outer loop. number of loop iterations varies, typically between 20-150, loop body huge amount of work, calling on lot of local intensive linear algebra routines (as in, code part of source , not external dependency). within loop body there 1000+ calls these routines, they're totally independent of 1 another, figured prime candidate parallelism. loop code c++, calls lot of subroutines written in c. code looks this; <declare , initialize shared variables here> #ifdef _openmp #pragma omp parallel \ private(....)\ shared(....) \ firstprivate(....) schedule(runtime) #endif for(tst = 0; tst < ntest; tst++) { // lots of functionality (science!) // calls other deep functions manipulate private variables // call function has 1000 loop iterations doing matrix manip...

facebook login application for phonegap in javascript -

i new facebook applications. 1) procedure implementing facebook application. 2) want sample login application in java script uses phonegap. could please send reply. thanks in advance. swathi i did similar ask using this connector , following base phonegap tutorials, shouldn't have problems in doing that. if want code done you, in wrong place, pleas show effort before asking , community you.

Where can I find a white theme for netbeans 7? -

it's hard find nice theme netbeans 7 , each theme have found black. can found nice white theme making php / html / javascript / css netbeans? thanks! i have found best theme netbeans 7 : http://net.tutsplus.com/freebies/themes/netbeans-twilight-theme/ edit: if don't found nice theme, edit color language it's said here : netbeans theme: adjusting colour of html parameter values

java - Finish game loop and go to another activity Android 2.1 -

please me answer challenge. have been looking on internet , board answer. cant referr has been posted before anywhere on internet. question might trivial knows whats he's doing in android. basically im trying finish game loop , go results page. when game hits if() end game. animation stops intent still on top of screen. how create intent: package com.droidnova.android.tutorial2d; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.view.window; import android.widget.button; public class menu extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.menu); button btnstart = (button) findviewbyid(r.id.btnstart); btnstart.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { ...

FPDF images not working in MODx Revo -

i'm using modx revolution 2.2.1-pl , fpdf generate pdfs. i've found using images on 100kb (at least around ballpark) results in them being corrupted in outputted pdf. it's if image still half way through downloading when written pdf. this snippet output onto page blank template: require_once($modx->config['base_path']."assets/fpdf/fpdf.php"); define('fpdf_fontpath',$modx->config['base_path']."assets/fpdf/font/"); $pdf=new fpdf(); $pdf->addpage(); $pdf->addfont('novecentowidedemibold','','novecentowidedemibold.php'); $pdf->setfont('novecentowidedemibold','',16); $pdf->cell(40,10,'text'); $pdf->image('assets/img/pdf/image.jpg',0,0,-300); $pdf->output("myfile.pdf", d); it finds fonts , ok, it's image isn't working correctly. if use smaller image (filesize), works. it's finding image, , image fine, it's when printed pd...

has many - Single table inheritance and has_many in rails -

i'm making simple financial app funzies. modeled credits , debits using single table inheritance, both inherit transactions. however, each transaction belongs user: class transaction < activerecord::base belongs_to :user end class debit < transaction end class credit < transaction end i create separate controllers credits , debits , this: @debit = current_user.debits.build(params[:debit]) ... @credit = current_user.credits.build(params[:credit]) ... but user not have methods debits or credits, transactions. alternatively, define single transactions controller: @transaction = current_user.transactions.build(params[:transactions]) but type null, , how should set if it's protected mass assignment? it's bit of pickle either way. except pickles taste good. you can explicitly set type of transaction in second example doing: @transaction = current_user.transactions.build(params[:transactions]) @transaction.type = "debit" @transacti...

javascript - jquery plugin error -

i'm trying make plugin (from other code have), can't options part work d: plugin (so far): (function($){ $.fn.scbox = function(options){ var $opts = $.extend($.fn.scbox.defaults, options); $.fn.scbox.defaults = { start: 40, //i: fn.scbox.defaults.start, width: 200, height: 50, min: 0, step: 10, fontsize: 15, textcolor: "#fff", bgcolor: "#000", slidecolor: "#ff0000" } console.log($.fn.scbox.defaults); } })(jquery); when try call $.scbox(); , error: uncaught typeerror: object function (a,b){return new e.fn.init(a,b,h)} has no method 'scbox' want log options gave d: jquery plugins called on jquery objects. aren't supposed call them directly. you're supposed call on jquery object. $('#myelement').scbox(); also, you're calling $.extend on $...

java - How to remove NullPointerExceptions due to JButton array -

i'm terribly unfamiliar swing, here i'm trying make "clacker" game each time 2 dice rolled, either click 2 (or 1 if they're same number) buttons representing 2 numbers or 1 button representing sum of 2 numbers. if button clicked, visible set false. have jbutton array hold 12 buttons, every time reference made array buttons , throws nullpointerexception. i've tried putting code making jbutton array within constructor , actionperformed, still throws same exception. here code: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.random; public class clacker implements actionlistener { jpanel panel; jframe frame; jlabel dieface1, dieface2, numturns; jbutton[] buttons; jbutton rolldie, reset; string turn="turns: "; int turns, numcovered; public clacker() { frame = new jframe("clacker"); frame.setdefaultcloseoperation(jframe.exit_on_close); panel=new jpanel(); pa...

how to parse nested table usin jsoup -

how can extract "tr" tags has directly 2 "td" tags using jsoup. sample html <table> <tr> <!-- don't want extract tr --> <td> <table> <tr><td>extract</td><td>extract</td></tr> <!-- want extact tr --> <tr><td>extract</td><td>extract</td></tr> <!-- want extact tr --> </table> </td> </tr> </table> i tried extract using query. had got 3 tr tags. doc.select("tr:has(td:eq(1))") have tried following query doc.select("tr tr") ? this query should select table rows commented.

C++ Comparison, What is the outcome? -

there simple code int a( int *p0 ) { int p; if( p0 ) return p0 > &p; return a(&p); } int main() { puts( a(0) ? "y" : "n" ); } what result , how many times method a called? comparing pointers using > unspecified if not part of same array. so there no actual answer, although can assume if stack grows down if( p0 ) return p0 > &p; true, otherwise false.

java - Swing Worker Delay -

i have button click event fire swing worker thread in return fire thread long calculation including writing file. file read draw graphics. drawing part never happens if don't add delay in between.. (it says file not found although file there..what better way fix without adding delay.. private void buttonfragmentactionperformed(java.awt.event.actionevent evt) { try { esiplusfragmenterworker epfw = new esiplusfragmenterworker(10, sdffile, cidspectrum); epfw.execute(); thread.sleep(1000); holder.moltable1.drawmolviewpanel(currdir+sep+"esifragments"+sep+"esifrag.sdf"); } catch (exception e) { e.printstacktrace(); } } swing worker public class esiplusfragmenterworker extends swingworker<void, void>{ int mzppm_; string sdf_; string spectrum_; double mion_; moltable holder_; esiplusfragmenterworker(int mzppm, string sdf, string spectrum) {...

visual c++ - Build boost.thread - lib file not found -

i trying build boost.thread library visual studio 9.0. used bjam build lib-files: bjam toolset=msvc-9.0 variant=release threading=multi link=shared the compilation succeeded , got plenty of .lib , .dll files under boost/stage/lib. added include path , above lib path visual studio 9.0. but when try compile program, following error: libboost_thread-vc90-mt-s-1_49.lib cannot opened. the lib file created build has name: boost_thread-vc90-mt-1_49.lib i tried rename file match expected name, visual studio still cannot find file. seems filename beeing seaarched depends on project option "c/c++ / code generation / runtime library". need option "multithreaded /mt". what doing wrong? thank in advance. you're trying link statically crt, dynamically - boost. not idea, if insist, should define boost_all_dyn_link macro. better option select /md in project options, or set "link=static" when building boost.

c# - Threading and sleep() -

for game i'm working on, wanted throw audio on thread queue sounds , have them play. code i'm using in thread looks this private void _checkforthingstoplay() { while (true) { if (_song != null) { _playsong(_song); _song = null; } while (_effects.count > 0) _playsfx(_effects.dequeue()); thread.sleep(100); } } this runs asynchronously , works beautifully. however, without call sleep eats entire core on cpu. questiom is, sleep() efficient way lower cpu usage or there better ways this? friend , feel quick hack. that called producer-consumer problem , can solved. if using .net 4, try blockingcollection . there's sample code in msdn page . note line in sample code: while (true) console.writeline(bc.take()); that block (no cpu cycles wasted) until there consume .

objective c - distanceFilter property use -

in cllocationmanager class documentation, find such explanation distancefilter property: this property used in conjunction standard location services , not used when monitoring significant location changes. can please explain it? in cllocationmanager , distancefilter used notify changes when device has moved x meters. default value kcldistancefilternone: movements reported. from docs after returning current location fix, receiver generates update events when significant change in user’s location detected. example, might generate new event when device becomes associated different cell tower. not rely on value in distancefilter property generate events. start standard location services calling startupdatinglocation method. service appropriate applications need more fine-grained control on delivery of location events. specifically, takes account values in desiredaccuracy , distancefilter property determine when deliver new events. ...

Using CSS selectors in HTML templates -

Image
after accidentally using css selector in html template started wondering if there template language or extension 1 allow syntax, , whether useful. instead of writing this: <div id="mydiv"> <div class="first column">1</div> <div class="second column">2</div> </div> we write like: <div#mydiv> <div.first.column>1</div> <div.second.column>2</div> </div> does exist? maybe mean jade ? it html preprocessor. the following: doctype 5 html(lang="en") head title= pagetitle script(type='text/javascript') if (foo) { bar() } body h1 jade - node template engine #container if youareusingjade p amazing else p on it! will translated to: <!doctype html> <html lang="en"> <head> <title>jade</title> <script type="text/javascri...

Validate a numeric value range from html form textbox. PHP or Javascript -

i have form contains number of textboxes i.e. volome, gain, treble, middle , bass. whole numbers can entered, validated javascript , maxlength set to, no problem there. how make sure numbers between 0 , 65535 entered. <?php $name = $_post['ampmod']; $volume = 'volume = '. $_post['volume']; $gain = 'gain = '. $_post['gain']; $treble = 'treble = '. $_post['treble']; $middle = 'middle = '. $_post['middle']; $bass = 'bass = '. $_post['bass']; if($volume != null && $gain != null && $treble != null && $middle != null && $bass != null) { echo "<h3> $name </h3>"; echo "<table><tr>"; echo "<td>$volume</td>"; echo "<td>$gain</td>"; echo "<td>$treble</td>"; echo ...

ios5 - iOS Images for iPhone and iPad and Rotation of Images -

i read on apple website when choose images display background image has of quality. see this link . i developing app ios 5 xcode 4.3.2. how know if device high-resolution one? for setting background image, when rotations of device left or right, need include wider version of image? doing header , setting background name "my apple app" in background. need make wider version can stretch?

python - Xvfb multiple displays for parallel processing? -

curious running multiple xvfb displays: have between 10-50 instances of script running in parallel connect xvfb display. is advantageous run same number of xvfb displays , connect 1 1? or can multiple processes share same display? ram not issue, neither processing power. one xvfb server should able handle lots of connections quite well. 1 thing want make sure run server -noreset option. without it, has memory leak every time client disconnects. the time multiple xvfb servers helpful if have more 1 processor available in machine (e.g. 8 cores) , script graphics-heavy. see if case, connect many instances of script , check top see cpu usage of xvfb is. if it's @ 100%, might benefit additional xvfb instances.

Styling tabs in android -

i've implemented tabs @ bottom guess in order avoid divider text , image icons overlap seen in image ![tabs][1] [1]: http://i.stack.imgur.com/ldjwf.png . can see there's lot of space above image can shifted up. can tell me how can that?

ipad - Playing mp4 video with Phonegap on iOS -

i have phonegap application targeting ipad needs embed video on 1 of pages. i've found forum posts , other claiming possible using video tag html5. here's code i'm using: <video id="video01" width="770" height="433" controls="controls" preload="auto" poster="splash.png"> <source src="movies/myvideo.mp4" type="video/mp4" /> </video> this code snippet works great in safari, when loaded via phonegap onto ipad shows splash image crossed-over play button (like video didn't load right). perhaps there nuance playing video on ios i'm not aware of? or there small formatting issue video itself. video formatted h264 wrapped in mp4 container. maybe issue in video codec. try setting h.264 level 3.1 or lower. i ran similar issue recently. problem in video codec, rendering video in adobe after effects (cs5.5) , when exporting h.264 settings on level: 5.1. cam...

c# - I would like to close a child form from another child forms event? -

i have child pops display data. but when data changes new form created display new data. i want close old form, don't end 5000 forms every time data changes. the reason new form created in name data's id can shown. my code: string pass; // used value class , pass next form. public void shownewcomparediff() //object sender, eventargs e { formcomparediff childform = new formcomparediff(pass); childform.mdiparent = mdiparent; childform.text = "comepare difference "; //childform.close(); //not working //childform = null; //not working childform.show(); } private void datagridviewresult_cellmouseclick(object sender, datagridviewcellmouseeventargs e) { comparexml com = new comparexml(); pass = com.compare(richtextboxsql.text, richtextboxprevsql.text); shownewcomparediff(); } child form formcomparediff: namespace auditit_1 { public partial class formcomparediff : form { string passed; public f...

jquery - Removing items from Spring's AutoPopulatingList -

i have created dynamic form using spring autopopulatinglist , jquery. addition works charm, new items created , persisted database. issue deletion: update method gets full list, regardless of deletion of elements on browser side. controller's update method simple that @requestmapping(value = "/user/{id}", method = requestmethod.post) @responsebody public string updateuser(@pathvariable("id") int id, @modelattribute("user") user user, httpservletrequest request) { userservice.update(user); return messagesource.getmessage("user.data_updated", null, request.getlocale()); } user pojo implementation follows @entity public class user implements serializable { ... @onetomany(targetentity = language.class, fetch = fetchtype.eager, cascade = cascadetype.all) private list<language> languages = new autopopulatinglist(language.class); ... } the post request goes controller looks (addition, language 2 added): languages[0].co...

hibernate - How set order by clause in HQL by run time? -

is there way set order clause in hql run time. i.e. select obj example1 order <here column name , asc or desc these 2 thing want set in run time>. any proper solution...? have try adding 2 ? it's not working. replacing string work....but there other way hql .... the way concatenate appropriate field. if don't it, use the criteria api , designed generate queries dynamically.

php - code igniter loading a view at the end of the controller -

on ci have possibility load view directly constructor of controller, i'm loading header , footer of page (since it's same each function) class add extends ci_controller{ public function __construct() { parent::__construct(); $this->load->helper('url'); $this->load->view('header_view'); $this->load->view('footer_view'); } function whatever() { //do stuff } } but load footer view before loading function, there way without "manually" loading view @ end of each function ? i add header/footer in main view data, or use template library (i use one ). if in main view function; // in view html page <?php $this->load->view('header'); ?> <h1>my page</h1> <?php $this->load->view('footer'); ?>

javascript - HTML changeable div height with static width lots of divs -

i think knows site http://pinterest.com/ , don't want create site have purpose want create divs under divs static width , height changeable value. i made html code here is: http://jsbin.com/ihekiv <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <style type="text/css"> div{ margin: 5px; } .width-200{ width: 200px; background-color: #fcf; } .float-left{ float: left; } </style> </head> <body> <div class="width-200 float-left color-01" style="height: 300px;"> </div> <div class="width-200 float-left color-01" style="hei...

python 2.7 - nginx not forwarding upstream -

i have paster server set host multiple applications nginx proxying. reason, appears requests aren't being sent upstream nginx. i'm getting 404 errors in client, , "error" can find in logs following line nginx_error.log (being generated approximately once every 5 seconds): 2012/06/12 10:29:37 [info] 22289#0: *49 client closed prematurely connection while reading client request line, client: 192.168.10.135, server: localhost some quality time on google indicates isn't application-breaking issue, it's have go on right now. nginx.access.log prints following line every 5 seconds: --[12/jun/2012:10:31:13 -0400]-4000-- no entry user actions being printed application log, despite there being several logging messages in application. for reference, nginx.cfg looks like: daemon off; error_log /app_directory/logs/nginx_error.log info; pid /app_directory/var/nginx.pid; worker_processes 1; working_dire...

sql server 2005 - Uploading Data For A New Column In MSSQL -

i've added new column database , want populate spreadsheet. there easy query grab data out based on column in spreadsheet matches 1 in database? thanks i know of 2 ways: edit spreadsheet, create formula ="update mytable set mynewcolumn = " + a1 + " " + b1 + " = primarykeycolumn" where a1 represents first cell data , b1 primary key value row updated. drag cell down lower right corner formula repeated. copy text produced formula, paste sql mgmt studio , run. or, can use mssql's import engine allows select spreadsheet datasource. there can map column new column.

jquery - Does $.mobile.loadPage provide a callback function? -

if wanted load content jquery mobile page required own jquery script, example slideshow plug-in, how load slideshow html page "and" slideshow jquery file $.mobile.loadpage? there callback function? thanks you can use "done" after loadpage. method called once page has been loaded.. $.mobile.loadpage("page2.html", true).done(function (e, ui, page) { //page has been loaded }).fail(function () { alert("sorry, no dice"); }); thanks