Posts

Showing posts from May, 2012

javascript - Removing everything except numbers in a string -

i've made small calculator in javascript users enter interest rate , amount want borrow, , calculates how of incentive might get. the problem i'm worried users enter symbols, e.g. loan amount: £360,000 - interest rate: 4.6% i'm not worried decimal places these needed , don't seem affect calculation, it's symbols £ , % mess things up. is there simple way strip out these symbols code: <td><input type="text" name="loan_amt" style="background-color:#fff380;"></td> <td><input type="text" name="interest_rate" style="background-color:#fff380;"></td> function calculate() { var loan_amt = document.getelementbyid('loan_amt').value; //this how loan amount entered var interest_rate = document.getelementbyid('interest_rate').value; //this how interest rate alert (interest_rate); } note should use correct dom id refer ...

ajax - Force jQuery / Javascript to wait for php script to load -

i'm having trouble making ajax request wait php script load, script works in chrome not ie in both instances. on button press script should fire php script wait complete display alert has complete in ie alert box displays , script never runs. work in chrome expected. this attempt 1 function reloadcalls(){ $('#reload').prop('disabled', true); $('.ajax-progress-throbber').show(); $.ajax({ url: '/kpi/technet_proj/cron/proj_cron.php', success: function(r){ alert('calls loaded'); location.reload(); }, error: function(r){ alert('calls not loaded'); } }); } this attempt 2 function reloadcalls(){ $('#reload').prop('disabled', true); $('.ajax-progress-throbber').show(); $.ajax({ url: '/kpi/technet_proj/cron/proj_cron.php', success: function(){ alerts(); }, error: function(){ ale...

oracle - Exception in thread "main" java.sql.SQLException: Missing defines -

have done below sample jdbc program retrieving user details.now getting surprised same callable statement getting different result set same output parameter index.ideally should return same resultset object. when got resultset moving cursor -1 0. i retrieving data resultset same output param using column name getting following exception , exception in thread "main" java.sql.sqlexception: missing defines system.out.println("before loading connection"); drivermanager.registerdriver(new oracle.jdbc.oracledriver()); connection connection = drivermanager.getconnection( "jdbc:oracle:thin:@170.45.3.165:1541/testdb.mycomp.com", "admin", "admin123"); system.out.println("connection loaded " + connection); callablestatement callprocedure = connection .preparecall("{call admin_user.fetch_user_details(?,?)}"); callprocedure.setstring(1, "userid=te...

c++ - Data conversion for ARM platform (from x86/x64) -

we have developed win32 application x86 , x64 platform. want use same application on arm platform. endianness vary arm platform i.e. arm platform uses big endian format in general. want handle in our application our device. for e.g. // in x86/x64, int nintval = 0x12345678 in arm, int nintval = 0x78563412 how values stored following data types in arm? double char array i.e. char chbuffer[256] int64 please clarify this. regards, raphel endianess matters register <-> memory operations. in register there no endianess. if put int nintval = 0x12345678 in code have same effect on endianess machine. all ieee formats ( float , double ) identical in architectures, not matter. you have care endianess in 2 cases: a) write integers files have transferable between 2 architectures. solution: use hton*, ntoh* family of converters, use non-binary file format (e.g. xml) or standardised file format (e.g. sqlite). b) cast integer pointers. int = 0x18758...

css - Div clearfix remove white space -

Image
my website has header , menubar. i'd position them horizontally sticked each other this: header menu but happens is: header white space menu the code header: <div id="headersecure" class="clearfix"> <div class="headeritem"><a href="#">uitloggen</a></div> <div class="headeritem"><a href="#" onclick="loadx()">x</a></div> <div class="headeritem headerfoto"><a href="#" onclick="loadx(()">test</a></div> <div class="headeritem"><a href="#" onclick="loadq()">w</a></div> <div class="headeritem"><a href="#" onclick="loadqc()">contact</a></div> </div> the header css code: #headersecure { padding-left: 10%; ...

plot area width and height in HighCharts -

how can read width , height of plot area in highcharts chart? don't mean width , height of whole chart, of plot area, excludes x , y axes labels , borders. use chart.plotwidth , chart.plotheight .

html - How to stop images from showing the "blank document" icon while they are loading? -

Image
i have bunch of server-side generated images following html tags: <img width="75" height="75" src="/mycontroller/myaction/_ac=4d04359f-0d66-45d3-881c-b198e95a8215" data-idx="1"> the problem images show default "blank document" (or "missing image") icon , border while loading. looks this: after images loaded, icon of course disappears, , broder gets set 1 specified in css. i don't want create fancy preloaders , not, make "blank document" icon , default border go away. although user sees less second, still that's not because creates impression wrong images. how make icon not show while images being loaded? one idea set background images, cannot because images have transparent areas, , parts of background visible after image has been loaded. update workaround i noticed if not specify width , height, default missing icon , border not shown while image loading. workaround did following:...

c++ - Allocation of memory for return value in function and memory leaks -

i have function: char const* getdata() const { char* result = new char[32]; sprintf(result, "my super string"); return result; } adn show string on screen this: std::cout << getdata() << std::endl; or have class: class myclass() { char m_data[32] public: myclass(const char* data) { strcpy(m_data, data) } ; } and create instance of object: myclass obj = new myclass(getdata()); i allocate char* result = new char[32]; , never delete this. how should deal memory leak ? how should free memory ? c++ best feature comes deterministic object destruction (this point taken bjarne). it allows raii idiom. make sure read it, should clear should use objects manage resources. essentially, when write program, know when each object's destructor called. use knowledge @ advantage delegate resource management object destructor free resources (and make sure object destructed when want free resource ^^) as pointed in ...

events - Android: Numeric key register backspace pressed -

i have edittext accepts numeric numbers defined this: <edittext android:id="@+id/routeinit_price" android:layout_height="wrap_content" android:layout_width="120dp" android:layout_gravity="center_horizontal" android:lines="1" android:inputtype="numberdecimal"/> i validating if there valid input below enable/disable button. however, doesn't receive event on backspace/delete button pressed event. how can fix that? because when edittext empty button should diabled. edittext pricefield = (edittext)findviewbyid(r.id.routeinit_price); pricefield.setonkeylistener(new view.onkeylistener() { @override public boolean onkey(view view, int keycode, keyevent keyevent) { if(keyevent.getaction() == keyevent.action_up) { if(((edittext)view).gettext().tostring().length() > 0) ready.setenabled(true); else ...

java - Difference between shaHex , sha256Hex , sha384Hex , sha512Hex -

in apache commons-codec api difference between generating shahex, sha256hex, sha384hex, sha512hex? these static methods in digestutils class. these implementations of different algorithms in sha family. see this section of wikipedia page on sha summary of differences. and in fact javadoc digestutils makes clear methods implement functions.

html - jQuery - get all src of images in div and put into field -

i want modified this tutorial requirements there 1 problem me. i'm beginner jquery , image sources specifïc div , put them field. there variable images field , contain images want instead of image sources div , put them field images . know isn't such complicated don't know how it. the source here http://jsfiddle.net/s5v3v/36/ this variable image source on jsfiddle want fill div instead have there now: images = ['http://kimjoyfox.com/blog/wp-content/uploads/drwho8.jpg', 'http://kimjoyfox.com/blog/wp-content/uploads/drwho7.jpg', 'http://kimjoyfox.com/blog/wp-content/uploads/drwho6.jpg', 'http://kimjoyfox.com/blog/wp-content/uploads/drwho5.jpg', 'http://kimjoyfox.com/blog/wp-content/uploads/drwho4.jpg', 'http://kimjoyfox.com/blog/wp-content/uploads/drwho3.jpg', 'http://kimjoyfox.com/blog/wp-content/uploads/dr-whos-tardis.png', 'http://kimjoyfox.com/blog/wp-content/uploads/drwho...

jquery - Changing .scrollLeft on Firefox inside the scroll event causes lag -

the best way describe problem provide example: http://jsfiddle.net/kmpdg/ basically, if @ in chrome, scroll past page 2, should start moving whole page left show page 3 on right. works fine in google chrome, if try same example in firefox... @ point of transition, scrolling becomes slow , sluggish. i've tried running scroll function through simple function throttle events, worked-ish. in situation sluggishness gone, replaced few millisecond lag (obviously). have of guys got advice me here? // code included in case jsfiddle.net fails. $(function() { $('.totheright').css({ position: "absolute", left: "100%", width: "100%" }); $('#page3').css({ margintop: "40%" }); var page2offset = $('#page2').offset(); var page2width = $('#page2').width(); var scrollfunc = function() { var scrolltop = $(window).scrolltop(), scrollleft ...

javascript - jQuery Unexpected token ILLEGAL - line 1 -

i know has been asked before, i'm yet see problem on line 1. all of js files getting console error (in every browser). i'm loading jquery google libraries working fine , not getting error, jquery plugin (fancybox) getting error , code hasn't been touched. i have no idea why rest of files getting error working day yesterday , morning. i saw in few cases error caused unreadable characters, don't think have on page. the page can found @ http://b9media.co.uk/tbw . my own js file starts follows. $(document).ready(function() { // log-in functionality var signin = $('#signin'); var login = $('#login'); signin.click(function() { login.show(function() { login.css("margin-left", 0); }); signin.animate({opacity: 0}, 300, function() { signin.addclass('hide'); }); }); // move sign-up box on mobile var windowsize = $(window).width(); if (win...

javascript - Send only specific value to server in Django -

i have html code this: {% i, j, k in full_name %} {{ }} {{ j }} <input type="text" name="follow_id" value="{{ k }}" /> <input type="submit" value="follow"><br /> <br /> {% endfor %} the output looks this: user1 user_id_of_user1 follow_button user2 user_id_of_user2 follow_button user3 user_id_of_user3 follow_button if press follow button of user3 want send id of user3 can access in server this: followed_user = request.post['follow_id'] # process but, no matter follow_button press, user id of user1. how fix this? this not django issue, html issue. here work around: 1 form each user: {% i, j, k in full_name %} <form action="mydomain.com/mysubmiturl/" method="post"><!-- leave action empty submit same html --> {% csrf_token %} <!-- django server accept post requests csrf token --> {{ }} {{ j }} ...

ios - iOS5: Best method of forcing UI orientation programmatically -

[i know has been done death, , i'd ask follow questions on existing question not not having enough stackoverflow points make one:(] i'm after app store valid way of forcing existing ui re-orientate without having destroy main viewcontroller or view . work in fullscreen mode, i'm assuming can't use of toolbar approaches quoted. i'm interested in ios5. for ios6 have solution based on answers in how change device orientation programmatically in ios 6 . used solution includes forceportrait , variation changed can supply required orientation parameter. for ios5 have experimented suggestion of: [uidevice currentdevice] performselector:nsselectorfromstring(@"setorientation:") withobject:(id)uiinterfaceorientationportrait]; from how set device (ui) orientation programmatically? . works i'm worried rejected app store (complete no no us). has used on has app store approval and/or got better suggestion? check out: force rotate uiviewcont...

How to write an R function which assigns to the object of the calling environment? -

i have objects of class contain several matrices, , build function access , possibly modifies subset of such matrix. example: foo<-list(x=diag(1:4),y=matrix(1:8,2,4)) class(foo)<-"bar" attr(foo,"m")<-4 attr(foo,"p")<-2 rownames(foo$x)<-colnames(foo$x)<-colnames(foo$y)<-c("a.1","b.1","b.2","c.1") attr(foo,"types")<-c("a","b","b","c") now access , modify elements this: foo$x[attr(foo,"types")%in%c("c","b"),attr(foo,"types")%in%c("c","b")] foo$x[attr(foo,"types")%in%c("c","b"),attr(foo,"types")%in%c("c","b")]<-matrix(5,3,3) but instead of above, construct following type of function: modify<-function(object,element,types){ # check object proper class, # , element , types found in object # returns lo...

html - Getting the part of string from the URL using jQuery? -

this question has answer here: how parse url hostname , path in javascript? 20 answers i have following url in browser address bar http://localhost:8080/myapp/myscreen?username=ccc i need part /myscreen?username=ccc it, excluding root. how can using jquery? var = location.pathname + location.search if reason want hash (the # part of url), use instead: var = location.pathname + location.search + location.hash then, must remove app root path a : a = a.replace( "/myapp/", "" ); // or = a.substring( "/myapp/".length );

jQuery live to on, with $(this) -

i'm updating scripts working in jquery 1.9+ live removed , have convert on syntax. there examples on jquery documentation . documentation gives: $(selector).live(events, data, handler); // jquery 1.3+ $(document).on(events, selector, data, handler); // jquery 1.7 so $("a").live("click", handler) schould converted $(document).on("click","a", handler) , on. but how convert when have no selector ? in case inside plugin. $(this).live("click", handler) this not working: $(document).on("click",$(this), handler) --edit i need delegation, bind not solution. used inside plugin, code elem.live("click", handler) , elem selector, , $(this) . have no control on that. just use $(this).on("click", handler); or $(this).click(handler);

android - StyledAttributes from theme not properly loaded -

Image
i added custom attribute textview called font. automatically loads custom font. example xml: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" > <com.egeniq.widget.textview android:layout_width="match_parent" android:layout_height="44dp" app:font="myriadpro" android:text="@string/login_welcome" /> </relativelayout> the custom widget following in constructors: typedarray styledattrs = context.obtainstyledattributes(attrs, r.styleable.textview); string customfont = styledattrs.getstring(font); // snip. error occurs here the r.styleable.textview declared such: <?xml version="1.0" encoding="utf-8"?> <r...

sqlite - SQLiteDatabase Android + parse.com -

i want take data parse.com public void parsequerymap() { query = new parsequery("myobject"); query.findinbackground(new findcallback() { public void done(list<parseobject> myobject, parseexception e) { if (e == null) { ( int = 0; < myobject.size(); i++) { stranaget = myobject.get(i).getstring("country"); oblastget = myobject.get(i).getstring("district"); gorodget = myobject.get(i).getstring("city"); } } } and want make of data database android dbhelper dbhelper; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); dbhelper = new dbhelper(this); contentvalues cv = new contentvalues(); sqliteda...

c# - Creating a Service To Return a List -

within service1.svc file have following; [operationcontract] public list<accounts> getallaccounts() { string conn = "......"; list<accounts> accs = new list<accounts>(); sqlconnection _con = new sqlconnection(conn); sqlcommand sc = new sqlcommand("sql query....", _con); sqldatareader reader; _con.open(); reader = sc.executereader(); while (reader.read()) { accs.add(new accounts() { name = reader["name"].tostring(), qty = convert.toint32(reader["qty"]), weight = convert.todecimal(reader["weight"]), value = convert.todecimal(reader["value"]) }); } _con.close(); return accs.tolist(); } public class accounts { public string name { get; set; } public int qty { get; set; } public decimal weight { get; set; } public decimal value { get; set; } } i know sql correct , have printed contents of list screen ensure data there, problem have when try run s...

java - Wicket Session with more than one user logged in -

i building first java application wicket , have bit of problem wicket sessions. my problem: when second user logs application overrides session first user -> both working on second session now. although both users create new session when logging in. my code: wicketsession.java: public class wicketsession extends websession { private userbean currentuser; public wicketsession(request request) { super(request); } public static wicketsession get() { return (wicketsession) session.get(); } // getter/setter in application class: @override public session newsession(request request, response response) { return new wicketsession(request); } and login (short version w/o ifs, make readable): @override public final void onsubmit() { if (signin(wiausername, wiapassword)) { getsession().bind(); setresponsepage(new charlistdetail()); } else { error("unknown username/ password"); } } private boolean signin(string username, strin...

Using Identity and Access Management with Java -

i working java application , want implement single sign on , federation in java application. want implement claims aware application in java.how achieve that. there various identity provider implementing single sign on: http://en.wikipedia.org/wiki/list_of_single_sign-on_implementations

css - remove php extension using .htaccess -

i'm working on script, , want set links following: www.mysite.com/sign-up.php www.mysite.com/sign-up and www.mysite.com/profile.php?username=abc www.mysite.com/profile/abc i found code , works me. rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.+)$ $1.php [l,qsa] but when want access: www.mysite.com/profile/abc the stylesheet doesn't work, seems path has changed. links in profile become like: www.mysite.com/profile/ profile /filename.php it keeps adding /profile everytime how fix this? edit: files works fine stylesheet except profile.php you can create htacess , modrewrite of apache. just check link below generating dynamic url. might solve problem: url generation

php - aoColumns of datatables are not working properly -

i trying handle value of aocolumns other php page. not coming properly, whereas if use static value working. code : in php page $aocolumn = array("null","null","null","{bsortable: false}"); <input type="hidden" name="aocolumn" id="aocolumn" value="' . implode(",",$aocolumn) . '"> in js page var aos = $('#aocolumn').val(); var ao = (aos)?aos.split(","):[]; $.each(ao,function(i){ }); and in datatable declaration: "aocolumns":ao but not working. please let me know issue. in advance. update i got know that, in case aocolumns prints ["null", "null", "null", "{bsortable: false}"] whereas should [null,null,null,object{bsortable=false}] . how it? this fun 1 :-) taken setup 1:1 (just 3 columns though) : <? $aocolumn = array("null", "{bsortable: false}", "null...

Why I cannot resume uploading a video to youtube with a refreshed access token? -

i'm attempting use resumable api upload video youtube refreshed access token. i'm getting 401 when i've finished uploading resumed part of data. following message alongside 401: autherror invalid credentials but can upload new video refresh access token. this bug on server-side: https://stackoverflow.com/a/14320908/1970843 , https://code.google.com/p/google-api-python-client/issues/detail?id=231 , https://code.google.com/p/gdata-issues/issues/detail?id=5124

Is a TestNG data provider parameter in setUp method possible? -

i have init statements need done data provider parameter , want access data provider parameter value in @beforemethod setup method. possible? yes, totally possible. in @beforemethod annotated method, can pass optional built-in argument of object[] copy of parameters being passed @test method. in case, pass 2 args test method: @test(dataprovider="provider") public void dotest( testhelper testhelper, map<string,string> parammap ) { .... so, (and doesn't need factory dataprovider) : @beforemethod public void setup( object[] testargs ) { map<string,string> parammap = (map<string, string>)testargs[1]; testhelper testhelper = testargs[0]; string testname = parammap.get( "testcasename" ); log.logtcstep( "test case name: " + testname ); log.setlogtcname( testname ); testhelper.settestname( testname ); testhelper.settagsbystring( parammap.get( "browser" ) ); testhelper.se...

c# - When OnAuthorization method is called? -

i have implemented custom method making user information available views smth that: protected override void onauthorization(authorizationcontext filtercontext) { if (httpcontext.user != null) { httpcookie authcookie = request.cookies[formsauthentication.formscookiename]; if (authcookie != null) { formsauthenticationticket authticket = formsauthentication.decrypt(authcookie.value); javascriptserializer serializer = new javascriptserializer(); awesomeuser user = serializer.deserialize<awesomeuser>(authticket.userdata); if (user == null) { httpcontext.user = null; } else { httpcontext.user = new platformuser(typeof(dbmembershipprovider).name, user); } } else { httpcontext.user = null; ...

python - Read large file in parallel? -

i have large file need read in , make dictionary from. fast possible. code in python slow. here minimal example shows problem. first make fake data paste <(seq 20000000) <(seq 2 20000001) > largefile.txt now here minimal piece of python code read in , make dictionary. import sys collections import defaultdict fin = open(sys.argv[1]) dict = defaultdict(list) line in fin: parts = line.split() dict[parts[0]].append(parts[1]) timings: time ./read.py largefile.txt real 0m55.746s however possible read whole file faster as: time cut -f1 largefile.txt > /dev/null real 0m1.702s my cpu has 8 cores, possible parallelize program in python speed up? one possibility might read in large chunks of input , run 8 processes in parallel on different non-overlapping subchunks making dictionaries in parallel data in memory read in large chunk. possible in python using multiprocessing somehow? update . fake data not had 1 value per key. bet...

php - Trying to show jqmobile grid(trirand) in a jquery mobile windows -

using jquery mobile want pop dialog box user can enter in search filters , when submit query show jqmobile grid(trirand) inside modal window. possible. here code below: qr.php <?php require_once '../auth.php'; require_once '../jqsuitephp/jq-config.php'; // include pdo driver class require_once '../../jqsuitephp/php/jqgridpdo.php'; // connection server $conn = new pdo(db_dsn,db_user,db_password); // tell db use utf-8 $conn->query("set names utf8"); if(isset($_request['a'])) { //get asset information $conn = new pdo(db_dsn,db_user,db_password); $sql = "select asset_no, dept_id dept, short_desc, `loto #` loto mfg_eng_common.machine asset_no ='".$_request['a']."'"; $result = $conn->query($sql); $row = $result->fetch(pdo::fetch_assoc); //check see if active work order exists in mwo system current asset //status_id of 50 mean approved/closed $sql = "select count(*) wocnt mfg_eng_mwo.mwo ass...

c++ - Should std::array have move constructor? -

moving can't implemented efficiently (o(1)) on std::array, why have move constructor ? std::array has compiler generated move constructor, allows elements of 1 instance moved another. handy if elements efficiently moveable or if movable: #include <array> #include <iostream> struct foo { foo()=default; foo(foo&&) { std::cout << "foo(foo&&)\n"; } foo& operator=(foo&&) { std::cout << "operator=(foo&&)\n"; return *this; } }; int main() { std::array<foo, 10> a; std::array<foo, 10> b = std::move(a); } so std::array should have move copy constructor, specially since comes free. not have 1 require actively disabled, , cannot see benefit in that.

How to know a code in php run sucessfully or not -

i have fallowing code <html> <body> <?php if ($_get['run']) { # code run if ?run=true set. echo "hello"; exec ("chmod a+x ps.sh"); exec ("sh ps.sh"); } ?> <!-- link add ?run=true url, myfilename.php?run=true --> <a href="?run=true">click me!</a> now want know exec ("chmod a+x ps.sh") executing or not. should do?? exec(..., $output, $return); if ($return != 0) { // went wrong } capture return code supplying variable name third parameter. if variable contains 0 afterwards, good. if it's other 0 , went wrong.

java - Android Service Classpath -

i'm building application starts service uses internal android .jar file located @ /system/framework the problem whenever try access class .jar file, classdefnotfound exception. note: i'm able compile project stub 'd version of .jar file, don't know how include internal library in application (service) classpath rid of exception. (i'm not using eclipse) add androidmanifest.xml <uses-library android:name="com.android.library" /> from android documentation: http://developer.android.com/guide/topics/manifest/uses-library-element.html this element tells system include library's code in class loader package.

drupal 7 - Ccontent entity reference field storing entity ID in form, not value from view -

i trying use entity reference field in content type uses views filter limit fields in entity , place them in select list in new content form. works fine. when publish form, saves entity id - not values view returned select box. need in drupal ui include in features override. does know how accomplish this? thing have come entity reference view widget module, maintainer has placed note on module page stating should not used. here appreciated. you can try entityreference_dynamicselect_widget module . in case 2562 sites using entity reference view widget module add value module.

hibernate - How do I calculate the anniversary date in JPQL -

i'm using jpa2 i have queried in ms access in following way for example, find out anniversary in 2 years: select dateadd(year, 2, initialdate) anniv or find out how many years have passed since initial date: select datediff(year, initialdate, getdate()) yearspassed i'm not able find function in dateadd in jpql could 1 please me getting similar effect in jpql hibernate session provides dowork() method gives direct access java.sql.connection . can create , use java.sql.callablestatement execute function. here oracledb function example: session.dowork(new work() { public void execute(connection connection) throws sqlexception { callablestatement call = connection.preparecall("{ ? = call myschema.myfunc(?,?) }"); call.registeroutparameter( 1, types.integer ); // or whatever call.setlong(2, id); call.setlong(3, transid); call.execute(); int result = call.getint(1); // propagate enclosing class } }); or calcula...

groovy - Sending an email: no object DCH for MIME type multipart/mixed -

i'm trying send email using java code running groovyconsole. works fine when send email without attachments fails add in multipart logic attachments. edit: i'm using javamail version 1.4.7 this error i'm getting. javax.activation.unsupporteddatatypeexception: no object dch mime type multipart/mixed; boundary="----=_part_16_24710054.1375885523061" @ javax.activation.objectdatacontenthandler.writeto(datahandler.java:891) and it's happening on line transport.send(mimemsg) below. import java.util.properties; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; properties properties = new properties() session session mimemessage mimemsg properties.put("mail.smtp.host", "[my host ip]") session = session.getdefaultinstance(properties) mimemsg = new mimemessage(session) string recipient = "[to email address]" mimemsg.addrecipient(message.recipienttype.to, new internetaddress(recipient)) mi...

PHP include: failed to open stream: no such file in "/literally/the/exact/location/of/the/file"? -

so while trying include file in php, using include(/users/leonaves/sites/mysite/admin/inc/pages/dashboard.php) (i'm running locally), php tells me: failed open stream: no such file or directory in /users/leonaves/sites/mysite/admin/inc/page_request.php on line 86. i have tried including relative path, absolute path, declaring root in variable etc. etc. have no idea how make file include other. php refuses find @ exact location is. amazing, thank you. php executes scripts found in directories specified in open_basedir . path not allowed.

android - Get values of views inside listview item on click -

i have listview containing different xml layouts, each different views. wondering how can data views inside item user has clicked on, inside onitemclick method. my listview made of multiple layouts cannot know sure layout being pressed when onitemclick method called. example, 1 of items in layouts in listview is: // list_item.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <textview android:id="@+id/lblsub" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:padding="6dp" android:layout_marginright="4dp" android:text="" android:textcolor="#ffffff" android:text...

jquery - resend ajax request changing only one attribute -

i want make ajax request in success function need pass different 'guidlist'. $.ajax({ url: "my.ashx", datatype: 'json', type: 'post', data: { cmd: 3, //poll database job status guidlist: guidlist }, success: function(){ $.ajax(this);<-all same except need change passing in guidlist } }) create function send request - recursively call inside success handler. careful though avoid infinite loops. function sendrequest(param) { $.ajax({ url: "my.ashx", datatype: 'json', type: 'post', data: { cmd: 3, //poll database job status guidlist: param }, success: function(){ if(param == [something]) sendrequest(newparam); } }); } sendrequest(guidlist);

xml - Escape developer name umlauts in a Maven POM file? -

in <developers> section of pom.xml , if name contains non-7-bit-ascii characters, e.g. german umlauts ( ä ) or french accents ( é )—do need escape them somehow? because if view file mozilla, error: xml parsing error: undefined entity <name>foo b&eacute;r</name> -----------------------^ should type accents such , assume maven uses utf-8 decoding? one cannot use html named entities in xml. use utf-8 , full wysiwig. if encoding not listed in defaults utf-8.

javascript - How to dynamically change a combobox's searchAttr based on a radio button in dojo? -

i trying change value of searchattr of combo box based on radio button. here working snippet of have far. <html> <head> <title>test</title> <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dijit/themes/claro/claro.css"> <script> dojoconfig = { parseonload: true } </script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script> <script type="text/javascript"> require([ "dojo/store/memory", "dijit/form/combobox", "dojo/domready!" ], function(memory, combobox) { var infostore = new memory({ data: [{ "prop1": "a1", "prop2": "a2" }, { "prop1": "b1", "prop2": "b2"...

ios - Unreleased xcdatamodel versions and lightweight migration -

if have multiple unreleased xcdatamodel versions between release , release b, lightweight migration still work once release public if delete unreleased versions? here's more discrete example: xcdatamodel version 1.0 --> release public xcdatamodel version 1.1 --> unreleased (based on v1.0) xcdatamodel version 1.2 --> unreleased (based on v1.1) xcdatamodel version 1.3 --> release public b (based on v1.2) i want make sure when submit release b, users coming release migrated properly. or terrible way go it? understand if didn't care data on testing devices, base xcdatamodel version 1.3 on version 1.0 , put new in version - don't want lose data on testing devices have had versions of app v1.1 , v1.2 on device. thanks! assuming format used existing user data can converted current format via automatic lightweight migration, doesn't matter created internal, unreleased versions. what need include in released app: every version user might ...

excel 2010 - Varying validation drop-downs based on varying cell values -

i attempting have cells in column “u” deliver different drop-down menus based on corresponding value in column “d”. have created 7 named lists: list_117g list_152 list_jmet list_xband list_pacwind list_vortex list_rover those lists called based on 7 values in column “d”: g 152 j x d/e v r so far have been able work first category g . when change value of column d g 152 no longer drop-down. here formula using in list function of validation. =if(d6="g",list_117g,if(d6="152",list_152,if(d6="j",list_jmet,if(d6="x",list_xband,if(d6="d/e",list_pacwind,if(d6="v",list_vortex,if(d6="r",list_rover,))))))) what doing wrong? when type '152' cell, stored number. can change format of number (e.g. display currency, percentage, date, text, etc), value number unless use text formula display text. in if statement, if want compare cell value number, can't have quotes around it. example: ...

excel vba - VBA Copy IF Value Equals -

i wonder whether may able me please. firstly, i'm first admit, i've received stage, i'm little unsure past issue have code below. to give little background: what i'm trying do, perform check code looks @ list of projects on sheet "alldata" (source) sheet, starting @ cell e3, , copies cell if contains text value "enhancements" , pastes "enhancements" (destination) sheet. in addition, code takes 'actuals' manhour figure , date associated each project , totals manhours project , period respective cells on destination sheet (enhancements sheet). these "rval" , "rdate" variables. revised code - full working script sub extract() dim long, j long, m long dim strproject string dim rdate date dim rval single dim blnprojexists boolean sheets("enhancements").range("b3") = 1 .currentregion.rows.count - 1 j = 0 13 .offset(i, j) = "...

sql server 2008 r2 - Returning Output Paramters or Variables From SSIS Script Task / Script Component -

Image
is possible return output parameters ssis "script task" has been called stored procedure using xp_cmdshell? all samples have found far show how assign values dts package variables etc; , show them via message box every single sample see shows script task returning dts.taskresult = (int)scriptresults.success; or dts.taskresult = (int)scriptresults.failure ... basically, have script task gets several values dll call works anticipated; values verified message boxes; have not been able ferret out how return stored procedure executed ssis package. am missing obvious? please provide functional code example & or screen shots of control flow / data flow, etc., of how end end... e.g.: stored procedure -> execute *.dtsx package, passing parameters, including output parameters; , how same stored procedure can read output parameters in type of call; when results returned... thanks in advance. i don't know if possible return values in script task calling st...

pyhook - How to find files and save them to different folder in python -

i amt trying find relevant files , folders local repository. e.g. pulled projects git local machine , want search specific files(.txt) , save them new folder in same pattern (root->dir-> file). want rid of files doesn't match name , extension keep same format. in advance. you can traverse directory tree finding files want this: import os, fnmatch def find_files(directory, pattern): root, dirs, files in os.walk(directory): basename in files: if fnmatch.fnmatch(basename, pattern): filename = os.path.join(root, basename) yield filename def find_files_to_list(directory, pattern): file_list = [] root, dirs, files in os.walk(directory): basename in files: if fnmatch.fnmatch(basename, pattern): filename = os.path.join(root, basename) file_list.append(filename) return file_list then copy repository , this: wanted_files = find_files_to_list(...

devexpress - Delphi: Name of Method that is called for updating content of TxcDateEdit (or TEdit) control needed -

Image
i'm writing routine checks input of tcxdateedit (from devexpress). after number typed in, should check , try autocomplete rest of content. in case, if user types in day in empty tcxdateedit control should automatically fill in current month , year. the problem need fire autocompletion method after number typed user , visually added in tcxdateedit control. can check actual input. i'm searching name of method used control update tcxdateedit . don't mean method implies focus lost, mean method called typing in control after (or while) each typed key added string variable content of control. i'm pretty sure similar method exists in common tedit control. if tell me name of method thankful. thanks in advanced! what ask possible using onchange event of properties , shown in following image using event , editingtext property edit, can use following code: uses dateutils, strutils; procedure tform1.cxdateedit1propertieschange(sender: tobject); var mo...