Posts

javascript - Check what $(this) is -

i trying alert each 1 checkbox clicked. this js code: $('#acts').find(':checkbox').click(function(){ if($(this) == 'all') { alert('checkbox clicked'); } }); and html: <div id="acts"> <input type="checkbox" id="all"> <input type="checkbox" value="brussel" name="locality"> <label>brussel</label> <input type="checkbox" value="anderlecht" name="locality"> <label>anderlecht</label> <input type="checkbox" value="oudergem" name="locality"> <label>oudergem</label> </div> i tried first way, tried adding var thename = $(this); and var thename = string($(this)); and compare in if statement agains 'thename', $(this) or variable assign to, keeps returning me [object][object], against can't compare that. ...

wpf c# update values combobox while typing -

i'm writing wpf-application has combobox. values combobox db (using stored procedure), however, if place them cbo, have 13,000+ values, slow down application. what cbo (user editable) shows 10 values and, while user types, list gets updated. i new wpf (as in couple of days, maybe week), please clear it. thx!!! jan please take @ these posts describes virtualisation combobox es: wpf combobox performance problems binding large collections faster controls ui virtualization hot tip! improving performance of combobox try searching in google many more examples.

css - Use viewport for iPhone only, not iPad -

i'm using following meta tag display site correctly in iphone: <meta name="viewport" content ="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width"> on ipad however, when using meta viewport, site not correctly zoomed once loaded. instead of showing entire page, have scroll right see hidden part of it. looks perfect though if not meta viewport not used. is there way use viewport devices width under 481px? or possible use css archive meta viewport does? for iphone: <meta name="viewport" content="width=device-width; initial-scale=0.65; maximum-scale=1.0;"> for ipad: <meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1.0;">

excel - Redesigned website: New URL structure: 301 Redirecting all old URLs -

i have 5500 indexed urls in google on website , launch redesigned version of brand new url structure. because of thousands of backlinks want redirect old urls new ones using htaccess 301 redirect. the problem is, takes forever manually write htaccess-rules in excel because have match new urls old ones. i.e. how excel document set up: | old url | new url | htaccess rule | /default/category/product-id/my-product | /category/my-product/ | 301 redirect /default/category/product-id/my-product http://mydomain.com/category/my-product/ is there way (software/service/tool) match these urls based on product name inside of url don't have manually??? there 2 ways can think of: you can use http module reads excel , loads in key-value pair old , new url , put in cache. in beginrequest, if url (old url) found in key, response.redirect new page. can add 301 header here make sure browser gets message permanently redirected. check codeproject article if old , new url h...

java - Android TextView does not work properly in HTC NEW ONE -

Image
android textview not show correctly in htc new 1 following: right word truncated ( in htc new 1 ) my xml code following: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingleft="5dp" android:paddingright="5dp" android:paddingtop="3dp" android:paddingbottom="3dp" android:background="@layout/date_bar"> <relativelayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingleft="5dp" android:paddingright="5dp" android:paddingtop="4dp" android:paddingbottom="5dp" android:background="@layout/round_corner"> <imageview android:id="@+id/left_arrow" android:visibility="gone" ...

sql - A cursor with the name 'cursor_name' does not exist -

i have code uses nested cursors. when parse it, sql studio tells me "command(s) completed successfully," whenever execute, bunch of repeated "a cursor name 'cursor_stats' not exist." error message displays every line cursor_stats mentioned in, repeats many times. idea problem is? declare @dc_grp varchar(50) declare @reqt_id int declare cursor_pairs cursor select distinct dc.dc_grp, dcx.reqt_id dc_grp dc inner join dc_grpx dcx on dc.dc_grp = dcx.dc_grp inner join reqt req on dcx.reqt_id = req.reqt_id dc.calc_stddev = 1 , req.v_a = 'v' , dcx.stddev_last_update != convert(datetime, convert(int, getdate())) order dc.dc_grp, dcx.reqt_id -------------------------------------- declare @vavg float declare @vstddev float declare cursor_stats cursor select avg(r.[var]), stdev(r.[var]) results r inner join instance on r.inst_id = i.inst_id i.dc_grp = @dc_grp , r.reqt_id = @reqt_id , r.[var] != 0 , r.inst_id in ( ...

Print three columns with awk, then sets of three columns -

i want create number of files larger file, dividing columns. example, header of larger file looks this: name chr position snp1a snp1b snp1c snp2a snp2b snp2c snp3a snp3b snp3c and want create these files: name chr position snp1a snp1b snp1c name chr position snp2a snp2b snp2c name chr position snp3a snp3b snp3c i've been trying use awk, i'm bit of novice it, command reads: for ((i=1; i<=440;i++)); awk -f printindivs.awk inputfile done where printindivs.awk is: {print $1 $2 $3 $((3*$i)+1) $((3*$i)+2) $((3*$i)+3))} the output i'm getting suggests way of trying sets of 3 wrong: how can this? thanks you can simple awk script: $ awk '{for(i=4;i<=nf;i+=3)print $1,$2,$3,$i,$(i+1),$(i+2) > ("out"++j)}' file the output files in out[1..n] : $ cat out1 name chr position snp1a snp1b snp1c $ cat out2 name chr position snp2a snp2b snp2c $ cat out3 name chr position snp3a snp3b snp3c