Posts

Showing posts from February, 2012

css3 - Apply transitions on :hover not :active -

i'm not sure if it's possible, here did: a { background-color: white; transition: 1s; } a:hover { background-color: grey; } a:active { background-color: black; } but transitions not apply on :active (just on :hover), tried this: a { background-color: white; } a:hover { background-color: grey; transition: 1s; } a:active { background-color: black; } and result same (except effect not reversed). possible in full css. thanks! a { background-color: white; transition: 1s; } a:hover { background-color: grey; } a:active { background-color: black; transition: none; } markup: <menu type=list> <li><a>home</a></li> <li><a>work</a></li> <li><a>contact</a></li> <li><a>about</a></li> </menu> demo: http://jsfiddle.net/7nwlf/

Hide 0 values in Stacked Column Chart in Highcharts -

i want remove 0-values stacked column chart in highcharts. @ this: http://jsfiddle.net/4nxyh/ at "15.08." see top value "0" confusing. how can hide this? how can hide "low" values top "1" on "14.08." doesn't overflow area? this code i'm using: chartoptions = { chart: { type: 'column' }, title: { text: '' }, xaxis: { categories: ["14.08","15.08","16.08","17.08","18.08","19.08","20.08","21.08","22.08","23.08","24.08","25.08","26.08","27.08","28.08"] }, yaxis: { min: 0, title: { text: '' }, endontick: false, maxpadding: 0.0, stacklabels: { enabled: true,...

xcode - iOS compile error: No visible @interface for 'CDViewController' declares the selector -

since switched ios project arc, keep getting compiler error: no visible @interface 'cdviewcontroller' declares selector 'setuseagof:' in line: [self.viewcontroller setuseagof:false]; in file: appdelegate.m #import "appdelegate.h" #import "mainviewcontroller.h" #import <cordova/cdvplugin.h> #import "nsstring+md5.h" @implementation appdelegate @synthesize window, viewcontroller; - (bool)application:(uiapplication*)application didfinishlaunchingwithoptions:(nsdictionary*)launchoptions { // (...) [self.viewcontroller setuseagof:false]; // <-- here // (...) return yes; } @end although method defined: mainviewcontroller.h #import <cordova/cdvviewcontroller.h> #import <adtechmobilesdk/adtechmobilesdk.h> @interface mainviewcontroller : cdvviewcontroller <atinterstitialviewdelegate>{ atinterstitialview *interstitial; } - (void)setuseagof:(bool)useagofparam; @end @inter...

java ee - Gradle BuildException in NetBeans -

i want run gradle java ee project using netbeans on ubuntu 12.04. error - project output: build failure: gradle run org.gradle.tooling.buildexception: not execute build using gradle distribution 'http://services.gradle.org/distributions/gradle-1.7-bin.zip' my gradle -version output: ------------------------------------------------------------ gradle 1.7 ------------------------------------------------------------ build time: 2013-08-06 11:19:56 utc build number: none revision: 9a7199efaf72c620b33f9767874f0ebced135d83 groovy: 1.8.6 ant: apache ant(tm) version 1.8.4 compiled on may 22 2012 ivy: 2.2.0 jvm: 1.6.0_27 (sun microsystems inc. 20.0-b12) os: linux 3.2.0-52-generic-pae i386 and build.gradle file: apply plugin: 'java' apply plugin: 'war' mainclass = "main.main" sourcecompatibility = '1.7' [compilejava, compiletestjava]*.options*.encoding = 'utf-8' if (!hasproperty...

android - Splash screen doesn't load -

part of project want use splash screen. fine code, unfortunately splash screen doesn't load @ starting. manifest file is <activity android:label="@string/app_name" android:name="com.example.gameplay.splashscreen" android:configchanges="orientation|keyboardhidden" android:theme="@android:style/theme.wallpaper.notitlebar.fullscreen" android:screenorientation="landscape"> </activity> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> <activity android:name="com.example.gameplay.game" android:configchanges="orientation|keyboardhidden" android:theme="@android:style/theme.wallpaper.notitlebar.fullscreen" android:screenorientation="landscape" android:label="@strin...

c# - wpf mvvm recursive tree -

Image
i have 2 classes public class leaf { public string name { get; set; } } and public class node { public observablecollection<node> nodelist = new observablecollection<node>(); public observablecollection<leaf> leaflist = new observablecollection<leaf>(); public observablecollection<node> prop_nodelist { { return nodelist; } set { nodelist = value; } } public observablecollection<leaf> prop_leaflist { { return leaflist; } set { leaflist = value; } } public string name { get; set; } } as can see work roads or tree. node can have information on node , leaf. i show in user control tree formated that nethead main node, , have 2 node (b, a). node have 2 node(b,c) , 2 leaf (a1, a2). dont mvvm. when mvvm like from c# im doing only this.datacontext = mainnode; // node hold everething (its named nethead) from xaml its <grid> <treeview itemssource="{binding prop_nodelist}"> ...

Object-level Restrictions not working (Facebook App) -

as described -here- wanted restrict app it's accessible 1 country using following tag, it's not working, can access app switzerland (ch). idea problem be? <meta property="og:restrictions:country:allowed" content="de" /> the object level restrictions apply open graph content, not applications. presume trying add meta tag html content in app. from bug filed on facebook: https://developers.facebook.com/x/bugs/343431899129688/

regex - Convert multiple Unicode in a string to character -

problem -- have string, buna$002c_texasbuna$002c_texas ' , $ followed unicode. want replace these unicode respective unicode character representation. in perl if unicode in form of " \x{002c} converted respective unicode character. below sample code. #!/usr/bin/perl $string = "hello \x{263a}!\n"; @arr= split //,$string; print "@arr"; i processing file contain 10 million of records. have these strings in scalar variable. same above substituting $4_digit_unicode \x{4_digit_unicode} below. $str = 'buna$002c_texasbuna$002c_texas'; $str =~s/\$(.{4})/\\x\{$1\}/g; $str = "$str" it gives me buna\x{002c}_texasbuna\x{002c}_texas it because @ $str = "$str" , line $str being interpolated, not value. \x{002c} not being interpolated perl. is there way force perl interpolate contents of $str too? or is there method achieve this? not want take out each of unicodes pack using pack "u4",0x002c , substitut...

c# - how to remove file format using substring -

i struggling understand how substring works in c#. how use substring in c# remove file format? from : test.xml to: test although path.getfilenamewithoutextension normal way it, can substring . first have find period. string name = "test.xml"; int pos = name.lastindexof('.'); if (pos >= 0) { name = name.substring(0, pos); }

android - My app closes device low memory -

i developing app android 4.0 uses services. app works fine , not crash. however, when start heavy app on galaxy s3 app closes, example. when use candy crash app crashes no reason. is because device on low memory , app doesn't close correctly? or maybe because use getapplicationcontext() inside service? my service activated on specific time. thanks help. can see problem downloading https://play.google.com/store/apps/details?id=com.digicode.keepintouch this code of service: public void startremindersservice(context context) { intent myintent = new intent(context, myalarmservice.class); myintent.putextra(constants.contact_id, "-1"); int id = 2; pendingintent pendingintent = pendingintent.getservice(context, id, myintent, pendingintent.flag_update_current); calendar calendar = calendar.getinstance(); calendar.set(calendar.hour_of_day, 8); calendar.set(calendar.minute, 55); calendar.set(calendar.second, 0); c...

asp.net mvc 4 - Cannot read property 'opacity' of undefined -

i loading fine uploader in manner: var uploader = new qq.fineuploaderbasic({ button: $("#docaddhref"), request: { endpoint: 'server/handleuploads' }, validation: { allowedextensions: ['jpeg', 'jpg', 'gif', 'png'], sizelimit: 204800 // 200 kb = 200 * 1024 bytes }, callbacks: { onsubmit: function (id, filename) { $messages.append('<div id="file-' + id + '" class="alert" style="margin: 20px 0 0"></div>'); }, onupload: function (id, filename) { $('#file-' + id).addclass('alert-info') .html('<img src="client/loading.gif" alt="initializing. ple...

javascript - Angular data-binding after setting input value with karma -

my question extremely close 1 : update angular model after setting input value jquery but, here, input modified val() method of karma runner : element('#stuff_input').val('thenewvalforstuff'); i won't detail test here, irrelevant. guess test fail if binding not maintained. in production, #stuff_input modified keyboard user, never jquery method of course. don't want use $watch, don't want introduce more complexity production code because : 1) karma not allow keyboard input natively 2) karma event not maintain data-binding val() any idea of how solve ? thanks

atlassian sourcetree - How can you get one file out of a another branch of a Git repository/ -

i'm using git. have code in 1 branch want get. there easy way version of 1 file different branch or easy way make other branch appear in directory of file system? just clear, want have other version examine, don't want replace version have it. i'm using sourcetree, i'd happy accept command line based answers well? i think (from last entry in documentation git checkout), you're after (not sure sourcetree though, sorry): git checkout mybranch -- mypath/myfile source: https://www.kernel.org/pub/software/scm/git/docs/git-checkout.html git checkout [-p|--patch] [<tree-ish>] [--] <pathspec>… when <paths> or --patch given, git checkout not switch branches. updates named paths in working tree index file or named <tree-ish> (most commit). in case, -b , --track options meaningless , giving either of them results in error. <tree-ish> argument can used specify specific tree-ish (i.e. commit, tag or tree) u...

Calling a C callback function from C++ via a lambda -

i have code in plain c static library: extern "c" { typedef void (__cdecl* visitchildren)(option*); void __cdecl dovisitchildren(children* list, visitchildren visitor); } and i'm trying use c++ code (unit tests) using lambda. ... dovisitchildren(children, [&] (option* option) { ... }); i'm getting compiler error c2664 ... cannot convert parameter 2 'unittests::unittest1::testbuild::<lambda_b286d160b9bab3e09ab93cd59fc49f0b>' 'visitchildren' if remove capture '&' compiles , works, need capture bits , bobs. is possible? a closure created lambda expression can implicitly converted function pointer, if not capture variables. also, converted pointer extern "c++" function, not extern "c" function, , technically incompatible types. so no, can't this. a hacky workaround store actual closure in global variable , pass callback invokes it. work if program single-threaded , dovisit...

android - Sony Xperia Z Tablet not found by adb -

i got sony xperia z tabled , deploy/debug xamarin.droid projects on it. did: * connected tablet dev machine * enabled developer options in devices settings * enabled usb debugging * tablet installed drivers on dev machine , recognized windows explorer , device manager "portable device - sony xperia" so seems fine me. however, when using "adb devices", device won't show up. system restart, tablet restart , "adb kill-server"&"adb start-server" did not help. am missing anything? can please give me hints check additionally or problem might be? i running windows 8 x64, in case matters. if have bought new phone remember activate developer rights : settings -> phone -> build number tap 7 times on build number , "developer options" appear on settings menu. i tried method sony xperia compact z3 , works!

character encoding - Appropriate charset for Android and Webservices -

Image
i have app retrieves user's data such name, , sends remote database web services. i'm facing issues special accents in name 'tağıyeva' the name stored ta?ıyeva in db. this use send data static string postdata(list<namevaluepair> namevaluepairs, string url) { inputstream ips = null; try { httpconnectionparams.setconnectiontimeout(httpparameters, timeoutconnection); httpconnectionparams.setsotimeout(httpparameters, timeoutsocket); defaulthttpclient httpclient = new defaulthttpclient(httpparameters); httppost httppost = new httppost(myinternetmanager_class.url+url); httppost.setentity(new urlencodedformentity(namevaluepairs)); // execute http post request httpresponse response = httpclient.execute(httppost); ips = response.getentity().getcontent(); string contentasstring = istostring(ips); if (myinternetmanager_class.debug...

JQuery Mobile Select Keyboard Operation not working? -

if tab jquery mobile (1.2 - 1.3) enhanced select, expect [down arrow] either select options or open selectable options if had clicked/tapped on select. finding underlying select apparently being made, options list not shown , visible selected option not changing. see http://jsfiddle.net/f9w67/ <form> <div data-role="fieldcontain"> <input id="start" type="text" placeholder="start here , tab"> <select name="select-native-1" id="select-native-1" onchange="alert($('#select-native-1').val())"> <option calue="0">choose keyboard ...</option> <option value="1">the 1st option</option> <option value="2">the 2nd option</option> <option value="3">the 3rd option</option> <option value="4">the 4th option</option> </select> ...

javascript - jQuery select add update and remove -

xample: considering have 2 hotel rooms can sold 2 options bb or hb, when change option of select 1 (taking 1 room in bb) or change option of select 2 (taking 1 room in hb, selecting again option 1 or option 2 number of rooms still available must result 1 <script> $(document).ready(function() { $('#rates1').change(function() { var val = parseint($(this).val()); var optionlength = ($('#rates1 option').length); var optionremove = optionlength - val - 1; //alert(optionremove); $('#rates2 option').remove(); }); }); </script> <select id="rates1" class="selectclass"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select><br /> <select id="rates2" cl...

c# - order list of objects by date -

i have following: list<object> mylist = new list<object>(); mylist.orderby(x => x.date); i need order mylist date, because it's list of objects i'm having trouble re-ordering it. i believe can using ienumerable: ienumerable<object> receiveddata = new list<object>(); but i'm not sure how order it. tips? thanks! you may use reflection var orderedlist = mylist .orderby(x => x.gettype().getproperty("date").getvalue(x, null)).tolist();

sql - How should data be provided to a web server using a data warehouse? -

we have data stored in data warehouse follows: price date product name (varchar(25)) we have 4 products. changes infrequently (on average once every 10 years). once every business day, 4 new data points added representing day's price each product. on website, user can request information entering date range , selecting 1 or more products names. analytics shows feature not heavily used (about 10 users requests per week). it suggested data warehouse should daily push (sftp) csv file containing data (currently 6718 rows of data , growing 4 each day) web server. then, web server read data file , display data whenever user made request. usually, push once day, more 1 push possible communicate (infrequent) price corrections. in price correction scenario, data delivered in file. problems approach? would better have web server make request data warehouse per user request? or have issues such greater chance network errors or performance issues? would bette...

The elegant way to replace specific characters in Python -

i have strings unpredictable in terms of character content, know every string contains 1 character '*'. how replace 2 characters after '*' non hard-coded string. non hard-coded string calculated checksum , converted string: checksum_str = str(hex(csum).lstrip('0x')) you want like: star_pos = my_string.find('*') my_string = my_string[:star_pos] + '*' + checksum_str + my_string[star_pos + 3:]

image processing - How do I create a histogram which can be used for calcBackProject in opencv? -

i have specified histogram as matnd skincrcbhist =mat::zeros(size(256,256),cv_8uc1); ellipse(skincrcbhist, point(113, 155.6), size(283.4, 159.2), 43.0, 0.0, 360.0, scalar(255), -1); // using big ellipse find sort of projection in crcb domain. cvtcolor(src, ycrcb, cv_bgr2ycrcb); //src input, image of person float crrange[]={0,255}; float cbrange[]={0,255}; const float* ranges[]={crrange,cbrange}; int channelsy[]={1,2}; calcbackproject( &ycrcb, 1, channelsy, skincrcbhist, backproj, ranges, 255, true ); imshow("bp",backproj); the problem face backproj shows black image. when used normal histogram created calchist on natural image, sort of backprojection. how use histogram, create artificially, specifying ellipse, backprojection. if understood problem correctly, use mask original calchist function. you didn't specified version of opencv using, assume latest 2.4.6.0. method prototype following (omitting defaults, , types): calchist(images, nimages, c...

c# - Regex to get url from HTML -

i'm using following regex (which found online) obtain urls within html page; regex regex = new regex(@"url\((?<char>['""])?(?<url>.*?)\k<char>?\)"); works fine html below; <div style="background:url(images/logo.png) no-repeat;">uk</div> however returns more need when html page contained following javascript, returning 'destpage' function buildurl(destpage) i tried following regex include colon, appears invalid :url\((?<char>['""])?(?<:url>.*?)\k<char>?\) any appreciated. to urls, use htmlagilitypack instead of regex. example page htmldocument doc = new htmldocument(); doc.load("file.htm"); foreach(htmlnode link in doc.documentelement.selectnodes("//a[@href"]) { } you can expand on obtain style urls by, example, using //@style style nodes , iterating through extract url value.

php - How to get relative links work in wamp or set wamp/www/mysite to act as the root? -

my website lives in wamp/www/mysite. there index.php , other files live in wamp/www/mysite/foo. inside foo dir there 2 include-files, header.php , footer.php. relative links in 2 files not work properly. act wamp/www root dir. i have tried both ways: /foo/somepage.php , foo/somepage.php on live server works perfect. how can fix that? os: windows 7 on wamp relative link /foo/somepage.php point wamp/www/foo/somepage.php , not wamp/www/mysite/foo/somepage.php your site may work on wamp using relative links, need install on root wamp/www or configure virtual hosts see how setup virtual hosts on wamp

api - Magento 1.7 - send email to customer after chanfing status to shipped -

in magento 1.7, programatically trigger sending of email after programatically changing status shipped. in code below, status changed email not sent. there bug in api, or maybe using wrong. function setshiporder($orderid){ // check if valid order number try{ $order = $this->soapobject->call($this->sessionid, 'sales_order.info', $orderid); } catch (soapfault $e){ output_error_xml(1600); } // try ship try{ $newshipmentid = $this->soapobject->call($this->sessionid, 'sales_order_shipment.create', array($orderid, array(), 'order has been shipped', true, true)); $this->outputordersuccessxml("your order" . $orderid . " shipped" , $newshipmentid); } catch (soapfault $e){ ... } } ...

mysql - phpmyadmin is no longer letting me set auto_increment value -

i used able set auto_increment value in phpmyadmin->table->operations, no longer see in box: http://puu.sh/4dhf4.png it used right under there, yes table has auto_increment field. i'm using phpmyadmin 4.4.0, , tried switching innodb myisam. i'm logged phpmyadmin root. i'm not sure why removed feature, way "old school" click on sql tab , run following mysql command: alter table `sessions` auto_increment = 12345 this set auto increment counter 12345 (or 1 more highest value in 'sessions' table).

php - I can't get Codeigniter's file upload feature to work -

i tried going through codeigniter documentation , example in stackoverflow find solution problem didnt help. here codes have uploading image. using upload library through autoload. this function in controller: public function do_upload() { $config['upload_path'] = './assets/dorm_images'; $config['allowed_types'] = 'jpg|png'; $config['max_size'] = '100'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $config['remove_spaces'] = true; $this->load->library('upload', $config); $this->upload->do_upload("userfile"); } this form submitted: <?php $attributes = array('id' => 'listing_form'); echo form_open_multipart('dorm/list_dorm',$attributes);?> <input type="text" name='name' placeholder='name'><br> <input type="text" name...

How can I test that a java applet is loaded using javascript? -

the applet own, calling ready() returns "yes". first tried embedding applet this: <object id="appletie" classid="clsid:8ad9c840-044e-11d1-b3e9-00805f499d93" width="100%" height="100%" codebase="myapplet.jar"> <param name="archive" value="myapplet.jar" /> <param name="code" value="mypackage.myclass" /> <param name="myparam" value="my param value" /> <embed id="applet" mayscript=true type="application/x-java-applet;version=1.6" width="1px" height="1px" archive="myapplet.jar" code="mypackage.myclass" pluginspage="http://java.com/download/"> </object> i tried check loaded javascript calling ready() on document.ready this: got error (typeerror: $(...

perl - open file in folder with unicode name on Windows -

i have folder on usa windows 7 computer titled "フォルダ". there's file in called "foo.txt", , put few lines of text in it. i'm trying read it, apparently sticky problem. answer related question had simple-looking method open file: use utf8; use encode::locale; use encode; $path = 'c:\users\my name\desktop\logrus_workspace\フォルダ\foo.txt'; $new_path = encode(locale_fs => $path); print $new_path; open $fh, '<', $new_path or die $!; the call open dies invalid argument . idea specific problem message indicates, , how can unicode-named file open? use win32::unicode::native or path::class::unicode .

Calculate percentage ratio from sum amount in mysql database in php -

i have total_amount ($total_amount_column) total sum of amount column down there. in database, have multiple entry called name , have amount associated them. so looks in table called "envelope_sub" name |amount |percentage house |1550.00 | electricity |400.00 | internet |50.00 | what need calculate automatically percentage column based on total amount sum column. in other words, need percentage ratio each entry , insert them automatically in respective percentage field in database. how can achieve please. here's how did it <?php $query = "select * stats user_id='".$nameid."' $where order week desc"; $result = mysql_query($query) or die(mysql_error()); $worked_week = mysql_num_rows($result); if(mysql_num_rows($result)) { $k = 1; while ($row_stats = mysql_fetch_array($result)) { // total sect...

Unique representations of Python objects -

let c python class , assume constructor of c takes integer argument. consider instructions x = c(0) y = c(0) the default behavior of python implies x , y occupy 2 different place in memory. is possible force x , y share same place in memory? i happy if python decorator makes job. [note] looking way memoize constructors (see http://en.wikipedia.org/wiki/memoization memoization of functions). [add] sage open source mathematics software provides solution problem through class uniquerepresentation (see here ). class should inherit 1 have expected behavior. nevertheless, wondering if there pure python solution problem. you may want use lru_cache . if class definition is @lru_cache(maxsize=32) class c(object): def __init__(self, num): self.num = num then behaves like >>> = c(1) >>> a.num = 2 >>> b = c(1) >>> b.num 2 >>> b true however, makes name c function, , class features aren't usabl...

android - Is there a adt bundle for Linux Ubuntu? -

so far have looked on interwebs , can not find adt bundle linux ubuntu. there link 1 or there way setup ubuntu if there how. please let me know if miss spelled thing wrong or did not ex plane thing well. i'm using adt bundle linux straight http://developer.android.com on ubuntu. site walks through how set , started. not needs done package manager.

ios - Replace "0" with blank character in String -

this question has answer here: nsstring removing initial zeros? 5 answers i have nsstring @"05205" or @"05931" or so. want remove leading 0 characters. e.g. @"05205" in @"5205" or @"00072" in @"72" . how can achieve in objective-c? if convert string integer , string, trim leading zeros. nsstring *s = @"0072"; nsstring *newstring =[ nsstring stringwithformat:@"%d",[s integervalue]];

c# - XML data sent to Chrome browser does not trigger file save dialog -

in our code, there option export metadata xml file. code below: string xml = toxml(metadatas, files); context.response.addheader("content-type", "application/octet-stream"); context.response.addheader("content-disposition", "attachment; filename=video_metadata.xml;"); context.response.write(xml); context.response.flush(); context.response.end(); this works fine in firefox. click button , prompted save xml file. however, in chrome, there no save file prompt. using fiddler, can see xml data there in response, , has status code of 200. there no errors shown on web server, , client side shows no indication of error, either. doesn't recognize data sent save file. any appreciated. on same web server, able export csv files headers such: context.response.addheader("content-type", "application/vnd.ms-excel"); context.response.addheader("content-disposition", "attachment; filename=assetlist.csv;"); ...

How can you easily calculate the square root of an unsigned long long in C? -

i looking @ question ( here ) looking way square root of 64 bit integer in x86 assembly. this turns out simple. solution convert floating point number, calculate sqrt , convert back. i need similar in c when equivalents i'm getting little stuck. can find sqrt function takes in doubles. doubles not have precision store large 64bit integers without introducing significant rounding error. is there common math library can use has long double sqrt function? function sqrtl() , taking long double , part of c99. note compilation platform not have implement long double 80-bit extended-precision. required wide double , , visual studio implements plain double . gcc , clang compile long double 80-bit extended-precision on intel processors.

ios - CoreData: removal of 'didSave' notification immediately after save: call. Too soon? -

-(void)somebackgroundtask { nsmanagedobjectcontext *context = [[nsmanagedobjectcontext alloc] initwithconcurrencytype:nsconfinementconcurrencytype]; [context setpersistentstorecoordinator:[self coordinator]]; // ... nsnotificationcenter *notificationcenter = [nsnotificationcenter defaultcenter]; [notificationcenter addobserver:self selector:@selector(handlesavenotification:) name:nsmanagedobjectcontextdidsavenotification object:context]; [context save:&error]; // safe? [notificationcenter removeobserver:self name:nsmanagedobjectcontextdidsavenotification object:context]; // ... } // meanwhile on main thread... -(void)handlesavenotification:(nsnotification *)notification { [[self context] mergechangesfromcontextdidsavenotification:notification]; } is safe remove observer after call save: ? as long you've received notification want, it's not soon. there other problems code. it doesn't make sense add observer, trigger n...

importing modules from a folder in portable python -

i've python in usb stick , i'm designing recursive descent parser . the main script recursive.py run following code command prompt. python.exe compiler\recursive.py<compiler\rd_input my directory structure python.exe compiler\ recursive.py rd_input in code i'm generating python script 3 functions. compiler\ recursive_header.py which need import in main script recursive.py later. i've tried import recursive_header , import compiler\recursive_header , import compiler/recursive_header it's showing error traceback (most recent call last): file "compiler\recursive.py", line 74, in <module> import recursive_header importerror: no module named recursive_header i've tried solution given here . same error. also tried import sys sys.path.append('/compiler') import recursive_header here error numbers increased mentioning sys . how can import compiler\recursive_header.py in script. ...

c# - WebException Response attribute returns null -

i'm scanning single url has many paths example: http://url.com/path1 1000 . webexception in catch block, throw nullreferenceexception error if don't use line if (x.status == webexceptionstatus.protocolerror && x.response != null) so question this: code below fix error or ignore it? error don't have specific path error random http://url.com/path10 or other link :) catch (webexception x) { if (x.status == webexceptionstatus.protocolerror && x.response != null) { httpwebresponse response = (httpwebresponse)x.response; if (response.statuscode == httpstatuscode.notfound) { listbox3.items.add(listbox1.items[i].tostring()); } } } according documentation webexception.response property if response available internet resource, webresponse instance contains error response internet resource; otherwise, null . so, if understand question correctly, is necessary test webexcept...

facebook - iOS Social Framework to post to friends wall -

my underlying goal allow user of app invite facebook friend use app, either posting story friend's timeline, or sending them private message. my hope using ios social framework exclusively. my immediate questions twofold: can use slcomposeviewcontroller post friend's wall, or limited posting app user's wall? if slcomposeviewcontroller cannot used that, recommended method doing (again, within social framework)? thanks! friend invite not possible in fecebook sdk..but u can send message friend easily..

java - Filter location updates when using LocationManager requestLocationUpdates method -

i ios developer learning android , please bear me. on ios when getting location updates have sure filter , throw out invalid locations. check things outdated locations based on timestamp, inaccurate locations, etc. is there preferred way on android or needed? far checking location got not nil: // other code start locationmanager ... @override public void onlocationchanged(location location) { if (location != null) { // stuff here } } it's not needed. however, encourage @ new location services apis offered in google play services ( http://developer.android.com/google/play-services/location.html )

PHP - cURL Get response body -

Image
how can print response content url because preview empty $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_referer, $ref); curl_setopt($ch, curlopt_cookiejar, cookie.txt'); curl_setopt($ch, curlopt_cookiefile, cookie.txt'); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_useragent, "mozilla/5.0 (windows; u; windows nt 5.1; rv:1.7.3) gecko/20041001 firefox/0.10.1"); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $post_fields); $output = curl_exec($ch); curl_close($ch); picture: you need echo out response echo $output; i noticed missing single quotes around name of cookie file , cookie jar.. should become curl_setopt($ch, curlopt_cookiejar, 'cookie.txt'); curl_setopt($ch, c...

separate output with comma in python 3 -

i need separate out comma print 1,2,fizz ect for x in range (1, 21): if x%15==0: print("fizzbuzz",end=" ") elif x%5==0: print (("buzz"),end=" ") elif x%3==0: print (("fizz"),end=" ") else: print (x,end=" ") i can add comma " " list print comma @ end 1,2,fizz,4,buzz,fizz,7,8,fizz,buzz,11,fizz,13,14,fizzbuzz,16,17,fizz,19,buzz, i've gone on notes , went on python tutorials not sure how rid of last comma or use more effective method rather add comma in instead of space. i asked before confused wording question came out real confusing. understand may simple first time programming noob. lecturer hasn't explained me how can this. use help/ pointers. thanks. instead of printing them immediately, put list of strings. join list commas , print resulting string.

android - Activities vs. Fragment Implementation -

i having trouble working activities , fragments. in stages of app development , looking design efficient way of integrating 2 separate screens. the first screen "splash screen", present user logo, ability enter user information , sign in through either database or facebook. there button available allow user register app. the second screen allow user set account defining user information , include register button , connect facebook button. i know how approach task @ hand had designed app designating 2 activities handle each screen. recently, have switched being able host screens 2 fragments under 1 activity. what benefits of each approach , design opt for? fragments allowing display 2 separate uis side-by-side on large-format devices. fragments can combine code , ui within single layout, , allow non-ui "activities", give flexibility in showing various views attached activity. i'd choose 2 activities, since you're describing progression ...

python - Why are Lists faster than character arrays for string concatenation -

in article linked below, author compares efficiency of different string concatenation methodologies in python: http://www.skymind.com/~ocrow/python_string/ one thing did not understand is, why method 3 (mutable character arrays) result in slower performance method 4 (joining list of strings) both of them mutable , think should have comparable performance. "both of them mutable" misleading bit. it's true in list-append method, list mutable. building list isn't slow part. if have 1000 strings of average length 1000, you're doing 1000000 mutations array, 1000 mutations list (plus 1000 increfs string objects). in particular, means array have spend 1000x time expanding (allocating new storage , copying whole thing far). the slow part list method str.join call @ end. isn't mutable, , doesn't require expanding. uses 2 passes, first calculate size needed, copy it. also, code inside str.join has had (and has continued have since articl...

Why would VBA TypeOf operator fail in EXCEL -

i have been fighting excel 2007 problem several days now. below listing of facts can think of might relevant: idetailsheet class declared in vba project several methods, , throws error in class initializer cannot instantiated (making abstract). option explicit set in modules. ten worksheets in vba project implement *idetailsheet* , compile cleanly (as entire project). cdetailsheets class declared in vba project wraps collection object , exposes collection object collection of idetailsheet . exposes additional methods perform methods of idetailsheet on collection menmbers. in class initializer (called workbook _ open event handler , assigned global variable), cdetailsheet executes following code populate private collection detailsheets : dim sht excel.worksheet each sht in activeworkbook.worksheets if typeof sht idetailsheet then dim detailsheet idetailsheet set detailsheet = sht detailsheets.add detailsheet, detailsheet.name end if next sht ...

javascript - array.map function not supported in IE8 standards? -

i don't have ie8 testing ie8 within ie10. when switch "ie8 standards" document mode, javascript map function of array object gives javascript error: object doesn't support property or method 'map' but when switch "standards" document mode, there's no error. mode should test under? if ie8 doesn't support map function, there way emulate it? it's not supported, mdn provides shim close specification: // production steps of ecma-262, edition 5, 15.4.4.19 // reference: http://es5.github.com/#x15.4.4.19 if (!array.prototype.map) { array.prototype.map = function(callback, thisarg) { var t, a, k; if (this == null) { throw new typeerror(" null or not defined"); } // 1. let o result of calling toobject passing |this| value argument. var o = object(this); // 2. let lenvalue result of calling internal method of o argument "length". // 3. let len touint32(lenvalue). var...

Existing SQL Server 2008 script improvement -

sql server 2008 have 2 tables orderids , itemids. need resulting table each orderid forst table linked orderid second table number of identical itemids maximum. i did script using 2 loops if number of orderids in tables big (~1000) means loop has run 1000x1000 times, might long. ca achieved in better way? see below written script: drop table #match, #orderrec, #ordersent create table #match( orderidrec int null, orderidsent int null) create table #orderrec( orderidrec int not null, itemid int null) create table #ordersent( orderidsent int not null, itemid int null) insert #orderrec values (1, 1) insert #orderrec values (1, 5) insert #orderrec values (1, 7) insert #orderrec values (1, 4) insert #orderrec values (1, 15) insert #orderrec values (1, 10) insert #orderrec values (2, 21) insert #orderrec values (2, 15) insert #orderrec values (2, 21) insert #orderrec values (2, 26) insert #orderrec va...

debugging - Basic Java questions Scanning -

this basic java i'm struggling n00b style. prints out this please enter '.' when want calculate 1 2 3 . numbers 1 2 3 sum is0the product is1 when supposed calculate sum , product of consecutive numbers. wrong id appreciate help! main method import java.util.*; public class numberscanned { public static void main(string[] args) { system.out.println("please enter '.' when want calculate"); scanner keyboard = new scanner(system.in); string scannedstring = keyboard.nextline(); scanning scanz= new scanning(scannedstring); while(!keyboard.nextline().equals(".")) { scanz.set(scannedstring); } keyboard.close(); system.out.println("numbers are"+scannedstring); scanz.printstate(); } } class scanning public class scanning { int num; int sum; int product; string useri...

entity framework - Scaffolder unable to load EDMX metadata after upgrading to .NET4.5 and EF5 -

so i've upgraded existing mvc4 project .net4.5 , ef5. i've run project , works properly. tried run custom scaffolder, , gave me no love. please forgive me if simple mistake, our templates written left company. i've done best understand how these work , try , debug it. after afternoon of banging head on desk, i've hit dead end... the error message receive - add-projectitemviatemplate : <path to>\codetemplates\scaffolders\sfrepository\repository.cs.t4(0,0) : error : running transformation: system.invalidoperationexception: sequence contains no elements @ system.linq.enumerable.first[tsource](ienumerable`1 source) @ microsoft.visualstudio.texttemplatingf690eb8002d6f86a4e8ae00cfb7daa03c9eb647292d7f28842f3ee3f3550c224e18fb3ec09900009a804cdfd9776a0afb2ae2497de3d77def417124ac7de860b.genera tedtexttransformation.transformtext() @ <path to>\codetemplates\scaffolders\sfrepository\sfrepository.ps1:39 char:1 + add-projectitemviatemplate $outputpath -tem...

excel - How to compare two sheets in different work books and highlight the difference in 2nd sheet? -

Image
sub compare2sheetsex() 'and highlight diffrence dim wb1 workbook, wb2 workbook, sh1 worksheet, sh2 worksheet set wb1 = workbooks(inputbox("enter b1")) set wb2 = workbooks(inputbox("enter b2")) set sh1 = wb1.sheets(inputbox("enter s1")) set sh2 = wb2.sheets(inputbox("enter s2")) rcount = sh1.usedrange.rows.count ccount = sh1.usedrange.columns.count dim r long, c integer r = 1 rcount c = 1 ccount if sh1.cells(r, c) <> sh2.cells(r, c) sh2.cells(r, c).interior.colorindex = 6 end if next c next r set sh1 = nothing set sh2 = nothing end sub q:i tried compare 2 sheets in different workbooks unable execute code above. aside undeclared variables (using option explicit prevent this, , typos in variable names), code works fine me minor modifications: option explicit sub compare2sheetsex() 'and highlight diffrence dim wb1...