Posts

Showing posts from February, 2014

how to get the preference value in HTML page? -

i have preference set in adfmf-feature , in amx page using <amx:inputtext label="url" id="it1" value="#{preferencescope.feature.adf.mobile.sample.profilepage.showprofileimage.showimage}"/> . but if use same format html <input type="username" name="xyz" id="user" value= "#{preferencescope.feature.adf.mobile.sample.username}" /> not able result. #{preferencescope.feature.adf.mobile.sample.username} output in text box! values here identification purpose. match respective id's in application should written in javascript side? or there other way value , set? thank html doesn't know how resolve el expression - see if have javascript api lets access preferences.

ios - NSString uppercase drawinrect -

do guys have idea why this: [self.rightfiletype drawinrect: text2rect withfont: [uifont fontwithname: @"helveticaneue-medium" size: 21.5] linebreakmode: nslinebreakbywordwrapping alignment: nstextalignmentcenter]; and [@"doc" drawinrect: text2rect withfont: [uifont fontwithname: @"helveticaneue-medium" size: 21.5] linebreakmode: nslinebreakbywordwrapping alignment: nstextalignmentcenter]; work, showing correct values but [[self.rightfiletype uppercasestring] drawinrect: text2rect withfont: [uifont fontwithname: @"helveticaneue-medium" size: 21.5] linebreakmode: nslinebreakbywordwrapping alignment: nstextalignmentcenter]; is not displaying anything?

multithreading - C# - Where is Lock Appropriate to Use in Libraries? -

i'm writing library multiple projects. , contains classes contain , manipulate data. thought should lock data while method of classes executed. thought if thread safe data manipulation must done, let higher application layer handle locking. best practice library of classes used actual applications later. let's have class speciallist . do: lock data when methods called let user lock list if needs thread safety + ignore (index) exceptions user must catch them ? if knew how .net framework class list handles same. classes not explicitly targeted @ single- or multi-threading. helping classes kinds of uses. if you're designing data structures , types needs have guarantee thread safety, sure, put locks , other constructs types uphold guarantees. however, locks alone isn't enough. take simple dictionary. let's want ensure internal data structure inside dictionary cannot corrupted multiple threads, introduce locks. however, if outside code thi...

Which gem version works best with rails 2.3.18 and ruby 1.8.7? -

for whatever reason need setup box ruby 1.8.7 , rails 2.3.18 host historical apps. what's best version of rubygem above combo? current ( gem -v => 1.8.19) gives many warnings, example: note: gem.source_index deprecated, use specification. removed on or after 2011-11-01.

c++ - Check if a file exists without opening it -

how can check if file exists in directory before continuing program? have read answers try opening file using various methods issue of time, file checking corrupt , cant opened. happens in error checking part of program , triggered when error in preceding code has occurred. want check if file exists, if ask delete it, otherwise print out message. how can go this? (just deleting , accepting errors work, i'm doing learn, want properly...) edit: i have downloaded boost use filesystem library , have compiled it, seemingly no errors, when try compile program, response: g++ program.cpp -i <path to>/boost_1_54_0 -o output undefined symbols architecture x86_64: "boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)", referenced from: boost::filesystem::exists(boost::filesystem::path const&)in cc1xx8rd.o "boost::system::system_category()", referenced from: __static_initialization_and_destruction_0(i...

android - getting SQLException during runtime and the program is running properly, also no messages in the logcat -

i new sqlite. trying make simple application uses sqlite database. have completed of part, getting runtime exceptions. here java file dbhelper- temperature.java :- package com.example.sqliteexample; import android.content.contentvalues; import android.content.context; import android.database.cursor; import android.database.sqlexception; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; public class hotornot { public static final string key_rowid = "_id"; public static final string key_name = "item_name"; public static final string key_temperature = "item_temperature"; private static final string database_name = "hotornotdb"; private static final string database_table = "itemtable"; private static final int database_version = 1; private dbhelper ourhelper; private final context ourcontext; private sqlitedatabase ourdatabase; private static class dbhelper extends sqliteopenhelp...

java - How to check if there is at least 1 day difference between 2 dates -

so, have check if difference between 2 dates @ least 1 day. method should return true, otherwise false. the format dates i´m using gregoriancalendar(year, month, day) . so have method uses date1.before(date2) , checks time, if date1 before date2 returns true, if same day (but time different!). what need way check if difference between dates @ least 1 day. any ideas? add 1 day cal1 , test if it's not after cal2 cal1.add(calendar.date, 1); system.out.println(!cal1.after(cal2));

c# - SmtpException While sending mails in a bulk of 3 or more -

i using smtpclient send emails.i using same code last 2years,but last day when send 3 or more emails 1 of them fail.when sent failed 1 again sent out.please me using aibn.com mail server. public bool sendmail(string p_strfrom, string p_strdisplayname, string p_strto, string p_strsubject, string p_strmessage , string strfilename) { try { p_strdisplayname = _displayname; string smtpserver = _smtpserver; smtpclient smtpclient = new smtpclient(); mailmessage message = new mailmessage(); mailaddress fromaddress = new mailaddress(_from,_displayname); smtpclient.host = _smtpserver; smtpclient.port = convert.toint32(_port); string strauth_username = _username; string strauth_password = _password; if (strauth_username != null) { system.net.networkcredential smtpuserinfo = new system.net.networkcredential(st...

ios - time.h functions do not see the header file -

i using structures , methods listed below , including sys/time.h or time.h not change anything. can problem? struct tm thetime; strptime((char *)nodevalue, "%a %b %d %h:%m:%s +0000 %y", &thetime); time_t epochtime = timegm(&thetime); i using xcode , compile armv7. (before, working perfectly. don't know what's changed since before..) i following errors: variable has incomplete type 'struct tm' implicit declaration of function 'strptime' invalid in c99 implicit declaration of function 'timegm' invalid in c99 enable declarations defining feature test macro -d_posix_c_source=200809l @ compilation time or before including header: #define _posix_c_source 200809l #include <time.h> see here more information on feature test macro _posix_c_source .

Issue while clicking on 'find hotels' using Selenium-Java -

i using selenium (web driver) - java. picked travel site demo of automation. on travel site, @ home webpage, need place following input before submit form. provide city name date , date to click on find hotel button. i able following: done done unable click on find hotel button. on 3rd step, whenever clicking on 'find button' through selenium code, redirect page other website (not sure redirection coming). my question is: doing wrong? below details: web page source code: <div class="clear"></div> <div class='multisearchbox' > <div class='clear'></div> </div> <div class="block_bottom"> <div class="bottom"> <button class="search" type="submit">find hotels</button> <input type="hidden" name="passengers" autocomplete="off" value=""> </div> </div...

html - Change color of parent li > span when mouse hover on li child ul -

is possible change color of parent li span when mouse hover on li child ul. (only css) html: <ul class="menu"> <li><a href="#"><i class="icon-list"></i> <span>home</span></a></li> <li><a href="#"><i class="icon-th"></i> <span>test-menu</span></a> <ul> <li><a href="#"><i class="icon-windows"></i> list-1</a></li> <li><a href="#"><i class="icon-windows"></i> list-3</a></li> <li><a href="#"><i class="icon-windows"></i> list-2</a></li> </ul> </li> </ul> css: .menu > li > a:hover > span { color:red; } i tried: .menu > li > > span + ul:hover { color:red; } fiddle : http:...

flash - Change cursor to custom on rollover -

i have graphics in flash object , want change cursor @ rollover on graphics . here code follows: on (rollover) { mouse.hide(); startdrag(dynmccrsr, true); } on (rollout) { startdrag(dynmccrsr, false); mouse.show(); } the code work @ rollover not functioning @ rollout. cursor remains unaltered @ rollout. new in action-script. in regard highly appreciated. you should use stopdrag() : on (rollout) { stopdrag(); mouse.show(); } startdrag has 1 required parameter , 5 optional parameters. first being object want drag , second 1 lockcenter . if use startdrag(object,false) not stop dragging. http://help.adobe.com/en_us/as2/reference/flashlite/ws5b3ccc516d4fbf351e63e3d118ccf9c47f-7f93.html

android - button settext to next class -

i have 2 classes; first.class , second.class . on first.class there button , on second.class there no button. need when button first.class clicked there text appear on second.class option save it. first.class button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { } }); public class first{ button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { second.settext(text); } }); } public class second{ private static string textfromfirst; public static void settext(string text){ second.textfromfirst = text; } }

Even With setHomeButtonEnabled(true) App Icon not Clickable in Android 14 -

my code: (updated) i've added oncreateoptionsmenu , onoptionsitemselected method here : actionbar actionbar = getactionbar(); actionbar.sethomebuttonenabled(true); actionbar.setdisplayhomeasupenabled(true); @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.login, menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { // handle item selection switch (item.getitemid()) { case r.id.action_createinvoice: startactivity(new intent("com.domain.activity1")); return true; default: return super.onoptionsitemselected(item); } } my manifest file: <uses-sdk android:minsdkversion="14" android:targetsdkversion="17" /> <activity android:label="@string/activity" android:name=".activity" andr...

php - Why do I get this error while editing the .profile file while installing cakephp on mac? -

i'm installing cakephp on mac osx lion on mamp. , following error when save .profile file corresponding path. -bash: export: `=/applications/mamp/bin/php5.4.10/bin:/users/aravind/sites/cake/lib/cake/console:/library/frameworks/python.framework/versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/x11/bin': not valid identifier my .profile consists of following lines. have no idea error means , why refers /library/frameworks/python.framework... alias www="cd /users/aravind/sites/public_html" alias mysql="cd /applications/mamp/library/bin/mysql -uroot -p" export path ="/applications/mamp/bin/php5.4.10/bin:/users/aravind/sites/cake/lib/cake/console:$path" due this, i'm not able continue installation of cakephp. please?

c# - Modify values in xml -

i have xml file in following format : <?xml version="1.0" encoding="utf-8"?> <server xmlns="urn:jboss:domain:1.2"> <extensions> <extension module="org.jboss.as.clustering.infinispan" /> <extension module="org.jboss.as.cmp" /> <extension module="org.jboss.as.ejb3" /> </extensions> <appsettings> <property name="external_fileserver" value="/site/bugbase.adobe.com/files/" /> <property name="ftp_user" value="password" /> <property name="ftp_server" value="sjshare.corp.adobe.com"/> <property name="ftp_password" value="password" /> <property name="ftp_read_user" value="password" /> <property name="ftp_read_pass" value="password" /> <property name="workfl...

iphone - UIView animateWithDuration not respecting delay -

i want schedule series of animations animate intro text across screen. last animation, on completion, should fire off game tick logic should run game. for reason happening immediately. can shed light on why happening or better alternative? [self.view bringsubviewtofront:_viewintroseconds]; [uiview animatewithduration:0.4 delay:0.0 options:uiviewanimationoptioncurveeaseinout animations:^(void) { [_introlabel1 setalpha:1]; } completion:^(bool finished){ }]; [uiview animatewithduration:0.4 delay:3.0 options:uiviewanimationoptioncurveeaseinout animations:^(void) { [_introlabel2 setalpha:1]; [_introlabel1 setalpha:0]; [_introlabel1 setcenter:cgpointmake(0, _introlabel1.center.y)]; } completion:^(bool finished){ }]; [uiview animatewithduration:0.4 delay:5.0 option...

user interface - How to restyle a TabControl in WPF -

Image
i new in wpf. here posting picture of tabcontrol . guide me how can re-style tab having same ui in wpf per picture. in case, need implement style / template tabcontrol form. tabcontrol has 3 directions tabs are: central ( default ), left , right directions. need left direction, judging picture. style tabitem (elements of tabcontrol ) 1 in directions. style tabcontrol left direction: <style x:key="lefttabcontrol" targettype="{x:type tabcontrol}"> <setter property="tabstripplacement" value="left" /> <setter property="margin" value="0" /> <setter property="padding" value="0" /> <setter property="background" value="white" /> <setter property="borderthickness" value="1" /> <setter property="borderbrush" value="transparent" /> ...

Qt just loads the translations of UI strings but not strings in the code -

i have lot of form , strings in project translatable strings boxed in tr() function. translated of strings linguist, when load correspond qm file, strings in ui being translated. for example, if had form containing label "hello world!" text, translated "olleh dlrow!"(just say). in code if wrote: if ( condition ) ui.settitle(tr("mainwindow")); else ui.settitle(tr("secondarywindow")); no translation of mainwindow or secondarywindow done , original text shown. any idea? in advanced. i want explain solution in situation me. consider have class named myform. defined namspace project called mynmespace. /* myform.cpp */ using namespace mynmespace; myform::myform(qwidget* parent):qmainwindow(parent) {} 1) if user wraps strings in tr() function, won't translated. enabling translation, must use qapplication::translate("classname", "str", 0, qapplication::unicodeutf8) like: /* myfor...

user interface - Detect 'home button pressed' event in android service displaying a UI (similar to facebook chatheads) -

in facebook chatheads, part of facebook messenger app, noticed following behavior: far can see, chat head , opened chat screen parts of service. no activity involved. how can sure? after press home on opened chat screen, gets minimized chat head, , can reopen chat screen. if chat screen activity, reopening activity via startactivity(intent) after home button pressed, delay start of activity, specified here: starting activity service after home button pressed without 5 seconds delay and here: reason 5 sec delay show activity on pressing home button? in service oncreate method, use following code display ui service: public class servicetest extends service { ... @override public void oncreate() { super.oncreate(); windowmanager = (windowmanager) getsystemservice(window_service); windowmanager.layoutparams params = new windowmanager.layoutparams( windowmanager.layoutparams.wrap_content, windowmanager.layoutparams.wrap...

directory - Deleting Directories by CreationTime in C# -

i have c# application in there requirement delete files date created older today’s date. how can achieve this? i had search in google find out sample code. decide create 1 , post here.if want delete older files directory , can use below method. if have queries on please let me know well, happy you. public void folderdelete() { directoryinfo d = new directoryinfo(configurationmanager.appsettings["<path>"]); if (d.exists) { //get directories path string[] folders = directory.getdirectories(d.tostring()); foreach (var item in folders) { directoryinfo info = new directoryinfo(item); //it purge 14 days older directories if (info.creationtime < datetime.now.adddays(-14)) { info.delete(true); ...

winforms - Linking error running a C++ program in Windows Forms -

some time ago made c++ program worked involving classes , main launched rest of application. need create graphic interface run program first idea build dll out of program , import windows forms application on visual studio 2008 turned not work. i decided import code directly copied files folder inside project , wrote (gp_app old main , fwindow form @ new app) gp_app.h public ref class gp_app { public: static int run_gp(); }; gp_app.cpp public static int gp_app::run_gp(){ /* implementation */ } fwindow.h private: system::void button1_click(system::object^ sender, system::eventargs^ e) { gp_app::run_gp(); } but keeps giving me error when compile fwindow.obj : error lnk2020: unresolved token (06000001) gp_app::run_gp any idea solve it? or thinking should dll , how make work? ui windows pass parameters , showing terminal window running app. sorry if question dumb (i'm c++ rookie), sorry poor english , mistakes formatting question ...

c++ - why we should implement pure virtual function in this case? -

my code: class { public: a(){} a(int _a) : a(_a){} virtual ~a() = 0; private: int a; }; class b : public { public: b(){} b(int _a):a(_a){} ~b(){} private: }; i declare b b; , when compile program, met error: error lnk2019: unresolved external symbol "public: virtual __thiscall a::~a(void)" (??1a@@uae@xz) referenced in function "public: virtual __thiscall b::~b(void)" (??1b@@uae@xz) i want know, need implement pure virtual function time? in general not need implement pure virtual function. indeed that's sort of point. however, destructors do, because not acceptable destructor have no implementation. because unlike regular virtual methods, most-derived 1 used @ runtime, virtual destructors in inheritance chain called, most- least-derived, fields of derived object may destroyed. for reason may preferable not make pure virtual destructors, except in cases necessary (i.e. when have base class must abstract has n...

statistics - How do I plot a binomial probability distribution? -

Image
i have calculated set of binomial distributions giving me probabilities of finding n number of objects given sample of n objects. i calculated using percent point function (ppf) (a.k.a. inverse cumulative function) using scipy.stats.distributions package. now want plot probability distribution question emerges: which package , function in python should use this? i've found few useful resources like: http://goo.gl/q2ujxx still no closer (most missing something). say n = 2 , n = 10. how go creating plot below? : the x-axis shows range of values 0 - n/n (where n > n always). y-axis shows probability of n/n. thank time.

java - change the bits order -

i have function converts int hex. in function, seekbar's value between 0 , 100. changes , convert hex. private string decimaltohex(int i) { /**conversion decimal of seekbar's % value*/ int_value = ((i * 20480) / 100) * -1; int_value = -20480 - int_value; /**conversion hex*/ hex_value = integer.tostring(int_value, 16); //hex_value = integer.tohexstring(c2_final); return hex_value; } lets suppose int i value 52. gets next value: int_value = -9831 when convert value hex, -2667 . not value need. i need make conversion gives me hex result value "d999". value ones-complementing value (aka ~ operator). converting value -9831 positve 9831 , substracting 1 9830 , , last, changing bits value 55705 in hex d999 . how can last thing? change bits? code in c: if (int_value < 0) { c2_value = int_value * -1; c2_value = c2_value - 1; c2_final = ~c2_value; } java.lang.integer provides to...

node.js - Nodejs (socket.io) memory usage compared to JavaScript's primitive data type memory usage -

first off, title may poorly defined or misleading, pretty tries summarize question whole. i've searched lot without getting questions answered. how socket.io memory allocation through memorystorage (socket.get/socket.set) work , how memory usage approximately 1 socket.set use? memory freed correctly when socket disconnects? optional: there known memory leaks should aware of in v0.11.0-pre? how javascript's garbagecollector work objects , associative arrays declared in global scope? memory freed when "delete" key-value pair this: "delete object[key];"? or ram continuely increase client requests increase? how option 1 , 2 compared each other? should use socket.set on globally declared "maps" when comes increasing , freeing memory? optional: how compared each other when comes performance ("executing" socket.get/object[key])? as basic information on project, i'm developing game server in node.js (single process) expected acc...

c# - Why DataDriven tests no longer run on Jenkins when using MSTest? -

i have suite of webdriver tests written c# , using mstest runner. @ point nunit not option, need figure out how make work current configuration. ci using jenkins ver. 1.514. not in control of plugins being installed or when jenkins updated , if asking such thing might lead long wait , approval processes in different teams (hate birocracy). so.. have few datadriven tests defined follows(i'll paste in 1 of them) [datasource("microsoft.visualstudio.testtools.datasource.csv", "usersdata.csv", "usersdata#csv", dataaccessmethod.sequential)] [testmethod()] public void test_login() { logger.info(""); logger.info("-----------------------------------------------------------------"); so, should clear enough using usersdata.csv file, placed in testdata folder in project. run test in jenkins, used use command line mstest /testmetadata:"%workspace%\seleniumjenkins.vsmdi" /testlist:jenkins /resu...

c++ - Turbo C Database in Notepad -

i'm working on case study myself - japanese english dictionary using turbo c , notepad. relevant part of code: #‎include‬ <stdio.h> main() { file *a; char word[20], ans[1]; clrscr(); a=fopen("dictionary.dbf","a"); { printf("add word: "); scanf("%s",&word); fprintf(a,"%s \n",word); printf("add one? (y/n)"); scanf("%s",ans); }while(strcmp(ans,"y")==0); fclose(a); } this code enables me insert word tc , saves notepad. unfortunately, don't know how print word notepad display tc. i need little guys. case study, , case study without having group. just few easy steps. your notepad file open file fopen(const char * filename, const char * mode) . when open file read file fread(void * ptr, size_t size, size_t count, file * stream) now final step... print on console or anywhere want, can us...

beautifulsoup - split a table into several with Beautiful Soup [Python] -

i need problem can't find out... i have html table tr , td: for example: <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td colspan="2"> <br /> <h2> macros </h2> </td> </tr> <tr> <td> #define&nbsp; </td> <td> <a class="el" href="#g3e3da223d2db3b49a9b6e3ee6f49f745"> snd_lstindic </a> </td> </tr> <tr> <td class="mdescleft"> &nbsp; </td> <td class="mdescright"> liste sons indication <br /> </td> </tr> <tr> <td colspan="2"> <br /> <h2> définition de type </h2> </...

Turning list of atoms into a single list using recursion -

i'm looking answer turns list of atoms single list recursively. an example be, (slist '(a (b c) (d e (f) g) h)) (slist (a b c d e f g h)) any answer helpful. what you're trying called flattening list. here bunch of options: ; required predicate (define (atom? x) (and (not (null? x)) (not (pair? x)))) ; naïve version using append (define (flatten1 lst) (cond ((null? lst) '()) ((not (pair? lst)) (list lst)) (else (append (flatten1 (car lst)) (flatten1 (cdr lst)))))) ; naïve version using append, map, apply (define (flatten2 lst) (if (atom? lst) (list lst) (apply append (map flatten2 lst)))) ; efficient version using fold-left (define (flatten3 lst) (define (loop lst acc) (if (atom? lst) (cons lst acc) (foldl loop acc lst))) (reverse (loop lst '()))) ; efficient version no higher-order procedures (define (flatten4 lst) (let loop (...

sql server - SQL dynamic ORDER BY using alias -

using sql server, can order normal select query using alias: select u.firstname + ' ' + u.lastname physicianname, count(r.id) referralscount referrals r inner join users u on r.physicianid = u.id group r.physicianid, u.firstname, u.lastname order physicianname however, attempting same thing dynamic order by : select u.firstname + ' ' + u.lastname physicianname, count(r.id) referralscount referrals r inner join users u on r.physicianid = u.id group r.physicianid, u.firstname, u.lastname order case when @orderby = 'physicianname' physicianname end, case when @orderby = 'referralscount' referralscount end produces following error: msg 207, level 16, state 1, line 10 invalid column name 'physicianname'. msg 207, level 16, state 1, line 11 invalid column name 'referralscount'. column aliases defined in select can used in order by on own. not in expre...

java - <li> tag Xpath location -

there many list elements in xml class name: <li class="name"> <div>....</div> ...... </li> set location "//*li[@class='name']" throws javax.xml.transform.transformerexception: illegal tokens: 'li', '[', '@', 'class', '=', ''name'', ']' how list elements via xpath location? remove * , i.e. instead of //*li[@class='name'] you need use //li[@class='name']

ios - creating UIView prevents IBAction being sent -

i trying draw uiview screen while simultaneously moving other ui elements out of it's way. both events triggered same uiswitch. when don't draw uiview ui elements move should, when call action draw uiview, ui elements don't move should. have no idea why happening, appreciated. here function adds , removes view: - (ibaction)showhidemynewview:(uiswitch *)sender { if (_myswitch.on) { [self.view addsubview:mynewview]; } else { [mynewview removefromsuperview]; } here function moves other ui elements make room uiview: - (ibaction)moveuielementsforpainintensityview:(id)sender { _myswitch = (uiswitch *)sender; if (_myswitch.on) { [_labelone moveto:cgpointmake(50, 350) duration:0.5 option:0]; [_labeltwo moveto:cgpointmake(50, 400) duration:0.5 option:0]; [_labelthree moveto:cgpointmake(50, 450) duration:0.5 option:0]; [_labelfour moveto:cgpointmake(50, 500) duration:0.5 option:0]; } else { [_labelone moveto:cgpointmake(50, 150) duration:0.5 ...

c# - Using a validation summary to display label text -

i have taken on maintenance of site makes calls through wcf service. there validation summary displays in message box validators on client-side. have label fires if exceptions arise web service calls. after tweaking layout, label sits in inconvenient spot. want know if there way display label text in validation summary should exception fire in code behind. any advice appreciated. example in cs file: bool resultuserexistence = register.checkuniquenessuserid(txtuserid.text); if (resultuniquenessemail == null) { continue through code... } else { lblexception.text = "please choose different user name. current user name registered."; } validation summary: <asp:validationsummary id="valsummary" runat="server" headertext="please correct following error(s):" displaymode="list" forecolor="#ff9999" showmessagebo...

jquery - Strip span and put into input -

this should pretty simple - content h1 tag, strip span tag , put remaining input tag i have html: <div id="contentarea"> <h1><span>course</span>arrangementname<h1> <input type="hidden" id="arr1form_arrangement" name="arr1form_arrangement"> </div> jquery var eventname = $('#contentarea h1').html(); eventname.find("span").remove(); var eventnametrim = eventname.html(); //alert(eventnametrim); $( "input[name*='form_arrangement']" ).val( eventnametrim ); but nothing happens - alert empty. firebug tells me "eventname.find not function" it's jquery 1.9.0 can please telle me whats going on? if desired output arrangementname problem first line, should be: var eventname = $('#contentarea h1'); ...because makes eventname jquery object, on can use .find() span , remove existing second line. though removes span elem...

What does an underscore "_" mean in CSS? -

i found following snippet in css file: position: fixed; _position: absolute; what underline mean in front of second position statement? this old css-hack ie5, 5.5 & 6 . browser display position:fixed while ie5 - 6 use _position , display absolute . but note: css won't validate! , won't work ie5/mac

zk button using Watir generates error indicating no button is present -

i´m testing zk form, , want click button. zk code following: <zk:button id="btnlogin" label="entrar" onclick="wndlogin.onlogin()" style="font-weight: bold; font-size:12px;" /> my watir code shown below: browser.button.click i have 1 button on page. when run script, error indicates button not exist on page. i believe problem caused namespace - ie 'zk'. have been elements or attributes in namespace using css selectors: browser.element(:css => 'zk\:button').click note colon needs escaped.

apache - Rewrite rule for replacing a single character. Once -

i need .htaccess files , mod_rewrite. now i've got script sms payment provider, executes different tasks according variables parse it. problem is, script called like: http://examp.le/path/script.php&param1=x&param2=whatever&param3=823 and on. this, know, wrong. first character should query mark, not ampersand. need write rewrite rule replace first occurence of ampersand query mark. i've never been @ regex, or htaccess in general. but. if you're answering, please explain characters , how in world work. thank in advance. enable mod_rewrite , .htaccess through httpd.conf , put code in .htaccess under document_root directory: options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritecond %{the_request} \s/(script\.php)&(param1=[^\s]+) [nc] rewriterule ^ /%1?%2 [r=302,l] once verify working fine, replace r=302 r=301 . avoid using r=301 (permanent redirect) while testing mod_rewrite rules.

download - Using wildcards in wget or curl query -

is possible use wildcards in wget queries when downloading directories? basically, have site, say, www.download.example.com/dir/version/package.rpm . howevery, version directory changes time , contains multiple rpm packages. there single wget query me , packages in version directory without knowing version is? in ideal world, query like: wget www.download.example.com/dir/*/*.rpm if there way curl , work well. you can't use wildcards in wget -a flag should work. wget manpage : you want download gifs directory on http server. tried wget http://www.server.com/dir/*.gif , didn't work because http retrieval not support globbing. in case, use: wget -r -l1 --no-parent -a.gif http://www.server.com/dir/ edit: found related question regarding directories: there's utility called lftp , has support globbing. take @ manpage . there's question on linux & unix covers usage in scenario similar yours.

javascript - Displaying radio button value total -

i working on interactive checklist needs count how many "yes" , "no" answers user has selected , display total either in alert box or on page. yes answer gets value of 1, , no gets value of 0. the problem is, when clicking total button, displaying value of each answer , total - need display total. i have poked around solutions, , have modified code based on have found. pretty new javascript, must missing something. here code: <script type="text/javascript"><!-- $(document).ready(function () { $('input:radio').on('change',function(){ var $first_question = parseint($("input[name=first_answer]:checked").val()); var $second_question = parseint($("input[name=second_answer]:checked").val()); $first_question = $first_question? $first_question : 0; $second_question = $second_question? $second_question : 0; var $total_score = $first_question + $second_question; { $(...

java - How to reset android service memory -

the issue restarting service , memory still tied up. button @ main activity. call stopsevice startservice method @override public void onbackpressed() { stopservice(new intent(this, autoalarmservice.class)); startservice(new intent(this, autoalarmservice.class)); finish(); } -- service restarts memory doesn't reset. service sitting on 50mb of memory , has been running couple hours. method resets doesn't free memory. there obscure method i'm missing can use free memory? public class autoalarmservice extends service { public static final string defaultname = "defaultfile"; random ran = new random(50000); imagebutton iblautomationitem, ibautosearchsettings, ibfinshautoitem; button ibautolocation, ibautocategory; edittext etname, etkeywords; int numz; static final int uniqueid[] = { 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 2000 }; stringbuffer npochecking = new stringbuffer(); ...