Posts

Showing posts from March, 2011

command line - How to start a process from Java with arguments which contain double-quotes -

i need start second java process java program, , 1 of arguments forked process need contain literal double-quote characters ( " ). how do in portable way, i.e. @ least works on linux , windows? i tried use processbuilder (which introduced overcome problems of runtime class, right?) array of strings command line, still there problem parameter containing quote: list<string> commandline = new arraylist<string>(); commandline.add(new file(system.getproperty("java.home") + "/bin/java").getabsolutepath()); commandline.addall(arrays.aslist("-jar", "plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar", "-application", "org.eclipse.equinox.p2.director", "-repository", "http://download.eclipse.org/releases/juno")); commandline.add("-list"); commandline.add("q:select(x | x.id == \"org.eclipse.sdk.ide\")"); new processbuilder().command(commandline).d...

asp.net - Stored procedure doesnt return any value -

i got simple problem got no idea problem :/ in gridview using objectdatasource custom paging in tutorial http://www.codedigest.com/articles/aspnet/180_custom_gridview_paging_with_objectdatasource_control_with_aspnet_20.aspx here aspx markup: <asp:objectdatasource id="objectdatasource2" runat="server" onselecting="objectdatasource2_selecting" enablepaging="true" selectcountmethod="getitemscount" selectmethod="binditems" startrowindexparametername="startrowindex" maximumrowsparametername="maximumrows" typename="esova.utilities.recordutilities" > and method calling: public static datatable binditems(int category,int search,int startrowindex,int maximumrows) { datatable table = new datatable(); using (sqlconnection connection = new sqlconnection()) { connectionutili...

iphone - How to get timing advance value in android? -

i getting mcc,mnc,lac values in android apps, , made own application , able obtain these values. but timing advance (ta) not available in of app or not finding way ta. can use ndk, or @ commands or sdk anything, want ta value. can suggest pointers. if not android, ok iphone, or windows app also. thanks. same questions here get mobile cell tower timing advance on android 2.3 for lte technology there access timing advance values: see http://developer.android.com/reference/android/telephony/cellsignalstrengthlte.html#gettimingadvance() no sdk access method gsm , umts. @ commands modem specific...

ios - ccDraw. Fill screen everywhere except on sprite -

so trying basic "flashlight"-style thing going in 1 of games. the way getting work, having layer on top of game screen, , layer draw black rectangle ~ 80% opacity, creating of darkness on top of game scene. ccdrawsolidrect(ccp(0,0), ccp(480,320), ccc4f(0, 0, 0, 0.8)); what want draw rectangle everywhere on screen, except around cone of vision represent "light source". what create dark overlay on top of except light, giving illusion of torch/light/flashlight. the way can foresee happening using ccdrawsolidpoly() , since position of light source changes, vertices poly. any suggestions on how achieve great. you can use ccdrawsolidpoly() , avoid having manually update vertices. can create new subclass of ccnode representing light object, , custom shape drawing in -(void)draw method. the ccdraw...() functions draw relative local sprite coordinates, can move , rotate new sprite suit needs , cocos2d vertices transformations you. update :...

iphone - - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {} is not working -

i called method, - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { [super touchesbegan:touches withevent:event]; [self.name resignfirstresponder]; [self.username resignfirstresponder]; [self.mailid resignfirstresponder]; [self.password resignfirstresponder]; [self.retypepassword resignfirstresponder]; } for purpose of resign first responder.it working without using scrollview.but if using scrollview cant able use method.why? you can add gesture recognizer if need use scrollview. try this: uitapgesturerecognizer *gesturerecognizer = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(resignfirstresponder:)]; gesturerecognizer.delegate = self; [scrollview addgesturerecognizer:gesturerecognizer]; -(void) resignfirstresponder:(uitapgesturerecognizer *) gesture { [self.name resignfirstresponder]; [self.username resignfirstresponder]; [self.mailid resignfirstresponder]; [self.passwor...

php - Create three array from other array -

this question has answer here: how create multiple array array? 1 answer i have array below.we need create 3 array array.we need seperate facebook inside array , other twitter,email. is possible? array ( [01] => array ( [facebook] => 375 [twitter] => 3276 [email] => 3276 ) [02] => array ( [facebook] => 385 [twitter] => 3326 [email] => 3326 ) [03] => array ( [facebook] => 391 [twitter] => 3327 [email] => 3327 ) [04] => array ( [facebook] => 446 [twitter] => 3327 [email] => 3327 ) [05] => array ( [facebook] => 486 [twitter] => 3334 [email...

soa - Soap Header variable in BPEL -

i using soa suite , developing bpel process. want add header request going partner link. have added variable messagetype picked wsdl of partner. used header tab , added variable request. but while running, couldn't see header in request xml. variable have created initialized , holding value expected. tools: soa, bpel 1.1, jdeveloper 11.1.1.5 you can add desired header shown here http://chintanblog.blogspot.com/2012/09/soa-11g-bpel-soap-header.html

how to tackle Arithmetic overflow in db2 functions -

when run user defined function db2 returns following error sql0802n arithmetic overflow or other arithmetic exception occurred. sqlstate=22003 without giving me indication function source of error. setting on db2 can have stack trace or better information. looking @ message don't know start investigating. look @ return type of udf. if it's decimal(5,2) , function trying return bigger that, give error. function do? you might try looking in db2dump directory (~sqllib/db2dump) error logs. not sure if error gets logged though.

c++ - QT - window on top -

'windowstaysontophint' doesn't work widget 'ww', why? dialog w; widget ww; ww.setwindowflags(qt::windowstaysontophint); ww.setwindowflags(qt::framelesswindowhint); ww.setfixedsize(206,206); w.show(); ww.show(); because replacing qt::framelesswindowhint . if want both: ww.setwindowflags(qt::windowstaysontophint | qt::framelesswindowhint);

android - iq-engines-sdk error : UnsatisfiedLinkError thrown while initializing com/iqengines/sdk/IQLocal -

Image
i trying run app on android 4.2.2 has dependency on iq-engines-sdk ndk setup , has following output after doing project>clean gdbserver : [arm-linux-androideabi-4.6] libs/armeabi-v7a/gdbserver gdbsetup : libs/armeabi-v7a/gdb.setup install : libiqengines-sdk.so => libs/armeabi-v7a/libiqengines-sdk.so install : libiqindex.so => libs/armeabi-v7a/libiqindex.so i have following files on iq-engines-sdk after build this working before error w/dalvikvm(3867): exception ljava/lang/unsatisfiedlinkerror; thrown while initializing lcom/iqengines/sdk/iqlocal; d/androidruntime(3867): shutting down vm w/dalvikvm(3867): threadid=1: thread exiting uncaught exception (group=0x40e4b300) e/androidruntime(3867): fatal exception: main e/androidruntime(3867): java.lang.exceptionininitializererror e/androidruntime(3867): @ com.iqengines.sdk.iqe.initiqsdk(iqe.java:249) e/androidruntime(3867): @ com.iqengines.sdk.iqe.(iqe.java:224) do know cause of this? have tried removing pr...

android - Custom Info Window Adapter and 2 other issues -

so searching solution , bumped the code answer on stackoverflow i getting error here: googlemap.setinfowindowadapter(new custominfowindowadapter( gpstracker.this)); saying cannot resolved type. also share cannot resolved variable private void getcurrentlocation() { double[] d = getlocation(); share.lat = d[0]; share.lng = d[1]; googlemap.addmarker(new markeroptions().position(new latlng(share.lat, share.lng)).title("current location").icon(bitmapdescriptorfactory.fromresource(r.drawable.red))); i couldn't solution custominfowindowadapter , not understand share stands for. any in understanding , solving issue appreciated. thank time. this may you https://developers.google.com/maps/documentation/android/intro custom info window adapter custom data in map v2

java - using DocumentFilter.replace with unicode characters -

i building gui 1 textfield must typed in latin characters, others in arabic. avoid switching keyboard layout, choosed maintain in arabic , use documentfilter in particular textfield replace arabic characters counterpart according latin azerty layout. example, if 1 types '\u0628' (it 'ب'), should printed 'f' because in in same key. worked fine characters except b key, translates two characters "لا" in arabic layout, , documentfilter.replace called 2 times each character. there way control size of text argument when replace called? other solution problem? here original documentfilter.replace code ... private static char[] latin = {'a','z','e','r','t','y','u','i','o','p',...}; private static char[] arabic = {'\u0636','\u0635','\u062b','\u0642','\u0641',...}; ... (plaindocument) txtfileid.getdocument().setdocumentfilter(new ...

c++ - Can a private member function of class A be declared as a friend of class B? -

lippman's essential c++ section 4.7 this. don't know why code not compile: #include <iostream> using namespace std; class { void f(); //other members... }; class b { //other members... friend void a::f(); }; int main() { return 0; } while putting "public:"before void f() in class compiles. lippman wrong? p.s. lippman's code this: //... class triangular_iterator { //... private: void check_integrity() const; //... }; //... class triangular { //... friend void triangular_iterator::check_integrity(); //... }; //... you cannot declare function or members of "class a" friend of "class b" in "class b". must allow "class b" friend of "class a"'s, , make a::f() friend of "class b"'s: class { void f(); friend class b; //allow b access private (protected) members , functions }; class b { friend void a::f(); }; in real life, can't determine someone's fr...

java - Implementing State Pattern -

i implementing state pattern in java application , need few clarifications. the state machine has 5 states state 1 state 5. total of 5 events(event1 event5) causes state transition. not events applicable in states. if event not applicable in particular state application throw exception. when state machine gets initialized starts state1. following interface , context class. /* interface defining possible events in each state. each implementer handle event in different manner. */ public interface state { /* handlers each event. each implementer handle vent in different manner. */ public void handleevent1(statecontext context); public void handleevent2(statecontext context); public void handleevent3(statecontext context); public void handleevent4(statecontext context); public void handleevent5(statecontext context); // method enter state , action. public void enter(statecontext context); // method exit state , clean-up activity on exit . public void exit(statec...

asp.net - Using jQuery val with AjaxToolKit's TextBoxWatermarkExtender with IE -

i know, know, "don't use ajaxtoolkit"... assume i'm stuck it. if have following: <asp:textbox runat="server" id="textbox" /> <asp:textboxwatermarkextender runat="server targetcontrolid="textbox" watermarktext="text" /> and var textboxselector = $(#'<%= textbox.clientid %>'); then not work (i.e. changes watermark text not desired text) textboxselector.val('example text'); however found in chrome: textboxselector.focus(); textboxselector.val('example text'); but not in internet explorer. any ideas how implement this? you need set , use behaviorid of watermark extender itself. <asp:textbox runat="server" id="textbox" /> <asp:textboxwatermarkextender runat="server targetcontrolid="textbox" behaviorid="textboxwatermark" watermarktext="text" /> then use $find() access o...

javascript - For loop in array reads 'remove'? -

this question has answer here: problems javascript “for in” loop 3 answers i experienced strangest thing, code i'm using : for (iter in data.list) { console.log(iter); } as expect, log should give number of each row (0, 1, 2...), instead gives me : 0 1 2 remove knowing array has 3 rows did ever encountred ? basically, problem iterating through array using for in loop, not meant iteratung through arrays. intent iterate through properties of object, , apparently there property called remove on array. for more details on why for in bad idea when comes arrays, see why using "for...in" array iteration bad idea? . as solution, i'd suggest use indexed for loop. type of loop not care properties, hence fine. comes down classical: for (var = 0; < data.list; i++) { console.log(data.list[i]); } by way: should not upper...

SQL Server convert YY/MM/DD to proper datetime -

i have varchar in format yy/mm/dd. want convert datetime format. how that? just cast value: select cast('05/01/12' date) this work american setting sql server. if using international settings (or need international compatible), use convert() . select convert(date, '05/01/12', 11)

Can I upload a CSV file directly into datastore through CKAN UI? -

the first time installed ckan 2.2 added filestore extension upload files. when tried preview, getting errors. after following other posts recommending use datastore instead (since it's used instead of dataproxy), reinstalled ckan 2.2, added datastore , confirmed it's working using read , write tests. time round haven't installed filestore. now i'm trying upload file resource dataset through ckan's ui, choose csv/json file screen responds "unable authenticate upload". looked through error log files, nothing told going on. so question is, can upload file using ui directly datastore? thanks , regards, noel there 2 different things here, , can use both filestore , datastore @ same time: to automatically add csv files datastore whenever dataset created, can use datapusher extension. standalone service runs on server , uploads new files datastore, regardless of if uploaded (via filestore) or hosted somewhere else. (note old datastorer (...

Convert Android Bitmap to OpenCV Mat and backwards -

i wanted convert bitmap android mat object opencv. topic adressed on stack overflow. example: convert mat bitmap opencv android ; convert bitmap mat after capture image using android camera ; templatematching mattobitmap opencv android there more find. followed instrcutions in answers, i'm still unable done right way. minimal code: //first convert bitmap mat mat imagemat = new mat ( image.getheight(), image.getwidth(), cvtype.cv_8u, new scalar(4)); bitmap mybitmap32 = image.copy(bitmap.config.argb_8888, true); utils.bitmaptomat(mybitmap32, imagemat); //do smth. imgproc.cvtcolor(imagemat, imagemat, imgproc.color_rgb2gray,4); //then convert processed mat bitmap bitmap resultbitmap = bitmap.createbitmap(imagemat.cols(), imagemat.rows(),bitmap.config.argb_8888);; utils.mattobitmap(imagemat, resultbitmap); //set member result bitmap. member displayed in imageview mresult = resultbitmap; (note: image bitmap supplied lines of code) errors: 08-07 15:13:59.188...

string - How to combine sql text field with extra text and handle php as if it were one sql text field? -

for joomla 3.1 website i'm building need little help. basically trying automate inclusion of pluginline in article default. normally article have contain pluginline have article output plugin. example given: content of article: <p>lorem ipsum.....</p> <p>{plugintag var1=val1|var2=val2|etc.}</p> and stored in database text field. now in order have plugincontent included in every article requires user add pluginline manually every time new article added. i want remove pluginline articlecontent , add @ view article php file. instead of output: <div><?php echo $article->content; ?></div> in view article php file, want somehow add pluginline $article->content. tried replacing $article->content $new_content , created new value before it: $new_content = $article->content . '<p>{plugintag var1=val1|var2=val2|etc.}</p>'; but outputs exact pluginline underneath content , isn't handled plugi...

Trouble with #defined identifier in c++ -

i"m writing program ,extensively, depends on identifier: #define number_of_elements 12 the parameter used in number of projects (in 1 solution). problem have 2 modes: first number_of_elements 12 , second number_of_elements equals 16. is there way change value of parameter during run-time? if not there work-around? thanks in advance! #define provides constants pre-processor. not available @ runtime or directly compiler itself. you need use runtime variable if want value changed @ runtime. best way define depends great deal on structure of program.

eclipse - a slippery JSF syntax error -

if try display jsf 2 page on tomcat 7.0.34 with: jsf-api/impl 2.1.7 el-api 2.5 jstl 1.2 like one: <?xml version="1.0" encoding="utf-8"?> <!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" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:cis="http://java.sun.com/jsf/composite/comp"> <h:head> <title>prova errore di sintassi</title> </h:head> <h:body> <f:view> <ui:include src="/web-inf/include/menubar.xhtml" /> <h:form> <p:ajaxstatus style="width: 32px;height: 32px;" /> ...

symlink - error while creating symbolic links in linux -

i trying create symbolic link ( soft link ) folder lies on remote machine on network. command: ln -s /abc/folder1 folder1 the links not created. when ssh remote machine using... ssh <user>@<remote machine> i able view folder want create symlink when try cd folder machine... not there. i have checked permissions of file on remote machine its: drwxr-xr-x please, can 1 me in understanding problem , how resolve it...

javascript - drag tail(arrow) of Speech bubble on div border -

i creating speech bubble , want drag tip of speech bubble around corner of bubble mouse. should rotate automatically depending on side on. tail moving must in direction mean should draggable side of divs 1 side , must on mouse drag..so can drag tail using mouse ever want bt should across border only..plz give solution. it speech bubble css:- .speechbubble { position: absolute; background: red; border: 1px solid #f2f2f2; opacity: 0.9; top: 58px; left: 18px; width: 153px; height: 40px; min-width: 47px; min-height: 38px; position: absolute; } .speechbubble:after, .speechbubble:before { top: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; ...

datatable - Adding the column result of a DataRow[] column to a variable c# -

i want return value of datarow[] string in c# here datatable : datatable table = new datatable(); table.columns.add("id", typeof(int)); table.columns.add("bugdescription", typeof(string)); table.columns.add("unitprice", typeof(double)); table.rows.add(1, "bug 1", 10.00); table.rows.add(2, "bug 2", 20.00); i create datarow[] called result stores row id = 1: datarow[] result = table.select("id = 1"); the last step want achieve add bugdescription value string named description . how achieve this? your code datarow[] result = table.select("id = 1"); tells you have got array of datarows. means may have more 1 record here. so, depends on row assign. can if think first one if(result.length > 0) { string description = convert.tostring(result[0]["bugdescription"]); } doing linq way string description = table.row...

joomla2.5 - Joomla tooltip not hiding -

my problem tooltips not hiding after cursor moved away text tooltip. can check page example of problem: http://federationgenealogie.qc.ca/nous-contacter (which simple com_contacts page) but problem persists throughout website. i've tried template override of com_contacts , change way tool-tips handled using: http://docs.joomla.org/how_to_add_tooltips_to_your_joomla!_website $tooltiparray = array('classname' => 'mytooltipclass', 'showdelay'=>'500', 'hidedelay'=>'500', 'fixed'=>true, 'onshow'=>"function(tip) {tip.effect('opacity', {duration: 500, wait: false}).start(0,1)}", 'onhide'=>"function(tip) {tip.effect('opacity', {duration: 500, wait: false}).start(1,0)}"); jhtml::_('behavior.tooltip', '.hastip', $tooltiparray); ?> only 'fixed'=>true parameter works, feeling kind of works. since other parameters not ...

add reply to a comment system that using jquery and php -

i trying create commenting system uses facebook. use php , jquery. code works perfect. want add reply system in it. idea how this? this main page: wall.php <script> $(document).ready(function(){ $("#comment_process").click(function(){ if($("#comment_text").val() != ""){ $.post("comments.php?action=post", { comment: $("#comment_text").val() }, function(data) { $(".comments").html(data); $("#comment_text").val(""); }); } }); }); </script> <div class="comment_container"> <div class="comment_form"> <textarea id="comment_text" ></textarea> <input type="button" id="comment_process" value="post"/> </div> </div> <div class="comments"> <?php include_once("comments.php");?> </div...

loops - PHP foreach with two 'as'? -

hi there trying combine 2 loops of foreach have problem. the problem <a href='$link'> same results must different. here code using: <?php $feed = file_get_contents('http://grabo.bg/rss/?city=&affid=16090'); $rss = simplexml_load_string($feed); $doc = new domdocument(); @$doc->loadhtml($feed); $tags = $doc->getelementsbytagname('link'); foreach ($tags $tag) { foreach($rss $r){ $title = $r->title; $content = $r->content; $link = $tag->getattribute('href'); echo "<a href='$link'>$title</a> <br> $content"; } } ?> where mistake? why it's not working , how make work properly? in advance! both loops going through different resources cross joining records in them. this should work data need: <?php $feed = file_get_contents('http://grabo.bg/rss/?city=&affid=16090'); $rss = simplexml_load_string($feed); forea...

c# 4.0 - how to add object to a list in a view? -

Image
i have typed view have form. display values of contact (object) in textboxes. contact has list of functions. have list of functions exist in database. in view i'm listing functions displaying checkboxes (value : id of function, display : name of function). before that, compare list of contact's functions functions , checked of contact. : @foreach (extranetclient.models.classes.fonctioncontact fonction in viewbag.fonctions) { string coche = ""; if ((@model.listefonctions).where(c => c.idfonction == fonction.idfonction).count() > 0) { coche = "checked"; } <input type="checkbox" @coche id="@fonction.idfonction" />@fonction.libellefonction <br /> } it looks that: but now, if user checks checkbox add function contact, need save in contact's list. cannot find how that. has ide...

jquery - Horizontal Javascript menu error -

i have small problem javascript menu. when choose item shows me last sub menu. this simple people professionals in javascript :p here sample: css ul#midnav { border-width: 1px 0; list-style: none; margin-bottom: 5px; text-align: center; border-bottom: solid thin #c8c8c8; padding: 0px 0px 13px 0px; } ul#midnav li { display: inline; padding: 0px 0px; } ul#midnav li { text-transform:uppercase; font-size:11px; padding: 5px 13px 0px 5px; background: url('../image/arrow-topdown-gray.png') 100% 9px no-repeat; } ul#midnav li ul { line-height: 28px; padding: 0; position: absolute; top: -30px; background: none; display: none; /* --hide default--*/ width: 960px; height:28px; background: #fff; border-top: solid thin #eeeeed; } ul#midnav li ul { background: url('../image/arrow-left-gray.png') 100% 9px no-repeat; } html <div id="navigation"> <div id...

regex - .htaccess dash separator 2 params or more -

i'm working .htaccess , , want make friendly urls. my current url: www.url.com/index.php?v=[something]&i=[idiom] but can be: www.url.com/index.php?v=[something] what want: www.url.com/[something]-[idiom] or in second case: www.url.com/[something] .htaccess config made: rewriterule ^([^/]+)-([^/]+)?$ index.php?v=$1&i=$2 writing www.url.com/[something]-[idiom] goes okay, webpage running properly. in second case have write www.url.com/[something]**-** . if write www.url.com/[something] page breaks. so, want make second param optional, , separated dash if it's possible. can 1 me please? it won't match www.url.com/[something] because expects - @ end. include - inside second capturing group, so: ^([^/]+?)(-[^/]+)?$ also changed first greedy quantifier lazy 1 avoid matching much.

c# - Displaying 2 columns in one combobox -

i have employee table. want combobox present employee number , city. sqlcommand cmd = new sqlcommand(); connection c = new connection(); cmd.commandtext = "select employeenumber, city tblemployee"; sqldataadapter adp = new sqldataadapter(cmd); dataset ds = new dataset(); adp.fill(ds, "employee"); combobox1.datasource = ds; that's got far, can me that? you can add format event combobox, , in compose whatever want show: private void _combobox1_format(object sender, listcontrolconverteventargs e) { var x = (datefiltertype)e.listitem; e.value = /* insert string concatenation stuff here... */; }

c# - Hourly collection of files across network -

i'm working on application in c# allow user select 1 or more networked drives or computers , collect data logs folder (folder location same on drive/pc) files must collected hourly, @ 10am application collect data logs of 9am each designated folder.. i'd occur in separate thread automatically on hour, every hour long application running in background. issue have not familiar how set timer/hourly system thread can made , run hourly. if has advise or ways perform please let me know. *i'm looking options coded this, distributed 40 or 50 different pcs use windows task scheduler invoke program. make sure don't miss invocations, code invoked @ right time , can deploy next version of tool using xcopy. i think can retry failed jobs, send error reports , such. you can script task using .bat-file or create using c#. mass-deployable.

ember.js - How to update record in local storage using ember data and localstorage adapter? -

i new emberjs , making 1 simple crud application. using ember data , localstorage-adapter save record in local storage of browser. i trying update record using localstorage-adapter throwing error. i have listed code here : updatecontact: function(){//save data in local storage var fname = this.obj_form_edit_data.get('cont_data.fname'); var lname = this.get('cont_data.lname'); var email = this.get('cont_data.email'); var contactno = this.get('cont_data.contactno'); var gendertype = ((this.get('ismale') == true) ? true : false); var contactype = $(".selectpicker").val(); grid.modalmodel.updaterecords({ fname: fname, lname: lname, email: email, contactno: contactno, gendertype: gendertype, contactype: contactype }); this.get('store').commit(); } i getting following error ...

javascript - How do I make a ajax-loaded UL sortable in a JQuery UI dialog? -

i need load ul in background , present in dialog sorting, i'm new jquery/jquery ui , having trouble google. far i've got: $(document).on('click','a.priority', function(){ // url of link var href = $(this).attr('href'); // tell page expect js instead href = href + "/ajax"; // page content $.get(href, function(data){ // initialise dialog content var my_dialog = $('<div></div>') .dialog({ autoopen: false ,open: function (event, ui) { // add result of (a ul) dialog's content my_dialog.html(data); // make sortable, how? my_dialog.sortable().disableselection(); // set dialog title (this dynamic later, , might need call single dialog gets remangled rather creating 1 every time) my_dialog.dialog("option","t...

Can I remove Java 6 and Android still working? -

Image
i have java 6, , working on eclipse android programming. installed java 7 , of sudden, java website told me have versions can remove. photo: if removed these versions, can eclipse , android programs keep working? eclipse , android work java 6 or 7. need 1 of 2 running (if don't have java @ won't work). building android platform issue entirely... keep in mind android runs java 6 won't able use java 7 runtime features not backwards compatible. see here eclipse compatibility see this answer android compatibility.

Is it the C# compiler or the CLR that prohibits multiple inheritance -

exactly title says. is restriction placed c# compiler or clr fundamentally prohibit it? both. the c# language, not directly tied clr (i.e. mono aot) not allow multiple inheritance. the clr type system, supports languages other c#, not support multiple inheritance.

image - Online tool to decode base64 string to png -

does know if there online tool decode base64 encoded strings png files. my base64 string follows http://pastebin.com/bfc1e1nv yes, such tool exists, example, this: http://www.motobit.com/util/base64-decoder-encoder.asp

Google's SNAPPY algorithm implementation in javascript (client side) -

i need use snappy compress data client side (javascript code), send server side, receive data server side , decompress @ client side (javascript code). concern 1 : this answer not appreciate native javascript implementation. do? concern 2 : appreciate if may provide pointer on how go or reference regarding same. what shall implication, in case snappy algorithm gets new release or bug fix - have to maintain overhead of updating client side implementation? suggestions... ? you might use emscripten, c/c++ js compiler on https://github.com/andikleen/snappy-c or http://code.google.com/p/snappy/ itself

php - why is echo changing font size on the rest of my page? -

Image
i'm getting angry @ this, i'm setting jquery dialog box, heres code i'm using echo it: echo " <div class='dialog' title='edit record'> <form method='post'> <table> <tr> <td>name</td> <td><input type='text' value='$row[name]' name='name'></td> </tr> <tr> <td>cash down</td> <td><input type='text' value='$row[cash]' name='cash'></td> </tr> <tr> <td>amount</td> <td><input type='text' value='$row[amount]' name='amount'></td> </tr> <tr> <td>mem type</td> <td><input type='text...

is_null behaviour php laravel 4 -

i in process of building small api system using laravel. small piece of code searches user, , if exists, sends json response back. when ran code such should return no user(usercontent {}), is_null still returns false. thought should return true in case. had planned use in code check if users exist, seems failing everytime. have misunderstood something? can explain missed? thanks. response code: if($user) { return response::json(array( 'error' => 'true', 'message' => 'user exists.', 'user' => is_null($user), 'usertype' => gettype($user), 'usercontent' => $user ), 400); } response json: { "error":"true", "message":"user exists.", "user":false, "usertype":"object", "usercontent":{} } edit: i did var_dump($user); var_dump(empty($user)); which seem retu...

Play sound file one after another in android -

i trying play sound in android 1 after "res/raw" folder. playing first sound sounds array. there other way it? there 3 sound file in raw folder 1.aa.ogg 2.ma.ogg 3.ar.ogg package com.protonray.calculatorplus; import java.util.list; import android.media.mediaplayer; import android.media.mediaplayer.oncompletionlistener; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.app.activity; public class layoutnew extends activity{ int count=0; int[] sounds={r.raw.aa,r.raw.ma,r.raw.ar }; mediaplayer mp=new mediaplayer(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.layout_new); button play=(button) findviewbyid(r.id.play); play.setonclicklistener(new view.onclicklistener() { @override ...

osx - Excel for Mac - Cells containing user-defined functions won't update -

i'm working on vba code writes formulas containing user-defined functions (udfs) cells of workbook, e.g.: h1004 = maxdd(h1:h1001) . when run code in excel 2010 (for windows) works expected: 1) formulas written cells 2) each cell returns correct result. when run same code in excel 2011 mac formulas written cells. however, cells won't return valid results - instead display #value errors. note: can't troubleshoot issue because when select 1 of these cells, put cursor in formula field, , press return (presumably forcing cell evaluate), correct answer appears. my question: what needs done keep excel mac returning #value errors instead of plain results? i figured out what caused problem, although have no idea why caused problem: in order make vba code run faster, had turned off automatic calculation @ beginning of code , turned on @ end of code, --> application.calculation = xlcalculationmanual 'main part of vba code ...

Problems with Android and Eclipse Functionality -

Image
i coming xcode , ios development android. downloaded sdk right here http://developer.android.com/sdk/index.html . seems unstable , things don't work, ie dragging textclock activity, need, throws null reference exception no guidance on wrong , layouts not staying lined when move or make seemingly trivial change. mind numbing , frustrating @ point, point feel set wrong or there issue it. know if might case or if there link describes gotchas eclipse , android , how through them without smashing mouse , keyboard first? below screen of happens after dragging in textclock. opened details window. this bad question , voted close it. however, it's (if obvious) observation. yes, tooling sucks. main problem - each upgrade of each element (eclipse, adt, sdk) brings new problems , gotchas, cannot find out workarounds , on work. have learn live occasional surprises , constant feeling of bewilderment , instability. the relatively news after couple of months develop (...

Design for max hash size given N-digit numerical input and collision related target -

assume hacker obtains data set of stored hashes, salts, pepper, , algorithm , has access unlimited computing resources. wish determine max hash size certainty of determining original input string nominally equal target certainty percentage. constraints: the input string limited 8 numeric characters uniformly distributed. there no inter-digit relation such checksum digit. the target nominal certainty percentage 1%. assume hashing function uniform. what maximum hash size in bytes there nominally 100 (i.e. 1% certainty) 8-digit values compute same hash? should possible generalize n numerical digits , x% accepted answer. please include whether there issues using first n bytes of standard 20 byte sha1 acceptable implementation. it recognized this approach increase susceptibility brute force attack increasing possible "correct" answers there design trade off , additional measures may required (time delays, multiple validation stages, etc). ...

Rails 4 Heroku Mysql to Postgres Dump Pending Migrations -

i've converted mysql db postgres . i'm used following import db: heroku pgbackups:restore database 'http://app.com' --app this creates tables , imports data. the problem have following: heroku run rake db:seed --app then list of pending migrations. is there way ignore these, reset it, or doing wrong? thank you

How to loop through & display Javascript Multidimensional Array -

i have testing search software , stores data in multidimensional array. can return whole database cannot return 1 value. i'm trying figure out how return 1 section multidimensional array. otherwise repeats passed value across display. while de-bugging can see complete array stored argument having trouble figuring out how loop through array display correctly. may need view source understand better. if enter lets 439023483 , click search isbn button, see issue. show button works fine. pointing me in right direction appreciated , thank in advance. here link testing source: http://mdhmotors.com/jstesting/test.html here part of code i'm stuck on: function searchbyisbn(isbn) { var isbn = document.getelementbyid('isbn').value; showbooks(getbookbyisbn(isbn)); } function getbookbyisbn(isbn) { var foundbook = null; (b in bookstore) { var book = bookstore[b]; if (book[isbn] == isbn) { foundbook = new array(book[isbn], book[title...

ruby - Iterate over loop accessing two elements if they exist -

well, haven't found clean solution write code in ruby: # java style version: array.each |i, el| if < array.length - 1 process(array[i], array[i+1]) end end # nice if this: array.each |i, el, next| process(el, next) end you can use each_cons : array.each_cons(2) |a, b| process(a, b) end

how to override error method in c# log4net -

i ask if possible override log methods or create new 1 properties in method. at moment can use it: globalcontext.properites["details"] = "some info"; log.error("some info",exception); i use it: log.myspecialerror(details, message, exception); any advice appreciated ori create own extension method. it must defined in static class, , static method. e.g. definitions: public static class log4netextensions { public static void myspecialerror(this log log, string details, string message, exception exception) { //do parameters } } use: log.myspecialerror(details, message, ex);

MySQL stored procedure OUT param returned as null (NO LOCAL VARIABLE DECLARED) -

i trying debug problem. i've gone great extremes , trying figure out why mysql return null when return var explicitly set value. delimiter $$ create definer=`root`@`localhost` procedure `foo`( out numberexpectedtofill int(11)) deterministic begin set numberexpectedtofill := 23; commit; end so, scripted little script call it, , return value null. why? prepare s 'call `test_schema`.`foo`(@output)'; execute s; select @output this unexpected ... works in sqlfiddle both , without using prepared statement: http://sqlfiddle.com/#!2/d4ddf/1 , http://sqlfiddle.com/#!2/d4ddf/2 maybe there problem permissions (would signal error, thought) ?!? edit: still guessing -- sure call foo right schema? o_o

c# - does not contain a constructor that takes '1' arguments -

i've searched few topics i'm still stuck, i'm new c# , error starting give me headache. i'm trying initilise list keep getting error message. welcome. public static list<bookoperator> createbookoperators() { list<bookoperator> ops = new list<bookoperator>(); bookoperator op = new bookoperator(ops); ops.add(op); return ops; } it looks me there no reason try , pass list book-operator. money says: public static list<bookoperator> createbookoperators() { list<bookoperator> ops = new list<bookoperator>(); bookoperator op = new bookoperator(); ops.add(op); return ops; } or more tersely: public static list<bookoperator> createbookoperators() { return new list<bookoperator> { new bookoperator() }; }

ruby on rails - activemodel - updating children of object when saving parent -

this followup question here: updating child association in activemodel i'm looking standard/correct way update number of children records associated parent. lets have parent (connected child table has_many, , :autosave=>true). obj = parent.first now iterate on children, , update them. obj.each.do |child| child.remark = "something" end i children saved parent, when calling obj.save, explained me in previous question, way update directly, this: obj.children.first.remark = "something" (or save each child, require explicit transaction believe shouldn't used here). what correct way implement this? thanks! *edit : following advice given here, i've added model: class parent < activerecord::base has_many :children, :inverse_of => :parent,:autosave=>true accepts_nested_attributes_for :children but still, x = parent.first c = x.children.first c.remark = "something" x.save # => doesn't...

concatenation - sql - concatenating case statements -

i want similar to: select ('['+twt.dept+']' + case when twt.typ <> 'empty' , twt.typ > '' '-['+twt.typ+']' end + case when twt.subtyp_1 <> 'empty' , twt.subtyp_1 > '' '-['+twt.subtyp_1+']' end + case when twt.subtyp_2 <> 'empty' , twt.subtyp_2 > '' '-['+twt.subtyp_2+']' end + case when twt.subtyp_3 <> 'empty' , twt.subtyp_3 > '' '-['+twt.subtyp_3+']' end) category table1 tb1 join table2 twt on (tb1.id = twt.id) i know can use coalesce or using stacking cases, anyways use simpler looking syntax have here achieve (especially without having monster case statement 5th case)? ps category coming empty, while have verified atleast 2 of field above contain values. i hoping [shoes]-[sandals]-[pancakes]-[cinnamon bun] i don't think can make query shorter. use separate ...

android - WebView must be loaded twice to load correctly -

when page webview first loads, images missing or displayed incorrectly. if reload page webview displays perfectly. know first think set javascript after loadurl, isn't true. in oncreate have: learnwebview = (webview)findviewbyid(r.id.learnwebview); learnwebview.setwebviewclient(new webviewclient()); learnwebview.getsettings().setjavascriptenabled(true); then later in function called after oncreate have: learnwebview.loadurl("myurl"); and yes, know function loadurl called after oncreate every time. please try instead of way, bad practice: learnwebview.post(new runnable() { @override public void run() { learnwebview.loadurl("myurl"); } }); or this, in case first 1 wont work: learnwebview.postdelayed(new runnable() { @override public void run() { learnwebview.loadurl("myurl"); } }, 500); h...

How do I synchronize the color and depth sensors for Kinect for Windows using MATLAB? -

i capturing color , depth images kinect windows using matlab , official kinect sdk. both sensors synchronized such image each sensor of same moment. unfortunately, current implementation has lag between 2 sensors (of 1 second!). please me find way synchronize sensors. here current code: colorvid = videoinput('kinect',1,'rgb_640x480'); depthvid = videoinput('kinect',2,'depth_640x480'); triggerconfig([colorvid depthvid],'manual'); set([colorvid depthvid], 'framespertrigger', 300); start([colorvid depthvid]); trigger([colorvid depthvid]); pause(10); [imgcolor, ts_color, metadata_color] = getdata(colorvid); [imgdepth, ts_depth, metadata_depth] = getdata(depthvid); stop([colorvid depthvid]); delete([colorvid depthvid]); clear colorvid depthvid; i've played while , seems adding pause between start() , trigger() functions solves problem! start([colorvid depthvid],'framespertrigger',300); pause(1); trigger([colorvid d...