Posts

Showing posts from May, 2013

web applications - Block automated requests without captcha -

i'm building application needs count polling votes. cookies, referrers , ip blocks have big downsides, , don't want use captcha, i'm wondering options (if any) have left block automated votes. i know can't ever block them all, i'm looking ways limit impact, raise barrier abusers.

visual c++ - how can is see the state of the error flag? Can I put error state flag in watch? -

i learning c++, beginner question. the iostream cin has error state error flag goodbit, eofbit, failbit, badbit can see how change putting them in watch? if have write? if not how can see how error state flags change? to display flags of cin in watch window while debugging: enter in watch window: std::cin.flags() or std::cin.good() etc. but: won't work right away. the default project configuration links c(++) runtime library dynamically (i.e. using dll). there seems issue debugger/watch have specify context of function if it's defined in dll, see this question . a quick workaround set project statically link c(++) runtime library; in vs2010 it's under project configuration -> c/c++ -> code generation -> runtime library -> set "multi-threaded debug" (instead of "multi-threaded debug dll").

html - Edit contenteditable text with Ctrl-A (Select All) removing all child elements -

in div contenteditable="true", if select text using ctrl-a , type something, removing child elements within div, not text. for example: <div id="texteditor" contenteditable="true"> ctrl-a , edit me. <div id="topleft-ornament" class="ornament"></div> <div id="topright-ornament" class="ornament"></div> <div id="bottomleft-ornament" class="ornament"></div> <div id="bottomright-ornament" class="ornament"></div> </div> the fiddle: http://jsfiddle.net/7jv4f/1/ the red circles (child elements of contenteditable div) in example above removed if text edited using ctrl-a. any idea how prevent it? thx :d so wrap text inside div , assign contenteditable attribute particular element demo <div contenteditable="true">ctrl-a , edit me.</div> <!-- wrap text, don'

install4j - Change installer intro image -

Image
is there way modify image on left-side of first screen of installer generated install4j? so far branding i've been able modify "header" image displayed in upper right-hand side corner. the image i'm referring following. the welcome screen (and other similar screens) have "image banner" property can specify own image.

php - Page keeps on loading when open a URL -

the page keeps on loading when open link. on pages fixed putting exit(); after header('location:link'); statement. the problem occurs when open 2 or more pages of website together. when occurs request further page on site not opens keeps loading. page opens after 10 20 minutes. when pages keeps loading , open other page of site in new tab, live http headers shows request not sent. any help? a header location should followed exit(); prevent further execution of code below point. you may find closing access session aid further can lock other pages accessing it, until script has finished. session_write_close(); header("location: url"); exit(); see: why have call 'exit' after redirection through header('location..') in php? http://www.php.net/manual/en/function.session-write-close.php

dependency injection - inject beans into an abstract class with spring and java ee 5 -

i injecting spring-managed bean abstract class , seems doesn't work. here explanation of do, if not enough, can edit post , add code: implement java code - 1 abstract class, 2 classes inherit , bean injected , used in abstract class , subclasses. define bean in spring config. define abstract class , 2 subclasses in spring config. define first bean property of abstract class bean. result - it's not working. then tried move injected bean abstract class 2 subclasses. works. so, did wrong, or theoretically impossible inject bean abstract class spring 3 , java ee 5? is theoretically impossible inject bean abstract class spring 3 , java ee 5? dependency injection happens on object not class. spring injects dependencies managed beans objects instantiated spring. since, abstract class cannot instantiated conceptually wrong think di here. on related note, can define non-abstract class abstract spring bean adding attribute abstract=true <bean> ta

html - CSS Drop down menu on Internet Explorer 7 bug -

i have css drop down menu built, working of course in firefox , chrome. on internet explorer 7 , 8, drop down moved right making impossible click links. i made jsfiddle here : http://jsfiddle.net/xmrpe/ and screenshot of under ie7 here : http://s16.postimg.org/g90wthb2t/image.png here html : <div class="menu"> <ul> <li> <a href="#">la meunerie française</a> <ul> <li style="margin-left:0;"><a href="conseil.php">conseil d'administration</a></li> <li style="margin-left:0;"><a href="syndicats.php">syndicats régionaux</a></li> <li style="margin-left:0;"><a href="equipe.php">l'équipe</a></li> </ul> </li> <li> <a href="#">la filière</a> <ul> <

java - How to convert a custom object into String in Android? -

i have object of custom class. need convert string can write file. there way out ? thanks help. you can't convert custom class string automatically. system has no way of knowing how want string formatted, want in , such. you have manually implement method in custom class returns text interpretation of object. override method called tostring() . method gets called automatically if provide instance of class methods. let's if system.out.println(instance) , instance 's tostring() method automatically invoked. i don't know custom class is. let's it's person class member variables string name , int age . tostring() method defined in class this: @override public string tostring() { return "name: " + name + ", age: " + age; } this provide output "name: name, age: 30".

html - Marquee : element vs. javascript -

i wondering advantages , disadvantages use html tag opposed achieving same scrolling text effect using javascript? is use of <marquee> html tag encouraged? you ask is use of <marquee> html tag encouraged? the w3.org answers : no, really. don't use it. you have no guarantee of marquee element support across future browsers , when it's present, of options might absent in today's browsers (for example tested mdn's examples in chrome , got different bouncing effect in firefox). most users prefer not see javascript based solution either, if need (like, boss asks it), search of "javascript marquee" gives many solutions, example very simple, smooth, javascript marquee javascript based solutions have advantages of being configurable , of not being based on non standard element ( "html5 classifies non-conforming feature.") .

php - file_get_contents() 'failed to open stream' error retrieving tweets -

i trying create simple script retrieve last 5 feeds twitter user (in instance bbc) it runs okay locally on development server once upload live site following error: warning: file_get_contents(https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=bbc&count=5): failed open stream: http request failed! http/1.0 400 bad request in .... does know why doesn't work on live server (but fine on dev server?) as mentioned in file_get_contents throws 400 bad request error php , may better using curl instead of file_get_contents due improved error handling - may provide clue.

jquery - triggeredAutocomplete search event -

i've problem triggeredautocomplete script i've found in page: http://www.hawkee.com/snippet/9391/ i've written script: $(function() { $("#ead_post_home").triggeredautocomplete({ source: "add_user.php", search: function(event, ui) {$('#tri_autocomplete_div ul').empty();}, trigger: "@" }) .data("triggeredautocomplete")._renderitem = function(ul, item) { return $("<li class='autocomplete_li'></li>") .data("item.autocomplete", item) .append(item.id) .appendto($('#tri_autocomplete_div ul')); }; $("#ead_post_home").triggeredautocomplete({ close: function(event, ui) {$('#tri_autocomplete_div ul').empty();$("#tri_autocomplete_div").css("display", "none");} }); }); but search event delete suggestion doesn't work. can me? maybe try

java - How to identify and run the JUnit test cases dynamically againest the multipledata sets corresponding to each test -

i have data configured in excel sheet. excel sheet name equal test class name , first sheet contains testmethods , correspoing data sheetnames. have constucted map>> object map>. want execute 1 test case list of map data. assume data ready now. want identify test method in test class , need execute method dynamically junit. iam totally struck on here. please me in this. regards, saran kumar p. your description rather confusing, assume junit's parameterized tests solution: https://github.com/junit-team/junit/wiki/parameterized-tests that mechanism allows have (1) 1 or more test methods accepting test data , (2) 1 method loading or generating collection of such test data. test methods executed each entry in generated dataset.

cgi - Perl create byte array and file stream -

i need able send file stream , byte array response http post testing of product. using cgi perl end, not familiar perl yet, , not developer, linux admin. sending string based on query strings easy, stuck on these 2 requirements. below script return page correct or incorrect depending on query string. how can add logic return filestream , byte array well? #!/usr/bin/perl use cgi ':standard'; print header(); print start_html(); $query = new cgi; $value = $env{'query_string'}; $number = '12345'; if ( $value == $number ) { print "<h1>correct value</h1>\n"; } else { print "<h1>incorrect value, said: $value</h1>\n"; } print end_html(); glad see new people dabbling in perl sysadmin field. precisely how started. first off, if you're going use cgi.pm module suggest use advantage throughout script. you've inputted <h1> can use cgi object you. in end, you'll end cleaner, more manag

java - Can I override toString method of functional interface in JDK8 using lambdas -

can override tostring method of functional interface? or rephrase. there elegant way change anonymous inner class implements functional interface , overrides tostring method lambdas? can override tostring when create lamba expression in jdk8. interface iface { void do(); } main() { iface iface = () -> /*do something*/ system.out.println(iface); // see useful in output } can override tostring iface? no, lambda expressions used express 1 method interfaces if functions. it's element of functional languages implemented in java (an oop language). to override tostring, must implement interface in class.

hashmap - how can i change the hash code of java class? -

my doubt is, have employee class contains 2 variable id , name follows: public class empbean { int id=10;; string name="uday"; } i have added object hashmap follows: hashmap<empbean, empbean> hashmap= new hashmap<empbean, empbean>(); hashmap.put(empbean, empbean); then: system.out.println(hashmap.get(empbean).id); output:10; when call get() method of hashmap ,it calculates hashcode , apply hashing on , finds bucket , returns value. so far fine. if want change hash code of object before calling get() method. how can ? tried empbean.id=2000; there no change in hashcode. if change value in object witch in hashmap must first remove item hashmap edit value , after insert hashmap again.

javascript - Change table cell color by pressing button -

Image
i change color of next cell in table pressing button. for example: if left button pressed color of next cell in left change white red , actual cells color change red white , on. in way have illusion red square moving pressing button. is possible jquery , css? as full example: html: <table> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> </table> <button id="left">left

How to call factory methods from HTML in angularjs? -

in controller have followed methods: var ispaused = false; $scope.switcher = function (booleanexpr, truevalue, falsevalue) { return booleanexpr ? truevalue : falsevalue; }; $scope.ispaused = function () { return ispaused; }; and can call html like: <body ng-controller="cntrl"> ... <h4> {{ switcher( ispaused(), 'search address mode', 'search location mode' )}} </h4> <div class="btn-group"> ... </div> as see if ispaused() returns false <h4>search location mode</h4> this utility therefore want define factory feederlitemodule.factory('switcher', function () { return { sw: function (booleanexpr, truevalue, falsevalue) { return booleanexpr ? truevalue : falsevalue; } }; }); no exceptions when try call like: <h4> {{ switcher.sw( ispaused(), 'search address mode', 'search location mode' )}} </h4> <div cl

asp.net - what does forms authentication protect, as opposed to using session variable -

i'm working on application uses session variable keep track of users, checking on master page it's existence otherwise knocking them out login. wanted change on form authentication read more secure , data encrypted. can tell me data encrypted? tried setting forms authentication on site, works fine, users being tracked , can't access pages without logging in. however, when @ request body, using fiddler, see forms fields , there content. can't hacker use change data , resubmit request, cookie generated session variable? application not using ssl, understand ssl encrypt body, thought that's forms authentication also. otherwise encrypt, session id in cookie? here code using: <authentication mode="forms"> <forms loginurl="default.aspx" name=".aspxformsauth_test" defaulturl="home.aspx" protection="all"/> </authentication> <authorization> <deny users="?"/> <

Java Swing Not Rendering Correctly -

Image
i have been working on project. in 1 part of project needed draw on jpanel. graphics2d object passed model part of framework , model draw whatever needs draw @ instance. problem jframe not rendered correctly. looks half white shaded , not painting correctly. works fine on laptop (sony vaio, windows7) it's not rendering correctly in other systems tested (2 dell laptops,windows8;1 thoshiba,windows7;1 samsung, windows8). it's rendering correctly on few other systems teammate tested. i'm sure there no errors made in model part. problem doesn't seem rendering on jpanel. 1 information can give we're doing our project in netbeans. perhaps code generated netbeans ide causing problem? checked code couldn't identify problem. it's difficult post sscce share screen shots of issue. ok since don't have enough reputation post images see links below.... [displays wrongly][1] [displays wrongly][2] [displays correctly on system][3] [displays correctly

sftp - Configuring timeout on JSch ChannelSftp operations -

i using jsch library list , download files sftp server. channel channel = this.session.openchannel(sftp_channel_name); channel.connect(); sftpchannel = (channelsftp) channel; vector listing = sftpchannel.ls("*"); while calling ls , application thread getting stuck sometimes. thread dump - thread 15108: (state = blocked) java.lang.object.wait(long) @bci=0 (compiled frame; information may imprecise) java.io.pipedinputstream.read() @bci=142, line=310 (compiled frame) java.io.pipedinputstream.read(byte[], int, int) @bci=43, line=361 (compiled frame) com.jcraft.jsch.channelsftp.fill(byte[], int, int) @bci=17, line=2527 (compiled frame) com.jcraft.jsch.channelsftp.header(com.jcraft.jsch.buffer, com.jcraft.jsch.channelsftp$header) @bci=12, line=2553 (interpreted frame) com.jcraft.jsch.channelsftp.ls(java.lang.string) @bci=298, line=1424 (interpreted frame) is there way configure timeout on ls , other methods? saw setting timeout on channel.connect(timeout) se

java - Sandbox/JRE limitations of CloudBees? -

i'm going start developing java web app believe deploying cloudbees, concerned jre/sandbox restrictions may apply. for instance, google app engine, you're not allowed execute methods packaged inside java.io.file or java.net . you're not allowed start threads without using custom threadfactory . you're not allowed use jndi, jmx or make calls remote rdbmses hosted on 3rd party machines. you're not allowed use reflection. gae, there's a lot you're not allowed do. do these same restrictions hold true cloudbees? i'm guessing no , read entire developer docs , didn't run across of sort. however , happens if app tries write local file system when deployed servers? must have certain restrictions can run on machines, if no other reason security! so ask: these restrictions, or can find them listed in docs? in advance! last checked (a) there no sandbox; (b) can write local filesystem, files write there may discarded if application repr

Netbeans Generics Bug using FEST, Java? -

i have following non-generic method getting jlistfixture using fest: public static jlistfixture getjlistfixturenongeneric(final framefixture frame) { return frame.list(new generictypematcher<myclass>(myclass.class) { @override protected boolean ismatching(myclass component) { return true; } }); } i have following generic method getting jlistfixture using fest: public static <t extends component> jlistfixture getjlistfixture(final framefixture frame, final class<t> t) { return frame.list(new generictypematcher<t>(t) { @override protected boolean ismatching(t component) { return true; } }); } in netbeans 7.3, non-generic method compiles without error. generic method not. editor window not show compilation errors (no red lines @ line numbers). however, if try compile right-clicking on project , clicking 'test', following error: an exception has occurre

c# - How to calculate with text boxes and skip empty text boxes? -

i have count money , have created textboxes user can input how many 1 euro coins has. (and 2 euro, 5 euro, etc) want calculate total, if textbox empty, can't count whit it. have tried ways won't work because program automatically start counting every input. to keep short, want skip empty textboxes during calculation. now have this: int32 aa = int32.parse(textbox1.text); // 5 c int32 ba = int32.parse(textbox2.text); // 10 c int32 ca = int32.parse(textbox3.text); // 20 c int32 da = int32.parse(textbox4.text); // 50 c int32 ea = int32.parse(textbox5.text); // 1 e int32 fa = int32.parse(textbox6.text); // 2 e int32 ga = int32.parse(textbox7.text); // 5 e int32 ha = int32.parse(textbox8.text); // 10 e int32 ia = int32.parse(textbox9.text); // 20 e int32 ja = int32.parse(textbox10.text); // 50 e int32 ka = int32.parse(textbox11.text); // 100 e int32 total = ((aa * 5) + (ba * 10) + (ca * 20) + (da * 50) + (ea * 100) + (fa * 200) + (ga * 500) + (ha * 1000) + (ia * 2000) + (ja

ios - Move view from UITableViewCell to Window and back to same cell -

i'm creating sdk have view performs various tasks such expanding , flipping not go detail. in 1 possible use case, user may place view in uitableviewcell. make expand work properly, have view removed superview , added subview of window. so: [mysdkview removefromsuperview]; uiwindow* window = [uiapplication sharedapplication].keywindow; if (!window) { window = [[uiapplication sharedapplication].windows objectatindex:0]; } [window addsubview:mysdkview]; now need figure out how put table cell! either automatically abstracted user (preferred) or implementation can leave in doc them follow. upon expand, store superview of mysdkview (named savedsuperview below). upon unexpand do: if (savedsuperview) { [savedsuperview addsubview:mysdkview]; } else { [viewcontroller.view addsubview:mysdkview]; }

c++ - How do I more efficiently multiply transpose matrices? -

i keep beating myself on head this. have sse-based algorithm multiplying matrix a matrix b . need implement operations a, b, or both transposed. did naive implementation of it, 4x4 matrix code represented below (which pretty standard sse operations, think), a*b^t operation takes twice long a*b . atlas implementation returns similar values a*b , , identical results multiplying transpose, suggests me there efficient way this. mm-multiplication: m1 = (mat1.m_>>2)<<2; n2 = (mat2.n_>>2)<<2; n = (mat1.n_>>2)<<2; (k=0; k<n; k+=4) { (i=0; i<m1; i+=4) { // fetch: 4x4 matrix mat1 // row-major storage, 4 rows float* a0 = mat1.el_[i]+k; float* a1 = mat1.el_[i+1]+k; float* a2 = mat1.el_[i+2]+k; float* a3 = mat1.el_[i+3]+k; (j=0; j<n2; j+=4) { // fetch: 4x4 matrix mat2 // row-major storage, 4 rows float* b0 = mat2.el_[k]+j; float* b1 = mat2.el_[k+1]+j; float* b2 = mat2.el_[k+2]+j;

java - How to check given timestamp is weekend? -

can me complete function in java? thanks // e.g. "20130218001203638" boolean isweekend(string date) { ... ... } find post giving exact answer want. check date string if weekend in java calendar#get(day_of_week) return values sunday, monday, ... what can conditionally check calendar.saturday or calendar.sunday .

asp.net mvc 4 - When does WebSecurity.ChangePassword fail when "new password is invalid"? -

this code changing password in default accountcontroller scaffolded in mvc 4: // changepassword throw exception rather //than return false in failure scenarios. bool changepasswordsucceeded; try { string username = user.identity.name; changepasswordsucceeded = websecurity.changepassword(username, model.oldpassword, model.newpassword); } catch (exception) { changepasswordsucceeded = false; } if (changepasswordsucceeded) { return redirecttoaction("manage", new { message = managemessageid.changepasswordsuccess }); } else { modelstate.addmodelerror("", "the current password incorrect or new password invalid."); } my issue message unclear. if current password incorrect that's fine if new password invalid i'd present better message user telling them what's wrong , i'd understand "failure sce

c++ - #include <afxinet.h> in a header file causes a lot of compilation error, however, include it in a cpp file is ok -

the first error when putting #include <afxinet.h> in header file intellisense: #error directive: windows.h included. mfc apps must not #include <windows.h> (1) idea why it? the other similar thing if put headers in wrong order, odd errors appear, msg not make sense @ all... kind of behaviour of vc++ complier driving me crazy. (2)anyone has solution kind of problem? i had similar problem winsock.h , that: fatal error c1189: #error : winsock.h has been included i've added win32_lean_and_mean preprocessor directive project , fixed it. i can't tell why, or reason behind that.

java - Alert dialog not functioning correctly. -

this code working on requires user press button after entering phone number text box. button made save number. when run code want have present user alert dialog asking them enter number if pressed button no number present. instead of getting alert dialog app crashes. number entered app works fine. any advice on awesome - here code stack trace under that. -thank you! b.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { //create if statement brings alert dialog if there no number entered field. switch (v.getid()) { case r.id.btnwidgetconfig: { if (shareddata == null) { alertdialog.builder alert = new alertdialog.builder(c); alert.settitle("no number entered"); alert.setmessage("please enter phone number using the text box"); alert.setcancelable(false);

SQL Pivot table for each hour -

i have table below prefix scandate 1/2/2013 08:30 1/2/2013 08:45 b 1/2/2103 09:15 i need output count in every hour i,e time b 08:30-09:30 2 0 09:30-10-30 0 1 till 7pm can 1 me depending on db using, should works: select sum(case when datepart(hh, dateadd(m, 30, scandate) = 1 1 else 0 end) '00:30 - 01:30 block' sum(case when datepart(hh, dateadd(m, 30, scandate) = 2 1 else 0 end) '01:30 - 02:30 block' sum(case when datepart(hh, dateadd(m, 30, scandate) = 3 1 else 0 end) '02:30 - 03:30 block' ... table you'll need iterate out hour part identifiers until 7 pm i.e. 1, 2,...19. caveat, won't work times before 12:30 am.

.net - Need expert advice for WCF Service programming -

!--- i'm sorry if post redundant others, problem project seems resulting of architecture, need general help. ---! i'm trying configure wcf service connected silverlight 5 client-side , c# class library doing crud requests database. service have pass gigantic amount of data. example, have public ilist< rainrecord> getallrain() method in service class can retrieve hundreds of thousands of records in database, more someday. thought these records smaller batches (i think it's pretty approach). here's web.config file : <?xml version="1.0" encoding="utf-8"?> <!--this file contains web configuration used wcf service. --> <configuration> <system.web> <compilation debug="true" targetframework="4.0" maxbatchgeneratedfilesize="2147483647" maxbatchsize="2147483647" /> <httpruntime maxrequestlength="2147483647" /> </system.web> <syste

asp.net - Dynamically adding multiple rows to a ASP Datagrid -

i have page 2 datagrids. 1 reads value database , allows selection. when user selects grid adds data second datagrid. code using this: protected sub page_load(byval sender object, byval e system.eventargs) handles me.load dim dc1 new datacolumn("name") dim dc2 new datacolumn("price") dt.columns.add(dc1) dt.columns.add(dc2) dim dr1 datarow = dt.newrow() gridview2.datasource = dt gridview2.databind() end sub and protected sub gridview1_selectedindexchanged(sender object, e eventargs) handles gridview1.selectedindexchanged dim dr1 datarow = dt.newrow() dr1(0) = name.tostring dr1(1) = price.tostring dt.rows.add(dr1) gridview2.datasource = dt gridview2.databind() now, works perfectly.... work under forms service. in web based enviroment whenever user selects value in grid 1 resets values in grid 2 , need multiple rows added 2nd datagrid every time user selects value. "data

c++ - How to include DDK headers in visual studio 2010? -

i need use zwloaddriver function ntddk.h . installed windows software development kit (sdk) windows 8 . set includes ( #include <ntddk.h> ). , have lots of errors type/sruct redefinition , ... has body . think headers sdk mixes ones ddk. how fix ? the ddk should ever used develop driver. water , fire in user mode, lots of declarations overlap sdk headers. using ntloaddriver() user mode undocumented, no header available declaration , there no import library available ntdll.dll. native operating system api function, argument uses non-standard format registry key. native os different win32 api. if really, want you'll have write own declaration , use getprocaddress() entrypoint in ntdll.dll but loading drivers user mode code supported in windows. best use documented , supported way, openscmanager + createservice. sample project available here .

c++ - CUDA: __device__ and __global__ error: expected constructor, destructor, or type conversion before "unsigned"/"void"" -

so problem is: i'm using nvidia's nsight application on mac os x mountain lion write cuda application: source code .h/.cu/.cpp mix. i have hellocuda.h header following declarations: //yep, both taken examples. __device__ unsigned int bitreverse2(unsigned int number); __global__ void bitreverse(void *data); and have hellocuda.cu file defines these methods: __device__ unsigned int bitreverse3(unsigned int number) { //definition return number; } __global__ void bitreverse4(void *data) { //another definition... bitreverse3(idata[threadidx.x]); } it worked, until added new c++ class files (.h/.cpp) using eclipse's (nsight) new class wizard. now, when try build thing: ../src/hellocuda.h:21: error: expected constructor, destructor, or type conversion before ‘unsigned’ ../src/hellocuda.h:23: error: expected constructor, destructor, or type conversion before ‘void’ i checked project settings, don't think has changes. so, gives? could

Need a hand with regex in c# that spans multiple rows -

i trying parse out html page has table rows in it. need of table cells within table row. here's sample of html i"m trying parse: <tr style="font-size:8pt;"> <td style="font-size:8pt;">1545644656</td> <td style="font-size:8pt;">billy</td> <td style="font-size:8pt;">johnson</td> <td style="font-size:8pt;">def</td> <td style="font-size:8pt;"></td> <td style="font-size:8pt;">1134 main st</td> <td style="font-size:8pt;"></td> <td style="font-size:8pt;">anytown</td> <td style="font-size:8pt;">pa</td> <td style="font-size:8pt;">05405</td> </tr> and here regex i"m using of stuff between tr start , tr end regex exp = new regex("<tr style=\"font-size:8pt

jquery - How to add a background text to textarea tags? -

you know can add image background image textarea using : textarea { background:#fff url(background.png) no-repeat center scroll; } how can have text (not image, nor text image) background textarea ? it isn't text contained in textarea itself . text behind. user can write in textarea, and, background image, see background text behind. css2 preferred, css3 , js ok. there brute force approach: <div class="wallpapered"> <div class="background">some background text...</div> <textarea></textarea> </div> with following css: .wallpapered { width: 400px; height: 300px; position: relative; outline: 1px dashed blue; } .wallpapered textarea { width: inherit; height: inherit; } .wallpapered .background { position: absolute; top: 0; left: 0; color: gray; } fiddle

php - Hide Repeated Column Values -

i have mysql database includes 2 tables called individuals , households. fields individuals table include: -ind_id -first_name -middle_name -last_name -household_id the fields households table include: -household_id -head_first_name -head_middle_name -head_last_name -address -city -province_state -country -postal_code -phone there foriegn key relationship between household_id fields in 2 tables. intent of 2 tables group individuals various households , able produce report listing selecting individuals database , group them household. isn't problem. using sql , php, have no problem producing list looks this: -household head address phone occupants -jones, robert john 1234 deadend st., anytown, usa 98004 (555) 420-5186 jones, ann leslie -jones, robert john 1234 deadend st., anytown, usa 98004 (555) 420-5186 jones, percy james -jones, robert john 1234 deadend st., anytown, usa 98004 (555) 420-5186

android - Create Menu options button in Tablet -

how create soft button tablets? have manifest minsdk 8, , target of targetsdk = 13. on phones normal, there no button on plates according documentation, there 3 parameters can use soft buttons naviagtion: the system_ui_flag_low_profile flag replaces status_bar_hidden flag. when set, flag enables “low profile" mode system bar or navigation bar. the system_ui_flag_visible flag replaces status_bar_visible flag request system bar or navigation bar visible. the system_ui_flag_hide_navigation new flag requests navigation bar hide completely. aware works navigation bar used handsets (it not hide system bar on tablets). try use: getwindow().getdecorview().setsystemuivisibility(view.system_ui_flag_visible);

php - Simple PDO update is not working -

the problem on :soundid if type manually soundid='soundidfrompost' received post, row updated, soundid=:soundid ... nothing. why? pdo::attr_errmode pdo::errmode_exception , error_reporting enabled. public function save($args) { $userid = controller::getuserconnection(); if ($userid) { $soundid = $_post['soundid']; $track_title = $_post['track_title']; $track_artist = $_post['track_artist']; $track_album = $_post['track_album']; $track_genre = $_post['track_genre']; $track_description = $_post['track_description']; $played = 1; $statement = $this->_db->prepare("update sounds set title=:track_title, artist=:track_artist, album=:track_album, genre_id=:track_genre, description=:track_description, played=:played soundid=:soundid , userid=:userid , ip=:ip"); $statement->bindparam(':soundid',$soundid,pdo::param_str);

Ruby Open-URI with Dynamic Website -

i'm trying use open-uri html page website. however, problem website needs couple of seconds load have correct code. have right is: require 'open-uri' html = open('http://hiddencode.me/dribbbucket/embed.html?key=my_api_key&bucket=56024-glassboard&delay=5000') response = html.read puts response if run right now, get: <div id="slam-dunk"> <div id="loading">loading..</div> </div> however, site needs load first before opening correct response. ideas how in ruby? can use solution in language, if ruby not expertise! as example, used watir-webdriver accomplish similar task. you'll able query dom after javascript execution , pull want out. if you'd headless, in case used headless gem. if you'd stick 'open-uri' you'll have use httpfox watch ajax requests javascript makes. can many different tools well. you'd start httpfox, in case, before visit url. wait unti

c# - Linq Data Source WhereParameters with "\" in value -

asp.net/c# project utilizing linq sql have listbox, values database, used filter linq data source. works fine until have value in listbox contain "\". eg "domain\group name". appreciated! if (ddlappgroup.selectedvalue != "*") { linqdatasource1.whereparameters.add(new parameter("applicationgroup", system.data.dbtype.int16)); linqdatasource1.whereparameters["applicationgroup"].defaultvalue = ddlappgroup.selectedvalue; if (linqdatasource1.where == "") { linqdatasource1.where = "applicationgroup == @applicationgroup"; } else { linqdatasource1.where = linqdatasource1.where + " && applicationgroup == @applicationgroup"; } } this parameters like: linqdatasource1.whereparameters[0] {applicationgroup} convertemptystringtonull: true