Posts

Showing posts from March, 2015

Convert xPath to JSoup query -

Image
does know of xpath jsoup convertor? following xpath chrome: //*[@id="docs"]/div[1]/h4/a and change jsoup query. path contains href i'm trying reference. this easy convert manually. something (not tested) document.select("#docs > div:eq(1) > h4 > a").attr("href"); documentation: http://jsoup.org/cookbook/extracting-data/selector-syntax related question comment trying href first result here: cbssports.com/info/search#q=fantasy%20tom%20brady code elements select = jsoup.connect("http://solr.cbssports.com/solr/select/?q=fantasy%20tom%20brady") .get() .select("response > result > doc > str[name=url]"); (element element : select) { system.out.println(element.html()); } result http://fantasynews.cbssports.com/fantasyfootball/players/playerpage/187741/tom-brady http://www.cbssports.com/nfl/players/playerpage/187741/tom-brady http://fantasynews.cbssports.c

ReSharper color identifiers screw up with Visual Studio 2012 dark theme -

Image
we're experiencing annoying problem issues resharper's color identifiers feature when visual studio 2012 set built-in dark theme. with resharper's color identifiers disabled, code looks fine: then, enable resharper's color identifiers: and code completly unreadable: the curious thing, on colleague's machine, same code, same visual studio , resharper settings... looks right: we tried reinitializing both visual studio , resharper settings, disabling add-ons , extensions , other voodoos no avail. here our setups: my add-ins - his add-ins my extensions - his extensions my system informations - his system informations i had same problem vs2013 , resharper 8. able fix following these steps: close visual studio instances open c:\program files (x86)\microsoft visual studio {vs version}\common7\ide\extensions\extensions.configurationchanged file type there save file open vs , check fonts , colors in tools | option

How to write a program to upgrade USB device firmware in windows -

i have usb device uses inbox class driver. how can write program update fw? can avoid writing driver using winusb library? doesn't make sense me using inbox driver , need write driver common operation of fw upgrade. thanks, shai i have usb device uses inbox class driver. this class uses hid base. use hid update firmnware too, eliminating need provide custom drivers. winusb needs @ least inf file.

javascript - function call with Json-Object, wich contains a function. how to get return variable outside the function? -

i use jfeed plugin read information rss-feed in javascript. can use plugin this: jquery.getfeed({ url: 'rss.xml', success: function(feed) { alert(feed.title); } }); no want make function, returns feed information this: function getfeed(feedurl) { message ="error"; jquery.getfeed({ url: 'http://www.spiegel.de/schlagzeilen/tops/index.rss', success: function(feed) { message = feed; } }); return message; } it not work. how can feed varibale outside scope of jquery.getfeed(...) ? it wont work way, since method jquery.getfeed asynchronous , return called earlier. you need use callback feeds, this: function getfeed(feedurl, callback){ message ="error"; jquery.getfeed({ url: 'http://www.spiegel.de/schlagzeilen/tops/index.rss', success: function(feed) { callback(feed); } }); } getfeed(feedurl, function(feeds_r

java - Intellij IDEA 12. Return to last active tab -

how can configure intelli-j idea show last visited tab after closing current tab (as in eclipse )? example: opened user.java tab, opened tab , closed it. after closing tab ide shows me random tab, want navigate user.java tab. this not yet possible, planned intellij 13: http://youtrack.jetbrains.com/issue/idea-106160 you can vote issue make more "important" in backlog.

javascript - Authorization Token for BOX API V2 obtained using scheduled script from Netsuite -

i using box v1 api in conjunction scheduled scripts (javascript) running in netsuite with new v2 api , authorization procedure, can obtain authorization tokens without user interface being required? does have idiots guide (ie me) steps required obtain valid token. andy, v2 api user must log in box , confirm application can access his/her data. box has put authentication primer walk through process. once authorized, you'll receive access token , refresh token user. scheduled scripts can use refresh token indefinitely update access token.

c# - relationship one to one EntityFramework error -

i create 2 table in sql server 2008 table 1 : user( userid,name, firstname,login, password...) , pk : userid table 2 : sessionuser(userid, date, adress) , pk : userid the relationship between 2 tables set in sql server 2008, 1 1 relationship , foreign key in table sessionuser (fk: userid) there users in user table (full lines) when tried add session in session table shows me error: entities in ' distributionssentities.sessionuser ' participate in ' fk_sessionuser_user ' relationship. 0 related 'user ' found. 1 'user ' expected. code: distributionssentities db = new distributionssentities(); sessionuser sessionuser = new sessionuser(); sessionuser.userid = 12; // id existe in user table sessionuser.date = "12-12-2012"; sessionuser.adressip = "192.168.1.1"; db.addtosessionuser(sessionuser); db.savechanges(); how resolve problem thanx. just setti

css - play form-helper not displaying inline -

i'm new play framework , trying add form top of page simple username , password field , submit button. i'm using play form helper, won't allow me have these fields side side ,instead puts them on top of 1 another. keep trying change css, no luck. here's relevant part of html <header id="top_header" class=rounded> <div id="logo"> <h1>@message</h1> </div> <div id="login_pane"> <div id="login"> @helper.form(action=routes.test.testfunction(), 'id->"login_form"){ @helper.inputtext(loginform("username"), 'id->"username", '_label->"username") @helper.inputpassword(loginform("password"), 'id->"password", '_label->"password") <input type="submit" value = "ent

regex - python - How to know what re used to split a string? -

the code below lets user input 2 names of movies separated either & , | or ^ : query = raw_input("enter query:") movie_f = re.split('&|\^|\|', query)[0].strip() movie_s = re.split('&|\^|\|', query)[1].strip() i want know re has used separate string ( & , | or ^ ). how can that? if group regex return items split every second item. >>> query '&foo^bar' >>> re.split(r'(&|\^|)', query) ['', '&', 'foo', '^', 'bar']

Exclude username or password from UserChangeForm in Django Auth -

i'm trying figure out way on how exclude username and/or password userchangeform . tried both exclude , fields doesn't work these 2 fields. here's code: class artistform(modelform): class meta: model = artist exclude = ('user',) class userform(userchangeform): class meta: model = user fields = ( 'first_name', 'last_name', 'email', ) exclude = ('username','password',) def __init__(self, *args, **kwargs): self.helper = formhelper self.helper.form_tag = false super(userform, self).__init__(*args, **kwargs) artist_kwargs = kwargs.copy() if kwargs.has_key('instance'): self.artist = kwargs['instance'].artist artist_kwargs['instance'] = self.artist self.artist_form = artistform(*args, **artist_kwargs) self.fields.update(s

java - Is there a way to update a record in an Arraylist without deleting the existing record? -

i have arraylist , records stored objects. want know if there way update record in array list without deleting existing record? for example, records have attributes first name, last name, initials, id etc. there way update first name in record, instead of having give other attributes values well? currently have done when user gives id, find whether id matches record in array , if does, delete off array , make user enter details beginning. arraylist stores reference , not copy/create new objects. if change stored object reference, reflected in arraylist well. here sample code demonstrate that: package arraylistexample; import java.util.arraylist; /** * class represeting entity stored in arraylist * */ class person { private string name; private int age; private string address; public person(string name, int age, string address) { super(); this.name = name; this.age = age; this.address = address; } public string getname() { return name; }

c++ - cmake linking error with lapack (undefined symbol: dgeev_) -

i have cmake project linked lti (in .a) linked lapack , try compile it, undefined symobls when running ldd -r on resulting .so: undefined symbol: dgeev_ (/home/sup-ubuntu/.sup_plugins/libsupprocessparametrablef2ftrackingplugin.so) undefined symbol: sgeev_ (/home/sup-ubuntu/.sup_plugins/libsupprocessparametrablef2ftrackingplugin.so) i have checked installed liblapack-dev (my system ubuntu 12.04 64 bits) , libblas-dev. have tried several methods in cmake, none of worked : set(cmake_cxx_flags "${cmake_cxx_flags} -llapack -lblas" ) or find_package( lapack required ) it seems that: sup-ubuntu@sup-ubuntu12:/usr/lib$ nm liblapack.so | grep sgeev_ nm: liblapack.so: no symbols and sup-ubuntu@sup-ubuntu12:/usr/lib$ nm liblapack.a | grep sgeev_ 0000000000000000 t sgeev_ so mean should link statically liblapack.a? how can cmake? i appreciate or ideas, have looked answers nothing find helped... sonia

Getting first line of file as argument of script in Perl -

so, need out first line of file, , use information purpose later. also, need remaining lines same file , use information first line something. tried textbook this: while (defined ($lines = <>)) { #do } how extract first line in perl?.. new in programming, advice help. just read first line before loop starts: my $first_line = <>; while (my $line = <>) { # whatever $first_line , $line } if want remaining lines in array, no loop needed @ all: my ($first_line, @lines) = <>;

c# - Listbox in asp.net not getting selected items -

i have multiple dropdown & listbox in webpage. i trying list of categoryid lstcatid listbox able populate listbox category name. if remember correctly in first attempt code worked fine, after made change stated first item selected x no. of time <asp:listbox id="lstcatid" runat="server" datatextfield="categoryname" datavaluefield="categoryid" selectionmode="multiple" cssclass="lstlistbox"> </asp:listbox> protected void button1_click(object sender, eventargs e) { string catid = string.empty; foreach (listitem li in lstcatid.items) { if (li.selected == true) { // response.write(); catid += lstcatid.selecteditem.value + ","; } } response.write(catid); } i not sure going wrong checkd msdn show same way of doing it. may doing wrong. just add using firefox able see multiple selected value have selected

c# - Extract Url from Javascript in -

i new in regex can please in writing regex in c# extract url text below? example 1 x+=1; top.location.href = "http://www.keenthemes.com/preview/index.php?theme=metronic"; example 2 alert("are sure"); top.location.href = 'http://www.keenthemes.com/preview/index.php?theme=metronic'; if url starts http:// , 1 should it: ["'](http.*)["'] the url stored in second group ( groups[1].value ) of match object

android - Applying color filter in StateListDrawable not working -

Image
i'm writing application in have on-the-fly image-mutations. what have put drawable on screen somewhere, give fancy color can changed on fly , make clickable (with statelistdrawable). for color-change on fly thinking use porterduffcolorfilter apply on drawable. adding drawables statelistdrawable seems bad idea color filters removed. came solution found somewhere on so: bitmapfactory.options options = new bitmapfactory.options(); options.inpreferredconfig = bitmap.config.argb_8888; bitmap 1 = bitmapfactory.decoderesource(context.getresources(), r.drawable.my_drawable, options); bitmap onecopy = bitmap.createbitmap(one.getwidth(), one.getheight(), bitmap.config.argb_8888); canvas c = new canvas(onecopy); paint p = new paint(); p.setcolorfilter(new porterduffcolorfilter(ontheflycolorresid, porterduff.mode.src_atop)); c.drawbitmap(one, 0, 0, p); ... sld.addstate(new int[]{-statefocused}, new bitmapdrawable(context.getresources(), onec

Delay JQuery Ajax (jqXHR) Request with done/fail/complete callbacks -

when use success callback solution works fine, when use .done() fail, how can retry send enqueued ajax request original .done() .fail() , complete() registered callbacks? var requestqueue = []; $.ajaxsetup({ cache: false, beforesend: function (jqxhr, options) { if(true){ //any condition 'true' demonstrate requestqueue.push({request:jqxhr,options:options}); //simulate process queue later resend request window.settimeout(function(){ //this work success callbak option, //but .done() console.log("well done!"); // fail $.ajax($.extend(requestqueue.pop().options, {global:false, beforesend:null})); }, 3000) return false; } }

Facebook fql like table removed? -

anyone knows if facebook removing table fql? i can no longer see table in fql list of tables. page shows not found, can still access table graph explorer demo select user_id object_id = "584042898287637" bug or not!? maybe bug or maybe removing table, trying find out, can save time on development if removing. it's bug. not removed. got answer facebook @ http://developers.facebook.com/bugs/120899048109637

javascript - Show a moving marker on the map -

i trying make marker move( not disappear , appear again ) on map vehicle moves on road. i have 2 values of latlng , want move marker between 2 till next point sent vehicle. , repeat process again. what tried:[this not efficient way, know] my thought implement above using technique in points below: 1) draw line between two. 2) latlng of each point on 1/10th fraction of polyline. 3) mark 10 points on map along polyline. here code: var isopen = false; var deviceid; var accountid; var displaynameofvehicle; var maps = {}; var lt_markers = {}; var lt_polyline = {}; function drawmap(jsondata, mapobj, device, deletemarker) { var oldposition = null; var oldimage = null; var arrayoflatlng = []; var lat = jsondata[0].latitude; var lng = jsondata[0].longitude; //alert(jsondata[0].imagepath); var mylatlng = new google.maps.latlng(lat, lng); if (deletemarker == true) { if (lt_markers["marker" + device] != null) { ol

css - Remove Hover Styling on Kendo Treeview -

i trying remove hover styling on kendoui treeview component when hover on item in treeview not have border / background image etc. have gotten rid of border looks there additional styles @ play cannot seem locate. here css far... (in addition default theme) .k-treeview .k-in.k-state-hover{ background-image:none; background-color:#fff;border:none; } .k-treeview .k-in.k-state-selected{ background-image:none; background-color:#fff;color:#000;border:none;} currently showing border looks black opposed grey 1 there before added styles above... idea can rid of stubborn border? with addition of style embedded on page able wanted. believe partially related how css being loaded (order) in multiple different sharepoint webparts on same page... .k-treeview .k-in.k-state-hover, .k-treeview .k-in.k-state-selected { border-style: none; border-width: 0; padding: 2px 4px 2px 3px; }

Which HTTP methods require a body? -

some http methods, such post , require body sent after headers , double crlf . others, such get , not have body, , them double crlf marks end of request. but others: put , delete , ... how know 1 requires body? how should generic http client react unknown http method? reject it? require body default, or not require body default? a pointer relevant spec appreciated. edit : i'll detail bit more question, asked in comments. i'm designing generic http client programmer can use send arbitrary http requests server. the client used (pseudo-code): httpclient.request(method, url [, data]); the data optional, , can raw data (string), or associative array of key/value pairs. the library url-encode data if it's array, either append data url get request, or send in message body post request. i'm therefore trying determine whether httpclient must/should/must not/should not include message-body in request, given http method chosen developer. e

c# - ASP.NET Web API Not Serializing bool fields -

i have following model class: [datacontract(namespace = "http://api.mycompany.com/v1")] public class job{ [datamember(isrequired = true), required] public long id { get; set; } [datamember(emitdefaultvalue = false)] public datetime? startdate { get; set; } [datamember(emitdefaultvalue = false)] public datetime? enddate { get; set; } [datamember(emitdefaultvalue = false)] public bool iscurrentjob { get; set; } } for reason when http request, boolean iscurrentjob field not included in serialized response client. there reason might happening? value not null, it's set true. if change field string, appears no problem in response. of other fields appear in response. it not desirable use emitdefaultvalue value types (like bool ). default value bool false , that's why gets omitted you. perhaps intending use nullable bool bool? instead? more info here: in .net framework, types have concept of default

ruby on rails - Spree Ecommerce System: Admin Account? -

i've installed , used number of cms systems written in ruby in past, , on start seem follow convention of pointing towards creating admin account. refinery cms this, example. but initial account create when setting spree normal user account. how can access admin account? just add /admin onto end of url! (if you're testing locally using rails server, 0.0.0.0:3000/admin ) log in default credentials set during initial installation of spree in terminal/command line.

bitmap - Android how to draw 400 similar pictures (only different colors) efficiently at runtime -

Image
i know similar questions have been asked couldn't find awnser , android beginner. want able draw houses (screenshot) during runtime. far have bean able create 400 imageviews invisible image in them , @ run-time swap image. feel extremely inefficient , seem have memory problems. images not need clickable. couldn't find way add imageviews during runtime. maybe utilize gridview (seems difficult due structure of board). thank you i prefere use andengine. can fine toturial here ( http://www.matim-dev.com/tutorials.html ) or can create custom view , override ondraw(canvas canvas) method @override protected void ondraw(canvas canvas) { canvas.drawbitmap(bitmap, left, right,paint); super.ondraw(canvas); }

exception - Copying a directory in Java -

basically reading this tutorial, have come across bit in explains how use replace_existing standardcopyoption. replace_existing – performs copy when target file exists. if target symbolic link, link copied (and not target of link). if target non-empty directory, copy fails filealreadyexistsexception exception. at end of bit quoted, says " if target non-empty directory, copy fails filealreadyexistsexception exception. " have tried , not give me exception, tried copy non-empty folder location desktop , succeeded without giving me filealreadyexistsexception in theory should have got. is regular? try one: create: c:\map1\filea.txt c:\map2\fileb.txt move: c:\map1 c:\map2 files.copy( (new file("c:\map1")).topath(), (new file("c:\map2")).topath(), standardcopyoption.replace_existing); this results in: c:\map1\filea.txt c:\map2\fileb.txt why?: "directories can copied. however, files ins

php - AJAX value sending error -

hi have problems script below. problem think lies on data need sent php via ajax. jquery $('.send').live("click", function(){ $.ajax({ url:'foobar.php', type:'post', data: 'id=' + $(this).attr('id'), datatype:'json', contenttype: 'application/json; charset=utf-8', success: function(data) { switch (data.status) { case "a": alert(data.text); break; case "b": alert(data.text); break; } }, error: function(xmlhttprequest, textstatus, errorthrown) { alert ("error: "+textstatus); } }) } and, php $id = $_request['id']; switch ($id) { case "foo": $data["status"] = "a";

mysql - Error Code: 1136. Column count doesn't match value count -

the following query triggers error: error code: 1136. column count doesn't match value count @ row 1. why getting error? set @id_country = (select id_country prestashop147.ps_country iso_code = 'br'); set @id_state = (select id_state ps_state iso_code = 'mg'); insert ps_address(id_address, id_country, id_state, id_customer, id_manufacturer, id_supplier, alias, company, lastname, firstname, address1, address2, postcode, city, other, phone, phone_mobile, vat_number, dni, date_add, date_upd, active, deleted) values (null, @id_country, @id_state, 2, 0, 0, 'endereço', 'sobrenome', 'nome', 'rua canada, 71', 'complemento', 'cep', 'cidade', null, 'telefone', 'celular', null, null, null, null, 1, 0); you have 23 columns in insert, supply 22 values

parsing - The following sets of rules are mutually left-recursive TREE GRAMMAR -

i have complete parser grammer generates ast correct using rewrite rules , tree operators. @ moment stuck @ phase of creating tree grammar.i have error: the following sets of rules mutually left-recursive [direct_declarator, declarator] , [abstract_declarator, direct_abstract_declarator] rewrite syntax or operator no output option; setting output=ast here tree grammar. tree grammar walker; options { language = java; tokenvocab = c2p; astlabeltype = commontree; backtrack = true; } @header { package com.frankdaniel.compiler; } translation_unit : ^(program (^(function external_declaration))+) ; external_declaration options {k=1;} : (declaration_specifiers? declarator declaration*)=> function_definition | declaration ; function_definition : declaration_specifiers? declarator (declaration+ compound_statement|compound_statement) ; declaration : 'typedef' declaration_specifiers? init_declarator_list | dec

asp.net mvc 4 - Radio button not showing as checked -

i'm using knockout mvc 4. cshtml is: ... <span>@html.radiobuttonfor(m => m.isactive, true, new { @class = "statusradiobutton", data_bind = "checked: isactive" })</span> <span>@html.radiobuttonfor(m => m.isactive, false, new { @class = "statusradiobutton", data_bind = "checked: isactive" })</span> ... my ko: ... self.isactive = ko.observable(product.isactive); ... it updates database correctly , doesn't show radio button checked when page loaded . tried using checked = "checked" html attribute , doesn't work either. advice? is product.isactive observable? if need execute observable product.isactive() by initialising self.isactive = ko.observable(product.isactive()); going set once. try turning observable like: self.isactive = ko.computed(function() { return product.isactive(); }); edit: try changing radio

sql - How do I return multiple column values as new rows in Oracle 10g? -

i have table multiple account numbers associated different ids(dr_name). each account have few 0 accounts, , many 16. believe unpivot work, i'm on oracle 10g, not support this. dr_name acct1 acct2 acct3 acc4 ====================================== smith 1234 jones 5678 2541 2547 mark null ward 8754 6547 i want display new line each name 1 account number per line dr_name acct ============== smith 1234 jones 5678 jones 2541 jones 2547 mark null ward 8754 ward 6547 oracle 10g not have unpivot function can use union all query unpivot columns rows: select t1.dr_name, d.acct yourtable t1 left join ( select dr_name, acct1 acct yourtable acct1 not null union select dr_name, acct2 acct yourtable acct2 not null union select dr_name, acct3 acct yourtable acct3 not null union select dr_name, acct4 acct yourtable acct4 not null ) d on t1.dr_name = d.dr_name; see sq

asp.net - AccessDataSource control reports unrecognizable database -

i running visual studio 2012 express web , on page added asp dropdown box. tried load source access 2007 database using asp:accessdatasource object. wizzard completed fine. when ran page in web, got error message telling me database in unrecognisable format. googled problem , found out visual studio not know use provider microsoft.ace.oledb.12.0 , need modify connection string. since i'm not writing code page, , relying on vs's visual interface generate code, how find code modify it? or write own code , not rely on vs me? you can use sample code on page here display connection string accessdatasource using. verify connection string includes provider=microsoft.ace.oledb.12.0; and path data source valid. fwiw, tried recreate issue under visual web developer 2010 express access 2010 database , worked fine me. couldn't find evidence connection string accessdatasource "written down" anywhere, in web.config or elsewhere.

java - Issue Converting Over To GMaps v2 for Android -

i'm trying convert old version of code gmaps v1.1 gmaps v2. having issues converting following mapcontroller code: private mapcontroller mmapcontroller; public void setcontroller(object controller) { /*if( controller instanceof org.osmdroid.views.mapview ) { mopenstreetmapviewcontrollersource = (org.osmdroid.views.mapview) controller; mmapcontroller = null; } else */if( controller instanceof mapcontroller ) { mmapcontroller = (mapcontroller) controller; mopenstreetmapviewcontrollersource = null; } } public void setzoom( int ) { if( mmapcontroller != null ) { mmapcontroller.setzoom( ); } /*else if( mopenstreetmapviewcontrollersource != null ) { mopenstreetmapviewcontrollersource.getcontroller().setzoom( ); mpostponedsetzoom = i; }*/ else { throw new illegalstateexception( "no working controller available" ); } } public void animateto( latlng point ) { if( point.latitude*1000000 != 0 &&

Java regex positive lookahead -

i've been having problems generating regex particular string. my source string set of key-value pairs. desired output here sample string: :27b:hello: world! world: hello :29a:test :30:something isn't right-} desired output: key: 27b value: hello: world! world: hello key: 29a value: test key: 30 value: isn't right and here regex far: (\\d+\\w?):([\\w\\d\\s'/,:\\q.()\\e]+(?=(:\\s*\\d+\\w?:|\\-\\}))) the problem seem capturing entire message. e.g. key: 27b value:hello: world! world: hello :29a:test :30:something isn't right what should regex extract these key/value pairs? + greedy, [\\w\\d\\s'/,:\\q.()\\e]+ capture characters last point in string @ lookahead can match. grab first such point need use "reluctant" version +? instead.

PHP mySQL INSERT syntax error? -

i'm newbie , i've been trying on hour solve simple query: mysql_query("insert `tracks` (artistid, albumid, format, trackid, nicetitle, title, tracknumber, description, pictureurl, playcount) values('$artistid', '$albumid[$i]', 'hq','$id[0]', '$trackname', '$title', '$j', '$description', '$pictureurl', '$playcount'") or die(mysql_error()); i error every time: you have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 1 i've done mysql_escape_string() on variables too. ideas? you missing final closing ) : mysql_query("insert `tracks` (artistid, albumid, format, trackid, nicetitle, title, tracknumber, description, pictureurl, playcount) values('$artistid', '$albumid[$i]', 'hq','$id[0]', '$trackname', '$title', '$j', '$description', '$pict

sql - Querying data from database with vb6 and ms access with adodb -

i want select , view data in database, it’s proving challenge. advice on missing it? if run code when select criteria met, returns search failed. help? if txtsun.text = "sun" set rst = new adodb.recordset dim ssql string ssql = "select * sundryproduct prodcont='" & txt_con_code.text & "'" rst.open ssql, cnn, adopenforwardonly, , adcmdtext 'rst.open "select * sundryproduct prodcont='" & txt_con_code.text & "' ", cnn, adopenforwardonly, , adcmdtext if rst.eof msgbox ("search failed") else msgbox ("quantity ordered " & rst!quantityordered & vbcrlf & " load number " & rst!loadnumber) end if end if i trying find out if there record matching prodcont value in database, since still trying make code work in first place have put messageboxes in code. have tried putting in actual value know exists in database sti

html5 - Selecting multiple id's and hovering using jquery each() and hover() -

please kindly take @ code. i'm selecting element same ids, however, first element changes color, when hover on other elements, color remain same. not sure if i'm doing right way.. please kindly offer suggestions. a life demo here -> http://jsfiddle.net/bwoodlt/2rece/ $(document).ready(function(){ $("#ade").live("hover", function(){ $("#ade").each(function (){ $(this).toggleclass('highlight'); // alert("in here..") }); }); }); update: thanks guys! did use class selector, selects elements on-hover! want select each element on hover, proceed next element, should change color rather selecting element , changing color when 1 item hovered! as stated, ids must unique. also, code doesn't make sense anyway. when hover on div, loop through every other div, , apply highlighted class each div. surely want add highlighted class hovered div? in case,

Edit the previous search string in emacs query-replace? -

when using query-replace (with or without regexp) in emacs, previous query-replace pair remembered , suggested default next time query-replace invoked. able edit default replacement similar without having type entire new variant. like this: in section of long document query-replace m-% antidisestablishmentarianism-a [return] antidisestablismentarianism-b later on in same document want do m-% antidisestablishmentarianism-a [return] antidisestablismentarianism-c the command m-% on own gives query-replace (default antidisestablishmentarianism-a -> antidisestablismentarianism-b): is there magic key combination makes possible change final "b" "c" without retyping? yah, try m-p , sequence m-% m-p [return] m-p [del] c [return]

reporting services - SSRS : Fiscal Grouping -

Image
i need group within ssrs report fiscal week, month , year. i'm having user select date referencing created table houses fiscal week, month year etc. calendar date. how group on within ssrs? fiscal table sample data calendar_date: 04/28/2013 fiscal_week: 13 fiscal_month: 3 fiscal_year: 2013 i want report display like how do grouping can group on week , month of selected date? you can set group grouped on multiple fields, though it's not intuitive. when add group can choose 1 grouping expression: however, when you've created group can add more grouping criteria: add in required fields here , should group correctly various required fields.

How do I change function after clicking buttons in JavaScript? -

if have 3 functions a(),b(),c() <input type="button" value="text" id="button" onclick="a()"></input> what should write in function a() make into <input type="button" value="text" id="button" onclick="b()"></input> after click button. change attribute after click: <input type="button" value="text" id="button" onclick="b();this.setattribute('onclick','a()')"></input> http://jsfiddle.net/ye87k/

javascript - Jquery to expand and collapse div on clicking a image -

my html looks like <h3><a href="#" title="story title">story title</a> <img class="expandstory" src="/images/plus.png" /></h3> <div class="description">short description story</div> <h3><a href="#" title="story title">story title</a> <img class="expandstory" src="/images/plus.png" /></h3> <div class="description">short description story</div> my jquery looks like $('.description').hide(); $('.description:first').show(); $('.expandstory:first').attr('src','/images/minus.png'); $('.expandstory:first').addclass('collapsestory'); $(".expandstory").click(function() { if($(this).attr('class')=='expandstory') { $(".description").slideup(500); $(this).parent().nextall('.description:

php - confusion about basic AJAX code -

<script> try { function xmldo() { var xmlhttp; xmlhttp = new xmlhttprequest(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readystate == 4 && xmlhttp.status == 200) { document.getelementbyid("para").innerhtml = xmlhttp.responsetext; } } var url = "http:\\127.0.0.1\ajax.php"; xmlhttp.open("get", url, true); xmlhttp.send(); } } catch (err) { document.write(err.message); } </script> <p id="para">hey message change</p> <br> <button type="button" onclick="xmldo()">click me</button> this code webpage want change content of #para.innerhtml respnse in php file ajax.php <?php $response="hey text changed"; echo $response; ?> i using wamp placed ajax.php in www folder , set location

python - SQLAlchemy error MySQL server has gone away -

error operationalerror: (operationalerror) (2006, 'mysql server has gone away') i'm received error when coded project on flask, cant understand why error. i have code (yeah, if code small , executing fast, no errors) \ db_engine = create_engine('mysql://root@127.0.0.1/mind?charset=utf8', pool_size=10, pool_recycle=7200) base.metadata.create_all(db_engine) session = sessionmaker(bind=db_engine, autoflush=true) session = scoped_session(session) session = session() # there many classes , functions session.close() and code returns me error 'mysql server has gone away' , return after time, when use pauses in script. mysql use openserver.ru (it's web server such wamp). thanks.. sqlalchemy has great write-up on how can use pinging pessimistic connection's freshness: http://docs.sqlalchemy.org/en/latest/core/pooling.html#disconnect-handling-pessimistic from there, from sqlalchemy import exc sqlalchemy import event sqlalchemy.

android - Hide WebView until JavaScript is done -

i have webview webview wv; wv = (webview)findviewbyid(r.id.webview1); wv.loadurl("http://example.com/"); simply said. at: onpagefinished i have: wv.loadurl("javascript:(function() { " + "document.getelementsbyclassname('centered leaderboard_container')[0].style.display = 'none'; " + "document.getelementsbyclassname('n')[0].style.display = 'none'; " + "document.getelementsbyclassname('paginator')[0].style.display = 'none'; " + "document.getelementsbytagname('ul')[0].style.display = 'none'; " + "document.getelementsbytagname('tr')[0].style.display = 'none'; " + "})()"); i've set webview visibility invisible how can set visibility visible after javascript done? now see whole page second , javascript done.. anyone? ps. website not mine, 3rd party website tested on api 17 emulator , works. you

html - Meta Tags Inside MasterPage Output On One Line -

i clean code , i'm sure developers do. coming across issue meta tags appearing on 1 line , not on separate lines. i have file called "client.master" , here code header: <head runat="server"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="default" /> <meta name="format-detection" content="telephone=no" /> <script src="/scripts/script1.min.js" type="text/javascript"></script> <script src="/scripts/script2.min.js" type="text/javascript"></script> <link rel="apple-touch-icon"

actionscript 3 - Bindings not firing on Interface -

i have interface ibaseinterface , class baseclass . when refer baseclass via ibaseinterface type bindings event names won't fire. normal binding (without event name) fires. if refer baseclass object or baseclass types ok , bindings fire. ibaseinterface: [event(name="proptwochanged", type="flash.events.event")] [event(name="propthreechanged", type="flash.events.event")] [bindable] public interface ibaseinterface extends ieventdispatcher{ function propone() :number; function set propone(value:number) :void; [bindable(event="proptwochanged")] function proptwo() :number; [bindable(event="propthreechanged")] function propthree() :number; } baseclass: [event(name="proptwochanged", type="flash.events.event")] [event(name="propthreechanged", type="flash.events.event")] [bindable] public class baseclass extends eventdispatcher implements

ruby on rails - Get record from url -

i know simple question guess brain , google-fu isn't working today. let's have event, registrants, , can pay event using 1 or more payments. i'm trying create payment linked registrant (who linked event). payment should have both registrant_id , event_id . my url looks this: (nested routes) http://mysite.com/events/1/registrants/1/payments/new my controller looks like: def create @event = event.find(params[:event_id]) @registrant = registrant.find(:first, conditions: {id: params[:registrant_id], event_id: params[:event_id]} ) @payment = payment.new params[:payment] end i know there much better way it, i'm having trouble wording google :) what syntax should using make .new automatically aware of event_id , registrant_id ? based on discussion in comments, there several ways question can addressed: direct way , rails way. the direct approach creating objects related create object using new_object = classname.new suggested in ques

ruby on rails 3 - facebook invited users from app -

i using facebook graph api make users send requests friends on facebook join rails application using these code , working great $("a#invitefriends").click(function(){ fb.init({ appid : 'myappid', cookie :false, status :true }); fb.ui({method :"apprequests",message :'my message '}); }); i wanted data of users user invited them rails app? you can use callback method. can find more information,syntax @ https://developers.facebook.com/docs/tutorials/canvas-games/requests/