Posts

Showing posts from July, 2011

javascript - Little box where I could write in -

i need use little textbox in order write in , value without creating window. (in have created textbox element) need alert box write in. know use ? to dialog box input using javascript can use window.prompt , more info here . if want prettier go modal window. there plenty plugins jquery (and there should enough scripts available in vanilla js well) achieve this.

uisearchbar - bar button created from childViewController don't work -

i have parentviewcontoller(with uinavigationitem), , childviewcontoller(with uitableviewcontoller, uisearchbar). want create uibarbuttonitem on click searchbar hiding. tableviewcontoller.h(childviewcontoller) @interface tableviewcontroller : uitableviewcontroller<uisearchbardelegate, uisearchdisplaydelegate, uinavigationcontrollerdelegate> @property (nonatomic, strong) iboutlet uisearchbar *searchbar; @end tableviewcontoller.m(childviewcontoller) @synthesize searchbar; - (void)viewdidload { [super viewdidload]; self.searchbar.hidden = no; [self createsearchbutton]; } - (void) createsearchbutton { uibarbuttonitem *mybutton = [[uibarbuttonitem alloc] initwithtitle:@"mybutton" style:uibarbuttonitemstylebordered target:self action:@selector(ibutton:)]; self.parentviewcontroller.navigationitem.rightbarbuttonitem = mybutton; } -(void) ibutton { self.searchbar.hidden = yes; nslog(@"click on ibutton"); } but, if click on mybut

Updated! Mechanize. Ruby. Can't get drop-down menu with dynamic content of hidden fields -

i'm not experienced in ruby + mechanize, starting, so... pls help. tried fill out form dynamic content. can't how step step. that code: #!/usr/bin/env ruby # encoding: utf-8 require 'rubygems' require 'mechanize' require 'logger' url = "https://visapoint.eu/visapoint2/disclaimer.aspx" agent = mechanize.new agent.user_agent_alias = 'mac safari' agent.log = logger.new(stdout) page = agent.get(url) page.encoding = 'utf-8' # disclamer.aspx object page disclamer_page = agent.page # click accept button on disclamer.aspx accept_button = disclamer_page.form.button_with(:value =>'accept') action_page = disclamer_page.form.click_button( accept_button ) # click new appointment button on action.aspx new_appointment_button = action_page.form.button_with(:name => 'ctl00$cphmain$btnnewappointment_input') form_page = action_page.form.click_button ( new_appointment_button ) # fill form on form.aspx page form_

php - Getting more than 10 results Google Search API -

i trying more 10 results form google using search api. know google search api gives 10 results , have call 10 times hundred can't seem working. tried creating while loop loop seems gives me same results on , over. <?php if(isset($_get['input']) && $_get['input'] != "") { echo "<br />your search results google:<br /><br />"; $i=0; $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0& key=aizasybacvripno7umqhtjxg4zeq1dtsqa_uod4&cx=014517126046550339258:qoem7fagpyk &num=10&start=".$i."&"."q=".str_replace(' ', '%20', $_get['input']) // sendrequest // note how referer set manually $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_referer, 'http://www.google.com'); $body = curl_exec($ch); curl_close($ch); // now, pro

search - MySQL - searching a self join and ranges or data -

i'm tasked local community center build 'newlywed' type game in time valentines day, no rush! so, we've got 50 odd couples know each other quite going asked 100 questions before time. each question has users response , range @ allow margin of error (this range quota limited). , can select think partners answer be, same range margin of error. eg (i'll play round me , gf): question: fruit? quite fussy fruit i'll put low score out of 100.. 20. like, love , think gf might think put higher answer, margin of error i'll allow going 30. think loves fruit , put @ least 90.. enjoys alot of foods may rank lower, i'll give margin of 20. ok, repeat process 100 questions , 50 couples. i'm left table this: u_a = user answer u_l = user margin of error level p_a = partner answer p_l = partner margin of error level create table if not exists `large` ( `id_user` int(11) not null, `id_q` int(11) not null, `u_a` int(11) not null, `u_l` int(11) not

Create Excel files in java(invalid number) -

i have string "2,345".i want put excel cell.i did in excel file got "2,345" string.so please suggest me how can "2,345" number value same format used above(comma seperated). thanks in advance. remove comma before inserting excel, cast number before inserting, format column show comma. string replace in excel code format range commas is: somerange.style = "comma" 'or, recorded version somerange.numberformat = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-" 'a simpler version.. somerange.numberformat = "#,##0"

php - how to make css contents like boxes, text as center? -

Image
i have started css tutorial, don't have idea css. here posting css code. can please tell me how make whole contents center in browser. including screen shot of output...... body { background:#e9e9e9; } #formwrap { width:720px; margin-top:30px; margin-left:30px; margin-right:30px; background:#fff; border:1px solid #f1f1f1; -moz-border-radius:20px; -moz-box-shadow:2px 2px 5px #999; -webkit-border-radius:20px; -webkit-box-shadow:2px 2px 5px #999; padding:16px 10px 40px; } #formwrap #form { border-top: 1px solid #eee; width: auto; } #formwrap #form .row { border-bottom: 1px dotted #eee; display: block; line-height: 38px; overflow: auto; padding: 24px 0px; width: 100%; } #formwrap #form .row .label { font-size: 16px; font-weight: bold; font-family: arial, helvetica, sans-serif; width: 180px; padding-right: 10px; margin-right: 10px; } #formwrap #form .row .input { float: left; margin-right: 10px; font-style: italic; width: auto; } .detail{ width: 260px; font-family: arial,

Google currency converter API - will it shut down with iGoogle? -

igoogle shutting down . there (undocumented?) currency conversion api available urls like: http://www.google.com/ig/calculator?hl=en&q=1gbp=?usd the base of url - google.com/ig - takes igoogle. api available after igoogle shuts down? i having same issue described here: https://stackoverflow.com/a/19786423/2819754 i used @hobailey answer temporary fix until can update version or google decide proper api. as google changed url https://www.google.com/finance/converter?a so fix found below. $amount = urlencode($amount); $from_currency = urlencode($from_currency); $to_currency = urlencode($to_currency); $get = file_get_contents("https://www.google.com/finance/converter?a=$amount&from=$from_currency&to=$to_currency"); $get = explode("<span class=bld>",$get); $get = explode("</span>",$get[1]); $converted_amount = preg_replace("/[^0-9\.]/", null, $get[0]); thanks @hobailey little fix.

dom - Add a list item through javascript -

so, trying print out array gets user input text added it, want print out ordered list of array. can see, (if run code) list item keeps getting user input added it, , no new list items added people's names. please help! here code below: <!doctype html> <html> <head> first name: <input type="text" id="firstname"><br> <script type="text/javascript"> var x= []; function changetext2(){ var firstname = document.getelementbyid('firstname').value; document.getelementbyid('boldstuff2').innerhtml = firstname; x.push(firstname); document.getelementbyid('demo').innerhtml = x; } </script> <p>your first name is: <b id='boldstuff2'></b> </p> <p> other people's names: </p> <ol> <li id = "demo"> </li> </ol> <input type='button' onclick='changetext2()' value='submit&#

kmlLayer not displaying google maps api -

first time ever posting on stackoverflow tell me , crude if doing terribly wrong anyway. created kml file maps.google.com , uploaded kml site, , trying implement google maps created, stumped have no errors not show @ all. // north campus shuttle kml implementation var redshuttle = new google.maps.kmllayer ( 'http://blazelist.org/maps/test/redshuttle.kml' ); redshuttle.setmap(map); can share more code? in example code working: function initialize() { var map = new google.maps.map(document.getelementbyid("map"), { center: new google.maps.latlng(22.7964,73.8456), maptypeid: google.maps.maptypeid.terrain }); /* var kmllayer = new google.maps.kmllayer('http://blazelist.org/maps/test/redshuttle.kml', { suppressinfowindows: true, map: map }); */ var redshuttle = new google.maps.kmllayer ( 'http://blazelist.org/maps/test/redshuttle.kml' ); redshuttle.setmap(map); } ht

javascript - Detecting pinch-zoom in firefox on android -

in other android browsers (chrome , default-one) pinch-zoom fires window.resize - not in firefox : ( how detect (surely can't impossible) ? solution: inserted (hidden) div width:100%. , function regularly monitors div's width. - when width in pixels changes, zoom has changed (or orientation or screen size.. whatever): call myresize(). demo: http://krydster.dk - crossword puzzle game (danish).

javascript - I can't make a wireframe box -

i make rotating box, , it's working properly. change material code wireframe material linebasicmaterial. read three.js documentation , follow examples. doesn't show anything. plain white. change color hex, since default white. this js fiddle example http://jsfiddle.net/wick3dsono/txgcd/ // revolutions per second var angularspeed = 0.2; var lasttime = 0; // function executed on each animation frame function animate(){ // update var time = (new date()).gettime(); var timediff = time - lasttime; var anglechange = angularspeed * timediff * 2 * math.pi / 1000; cube.rotation.y += anglechange; lasttime = time; // render renderer.render(scene, camera); // request new frame requestanimationframe(function(){ animate(); }); } // renderer var renderer = new three.webglrenderer(); renderer.setsize(window.innerwidth, window.innerheight); document.body.appendchild(renderer.domelement); // camera var came

networking - Do private domains names really hide owner information? -

i want register domain name in order political activism. want hide personal information being displayed. i'm considering registering provide domain website godaddy.com my question: how safe that? can access private personal information of owner of domain? according arin contact information availble in customer records not whois users. if gets access customer records can access contact information. whether can happen depends on service provider policies , dpends on laws of country service provider situated.

can %s be an integer? *Python code* -

looking @ django code djangobook: from django.http import http404, httpresponse import datetime def hours_ahead(request, offset): try: offset = int(offset) except valueerror: raise http404() dt = datetime.datetime.now() + datetime.timedelta(hours=offset) html = "<html><body>in %s hour(s), %s.</body></html>" % (offset, dt) return httpresponse(html) after try, converts offset integer, right? , in line 'datetime.timedelta(hours=offset)', offset used integer, in line 'html = "in %s hour(s), %s." % (offset, dt)' offset %s string, right? or miss understanding? thought %s can string, not integer? %s calls str() method on corresponding argument... (similar %r calls repr() ) - either of can used any object... unlike %d ( %i same) , %f instance require appropriate types.

javascript - Get html source of dynamic content generated through Java functions -

in site working on there many java functions dynamically generate content when executed, problem content not visible in source when viewing source show java function content not visible search engines. is there way make content visible in source visible search engines? the answer question 'no'. search engines not attempt parse , run js (which necessary recreate output user sees).

android - Screenshot to any screen with button on top -

i have button on top, allows me explore android ui, , i'm trying add screenshot action , , part of adding action button works fine, doesn't work screenshot code, code works when add code "myactivity" button, when i'm exploring android ui, , when action on allways on top button, gives me black image no data (0 kb). screenshot code: view content = findviewbyid(android.r.id.content).getrootview(); content.setdrawingcacheenabled(true); bitmap bitmap = content.getdrawingcache(); file file = new file( environment.getexternalstoragedirectory() + "/test.png"); try { file.createnewfile(); fileoutputstream ostream = new fileoutputstream(file); bitmap.compress(compressformat.png, 100, ostream); ostream.close(); } catch (exception e) { e.printstacktrace(); } maybe problem content or maybe can't done without root access, if root access needed, can give me sample code? here code taki

c# - Newtonsoft.Json Assembly Conflict -

i use netonsoft.json in project. works fine until start integrating paypal sdk in project. code below. string accesstoken = new paypal.oauthtokencredential("", "").getaccesstoken(); ---->>>> line throwing error paypal.api.payments.address add = new paypal.api.payments.address(); add.city = textboxcity.text; add.line1 = textboxaddress.text; add.phone = textboxphonenumber.text; add.postal_code = textboxzipcode.text; add.state = textboxstate.text; paypal.api.payments.creditcard cc = new paypal.api.payments.creditcard(); cc.number = textboxcreditcardnumber.text; cc.first_name = textboxfirstname.text; cc.last_name = textboxlastname.text; cc.expire_month = convert.toint16(textboxexpirymonth.text); cc.expire_year = convert.toint16(textboxexpiryyear.text); cc.cvv2 = textboxcvvnumber.text;

javascript - Different behavior of the onclick attribute during form submission -

hello came across weird behavior onclick attribute regarding form submission. page on server: <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head lang="en-us" > <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>return form example</title> <script type="text/javascript"> function dosomething(){ alert("hey"); return false; } </script> </head> <body> <form action="submit.php" method="post"> <input type="submit" onclick="return dosomething()" value="click me!"> </form> </body> </html> in example, running on server, when click submit button alert saying

text editor - How do you change the color of a cursor so you can see it on a black background? -

i'm using textedit transcribe sections of 26 moleskine notebooks i've filled on past 7 years. changed background black , text color gray, great eyes except cannot see cursor. makes hard edit, can imagine. when use textwrangler or sublime cursor blinks white..how extend these settings textedit? thank - first ever stackoverflow question :) unfortunately looks textedit not allow configuring color of cursor. is there way change cursor color in textedit?

join - Copying data from one table in SQL -

i need update attribute copying info table. problem identify information needed have follow format. update charter table setting char_wait_chg equal results of selecting mod_wait_chg model , aircraft matching mod_code between model , aircraft tables , ac_number between aircraft , charter tables. have charter table contains ac_number , char_wait_chg, aircraft table contains ac_number , mod_code, model table contains mod_code , mod_wait_chg. need make char_wait_chg equal mod_wait_chg, thought use subquery, error ora-01427: single-row subquery returns more 1 row. here have tried: update charter set char_tot_chg=(select mod_wait_chg model join aircraft using(mod_code) join charter using(ac_number)); i hope explained enough, appreciated. this query. subquery returning more 1 row: update charter set char_tot_chg = (select mod_wait_chg model join aircraft using(mod_c

node.js - REST API: CRUD operations in model or controller -

i'm building app using express , mongoose. backend api (since frontend native ios). in mvc framework, controller acts interface between model , view. since don't have views, should away controllers , keep crud operations in models, or should keep them in controllers? pros , cons of each approach? view you still have view since you'll need display whatever response is. crud operations these operations delegated service layer controllers. service layer alters state of model layer.

jquery - Fixing a JavaScript conflict in Wordpress, help using wp_enqueue_script -

i think (not 100% sure) suffering javascript conflict. using pluggin generate countdown clock on wordpress page, , using simple custom made javascript jquery make div appear , dissapear on page @ points of scrolling. to make appearing / dissapearing div work correctly added 2 javascript calls header: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/test1.js"></script> the first being jquery library , second being custom script. after adding these lines of code header, countdown clock stopped working on website. through little debugging have realized google hosted script causing clock not work. when have code google hosted jquery library in header receive following error: error = object [object object] has no method 'jcountdown' i believe solution using wp_enqueue_script , wp_register_sc

multithreading - priority inversion in mutex vs semaphore -

why (and how) mutex can deal priority inversion , semaphores not? i read in lots of places difference (one of them) between mutex , semaphore priority inversion, can explain please? from wikipedia : since mutex knows current owner, possible promote priority of owner whenever higher-priority task starts waiting on mutex.

java - How to send parallel GET requests and wait for result responses? -

i'm using apache http client within spring mvc 3.2.2 send 5 requests synchronously illustrated. how can send of these asynchronously (in parallel) , wait requests return in order return parsed payload string requests? public string mymvccontrollergetdatamethod() { // send 1st request httpclient httpclient = new defaulthttpclient(); httpget httpget = new httpget("http://api/data?type=1"); responsehandler<string> responsehandler = new basicresponsehandler(); string responsebody = httpclient.execute(httpget, responsehandler); // send 2st request httpclient httpclient2 = new defaulthttpclient(); httpget httpget2 = new httpget("http://api/data?type=2"); responsehandler2<string> responsehandler2 = new basicresponsehandler(); string responsebody2 = httpclient.execute(httpget, responsehandler2); // o o o more gets here // perform work here...and wait requests return // parse info out of multiple requ

android - Manually install Device plugin (and others) into cordova 3.0 -

phonegap/cordova 3.0 has moved modular design starting version 3.0. example, call device.version api, need include device plugin project. anyone can provide me clear instructions on how install device (or other) cordova api plugin new ios project (using xcode) , android (using eclipse)? all find details using node.js and/or plugman. needing automated script basic job of adding plugin undesirable me, not processes doing things don't understand (behind scene). in past (cordova 2.9), did following add third-party plugin in (say android) worked perfectly: put plugin .java code /src folder put plugin .js code in www folder import .js file index.html add feature tag in config.xml call plugin in javascript i never added plugins in ios before. however, assumed above process should work fine cordova-based plugins, did not. point, did not try android, tried ios no luck. i included cdvdevice.h , cdvdevice.m in /plugins folder. imported device.js index.html, , modif

portal - how to create a navigation in GateIn programatically -

i created gatein portal application using gatein 3.2. need create navigation link in gatein portal application without changing navigation.xml file. means need create in pragmatically. gatein service class need call?. there sample code available that? afaik version 3.3 gatein introduced navigationservice that's used manipulate navigation. example usage of navigationservice: pomsessionmanager mgr = (pomsessionmanager) container.getcomponentinstanceoftype(pomsessionmanager.class); navigationserviceimpl service = new navigationserviceimpl(mgr); mgr.getpomservice().getmodel().getworkspace().addsite(objecttype.portal_site, "save_navigation"); navigationcontext nav = new navigationcontext(sitekey.portal("save_navigation"), new navigationstate(5)); service.savenavigation(nav); for more details should take @ navigationservice & testcases in version 3.3 (or later). , in component/portal module.

asp.net mvc - Single Page Application versus jQuery -

can tell me difference of using spa , normal jquery reload particular content of page. eg: let's say, have grid. can use ajax/jquery refresh grid every 5sec. how different spa? in single page application, fetch data server in asynchronous manner , update page without reloading entire page . can change content of parts of pag e or can update complete html using data fetched server. important thing not reload page. to that, can use jquery of course not must. have update dom. you can either use dom manipulation frameworks such jquery or new popular javascript mvc frameworks such ember.js , angular.js handles of dom manipulation you. for question updating grid in html page via ajax queries not mean web app spa.

css - Adjust automatically the size of div -

i have code, .text not working expected. auto should fit in width of container, .text div pushed second line. need auto value because width of image can change, , right div should fit in container regardless of image width. <div class="container"> <div class="img"><img src="http://placehold.it/350x150"></div> <div class="text">some text textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome text</div> </div> .img, .text { float:left; } .text{ border: 1px solid red; height:150px; width:auto; //should width:248px in specific case; } .container{ width:600px; border:1px solid green; height:150px } http://jsfiddle.net/lcakw/ just don’t let .text class float well. way block element, taking full width (of parent element) minus floating. might want apply left padding though.

verilog - What is `+:` and `-:`? -

i've saw operator in verilog/systemverilog code. logic [15:0] down_vect; logic [0:15] up_vect; down_vect[lsb_base_expr +: width_expr] up_vect [msb_base_expr +: width_expr] down_vect[msb_base_expr -: width_expr] up_vect [lsb_base_expr -: width_expr] i've seen so, i'd ask this, when , how use it? that particular syntax called indexed part select . it's useful when need select fixed number of bits variable offset within multi-bit register. here's example of syntax: reg [31:0] dword; reg [7:0] byte0; reg [7:0] byte1; reg [7:0] byte2; reg [7:0] byte3; assign byte0 = dword[0 +: 8]; // same dword[7:0] assign byte1 = dword[8 +: 8]; // same dword[15:8] assign byte2 = dword[16 +: 8]; // same dword[23:16] assign byte3 = dword[24 +: 8]; // same dword[31:24] the biggest advantage syntax can use variable index. normal part selects in verilog require constants. attempting above dword[i+7:i] not allowed. so if want select particular byte u

jquery - How to keep dynamic item behavior after clicking any item in the list? -

i have menu this. can view on website under products tab firstly, please hover on products . if hover on items in list, content in right pane changed dynamically. however, if click 1 of them , try hover on other items, content in right pane doesn't change automatically. have click others. basically, loses it's dynamic behavior after clicking items in left item list. i had written jquery code think missing something. $('.urun_tab').hover( function(){ if($(this).hasclass('hoverblock')) return; else $(this).find('a').tab('show'); }); $('.urun_tab').find('a').click( function(){ $(this).parent() .siblings().addclass('hoverblock'); }); this items part on website <ul class="nav nav-tabs span4"> <li class="active urun_tab"><a href="#a" data-toggle="tab">seksiyonel kapılar<i class="icon-circle-arrow-r

Quick Websocket communication in Android -

i'm trying make application android such can control computer mouse moving on phone screen. means needs quick , responsive. so far have websocket server written listens movement, works great when using laptop's browser websocket client. however, i've tried several websocket clients android, they're slow , unresponsive. is possible create websocket connection android can deliver real time communication? how? if not, alternative solutions? thanks! what looking fastest streamed data, chance of missing packets - not mandatory have persistent state. so in case udp transport protocol best choice. offers speed in price of reliability on data delivery. might have messages dropped, ones delivered there relatively fast (most delivered). as need implement extrapolation, in order predict mouse movements if want have feeling of being "in same time" on both sides. although, clicking - should delivered reliably, specific location of click. way clicks

java - Can I get a 'better' verbose output in Netbeans 7.3? -

i'm trying find output mode show me execution , order of every method called in running program. verbose , debugger output detail don't seem give me that. there way detailed output 1 i've described here? thanks! you can using following ways: one : put either of these codes in every method in program: system.out.println(thread.currentthread().getstacktrace()[1].getmethodname()); system.out.println(new object(){}.getclass().getenclosingmethod().getname()); two : use dumpstack() method: thread.currentthread().dumpstack(); three : use printstacktrace of throwable new throwable().printstacktrace(); four : variation of first solution stacktraceelement[] stacktrace = thread.currentthread().getstacktrace(); for(stacktraceelement st : stacktrace){ system.err.println(st); }

android - Start an app from a running background service -

just wondering if possible launch install application background service. have packagename well. an installed application can invoked using packagemanager class startactivity(backgroundservice.this.getpackagemanager() .getlaunchintentforpackage(packagename) .setflags(intent.flag_activity_new_task));

maven - Staging repos and dependent artifacts -

i'm using sonatype nexus repo hosting , have 2 artifacts depends on b separate projects (not multimodule). staged b 1.0.0 want stage dependency on b-1.0.0 , not on snapshot; however, because b still staged , not released, maven complains can't find b-1.0.0. correct way this? doesn't make sense me have release dependency (b) without being tested part of project (a) what doing wrong? iiuc, staging repos dynamically created, adding (temporary) staging repo <repository> in project doesn't sound either as secondary question, know if supposed stage main artifact (a) in same staging repo b or if should close b , stage in new staging repo you should have separate repository group public , have configured target group staging profile project a. then when build project b use group , available building project.

select - Selecting users in a SQL Server database which have only default children -

i'm trying figure out how many users in database have default parameters. i've got following query: select top 4000 users.id users join streams on users.id = streams.userid join playlists on streams.id = playlists.streamid playlists.firstitemid = '00000000-0000-0000-0000-000000000000' i thought fine, realized not specific enough. currently, stream 2 playlists, 1 populated , 1 not, still selected. not select stream if of child playlists have firstitemid set value other '00000000-0000-0000-0000-000000000000'. this additional select bit beyond me.. i've tried time, can't syntax. point me in right direction? try like: select top 4000 users.id users join (select playlists.streamid streams join playlists on streams.id = playlists.streamid group playlists.streamid having max(cast(playlists.firstitemid varchar(36)) = '00000000-0000-0000-0000-000000000000') streamplaylists on users.id = streamplaylists.userid you

NULL Conditons in SQL Server -

this question has answer here: conditional conditons in sql server 2 answers i have table this: id | code | year --------+---------+---------- 0 | 1 | '1998' 1 | 5 | null 2 | 7 | '2013' 3 | 1 | '1892' 4 | 5 | null 5 | 7 | '1900' i have combobox 3 values: all , nulls , not nulls . all : load rows , no condition. select * tbl_location nulls : select * tbl_location year null 'not nulls' select * tbl_location year not null 'all' combo-box value load rows without condition i want in 1 query. can do? you need pass value of combobox in @status : here need set conditions this: declare @status varchar(15) --set status select * tbl_location (@status = 'all' or (@status = 'nulls' , year null)

performance - Eclipse Plugin Development---PopupMenuCreation -

i developing wizard using eclipse plugin development. requirement: i have create context menu needs populated user right clicks on source folder in java project. once user performs first step handler needs selected src folder in wizard. wizard contains treeviewer need selected src folder packaged. my analysis: i have handler class gets selected packages samplehandler.java public object execute(executionevent event) throws executionexception { shell = handlerutil.getactiveshell(event); // initializing workbench window object iworkbenchwindow window = (iworkbenchwindow) handlerutil.getactiveworkbenchwindow(event); iselection sel = handlerutil.getactivemenuselection(event); final istructuredselection selection = (istructuredselection) sel; object firstelement = selection.getfirstelement(); if (firstelement instanceof ipackagefragment) { // selected fragment ipackagefragment packagefragment = (ipackagefragment) firstelement;

Context menu right click -- Jquery -

iam using jquery context menu in these way.., function applycontextmenu() { $.contextmenu({ selector: '.pnlaccordion h3', callback: function (key, options) { contextmenuaction(key, options, $(this)); }, items: { "add": { name: "add port", icon: "add" }, "edit": { name: "edit port", icon: "edit" }, } }); } function contextmenuaction(key, options, $port) { $(".dialogadd").dialog('open'); if (key == "add") { $(".dialogadd").dialog({ height: 238, width: 465, resizable: false, title: "add ports" }); $(".imgbtnupdatecontext").click(function () { //ajax call action success: function (jsondata) { try { $(".dialogadd").dialog('close'); }

javascript - HTML Span text toggle -

i have span <span id="spanactive">show inactive</span> trying change text using jquery below: $('#spanactive').text(($(this).text()=='show inactive') ? 'hide inactive' : 'show inactive'); but not working. use below code $('#spanactive').text(($('#spanactive').text()=='show inactive') ? 'hide inactive' : 'show inactive'); you need use this in event handler having current object in " this ". check working demo @ link if using this in click event handler span, try below code $('#spanactive').click(function () { if($(this).text() == 'show inactive') $(this).text('hide inactive'); else $(this).text( 'show inactive'); }); check demo @ link enter link description here

javascript - what causes " inline method not to work for chrome browser"? -

i have uploaded 3d object in .x3d format using inline method in x3dom frame work. loading in mozilla firefox browser, not in google chrome . can please let me know why doesn't work , things have done make work on google chrome? thanks. you said "upload", had problem debugging html in local chrome beacuse chrome doesnt local files without "--allow-file-access-from-files" flag execution.

c# - Access master page control not work -

i work master page in there 1 hyperlink . set hyperlink navigateurl form (master page's) child page. for use code in child page. hyperlink hl = (hyperlink)this.master.findcontrol("linkviewmysite"); hl.navigateurl = "../" + ds.tables[0].rows[0]["username"].tostring(); response.redirect("siteadmindata.aspx", false); here linkviewmysite id of master page's hyperlink . now problem when set navigateurl it's not work. but when remove line ( response.redirect("siteadmindata.aspx", false); ) code navigateurl set , hyperlink work fine me. so should with response.redirect . i got answer hyperlink hl = (hyperlink)this.master.findcontrol("linkviewmysite"); session["user_name"] = ds.tables[0].rows[0]["username"].tostring(); response.redirect("siteadmindata.aspx", false); now in master page page load if(!postback) { if(session["user_name"]!=null) { linkvi

Is there official JavaScript and CSS icons? -

Image
i have found html5, php icons use in project (on website). html5 icon on w3c site , php icon on php.net site. how js, css icons? because have found javascript icon: , don't know: can use or not? , 1 more question: there css/js/html5 file icon? have found php file icon. there no "official" icon, because there no body officially "governing" javascript. see this related stack overflow question "official" manual on javascript. instead, javascript derivative of ecmascript. glancing on official ecmascript website don't see official logo's or icons ecmascript either, not in specification documents (for version 3 nor version 5). interestingly, wikipedia article on javascript shows logo, i'd never seen before: this semi official icon said in here . in response second question: guess if must choose go icon in existing house style these 2 features: capitals "js" indication icon's code to add this, see there'

c# 4.0 - Load some data from Sybase query reader using columns names -

i using sybase query reader can't find anyway far load data using column names instead of column number. know how to? here current reader i'd change: var queryreader = thecontext.executestoredprocedure("dbo.sp_getmydata"); try { while (queryreader.read()) { if (queryreader.getvalue(0) == null) { continue; } int numdayspending; int.tryparse(queryreader.getvalue(2).tostring(), out numdayspending); ... thank you! i've found answer, needed generate dictionnary containing columns mappings [columnname;columnid]: public dictionary<string, int> getcolumnsmap(asedatareader reader) { var columncount = reader.fieldcount; dictionary<string, int> columnsmap = new dictionary<string, int>(); (int columnid = 0; columnid < columncount; columnid++) { var columnname = reader.getname(columnid); if (!columnsmap.containskey(columnname)) { columnsmap.add(columnname

javascript - ExpressJS and Angular - 'leaving' the app to do server-side authentication -

my app runs on nodejs, expressjs , angularjs. i'm trying facebook authentication using passportjs. avoid posting bunch of unnecessary code, let's passport code works intended , logs facebook, grabs token , receives response. in expressjs routes set follows: app.get('/', routes.index); app.get('/fbauth', passport.authenticate('facebook', { scope: 'email' })); app.get('/fbauthed', passport.authenticate('facebook',{ failureredirect: '/' }), routes.loggedin); app.get('/logout', function(req, res) { req.logout(); res.redirect('/'); }); my server set @ localhost:3000 . question my issue angular not behaving @ all. when put link on page goes href="/fbauth" (this goes localhost:3000/fbauth ) see address bar change localhost:3000/fbauth split second, main localhost:3000 page reloads. however, if type localhost:3000/fbauth address bar, authentication happens , i'm passed along fa

c - Expected signature of external symbol in static lib -

i have static lib libthelib.a (compiled else). trying link program. 1 of functions lib requires linking getname . have function void getname(char*, int) in project, linker still complaining the symbol not found. guessing maybe lib looking function different signature. tried using nm hoping reveal being looked for, says is u _getname which not helpful. there way find signature of symbol looking for? or signature not part of symbol, , can link symbol of name? the lib written in c , program in c++ , function declared extern "c" getname(char* c, int i) {...} also, using clang , not gcc , if makes difference (using xcode) 1) sure function name , signature correct? 2) why extern "c" getname(char* c, int i) {...} instead of extern "c" getname(char* c, int i); ?

python - IntegrityError - Column 'user_id' cannot be null -

i trying register new user on site, class userinfo(models.model): user = models.foreignkey(user,primary_key=true)#user profile email_id=models.charfield(max_length=32, null=true, blank=true) when registering user, getting stuck integrity error , please me resolve problem. def registration(request): registration_dict = {} if 1==1 : #if request.post: #username=request.post['email'] #password=request.post['password'] username="admin@admin.com" password='123456' #try: userinfo.objects.get_or_create(email_id=username,user__username=username,user__email=username,user__password=password) #except: # registration_dict["status"]="0" # registration_dict["message"]="username present" # return httpresponse(simplejson.dumps(registration_dict),content_type="application/json") registratio

Android Bluetooth MAP -

i have question ever worked bluetooth map on android . can external device (implementing map profile), access emails information on android devices, via bluetooth map ? i searching information create specification, , can't find this. i found there lots of android devices not supporting map @ all. and tricky part found in map specification, should able query email inbox, android not expose related email (via content provider or else). can point me specification or might help? thanks, arkde yes, external devices(often carkits) can access phone email information, in map spec , check sdp record section in spec in need mention message types supported mse(map server), if email bit set , map server needs support email messages well. folder listing/ message listing standard operation in map, map email implementation recommend check in codeaurora site.

php - displaying value of dynamic checkbox in next page . and inserting such value -

i've created dynamic checkbox, failed display value on page. work have done following: index.php <form method="post" action="print.php"> <?php $host="localhost"; $username="root"; $password=""; $database="checkbox"; mysql_connect($host,$username,$password); mysql_select_db("$database"); //create query $sql = "select test, rate lab"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)) { echo <<<eol <input type="checkbox" name="name[]"value="$row['test']}/{$row['rate']}"/> {$row['test']}-{$row['rate']}<br /> eol; } ?> <br> <input type="submit" name="submit" value="add" /> </form> i trying display value on seco

wpf - Binding on a row of a list -

i'm searching way making binding of datagrid colomn on row of list looking in pseudo code: datagridtextcolumn colbuild = new datagridtextcolumn { header = "custom column name", binding = new binding("mylist.elementat(0)") }; i known can looks strange i'm looking adding variable number of custom columns on datagrid in addition fixed ones. , don't know how data filled in columns. can me?

android - Calling OpenCV methods from vuforia -

i trying image processing on images camera frames vuforia qcar. , want use opencv. i want send pixels byte arrays opencv vuforia. dont know how it. know how reach java methods native part or vice versa, couldnt find starting point how call native function library. one more question, can invoke opencv methods in native(c++) part of vuforia? dont have send bytes class? i bit confused thanks yes, can work opencv strictly in native code along vuforia. it's not totally clear if you're trying in real-time or not, however, it'll more efficient if computer vision stuff in c/c++. here's example of how create opencv mat using qcar::image. mat grayimage = mat(qcarimage->getheight(), qcarimage->getwidth(), cv_8uc1, (unsigned char *)qcarimage->getpixels()); once instantiate mat pointer qcar image data, can go doing image processing , computer vision opencv.

wordpress - Pass through '&parameter' in a URL -

i'm working on project passes variable iframe code: jquery(function() { var search = window.location.search; jquery(".iframe-wrapper").attr("src", jquery(".iframe-wrapper").attr("src")+search); }); but, when pass through &section=p1 in url, gives 404. source of iframe: example.com/page?cart=1 after going site.com/&section=p1 iframe should change example.com/page?cart=1&section=p1 anyway pass through &section=p1 through url? please send html mine working fine below: <iframe width="500" height="200" class="iframe-wrapper" src="http://www.google.com?param=1"></iframe> <script type="text/javascript"> $(function() { var search = window.location.search; search = search.replace("?","&"); $(".iframe-wrapper").attr("src", $(".iframe-wrapper").attr("src

ssis - "Flat File Source" (471) failed the pre-execute phase and returned error code 0xC020200E. How do I stop this Happening? -

hi wonder if can help... every single week error. "flat file source" (471) failed pre-execute phase , returned error code 0xc020200e. cannot open datafile "g:\data\to processed\ro_orders.csv". i know if go flat file connection manager editor , browse file @ location "g:\data\to processed\ro_orders.csv" work. if have reset location of file every week yet, file in same location has been. i have not edited file, or moved location. i have lots of other packages load different types of data , fine. also have logging file attached errors. i not believe ownership error can run other packages , owned same person. this reoccuring annoyance cant seem work out why happening...ideas? thanks in advance. try setting connection string in expressions . enter full file path on server of file loading under connectionstring property.

objective c - Checkmark not appearing in UITableView -

i have written program stores set of objects under label , labels can viewed , changed later. have written following code that(just including portions adds check mark): - (uitableviewcell *) tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { cell.selectionstyle = uitableviewcellselectionstylenone; //to avoid blue selection //necessary codes populate table here [tableview cellforrowatindexpath:indexpath].accessorytype = uitableviewcellaccessorycheckmark; return cell; } but table not showing check mark. yes, tried again commenting off cell.selectionstyle = uitableviewcellselectionstylenone; , still no use. haven't written code elsewhere unchecking checkmark made. why setting accessory type [tableview cellforrowatindexpath:indexpath].accessorytype , since getting cell in method - (uitableviewcell *) tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { cell.selectionstyle = uitableviewce

ruby on rails - Error while running jobs:work with RAILS_ENV=production -

i getting following error while running jobs:work rake task rails_env=production option c:\railsproject>rake jobs:work rails_env=production --trace (in c:/railsproject) ** invoke environment (first_time) ** execute environment ** invoke jobs:work (first_time) ** invoke merb_env (first_time) ** execute merb_env ** invoke environment ** execute jobs:work rake aborted! expected c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/delayed_job-2.0.8/lib/delayed/worker.rb define delayed::worker c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:426:in `load_missing_constant' c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies' c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/delayed_job-2.0.8/lib/delayed/tasks.rb:13:in `(root)' org/jruby/rubyproc.java:270:in `call' org/jruby/rubyproc.java:220:in `call' c:/jruby-1.6.8/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:i

javascript - How do I link to Play Store, so users can rate my APP? -

i build app phonegap. have added custom settings menu, ul li tags, 1 of tag needs link, users can click , go play store rate app. not sure how achieve this. <ul> <li><a href="javascript: void(0);" class="rate_app">rate app</a></li> <li><a href="javascript: void(0);" class="exit_app">exit app</a></li> </ul> $("li a.rate_app").on('click', function() { this.href="https://play.google.com/store/apps/details? id=com.project.projectxxx" //i need link? }); any ideas? thanks you should point window.location = " https://play.google.com/store/apps/details ? id=com.project.projectxxx"

php - Propogating checkboxes into grid list view -

ok site has form , within there locations section 3 states, select locations checkbox, county title on select checks towns/cities beneath , towns/cities checkboxes. heres php give better idea: $str = '<input id="chkmaster" onclick="checkallenquirylocation();" type="checkbox" value="ar000" name="location[]" /> <strong>all locations</strong>'."\n"."<br>"; $sql = "select location_area_code, location_area_name emg_location_area"; $rs = $db->query($sql); if ($db->get_num_rows($rs)) { while ($row = $db->fetch_row($rs)) { $str .= '<div id="loco-column">'; $area_code = $row['location_area_code']; $area_name = $row['location_area_name']; $str .= '<input onclick="checkall_'.$area_code.'()'.';" id="'.$area_code

http - How to download git repository without using git -

i learning git following tutorials want git repository practicing same. but due firewall or , command wouldn't work $git clone git://git.kernel.org/pub/scm/git/git.git instead can repo zipped file download or how recursively download url displayed html page directories? you can do wget --no-check-certificate -o kernel.zip https://github.com/repo/repo/archive/branch.zip unzip kernel.zip

testing - How do I test multiple angularjs apps with the rails jasmine gem? -

i have rails 3 app 2 different angular apps (which share code) include in different areas of rails app ie, app1.js //= require vendor/angular.min //= require vendor/angular-resource //= require app/app1 //= require services/someservice //= require controllers/app2specificcontroller app/app1.js (function() { "use strict"; var app = app || {}; app.controllers = angular.module('app.controllers', []); app.services = angular.module('app.services', ["ngresource"]); // make app global window.app = app; angular.module('app', [ "app.controllers", "app.directives", "app.services" ]) .config(['$routeprovider', function($routeprovider) { $routeprovider. // routes }]); })(); app2.js //= require vendor/angular.min //= require vendor/angular-resource //= require app/app2 //= require services/someservice //= require controllers/app2specifi

Opencart 1.5.4: Remove Hidden Products from Featured Module -

i'm using multistore feature when use featured products module, want categories in sub-domain. @ moment, products i'm not displaying in sub showing empty space. how can rid of them , show assigned products? thanks. in file file catalog/controller/module/featured.php pls replace $this->data['products'][] to if(!empty($product_info['status'])) $this->data['products'][]

How to add POI with Wikitude? -

i'm new developer ar poi i'm using wikitude developer ar.i follow here this code in js file: var world = { loaded: false, init: function initfn() { ar.context.onlocationchanged = world.onlocationchanged; }, onlocationchanged: function onlocationchangedfn(latitude, longitude, altitude, accuracy) { ar.context.onlocationchanged = null; world.createmarkeratlocation(latitude + 0.01, longitude - 0.0005, altitude - 0.06); }, createmarkeratlocation: function createmarkeratlocationfn(latitude, longitude, altitude) { var markerlocation = new ar.geolocation(latitude, longitude, altitude); var markerdrawable = new ar.imagedrawable(world.markerdrawable, 3); var markerobject = new ar.geoobject(markerlocation, { drawables: { cam: markerdrawable } }); }, worldloaded: function worldloadedfn() { document.body.removechild(document.getelementbyid(&#

html5 - confusion with php function resulting in error on different server -

i have problem dont know how solved, snapshot of php script. foreach($result $row){ $admin [] = array('id'=>$row['id'],'username' => $row['username'], 'email' => $row['email'], 'password'=>$row['password']); } include 'view_admins.php'; and part of view_admins.php thats relevent question <article id="admins">//html tag <?php foreach($admin $admins)://this line 75 ?> <form action="" method="post" > <div> <p><tr><td><p><?php htmlout($admins['username']); ?></p></td><td> <input type="hidden" align="center" name="id" value="<?php echo $admins['id'];?>"></td><td> <input type="submit" name="act

Yii Front Controller Implementation before Routing -

i want implement language setter controllers , need run method before routing controller -> front controller. if have implemented method in controller class, usages must run earlier before controller initilisation class controller extends ccontroller { public function __construct($id, $module = null) { // set application language if (isset($_get['language'])) { $lang = $_get['language']; you use onbeginrequest event of application. requires add code index.php . here's quick example: $app = yii::createwebapplication($config); $app->onbeginrequest = function($event) { // ... whatever want } $app->run(); of course instead of closure function can attach other valid callback .

c# - how to avoid re initialization of session value after redirecting to same page -

i have intialized session variables in page load method zero. modifying them in button press method. using 1 session variable counter when redirecting page same page, variables intialized again. please me prevent re-initialization. i don't want use static variables . the scenario is- protected void page_load(object sender, eventargs e) { session["counter"] = 0; } protected void button1_click(object sender, eventargs e) { int count = (int)session["counter"]; count++; session["counter"] = count; response.redirect("same page"); } assuming want check non set session variable , if so, set zero, do: protected void page_load(object sender, eventargs e) { if(session["counter"] == null) { session["counter"] = 0; } } there range of client side options use, depending on situation.