Posts

Showing posts from April, 2010

c# - Designing according to various resolution in windows8 -

c# - Designing according to various resolution in windows8 - in metro application want design pages satisfy resolutions. used viewbox command , set height=768 , width=1366 command within viewbox.in case design satisfied resolution except 1024*768 , 1280*800. how can design pages satisfy every resolution.please help me? hi heres code piece solve ur issue. //add event listner on size changed window.current.sizechanged += current_sizechanged; here's code within event listener or other custom method height , width , stuff : var height = window.current.bounds.height; var width = window.current.bounds.width; this give height , width of app. (i write app here because metro can run in snapped mode) ... according can manipulations controls. c# windows-8 microsoft-metro windows-runtime winrt-xaml

android - ShareActionProvider with one icon - looking as simple actionitem -

android - ShareActionProvider with one icon - looking as simple actionitem - i want dislay shareactionprovider on actionbar , custom look&feel. 1 simple share icon without borders , without used app icon on right. providing popup menu used applications. there simple way without implementing own shareactionprovider ? ok regardless of actionbarsherlock first test see if creating intent correctly, abs uses same code generic chooser see if app's looking show when execute code. intent i= new intent(intent.action_send); i.settype("text/plain"); i.putextra(android.content.intent.extra_text, "my test text"); startactivity(intent.createchooser(i,"share using ...")); all of app's handle plain text show up, if facebook, or whatever expecting not there app's don't back upwards action_send intent type have registered (plain/text). (facebook does, more in minute) abs has sample using share action provider try's send photo,...

updates - mysql query to compare 2 types of dates when actual date unknown -

updates - mysql query to compare 2 types of dates when actual date unknown - is posaible write query when don't know acutal dates? need compare transaction dates funds available dates & update funds available date adding day date. i know ms sql improve mysql, still should able compare them using greater , less than. if want modify value, you'll want utilize date_add function (date , time functions reference). comparing transaction date funds available date involve where transtable.transdate >= custtable.fundsavaildate , , adding 1 day funds available date set fundsavaildate = date_add(fundsavaildate, interval 1 day) mysql updates

Java -- Iterations not working -

Java -- Iterations not working - i doing java game that's cows , bulls. instead of displaying "cow" , "bull" displays "moo" or "moo." 4 digit number generated , user can guess it. each digit correctly specified (same number, same position), "moo" displayed on screen. each digit guessed has same number, wrong position "moo" displayed. i'm having problem doing method returns how many "moo's" returned. public int getlittlemoocount(int guess) { int count = 0; string guessstring = integer.tostring(guess); string randomvaluestring = integer.tostring(randomvalue); // pads number 0 if less 4 digits, length 4 while(guessstring.length() < 4) { guessstring = "0" + guessstring; } while(randomvaluestring.length() < 4) { randomvaluestring = "0" + randomvaluestring; } // checking see if positions match. if so, homecoming m...

performance - Matlab + CUDA slow in solving matrix-vector equation A*x=B -

performance - Matlab + CUDA slow in solving matrix-vector equation A*x=B - i calculating equation a*x=b, matrix , b vector, x reply (unknown) vector. hardware specs: intel i7 3630qm (4 cores), nvidia geforce gt 640m (384 cuda cores) here's example: >> a=rand(5000); >> b=rand(5000,1); >> agpu=gpuarray(a); >> bgpu=gpuarray(b); >> tic;a\b;toc; elapsed time 1.382281 seconds. >> tic;agpu\bgpu;toc; elapsed time 4.775395 seconds. somehow gpu much slower... why? slower in fft, inv, lu calculations, should related matrix division. however, gpu much faster in matrix multiplication (the same data): >> tic;a*b;toc; elapsed time 0.014700 seconds. >> tic;agpu*bgpu;toc; elapsed time 0.000505 seconds. the main question why gpu a\b (mldivide) slow comparing cpu? updated here more results when a, b (on cpu), aa, bb (on gpu) rand(5000): >> tic;fft(a);toc; elapsed time *0.117189 *seconds. >> tic;fft(a...

php - Will imagedestroy() delete from disc -

php - Will imagedestroy() delete from disc - function png2jpg($originalfile, $outputfile, $quality) { $image = imagecreatefrompng($originalfile); imagejpeg($image, $outputfile.'.jpg', $quality); imagedestroy($image); } i'm using image compression, maintain finding file save deleted. imagedestroy() cause save memory or delete output file. no in memory. from manual imagedestroy() frees memory associated image image. use unlink() delete file php image compression gd

tfs - TFS2012 permissions: how do I remove the user? -

tfs - TFS2012 permissions: how do I remove the user? - i 1 time added user alter permission on 1 specific project folder. can inherit permission grouping , wanted remove him list. how remove user permission management of specific project folder? i checked documentation user removal mentioned nowhere: http://msdn.microsoft.com/en-us/library/ms252470.aspx thanks. from web interface: navigate http://{yourtfs}:8080/tfs/{collection}/{project}/_admin/_security click "users" link @ top section of left pane find user , select it from right pane, click "member of" link you can remove user grouping want clicking "remove" link next group tfs tfs2012

How set the application support multi screen in android? -

How set the application support multi screen in android? - i creating android application. how set multiple screen support? how design button background, background images, etc. different screens using photoshop? android android-ui android-screen-support

visual studio 2012 - TFS2010 with VS2012 workflow build process templates -

visual studio 2012 - TFS2010 with VS2012 workflow build process templates - it's known visual studio 2010 works extremely slow build process templates using visual designer editing xaml file (more info at: why workflow designer extremely slow when editing build process templates?). reason, started utilize visual studio 2012 results. each file saving takes 2 seconds instead of 40 got visual studio 2010. in order create work, had clean-up versioned assemblies , alter custom ones .net 4.5 framework. once got sorted out (load workflow in visual designer without errors), launched build definition workflow against our tfs2010 server , got next error message: tf215097: error occurred while initializing build build definition \myproject\mybuilddefinition: cannot set unknown fellow member '{http://schemas.microsoft.com/netfx/2009/xaml/activities}textexpression.namespacesforimplementation'. is possible run vs2012 edited build templates in tfs2010? if so, how can...

html - Display inline content on separate lines -

html - Display inline content on separate lines - i have simple block content: <div> <img src="/img/sample.png" alt="sample image"> <span class="colored-text">company name</span> <em>address</em> </div> i want 'company name' , 'address' on separate lines. and have several options available: make additional <div> s, add together <br/> tag between <span> , <em> tags , maybe other solutions. proper way add together such functionality? you should semantically makes sense. in general, div tags meant represent kind of partition in page. if listing address doesn't create sense this. utilize <br /> @ end of line adds line break without making kind of semantic statement content. html css

microsoft metro - WinRT XAML ItemsControl Children binding -

microsoft metro - WinRT XAML ItemsControl Children binding - i have next xaml: <itemscontrol itemssource="{binding datacontext}"> <itemscontrol.itemtemplate> <datatemplate> <local:mycontrol datacontext="{binding}"/> </datatemplate> </itemscontrol.itemtemplate> <itemscontrol.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal"/> </itemspaneltemplate> </itemscontrol.itemspanel> </itemscontrol> how set datacontext of mycontrol single item of itemscontrol ? note: itemscontrol embedded in usercontrol . usercontrol has it's datacontext property set in place it's beingness used. figured out: <itemscontrol itemssource="{binding}"> <itemscontrol.itemtemplate> <datatemplate> <local:mycontrol datacontext="{bindin...

javascript - Trying to display image in a game of memory -

javascript - Trying to display image in a game of memory - okay, problem. i'm creating game of memory images in it. cannot understand how able display image after setting display='none' for-loop onload function. i've tried couple of hours without result. =( anyone can help me? and elem.id points td id it's dynamic. it's tricky because in every td there img. i sincerely appreciate help. this code: var clicked = true; var firstclick; var secondclick; var firstplayer = true; var addpointplayer1 = 0; var addpointplayer2 = 0; var totalpoints = 8; function clickcard(elem){ //document.getelementsbytagname('img').style.display = ""; if(clicked){ firstclick = document.getelementbyid(elem.id); // document.getelementsbyname(/.img/).style.visibility="visible"; firstclick.style.backgroundcolor= "white"; clicked = false; } else{...

ruby - Array of Strings to Convert to Mixed Array -

ruby - Array of Strings to Convert to Mixed Array - i'm trying convert array of arrays consisting of ruby strings array of arrays consisting of strings , floats. here attempt: array = [["my", "2"], ["cute"], ["dog", "4"]] array.collect! |x| x.each |y| if y.gsub!(/\d+/){|s|s.to_f} end end end => [["my", "2.0"], ["cute"], ["dog", "4.0"]] i'm looking rather homecoming [["my", 2.0], ["cute"], ["dog", 4.0]] did wrong? what did wrong used gsub! . takes string , changes string. doesn't turn else, no matter (even if convert float in middle). a simple way accomplish want is: [["my", "2"], ["cute"], ["dog", "4"]].map{|s1, s2| [s1, *(s2.to_f if s2)]} if not want create element array, replace contents, then: [["my", "2"], ["cute...

android - Date not updated when restoring snapshot -

android - Date not updated when restoring snapshot - when start emulator set save snapshot, emulator still uses date since lastly ran it, 4 days ago. i'm trying work on app , need have update can test things since app uses log dates. how prepare without losing info of snapshot? well had go settings , disabled "automatic date" , manually set date os. android emulator snapshot

visual c++ - overwriting in a .txt file -

visual c++ - overwriting in a .txt file - i'm writing code visual c++. target writing double values in .txt file. problem i'm passing in cicle , everytime there's file overwrite , can see lastly value. (the values of marker1, marker2, marker3 alter in every cicle). ofstream myfile; myfile.open("c:/mattia_progetto/linescannerrealtime/markers.txt"); myfile<<marker1[0]<<"\t"<<marker1[1]<<"\t"<<marker1[2]<<"\t"<<marker2[0]<<"\t"<<marker2[1]<<"\t"<<marker2[3]<<"\t"<<marker3[0]<<"\t"<<marker3[1]<<"\t"<<marker3[2]; myfile.close(); how can solve it? pass ios::app mode flag myfile.open() append file instead of overwriting contents. see: http://en.cppreference.com/w/cpp/io/basic_ofstream/open visual-c++

Is this way to deal with errors safe in PHP ? Is it idiomatic? -

Is this way to deal with errors safe in PHP ? Is it idiomatic? - i'm writing lot of code in few of functions : $f = fopen($fname); if ($f === false) { throw new exception("cannot open $fname"); } this verbose when deal lot of file open & deal with. i'm wondering if can work without unforeseen bad side-effect : $f = fopen($fname) or die("cannot open $fname"); this idiomatic in perl, right in php ? there another, improve way ? seems valid, know php can bite in lot of unexpected ways. i tend opt like: if(!($f = @fopen($fname, 'r'))) { throw new exception("cannot open $fname"); } the perl-style fine too, although believe fopen raise errors. php error-handling

How to access the variables declared inside functions in python -

How to access the variables declared inside functions in python - i have next code reads configuration file , stores results in variables list import configparser def read_config_file(): config = configparser.configparser() cnf_path = 'config_files/php.sr' config.read(cnf_path) if config.has_section('basic'): if config.has_option('basic', 'basic'): php_bsc_mdls = config.get('basic', 'basic').split(',') if config.has_section('advance'): if config.has_option('advance','advance'): php_adv_mdls = config.get('advance', 'advance').split(',') now want result variables php_bsc_mdls , php_adv_mdls function read_config_file.php_bsc_mdls or read_config_file.php_adv_mdls so possible access/get variables python function ? you need homecoming them. cease exist when function ends. def read_config_file(): co...

jquery - Apply function to specific elements -

jquery - Apply function to specific elements - i know simple stuff, can't figure out... how apply css changes multiple elements? @ moment, it's working first, showing no errors. function eleminit(){ var elem1 = jq('#elem1'); var elem2 = jq('#elem2'); jq(elem1, elem2).each(function(){ jq(this).css({ 'margin-left': '-' + jq(this).width()/2 + 'px' }); }); }; eleminit(); jq ensure there's no conflict. jquery selectors work css selectors, css method uses each method internally, can code: jq('#elem1, #elem2').css('marginleft', function(i, oldmarginleft) { homecoming '-' + jq(this).width()/2 + 'px'; }); jquery

html - Where to find "javascript" source code of V8 DOM method implementations (document.createElement())? -

html - Where to find "javascript" source code of V8 DOM method implementations (document.createElement())? - this question has reply here: hooking document.createelement using function prototype 2 answers i need rewrite document.createelement() method , i'm looking javascript source code online ideas. searched http://code.google.com/p/v8/source/browse seems search returns results svn sources (even non-related libraries) makes messy. browsed code in svn, , there of course of study c++ source code, no javascript implementations. you should not, , cannot, re-write native dom methods. methods such createelement "close surface" of client's emacscript implementation, have protected scopes, , not able reproduced "userland" script. in case of createelement , might able overwrite createelement function of document object in brow...

mysql - User Logging in getting redirected to index.php -

mysql - User Logging in getting redirected to index.php - note: first using php, html, css, mysql (database), using dreamweaver 6 edit code in. ok, final year project creating e-attendance tracking , monitoring system. having great difficulties creating logins multiple users. 3 users scheme staff, parents & students. this, focusing on staff ok have... staff_register.php staff_verify.php staff_login.php staff_home.php so when staff wants sign must register first. have form when submitted writes database perfectly. student_register.php posts student_verify.php, in activation email gets sent user requiring them verify (click on link). 1 time user verifys, become active user. proceed log in page. when user enters details, redirected index.php in code state redirected staff_home.php below going provide code: this staff_login.php: <?php include_once("scripts/global.php"); $message = ''; ` `if(isset($_post...

c# - Using timestamp with time zone with Npgsql -

c# - Using timestamp with time zone with Npgsql - there need save timestamp time zone in database. target field in table declared as "uploadtime" timestamp time zone i'm inserting info using command parameters : var uploadtime = datetimeoffset.now; var insertquery = @"insert ""table"" (""uploadtime"") values :uploadtime"; var uploadtimeparam = new npgsqlparameter("uploadtime", npgsqldbtype.timestamptz); uploadtimeparam.value = uploadtime; var insertcommand = new npgsqlcommand(insertquery, databaseconnection); insertcommand.parameters.add(uploadtimeparam); value stored , returned datetime without time zone. guess that's because "timestamp timezone" database type mapped datetime default. can fixed via checking out sources , making respective changes timestamptz, interfere thought of using nuget manage project dependencies. maybe there less complicated ways accomplish that? storin...

validation - form still submitted after return false javascript -

validation - form still submitted after return false javascript - i'm having little problem validation thing in javascript. <form action="insert.php" id="form" name="form" method="post" onsubmit="return validate()"> <pre> vul hier de/het e-mail adres(sen) in <textarea name="email" rows="5" cols="50"></textarea><br> typ hier de e-mail <textarea name="text" rows="5" cols="50"></textarea><br> <input type="submit" name="submit" value="submit"> </pre> </form> as can see here, i've got 2 textareas. in upper one, you're supposed come in 1 or multiple email addresses underneath eachother, , in bottom textarea you're supposed compose email itself. then, when click on submit, it'll send email specified email a...

string - Python stdin, readlines. change output order -

string - Python stdin, readlines. change output order - i working mac , have question python look. using .txt file called rectangle.txt , within file looks this: abcde fghij klmno i need read these in using stdin. need programme to: afk bgl chm din ejo so far, have programme reads lines , splits them , prints them out. code edited so when changed code this: line in sys.stdin.readline(): ls1 = line print ls1 i received list: a b c d e so need loop through other ones, can't figure out i running function command line: python rectangle.py < rectangle.txt i trying larn of this, instead of giving me answer, help explain me, in way can understand. also, in add-on .txt file input. programme test these inputs: 123 456 789 and a b c all doing same thing above. give thanks 1 time again in advance helping me. have been working on hours , can't seem figure out. i'm assuming input in each line has same length....

java - Repaint() not being called -

java - Repaint() not being called - recently i've been working on programme paints area empty, colored squares. locations on screen based off of values 1 , 2 in text file. 1s supposed create reddish boxes, , 2s supposed create greenish boxes. however, when run program, reddish boxes painted. did testing , found out repaint method beingness called twice(once reason), though there close 300 values in file, , repaint() should called 1 time every value. here code: public class map extends jframe { public static void main(string[] args) throws ioexception { map map = new map(); } shape shape; int x = -32; int y = 0; arraylist<shape> shapes = new arraylist<shape>(); graphics2d g2; color coulor = null; private class paintsurface extends jcomponent { public paintsurface() { } public void paint(graphics g) { g2 = (graphics2d) g; g2.setcolor(coulor); (shap...

Samsung SDK 4 Eclipse Missing Plugins -

Samsung SDK 4 Eclipse Missing Plugins - i installed sdk version 4 , eclipse ide doesn't have of samsung plugins, seems simple basic java edition. ok, must open eclipse using administrator rights, found reply in question "can install sdk samsung smart tv existing eclipse?", question isn't problem. eclipse sdk samsung-smart-tv

update statement using php mysql not working -

update statement using php mysql not working - i have table below values: table ----------------------------------------------------------- column | type | default ----------------------------------------------------------- name varchar(100) none logincount int(11) 0 lastlogindate datetime 0000-00-00 00:00:00 ----------------------------------------------------------- now, want check if user logged in , if yes, update logincount , lastlogindate correspondingly. the php script below: <?php // verification query.. if($row = mysql_fetch_array($result, mysql_assoc)){ $sql = "update table set `logincount` = `logincount` + 1, `lastlogindate` = now() `name` = '".$username"'"; $result = mysql_query($sql); } ?> the issue is, not working! however, if utilize same logging mysql console directly,...

How to get an ipython graphical console on Windows 7? -

How to get an ipython graphical console on Windows 7? - where can find step-by-step instructions install modules required ipython qtconsole in windows 7 (64-bit)? (sorry brevity of question. take literally hours me write downwards things have attempted, , long read it. i'll note have found remotely related pyqt4 seems extremely unix-specific, @ cursory nod @ windows users may try...) i suggest using total bundle distribution epd (http://www.enthought.com/products/epd_free.php), should work out of box. otherwise dependencies are zeromq, pyzmq, pyside or pyqt, , pygments, and unfortunately don't have plenty users using windows improve install docs. ipython

google analytics - Wrong goal completion numbers -

google analytics - Wrong goal completion numbers - i have 10 goals set in google analytics. share same completion url, have different funnels / steps before completion. today know have 1 goal completion, looking @ study there 10 reported. completions counted goals. has experienced same , figured out solution? the funnel steps apply fo funnel report. goal completions based on goal url. hence if have same goal url of them have 10 goal completions no matter steps have setup each 1 of them. google-analytics goal-tracking

java - JPA: PGobject cannot be cast -

java - JPA: PGobject cannot be cast - i'm using jpa first time , i'm getting error when seek query postgres database: exception in thread "main" java.lang.classcastexception: org.postgresql.util.pgobject cannot cast [ljava.lang.object; the code is: list<results> r = em.createnativequery("select r results r\n" + "inner bring together session s on s.session_id = r.session_id s.session_id = '" + sessionid + "'").getresultlist(); i've tried object[], error still same list<object[]> r = em.createnativequery("select r results r\n" + "inner bring together session s on s.session_id = r.session_id s.session_id = '" + sessionid + "'").getresultlist(); someone knows whats wrong? i noticed using jpql syntax nativequery, have tried code createquery method()? list<results> r = em.createquery("select r results r\n" ...

javascript - JQuery .replaceWith() suddenly putting new element in the wrong place? -

javascript - JQuery .replaceWith() suddenly putting new element in the wrong place? - this 1 baffling me. i'm using replacewith() "clear" file input field. however, when replaces it, puts in wrong place, , have no thought why. used term "suddenly" in title because what's more mysterious when stopped working weekend replacement working expected. work , it's not. here's source html before calling replacewith() : <label>audio</label> <i style="color:#888888;">mp3 or ogg format recommended</i> <br> <button id="clear_audio_input" style="display:none;">clear</button> <input type="file" value="" name="source_audio" style="width:300px;"> <br> <div style="margin-top:15px;"> <b>current: </b> <i id="current_audio_source">1360954394_121ruleofrosepianoetudei.mp3</i> ...

c# - How should I organize two objects in order to be able to join them on a key? -

c# - How should I organize two objects in order to be able to join them on a key? - so basically, reading in 2 xml docs. first has 2 values need stored: name , value. sec has 4 values: name, defaultvalue, type, , limit. when reading in docs, want store each object. need able combine 2 objects 1 has 5 values stored in it. xml docs different lengths, sec @ to the lowest degree size of first. example: <xml1> <item1> <name>cust_no</name> <value>10001</value> </item1> <item4> item4 name , value </item4> <item7> item 7 name , value </item7> </xml1> <xml2> <item1> <name>cust_no</name> <defaultvalue></defaultvalue> <type>varchar</type> <limit>15</limit> </item1> 6 more times items 2-7 </xml2> i have code looping through xml. need thoughts on best way store info it. ultimately, want ab...

memory - When should I avoid using `seq` in Clojure? -

memory - When should I avoid using `seq` in Clojure? - in this thread, learned keeping reference seq on big collection prevent entire collection beingness garbage-collected. first, thread 2009. still true in "modern" clojure (v1.4.0 or v1.5.0)? second, issue apply lazy sequences? example, (def s (drop 999 (seq (range 1000)))) allow garbage collector retire first 999 elements of sequence? lastly, there way around issue big collections? in other words, if had vector of, say, 10 1000000 elements, consume vector in such way consumed parts garbage collected? if had hashmap 10 1000000 elements? the reason inquire i'm operating on big info sets, , having more careful not retain references objects, objects don't need can garbage collected. is, i'm encountering java.lang.outofmemoryerror: gc overhead limit exceeded error in cases. it case if "hold onto head" of sequence clojure forced maintain in memory. doesn't have choic...

javascript - Select tag in TD -

javascript - Select tag in TD - i have select tag within cell in table. want add together new row if alternative selected in previous rows. want know how accomplish using dom. this addrow javascript function function addrow() { var newrow = document.all("esttable").insertrow(); var tblobj = document.getelementbyid("esttable"); var noofrow = document.getelementbyid("esttable").rows.length; var ocell = newrow.insertcell(); ocell.innerhtml = tblobj.rows[1].cells[0].innerhtml; ocell.childnodes[0].selectedindex =0; ocell = newrow.insertcell(); ocell.innerhtml = tblobj.rows[1].cells[1].innerhtml; ocell.childnodes[0].selectedindex =0; ocell = newrow.insertcell(); ocell.innerhtml = tblobj.rows[1].cells[2].innerhtml; } your new code use: var objparent = document.getelementbyid("someuniqueid"); where someuniqueid row want parent of. here can access parent anyway want to. java...

python - Pycrypto AES-CTR implementation -

python - Pycrypto AES-CTR implementation - i new python , pycrypto. trying implement aes-ctr. check programme right ciphering tried utilize test sequences nist sp 800-38a standard (section f.5). not right result. doing wrong? from crypto.cipher import aes crypto.utils import counter ctrkey="2b7e151628aed2a6abf7158809cf4f3c" ctr=counter.new(128, initial_value=int("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff",16)) cipherctr=aes.new(ctrkey, aes.mode_ctr, counter=ctr) print(cipherctr.encrypt("f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff".decode("hex")).encode("hex")) result: 0008007df81ad564b9aadd6b883fef16 but expected result (ciphertext) is: 874d6191b620e3261bef6864990db6ce in nist sp 800-38a standard (section f.5.1), input ctr-aes128 encryption operation called plaintext not input block. if utilize plaintext ( 6bc1bee22e409f96e93d7e117393172a ) right result, ciphertext 874d6191b620e3261bef6864990db6ce . python encrypt...

payment - facebook pay dialog not showing local currency dialog -

payment - facebook pay dialog not showing local currency dialog - facebook pay dialog shows credits only, when click on purchase credits rather should goto next dialog should inquire me payment options says purchase successful. not sure i'm doing tried it's not working. here javascript function function buy_tokens(p){ fb.init({appid: "myappid", status: true, cookie: true}); var obj = { method: 'pay', action: 'buy_item', order_info: {'item_id': 'tokens', 'price':p}, dev_purchase_params: {'oscif': true} }; //fb.ui(obj, js_callback); fb.ui(obj, function(paydata) { // response }); } here callback.php <?php $facebook = new facebook(array( 'appid' => app_id, 'secret' => secret, 'cookie' => true, )); $api_key = 'appid'; $secret = 'app secret'; // prepare homecoming info array $data = array('con...

SCRIPT438: Object doesn't support this property or method - error in jQuery -

SCRIPT438: Object doesn't support this property or method - error in jQuery - i have been having issue on live site of mine whereas on first load of page in net explorer jquery not load , error 'script438: object doesn't back upwards property or method' gets thrown. when reload page error disappear. here code: <script type="text/javascript"> jquery(document).ready(function() { jquery(".item-473 a").hover(function() { jquery('.menu_image').removeattr('style').attr('style', 'background-image: url(/images/volunteers_navbar.png);'); }, function() { jquery('.menu_image').removeattr('style').attr('style', 'background-image: url(/images/adults_navbar.png);'); }); and here html: <ul class="nav-child unstyled small"> <div class="menu_image" style="background-image: u...

jquery - how can I call two functions: Java and Javascript with one KeyUp event on InputText -

jquery - how can I call two functions: Java and Javascript with one KeyUp event on InputText - how can phone call 2 functions: java , javascript 1 keyup event on inputtext , i'm using primefaces component. : <p:inputtext id="aa" value="#{bonbonnemanagedbean.sel}"> <p:ajax event="keyup" onstart="fnc(this)" listener="#{bonbonnemanagedbean.ajouterselected(bonbonnemanagedbean.sel)}" /> </p:inputtext> you're close. you've typo in onstart attribute. should written in lowercase. <p:ajax event="keyup" onstart="fnc(this)" listener="#{bonbonnemanagedbean.ajouterselected(bonbonnemanagedbean.sel)}" /> refer vdl documentation right attribute names. javascript jquery jsf primefaces

symfony2 - Symfony - FOSUser Bundle Styling Form Elements -

symfony2 - Symfony - FOSUser Bundle Styling Form Elements - i trying add together classes style of form elements fosuser bundle uses... illustration ; i want style {{ form_widget(form.plainpassword.first) }} in twig use. how add together styling call? first, sure understand how customize form elements next, described in fosuserbundle documentation , need create bundle extends fosuserbundle namespace acme\userbundle; utilize symfony\component\httpkernel\bundle\bundle; class acmeuserbundle extends bundle { public function getparent() { homecoming 'fosuserbundle'; } } fosuserbundle resources edit: to update form element class {{ form_widget(form.plainpassword.first, { 'attr': {'class': 'myformclass'} }) }} hope helped symfony2 fosuserbundle

ios - property scope in TabBarController -

ios - property scope in TabBarController - i having tabbarcontroller tabs , b. have nsmutablearray property defined in tab b below: .h file: @property (nonatomic,strong) nsmutablearray *cart; i updating property in .m file of same tab(tab b). now, question is: when nail button on either of these tabs , move previous view, property go out of scope , values in property reset/the property gets assigned nil? if case there way preserve property , prevent form getting assigned nil when navigated to previous view via button? appreciate inputs , thoughts. thanks, mike ios objective-c properties uitabbarcontroller

wait - How to force driver to refresh (or throw timeoutException) after 5 seconds of upload page attempt? -

wait - How to force driver to refresh (or throw timeoutException) after 5 seconds of upload page attempt? - i writing test cases using selenium web driver. need setup implicit wait chrome driver. don't need explicit-it long! there way forcefulness google chrome driver throw timeoutexception or (refresh page work) after 5 seconds of effort upload page. i tried: driver.manage().timeouts().implicitlywait(5, timeunit.seconds); it not work. here brief source code: ....... driver.manage().timeouts().implicitlywait(5, timeunit.seconds); ....... ....... element.click(); ....... now need driver throw timeoutexception if page not load within 5 seconds. there easier way of doing it... not have on complicate code webdrivertimeouts etc...you can install chrome auto refresh plus on browser , take auto refresh after 5 seconds. every loop or whatever have, browser going provide 5 seconds finish it, otherwise going refresh page, want it. install auto refresh: https://chr...

antlr3 - ANTLR - StringTemplate - CamelCase -

antlr3 - ANTLR - StringTemplate - CamelCase - what best pattern (language independent, retargetable generation code) translate antlr token camel case stringtemplate attribute in tree conversion? example: dsl has my_field definition , in stringtemplate output need myfield. in parser set text of token, , should flow through stringtemplate. grammar fragment should work: my=my_field { $my.settext("myfield"); } antlr antlr3 stringtemplate antlr4 stringtemplate-4

magento - Add extra item to the cart (observer) -

magento - Add extra item to the cart (observer) - i seek add together product cart. have created observer this. <?php class wp_plugadapter_model_observer { public function hooktocontrolleractionpostdispatch($observer) { if($observer->getevent()->getcontrolleraction()->getfullactionname() == 'checkout_cart_add') { mage::dispatchevent("add_to_cart_after", array('request' => $observer->getcontrolleraction()->getrequest())); } } public function hooktoaddtocartafter($observer) { $request = $observer->getevent()->getrequest()->getparams(); $_product = mage::getmodel('catalog/product')->load($request['product']); $extra_functions = $_product->getextra_functions(); if(!empty($extra_functions)){ $extra_functions = explode(',', $extra_functions); i...

android - ActionBarSherlock - remove the app icon in the Action View (and other styling issues) -

android - ActionBarSherlock - remove the app icon in the Action View (and other styling issues) - i have started using actionbarsherlock , i'm having minor styling issues. don't want app icon displayed on left side, , achieved with getsupportactionbar().setdisplayshowhomeenabled(false); however in 1 of activities want have collapsible action view (a search view). when set searchview action view , drill it, app icon appears again. have thought how rid of it? and issue divider between buttons, how can set drawable? i'll appreciate help! well, found workaround icon issue, don't it. there should away create go away in search mode... for now, set transparent color icon drawable: getsupportactionbar().seticon(android.r.color.transparent); still looking improve ideas though! android android-actionbar actionbarsherlock android-styles

java - Password with at least [1-9] at least [a-z] al least [A-Z] without special character -

java - Password with at least [1-9] at least [a-z] al least [A-Z] without special character - i need help validate password regex java password must contain: - @ to the lowest degree [a-z] - @ to the lowest degree [a-z] - @ to the lowest degree [1-9] without special characters. thanks samuele if characters password can contain a-z , a-z , 1-9 use "^(?=.*[a-z])(?=.*[a-z])(?=.*[1-9])[a-za-z1-9]+$" if password can contain other characters need specify are, or specify cannot be. if want specify minimum length, alter + e.g. {10,} - means 10 or more. java regex passwords special-characters

delphi - How to select item by the "value" attribute in drop-down list? -

delphi - How to select <option> item by the "value" attribute in <select> drop-down list? - in delphi application i'm using twebbrowser control, have loaded html document, containing <select> element (drop downwards list) few <option> items (drop downwards list items). let's say, have next html document loaded in web browser: <html> <body> <select id="combobox"> <option value="firstvalue">first value</option> <option value="secondvalue">second value</option> <option value="thirdvalue">third value</option> </select> </body> </html> how can programatically select e.g. <option> , value attribute thirdvalue ? or in other words, how can programatically select 3rd item in drop downwards list, when know item's value attribute thirdvalue ? you can utilize ihtmlselectelement interface...

symfony2: including inline javascript -

symfony2: including inline javascript - i've added javascript code below show photos using slide show jquery plugin. //parent template {% block javascripts %} <script src="{{ asset('http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js') }}" type="text/javascript"></script> <script src="{{ asset('bundles/canalonesfrontend/js/slides.min.jquery.js') }}" type="text/javascript"></script> {% endblock %} //child template {% block javascripts %} {{ parent() }} $(function(){ $("#slides").slides(); }); {% endblock %} the problem: code shown in web page directly: some content $(function(){ $("#slides").slides(); }); you have wrap <script></script> tag around code //child template {% block javascripts %} {{ parent() }} <script type="text/javascript"> $(function(){ $("#slides...

session variables - php header redirects not working -

session variables - php header redirects not working - so, consolidated various php login files here one file. consolidate 1 file, append url, , different things based off of appended. this works locally not on remote server. anyway... at top of 'consolidated' file have session_start(); this time have session_start(). rest of post.php code looks this: if(isset($_get['app1'])){ ...do stuff header("location:post.php?app2"); exit(); } if(isset($_get['app2'])){ ...do other stuff header("location:post.php?app3"); exit(); } locally, if start @ post.php?app1, go post.php?app2 , work fine, on remote server gets stuck (no redirect). know why? maybe these happen because there code provide output before trying redirect. seek add together buffer function in 'consolidated'file. ob_start(); session_start(); php session-variables isset

objective c - How to Subclass UICollectionViewFlowLayout with Storyboard -

objective c - How to Subclass UICollectionViewFlowLayout with Storyboard - i'm using uicollectionview storyboard , trying subclass uicollectionviewflowlayout doesn't seem work. i've created subclass collectionviewflowlayout : #import "collectionviewflowlayout.h" @implementation collectionviewflowlayout -(id)init { nslog(@"init of collectionviewflowlayout"); if (!(self = [super init])) homecoming nil; self.itemsize = cgsizemake(250, 250); homecoming self; } @end and in storyboard's identity inspector changed class flow layout: but when save/build/run, itemsize not set @ 250 , nslog isn't beingness output. i've seen in examples such this can set layout in collectionview controller, sort of assumed wasn't necessary if set in storyboard. objects loaded storyboard utilize initwithcoder: , not init . move setup code there instead, or have mutual method called each initialiser. objective-...

How can I perform an inspect element in Chrome on my Galaxy S3 Android device? -

How can I perform an inspect element in Chrome on my Galaxy S3 Android device? - how can perform inspect element in chrome on galaxy s3 android device? i've tried couple of guides online, 1 saying utilize android sdk thing run adb forwards tcp:9222 localabstract:chrome_devtools_remote, says "error:device not found". anyone have ideas on how this? for remote debugging on android chrome: seek https://developer.chrome.com/devtools/docs/remote-debugging android google-chrome chrome-for-android

c# - How do I lock and force the user to re-enter one's windows password? -

c# - How do I lock and force the user to re-enter one's windows password? - i want lock accessing of current operating user, if user clicked on start → pointed shutdown → click on lock how in c#? http://jessn.blogspot.com/2009/05/lock-my-computer-programatically-in-c.html article says best: a much improve design isn't hard coded windows scheme paths, etc: using system.runtime.interopservices; [dllimport("user32.dll")] public static extern void lockworkstation(); then phone call lockworkstation(); c# windows windows-shell user-accounts

c# - How to deserialize a nested object? -

c# - How to deserialize a nested object? - i've managed create deserialization creating info contract class (after nagging on client metric ton). problem both fields i've declared, returning empty stuff. so, i've looked @ , realized json object nested , i'm unclear on how access parts inside. the info contract i'm getting bopp null (or empty string, not sure which) , mopp bunch of zeros. [datacontract] public class client { [datamember(name = "beep")] public string bopp; [datamember(name = "meep")] public guid mopp; } i thought info on form. [ {"beep":"beep1", "meep":"meep1"}, {"beep":"beep2", "meep":"meep2"}, {"beep":"beep3", "meep":"meep3"} ] however, apparently, moved object inside other it's more this. [ "root":[ { "a":"some", "b...

Advanced Validation with Lithium PHP Framework -

Advanced Validation with Lithium PHP Framework - i'm building pretty complex , dynamic form via lithium php framework. i've got form working , saving mongodb little problem. having problem validation. simple validations (such checking if field not empty or numeric) working fine. have few complex validations rely on number of fields in form. for example, have form user can come in question , come in unlimited number of possible answers question. field id each reply listed such "answer_1", "answer_2", "answer_3", etc. user can add together unlimited number of answers. happens via fancy javascript inserts elements form on client side. at validation level, want create sure every reply added not null. i using "traditional" validator functionality built within lithium. doing @ model level, not controller level (note - have workaround solve on controller level, rather "right" way @ model) the problem, f...

java - ArrayIndexOutOfBoundException when displaying matched lines -

java - ArrayIndexOutOfBoundException when displaying matched lines - i have issue in android code. objective of code read each lines of text file match static string need display matched questions. static input string "what dob" , having text(fms.txt) file has questions in assets folder. have compiled code. got output errors. my code try { ins = this.getassets().open("fms.txt"); reader = new bufferedreader(new inputstreamreader(ins)); line = reader.readline(); message = "what dob"; messages = message.split(" "); int = 0, j = 0, inc = 1, oldin = 0; while (line != null) { lines = line.split("#"); words = lines[0].split(" "); if (words[0].trim().equals(messages[0].trim())) { for(i = 1; messages[i].trim() != null; i++) { log.e(tag, "----------::::"+messages[i].trim()); oldin = inc; } } lin...

asp.net - $find() returns null in IE 9 -

asp.net - $find() returns null in IE 9 - sometimes $find() method in sys.application.add_load returns null , please help me this. please note that this ie 9 specific issue happens occasionally method $('#id') returns right jquery object element i'm trying find span within raddockzone and same $find() function returns ajax component after page loaded code sys.application.add_load(gridrefresh_ctl00_contentplaceholder_ctl02_2_c_ctl00_gridbooking); function gridrefresh_ctl00_contentplaceholder_ctl02_2_c_ctl00_gridbooking() { var gridctl00_contentplaceholder_ctl02_2_c_ctl00_gridbooking = $find('ctl00_contentplaceholder_ctl02_2_c_ctl00_gridbooking'); sys.application.remove_load(gridrefresh_ctl00_contentplaceholder_ctl02_2_c_ctl00_gridbooking); if(gridctl00_contentplaceholder_ctl02_2_c_ctl00_gridbooking._customdata['refreshonpageload']) gridctl00_contentplaceholder_ctl02_2_c_ctl00_gridbooking.refresh(); } i'm...

php - Htaccess changing URL case if directory exists -

php - Htaccess changing URL case if directory exists - the problem having when url contains directory exists, url getting changed the case of file. more specifically, happening: when go domain.com/cron/xxx in php script, uri be: cron/xxx but if folder cron exists, uri be: cron/xxx does know causes happen? here .htaccess file: rewriteengine on #remove www. rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] rewritecond %{http_host} ^api rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php?uri=api/$1 [l,qsa] rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php?uri=$1 [l,qsa] i'm not super versed in modrewrite, try: rewritemap lc int:tolower and utilize in rule so: rewriterule (.*) ${lc:$1} [r=301,l] php .htaccess

php - Table Row explode with the delimeters comparing it to the other and show it -

php - Table Row explode with the delimeters comparing it to the other and show it - here code <?php $split_getcreatedfield = explode(",", "1,5,3"); $fieldswithvalue = explode("~","1->sample 1~3->sample 2~5->sample 3~"); for($c=0;$c<=count($split_getcreatedfield);$c++){ for($b=0;$b<=count($fieldswithvalue)-2;$b++){ $data = explode("->", $fieldswithvalue[$b]); if($data[0]==$split_getcreatedfield[$c]){ echo "<td>"; echo $data[1]; echo "</td>"; } } } ?> i want output using table header 1 | header 2 | header 3 sample 1 | sample 2 | sample 3 then if $split_getcreatedfield doesnt match $data[0] i want output this header 1 | header 2 | header 3 sample 1 | | sample 3 php html

internationalization - How to display two different translation in one view - Rails ? -

internationalization - How to display two different translation in one view - Rails ? - i have app 2 translation: :pl , :en. want send email in both languages (one view file) something that: =t(".my_translation_key", :en) =t(".my_translation_key", :pl) instead of -i18n.locale = :en =t(".my_translation_key") -i18n.locale = :pl =t(".my_translation_key") is there way ? just send :locale option: = t(".my_translation_key", :locale => :en) = t(".my_translation_key", :locale => :pl) ruby-on-rails-3 internationalization rails-i18n

java - Run functions inside for loop -

java - Run functions inside for loop - i want run function many times , different answers(because deals random numbers), , minimum possible answers. function returns same value. how can right loop different answers each time , find minimum? here code int n = 0; kargerminimumcut karger = new kargerminimumcut(); arraylist<integer> answers = new arraylist<integer>(); for(int = 0; < 10; i++) { n = karger.mincut(vertices); answers.add(n); } int min = minimum(answers); system.out.println("minimum number is: " + min); and minimum function public static int minimum(arraylist<integer> array) { int min = array.get(0); for(int = 1; < array.size(); i++) { if(array.get(i) < min) min = array.get(i); } homecoming min; } edit: okay after seeing algorithm need this. (i have used simple 2d array of integers way). int min = integer.max_value; kargerminimumcut ...

swt - Drag item from treeviewer without the viewer getting focus -

swt - Drag item from treeviewer without the viewer getting focus - question is there way prevent treeviewer gaining focus when starting drag-and-drop operation? or know way prevent changing selection on drag? situation category 1 note 1.1 category 2 note 2.1 i have treeviewer "categories" show categories , 1 tableviewer "notes" shows notes within selected category. "notes" view content provided selection of "categories" view through databinding. problem when have category 1 selected in "categories" view see note 1.1 in "notes" view. problem when want drag category 2 onto note 1.1 "categories" view selects category 2 , cannot drop category on note 1.1 anymore because "notes" view shows note 2.1 i don't think can stop categories view getting focus , firing selection alter when want start drag. natural behavior of controls. there might unconventional ways delay selection firi...

opengl es - Vertex buffers in open gl es 1.X -

opengl es - Vertex buffers in open gl es 1.X - i teaching myself open gl es , vertex buffer (vbo) , have written code , supposed draw 1 reddish triangle instead colours screen black: - (void)drawrect:(cgrect)rect { // draw reddish triangle in middle of screen: glcolor4f(1.0f, 0.0f, 0.0f, 1.0f); // setup vertex data: typedef struct { float x; float y; } vertex; const vertex vertices[] = {{50,50}, {50,150}, {150,50}}; const short indices[3] = {0,1,2}; glgenbuffers(1, &vertexbuffer); glbindbuffer(gl_array_buffer, vertexbuffer); glbufferdata(gl_array_buffer, sizeof(vertices), vertices, gl_static_draw); nslog(@"drawrect"); glenableclientstate(gl_vertex_array); glvertexpointer(3, gl_float, 0, 0); // next line actual drawing render buffer: gldrawelements(gl_triangle_strip, 3, gl_unsigned_short, indices); glbindrenderbufferoes(gl_renderbuffer_oes, framebuffer); [eaglcontext presentrenderbuffer:gl_renderbuffer_oes]; } here vertexbuffer of type gluint. going...