Posts

Showing posts from May, 2011

google finance - Getting jquery data to populate table column -

i trying javascript stock ticker work, going knowledge of javascript @ beginner level. the current code (top example) pulls out live stock data using google finance api. checks see stock acronym , prints full company name , has various styling. the second part attempt data displaying in table format, columns work cant jquery populate final column live date :(. i need create 3 columns; 1 stock name eg (haulotte), 1 stock acroynm eg (pig) , 1 live stock figures. ensure each stock data row keeps parallel 1 above , below it. attached current jsfiddle: thanks help. https://jsfiddle.net/oqousalw/ <div class="haul" data-symbol="pig" data-title="haulotte"></div> <div class="ashtead" data-symbol="aht" data-title="ashtead"></div> <div class="united" data-symbol="uri" data-title="united rentals"></div> <div class="terex" data-symbol="tex

android - How to use callback for multiple json array in retrofit? -

i trying retrofit how data below response {"schedule_students":[{"id":"753","sch_id":"153"},{"id":"765","sch_id":"153"}], "s_students":[{"id":"753","s_id":"153"},{"id":"765","s_id":"153"}], "schedu":[{"id":"753","ch_id":"153"},{"id":"765","ch_id":"153"}], "delids":"no","expdelids":"no","lastsyncdate":"2015-06-01 10:33:19"} in api response it's having multiple json array. how retrieve data response create pojos ( p lain o ld j ava o bjects) json data sets. use tool generate pojos. sstudent.class package com.example.someapp; import com.google.gson.annotations.expose; import com.google.gson.annotations.serializedname; packag

How to enable simple compression with mod_deflate/gzip on Apache within .htaccess -

i have following .htaccess file website hosted on linux, apache , php 5.4.41 stack: # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress the following php 5.4.41 functionality available me on server shown here in php info file: http://88.208.252.229/phpinfo.php i'm trying optimise website output server compressed before being sent client on network. now believe achieved mod_deflate - problem don't know how implement in .htaccess file. in it's simple form not enable compression html files making overall .htaccess file this? i'm assuming "/your-server-root/manual" htdocs. # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d r

php - How to remove auto generated log files -

Image
i working on laravel project few folders , files auto-generated as project on server, there few files generated there , when trying delete project (as no longer required it), removed files expecting auto-generated files , folder. is there anyway delete server? know master credentials possible, current credentials there anyway this?

javascript - Passing an object to a dynamically created directive -

i'm trying simple, pass object dynamically created directive. in short, use button directive which, on click, uses $compile produce template containing directive element. want pass object directive's attribute. angular.element(document.getelementbyid('dircontainer')).append($compile("<my-dynamic-directive name='data.name' data='data'></my-dynamic-directive>")(scope)); fiddle works angular 1.2 not angular 1.3! can't find relevant documentation change. jsfiddle: http://jsfiddle.net//weso9huo/ (angular dep in external resources) edit fiddle 1.2. changing 1.3 breaks it. edit 2 fiddle http://jsfiddle.net/7jjfadun/ angular 1.3 doesn't work. any ideas? you getting following error error: [ng:areq] argument 'mainctrl' not function, got undefined http://errors.angularjs.org/1.3.15/ng/areq?p0=mainctrl&p1=not%20a%20function%2c%20got%20undefined angular 1.3+ no longer supports controller

python - How to store user GUI entry in another py file -

i have seperated gui code( ui.py ) code calculations( calcs.py ) based on user's gui entries/selections. basically, enter numbers , make selections , hit start, start button should start calculations , print out stuff. below explanations provided relevant parts of code: when hit button, below method starts: import calcs class application: def sendguiinput(self): self.entry1 = self.coeff1.get() #get entry 1 self.entry2 = self.coeff2.get() #get entry 2 self.entry3 = self.coeff3.get() #get entry 3 calcs.createdata(self.entry1, self.entry2) #pass entries 1 , 2 calcs.py calculations please note that, app = application(root) calcs.createdata calculations , calls class other calculations: class createdata: def __init__(self, entry1, entry2): """some calculations here produce self.somenewvar1 , self.somenewvar2""" createdata2(self.somenewvar1, self.somenewvar2) this i'm ha

Need to fix Layout Showed Transparent Android while Creating Fragment -

hello have create 1 activity , have 3 fragment class.i facing problem if call fragment background transparant , can see previous fragment or activity can see , perform action on it. i need fix solution. how possible. thank in advance. i suggest add properties top view of fragment's layout: android:background="#fff" android:clickable="true" its should solve problem android:clickable="true" enough didn't test it.

c# - Windows forms Listbox won't show the right text for each item -

i done project. tested , worked , showed right values. today won't show right text in listbox. here code: private void filmbtnloadfilms_click(object sender, eventargs e) { filmserviceclient filmclient = new filmserviceclient("nettcpbinding_ifilmservice"); showserviceclient showclient = new showserviceclient("nettcpbinding_ishowservice"); filmrecord[] list = null; try { //retrieve films if (list == null) { list = filmclient.retrieveallfilms(); } if (filmlist.items.count > 0) { filmlist.items.clear(); } foreach (var film in list) { filmlist.items.add(film); } this.filmlist.datasource = list; this.filmlist.displaymember = "title"; this.filmlist.valuemember = "id"; } catch { loglabel.text = "film kunne ikke indlæses"; } showclient.close(

c# - Get all files except files in hidden directories? -

i want create list of files in directory, except hidden fies , files inside hidden folder in directory. used method, new directoryinfo(path).getfiles("*.*", searchoption.alldirectories) .where(f => (f.attributes & fileattributes.hidden) == 0) but above method return files inside hidden folders. there other way without recursively iterating through directories? one way without "manually iterating" following: var dirinfo = new directoryinfo(path); var hiddenfolders = dirinfo.getdirectories("*", searchoption.alldirectories) .where(d => (d.attributes & fileattributes.hidden) != 0) .select(d => d.fullname); var files = dirinfo.getfiles("*.*", searchoption.alldirectories) .where(f => (f.attributes & fileattributes.hidden) == 0 && !hiddenfolders.any(d => f.fullname.startswith(d))); but iterating whole directory tree twice , has .any -overhead every file =

Why do forms ask to confirm email address? -

why forms (mostly traditionally believe) ask users confirm email address , have 2 fields of email address (one called email address , second 1 called 'confirm email')? of time done in registration or contact forms. way filter out robots or database check , used db types (ms sql etc.). or maybe developers want 100% sure email address input correct getting input twice can check on correct (and correct in 2 places?). sounds silly question why developers instead of asking email address once? for know if can check email in 1 form field against db entry sufficient , build security in way. as mentioned, done 100% sure. done because developers want user review email address have given correct confirmation mail sent email , if email wrong if lead spam mail sent , @ same time user may not complete whole login procedure again.

how to find k components in a directed graph using Girvan-Newman algorithm? -

i aware of girvan - newman algorithm - here algorithm : the betweenness of existing edges in network calculated first. the edge highest betweenness removed. the betweenness of edges affected removal recalculated. steps 2 , 3 repeated until no edges remain. but want use algorithm find k components in directed graph, k given integer. how can this? possible? thanks. if graph directed, need process directed version of edgebetweenness, i.e. count directed shortest paths going through edge. regarding parameter k, must remove central links until obtain k separated components. in other words, don't need apply step 4 until no edge remain: can stop before, when you've reached required k. nodes contained in resulting components correspond communities initial graph.

How can i debug chromecast when i use default receiver? -

i have created android sender application. seem not working, want know happen, can't access http://receiver-ip-address:9222 . have registered chromecast device , used default receiver. you cannot attach chrome debugger unless app running on cast device has own app id, hence won't able default receiver. way around register styled receiver (at least debugging purposes); share same code base , difference in css customization, can safely debugging on styled one.

haskell - Is it safe to use trace inside a STM stransaction? -

i have transaction failing indefinitely reason, , use trace instructions inside. example, print state of mvar's before executing transaction in fragment: data_out <- atomically $ rtg_state <- taketmvar ready_to_go jobdescr hashid url <- t.readtbchan next_job_descr case rtg_state of ready_rtg n -> puttmvar ready_to_go $ processing_rtg n puttmvar start_harvester_browser hashid puttmvar next_test_url_to_check_chan hashid puttmvar next_harvest_url hashid return (n,hashid,url) _ -> retry would make program segfault or miss-behave? as long use trace debug purposes should ok. general rule, assume in final production-ready version of program there no trace s around. you never observe segfaults trace . "unsafety" stems injecting observable effects in pure code. e.g., in stm, when transaction retries, effects ass

bluetooth lowenergy - BluetoothLEGatt sample codes in Android Studio to ON/OFF LED lights -

i'm looking "simple" pair of app written in android studio , code in mbed work together, , allow: - send app mbed (led on/off) - send mbed app (button status) - notify mbed app, (ring when button pressed) any pointers or guidance appreciated, , i'll make resulting mbed code , app source public here on mbed. i've worked through several of examples here on mbed (htm, htm, uart, more...), have used them nordic sample apps (nrf-mcp, toolbox, etc.). apps written in older eclipse, , when imported new android studio result quite cryptic code versus beginner needs. i've looked @ apps other suppliers tend use custom older libraries, not latest mbed, android studio, or android sdk. the android studio sample code i've found ble bluetoothlegatt, generic starting point connect , list services, nothing past that: http://developer.android.com/samples/bluetoothlegatt/index.html . please me. in advance. i found myself. ohh @override public

html5 - Error show css masonry grid gallery on iMac -

Image
demo: click here on chrome, safari on macbook firefox, opera,... ok but see below issue on imac ! how fix ? i've been looking code. i see use wordpress template, try clear cache in safari. otherwise ask in wordpress section more answers.

php - Codeigniter Pagination view -

i new on codeigniter , need find out way. controller, here fetch data : <?php class propertymodel extends ci_model { function __construct() { // call model constructor parent::__construct(); } public function pagination() { $this->load->view('templates/header'); $this->load->library('pagination'); $this->load->library('table'); $config['base_url']='http://localhost/goldenacre/property/pagination'; $config['total_rows']= $this->db->get('property')->num_rows(); $config['per_page']= 10; $config['num_links']=5; $this->pagination->initialize($config); $config['total_rows']=$this->db->get('property')->num_rows(); $data['records']=$this->db->get('property',$config['per_page'],$this->uri->segment(3)); $this->load->view('listvieww',$data); $this->load->view('templates/footer'

c# - How to execute selenium NUnit test cases from jenkins -

i have installed jenkins , want execute selenium test cases jenkins. have installed selenium grid plugin jenkins , running server node. scripts written in c#. java think can done using ant or maven xml. don't know how execute nunit test cases. go project under configuration click "add task" , add "run unit tests ms tests". you need specify test lies. (i use .dll of specific test project). just hit run , execute. also make sure have specified following tags in code [testclass] //on class [testmethod] //on each method

how to tweet an image,url,text at a time using asp.net c# -

how tweet image, url, text @ time on twitter means single tweet in load event using c#. chances on kind off issues ? protected void page_load(object sender, eventargs e) { string sans = ""; string tosh = ""; var oauth_consumer_key = "8888888888888888888888888888"; var oauth_consumer_secret = "11111111111111111111111111111"; if (request["oauth_token"] == null) { oauthtokenresponse reqtoken = oauthutility.getrequesttoken( oauth_consumer_key, oauth_consumer_secret, request.url.absoluteuri); response.redirect(string.format("http://twitter.com/oauth/authorize?oauth_token={0}", reqtoken.token)); } else { string requesttoken = request["oauth_token"].tostring(); string pin = request["oauth_verifier"].tostring(); va

c# - Opening Excel File by ClosedXML.dll is showing error "Excel found unreadable content" -

hi have created excel file using closedxml.dll , when going open file, showing "excel found unreadable content" message. file content has swedish text. don't know root cause? there way set language? how remove warning please me. here code snap. using (xlworkbook wb = new xlworkbook()) { wb.worksheets.add(dt); //dt datatable response.clear(); response.clearheaders(); response.buffer = true; response.charset = ""; response.contenttype = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; response.addheader("content-disposition", "attachment;filename="+filename+".xlsx"); response.contentencoding = encoding.utf8; using (memorystream mymemorystream = new memorystream()) { mymemorystream.capacity = (int)mymemorystream.length; wb.saveas(mymemorystream); mymemorystream.writeto(response.outputstream); response.flush(); response.

reporting services - SSRS Position calculate Expression -

Image
i trying show postions of student on basis of aggregate (aggregate ) the aggregate expressions calculating on basis of (final + mock + asst)/3 m doing on run time expression calculate... now unable display position positions column highest aggregate highest positions(1 or 2 or 3 ) positions there expression can write show positions column. please me m stuck there's not function can use - you'd need use iifs: =iif(fields!final.value >= fields!mock.value , fields!final.value >= fields!asst.value, 1, iif(fields!mock.value >= fields!final.value , fields!mock.value >= fields!asst.value, 2, 3))

Store byte[] in MongoDB using Java -

i insert document collection field of byte[]. when query inserted document field, returns different byte[]. how fix that? byte[] inputbytes = ... mongocollection<document> collection = _db.getcollection("collectionx"); document doc = new document("test", 1).append("val", inputbytes); collection.insertone(doc.getdocument()); mongocursor<document> result = collection.find(eq("test", 1)).iterator(); document retrived_doc = cursor.next(); cursor.close(); byte[] outputbytes = ((binary)retrived_doc.get("val")).getdata(); // inputbytes = [b@719f369d // outputbytes = [b@7b70cec2 you can encode byte array , store in doc decode after extraction retrieve original. static string encodebase64string(byte[] binarydata) encodes binary data using base64 algorithm not chunk output. static byte[] decodebase64(string base64string) decodes base64 string octets. please refer link - https://commons.apache.org/prope

jquery - How to frame AJAX request -

i need call wcf service webpage. method in service uses generic list argument,i need know how frame ajax query? method: public list<filelistentity> listlogfiles(string status, list<filelistentity> filelist) { .............//implementation.... return filelist; } 1st time when method called 'filelist' passed null, method populates list , send website. 2nd time website sends received filelist along status service. ajax query: var status = definestatus(); var value; var jsonobj; function calllogservice(){ debugger; if (value == null) { jsonobj = "null"; } else { jsonobj=value; } $.ajax({ type: "post", url: "http://localhost:56256/searchservice.svc/listlogfiles", data: '{"status":"'+ status+'","filelist":'+jsonobj+' }', crossdomain: true, contenttype: "application/json; charset=utf-8&q

android - UID of a NFC/SWP-accessed SIM card -

sim card used secure element in project. accessed through nfc-swp contactless interface terminal device. i need identify sim card somehow unique , permanent identifier , need able read identifier through nfc. iccid seems best choice, have expose ef iccid file through contactless interface, might dangerous. moreover, ef iccid file out of scope on sim card - access dedicated security domain have. i tried use 4-byte long uid specified in iso/iec 14443 type a, different uid each time read sim card through nfc. why? another solution accessing card serial number through global platform data command (card production life cycle data (cplc)), have able select card manager through contactless interface, forbidden default , not recommended because of security. is there typical way solve issue? the 4 byte uid type (same pupi type b) allowed random (iso 14443-3, chap. 6.4.4 "fixed unique number or random number"). purpose only, select 1 of several cards in field of r

python - How to autostart apachectl script that mod_wsgi-express made for django? -

i'm working on web application based on django-1.8.2 , on virtual env provided python-3.4.3 of ubuntu-15.04. my app. working on development server, , has been deployed using mod_wsgi-4.4.11 (pip installed) , ubuntu's apache. is, after collecting static files , modify file permissions of db.sqlite3, did ... % sudo ../bin/python manage.py runmodwsgi --setup-only --port=80 --user www-data --group www-data --server-root=/etc/mod_wsgi-express-80 % sudo /etc/mod_wsgi-express-80/apachectl start to have working server. i'd daemons start on boot-up automatically, have no luck in writing init.d script or config file. probably, utterly new way required systemd of 15.04. suggestions welcome. looks question ubuntu systemd launcher rather django + mod_wsgi... after struggling init.d scripts, have moved on systemd service file: /lib/systemd/system/apache_mod_wsgi.service [unit] description=apache2 mod_wsgi [service] type=oneshot remainafterexit=y

java - JVM GC problems -

Image
in last few weeks have been testing different jvm setting glassfish server. main settings heap (among others) are: -xms512m, -xmx512m, -xx:newratio=2. tried different gc setting still have problems long pauses after few days starting server. noticed following: 1. -xx:+useparallelgc -xx:+useparalleloldgc - minor gc occuring every minute, major gc every 18 hours. had no problems minor gc there problems major gc after 5 days. @ first major gc pauses lasted 100-200ms @ end last pause lasted 70 seconds. 2. -xx:+useconcmarksweepgc -xx:+useparnewgc - same above. minor gc fine, major gc (not full) pauses getting long. noticed problems high class unloading @ gc (cms final remark) phase stop world phase. 3. -xx:+useconcmarksweepgc -xx:+useparnewgc , -xx:maxgcpausemillis=5000. testing day because second major gc last (not full) lasted 20 seconds thought there else wrong. 4. -xx:+useg1gc, -xx:maxgcpausemillis=5000, -xx:+usestringdeduplication without -xx:newratio=2 option - major gc (not f

css - Circle text with jquery animation -

i have tried circle texts jquery animation. working fiddle is: http://jsfiddle.net/60rz99zu/5/ $(function () { $('.main-content').circletype({radius: 1000}); var $els = $('div[id^=quote]'), = 0, len = $els.length; $els.slice(1).hide(); setinterval(function () { $els.eq(i).fadeout(function () { = (i + 1) % len $els.eq(i).fadein(); }) }, 2000) }) the first text working good. see second , third text. circle effect messed. spent more time fix. couldn't. how can achieve this?? the problem since elements hidden, circle plugin not able findout dimensions properly. so 1 solution hide them after initiazing library <div id="quote1" class="text-center main-content">first text here</div> <div id="quote2" class="text-center main-content">second text here</div> <div id="quote3" class="text-ce

Calling this function in Android using Rhino -

i working on project need download javascript , use calculate values. working on ios javascript seems fine. here stripped down javascript (i have removed content not own script): var resultarray = []; function calculateremainingamountforforecastweeks(numberofweeks, weeklydisposable, easing, safetyzone, safetyzoneeasing, overspentthisweek) { // calculations... resultarray[numberofweeks] = spentbeyondforecast; } i using rhino , here do: org.mozilla.javascript.context rhino = org.mozilla.javascript.context.enter(); rhino.setoptimizationlevel(-1); try { scriptable scope = rhino.initstandardobjects(); rhino.evaluatestring(scope, weeklyapplication.getcalculatorjs(), "javascript", 0, null); object obj = scope.get("calculateremainingamountforforecastweeks", scope); if (obj instanceof function) { function jsfunction = (function) obj; // call function params object[] params = new object[]{numberofweeks, weeklydisposable, easing, safetyzone

android - LatLngBounds.contains returns true even if LatLng is not within the defined boundary -

Image
i'm stumped; ff. method intend return true if latlng within latlngbounds or return true if latlng part of boundary set including ? https://developers.google.com/android/reference/com/google/android/gms/maps/model/latlngbounds#contains(com.google.android.gms.maps.model.latlng) so far tests counterproductive; returns true if latlng outside latlngbounds . latlngbounds latlngbounds = // boundaries of location latlng target = cameraposition.target; // returns center of camera if (!latlngbounds.contains(target)) { // processes } what display toast message if camera panned outside polygon (i log it) apparently, have scroll way away polygon show. i use polygon.getpoints latlngbounds i did simple test, , contains() method return true point within bounds, , return false considers points outside of bounds. i used extreme example, bounds set country of australia, , tested point inside australia, , point in san francisco. the bounds: private latlngb

excel - Interior.PatternTintAndShade Property -

i working on excel sheets large amount of cell pattern based data. trying read values of these cell patterns , store info in sheet. unable there no function available in excel. please help. as per title, appears want vba. now, not clear if want copy interior.pattern , interior.patterntintandshade , or perhaps else. the code need like dim wssrc worksheet, wstrg worksheet dim rngsrc range, clsrc range, cltrg range set rngsrc = <what want> each clsrc in rngsrc set cltrg = wstrg.range(clsrc.address) cltrg.interior.patterntintandshade = clsrc.interior.patterntintandshade next clsrc (ps: not have system excel, code may need little adjustments). other option perhaps works is: first copy, , use range.pastespecial method , first argument xlpasteformats . vba method edit -> paste special (see comment jeeped).

soap - Adding passive bookings in sabre -

i have requirement add passive bookings sabre. idea on service used. couldn't find required soap request dev studio. i'm supposed create passive bookings bookings create in system. as far know, there isn't dedicated service create passive segments. we had similar requirement, , ended issuing commands using sabrecommandllsrq

ios - Swift delegate protocol not updating with locationManager -

i have 2 views childview communicates parentview . using google maps sdk track users location if startupdatinglocation() using button, protocol not work if initiate startupdatinglocation() app loads works fine. below two controller files. i trying display location in label not sure why protocol not working after button click. child: import foundation import uikit protocol locationupdatedelegate{ func delegateuserlocation(mapchildcontroller:mapchildcontroller, userlocation: string) } class mapchildcontroller: uiviewcontroller, cllocationmanagerdelegate { @iboutlet weak var mapview: gmsmapview! let locationmanager = cllocationmanager() var didfindmylocation = false var mylocations:[string] = [] var alreadyupdatedlocation = false var locationdelegate:locationupdatedelegate? override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. var camera = gmscameraposition.camerawithlatitude(-33.86, longitude: 151.20, zoom

parse.com - Parse push notifications and iOS 8.2's alert titles -

ios 8.2 introduced alerttitle property remote , local notifications. there way add alert title parse push notification? tried adding both title , alerttitle data dictionary, neither worked. just figured out - instead of passing string alert property, send dictionary title , body .

css - Auto widht and height in textarea -

i tried on several questions, have not found answer. how textarea set according size of pattern "texdtart"? #entry{float:center;clear:both;margin-top:40px;margin-bottom:25px;margin-left:auto;margin-right:auto;} #entry textarea{margin-left:auto;margin-right:auto;line-height:100%;text-align:left;margin-top:0px;display:block; <div id="entry"><form><textarea class="textarea3" onclick="this.focus();this.select()" readonly="readonly" style=" width:"";height""> _________________§§§§§§§§__________§§_____§§ _______________§§________§§_______§§§§___§§§§ _____________§§__§§§§§§§§__§§______§§_____§§ ____________§§__§§______§§__§§______§§___§§ ___________§§__§§___§§§__§§__§§_____§§§§§ ___________§§__§§__§__§__§§__§§_____ §§§§§ ___________§§__§§__§§___§§§__§§_____§§§§§ ___________§§__§§___§§§§§§__§§_____§§§§§§ ____________§§__§§_________§§_____§§§§§§ _______§§§§§§§§§§§§§§§§§§§§§§§§§§

Facebook php sdk v4 get unlimited messages from user inbox -

i'm trying user messages of threads, can 30 last messages of each thread: $request = new facebookrequest($session, 'get', '/me/inbox?comments_limit=9999'); $response = $request->execute(); $threads = $response->getgraphobject()->asarray(); $comments = $threads->comments; foreach($comments $messages) { foreach($messages $message) { echo $message->from->name.'<br />'; echo $message->message.'<br /><br />'; } } do know how can unlimited messages? thanks you need implement paging entries: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4#paging for example, use recursive function that. keep in mind may run api call limits if there lot of messages. you can increase limit bit, maximum 100: /me/inbox?limit=100

javascript - How to get multiple scrolling images in HTML continuously -

this whole code html , css this css scrolling images. <style> * {margin: 0; padding: 0;} body { background-color: #666; } #container { width:70%; overflow: hidden; margin: 50px auto; background: white; } /*header*/ header { width: 800px; margin: 40px auto; } header h1 { text-align: center; font: 100 60px/1.5 helvetica, verdana, sans-serif; } header p { font: 100 15px/1.5 helvetica, verdana, sans-serif; text-align: justify; } /*photobanner*/ .photobanner { height: 233px; width: 3550px; margin-bottom: -45px; } /*keyframe animations*/ .first { -webkit-animation: bannermove 30s linear infinite; -moz-animation: bannermove 30s linear infinite; -ms-animation: bannermove 30s linear infinite; -o-animation: bannermove 30s linear infinite;

ios - How to check Alamofire request has completed -

i developing ipad application using swift . http requests use alamofire library. far have managed pull data api. problem since asynchronous call don't know how check whether request has completed. appreciated. this code have implemented far client class func getusers(completionhandler: ([user]?, nserror?) -> ()) -> (){ var users: [user] = [] let parameters = [ "id": "123", "apikey": "1234", ] alamofire.request(.get, "api_url", parameters: parameters).responsejson() { (_, _, json, error) in let items = (json!.valueforkey("users") as! [nsdictionary]) item in items { var user: user = user() user.userid = item.valueforkey("id")! as? string user.username = item.valueforkey("name")! as? string user.group = item.valueforkey("group")! as? string users.append(user)

scala - TestActorRef: Could not get the underlyingActor, says Nothing -

Image
i trying write first scalatest following actor object runner { def props(race: race) = props(classof[runner], race) } class runner(race: race) extends actor actorlogging { import context.dispatcher @throws[exception](classof[exception]) override def postrestart(reason: throwable): unit = context.parent ! restartrunner override def receive: receive = loggingreceive { case start => { log.debug("running...") (i <- 1 3) { thread.sleep(200) } throw new runtimeexception("marathonrunner tired") } case startwithfuture => log.debug("i starting run") race.start pipeto self case failure(throwable) => throw throwable case stop => log.debug("stopping runner") context.stop(self) } } so, import akka.actor.{props, actorsystem} import akka.testkit.{testactorref, testkit} import org.scalatest._ class runnerspec extends testkit(actorsystem(&q

c# - JNA couldn't find the specified procedure in dll file through java -

i trying access dll procedure through java java method unable find procedure. dll file loaded the procedure c# code named login can't call. below def of procedure in adhelper.dll: public static adhelper.loginresult login(string username, string password) { if (!adhelper.isuservalid(username, password)) return adhelper.loginresult.login_user_doesnt_exist; directoryentry user = adhelper.getuser(username); if (user == null) return adhelper.loginresult.login_user_doesnt_exist; int useraccountcontrol = convert.toint32(runtimehelpers.getobjectvalue(user.properties["useraccountcontrol"][0])); user.close(); return !adhelper.isaccountactive(useraccountcontrol) ? adhelper.loginresult.login_user_account_inactive : adhelper.loginresult.login_ok; } the dll file name adhelper.dll. loginresult enum type: public enum loginresult { login_ok, login_user_doesnt_exist, login_user_account_inactive,

paypal - How to handle reversal which generated 3 IPNs -

recently customer filed bank-reversal purchase. purchase 100 dollars. reversal triggered 3 ipn requests: day 1: ipn 1: mc_gross=-96.80 mc_fee=-3.20 payment_status=reversed reason_code=buyer_complaint day 2: ipn 2: reason_code=unauthorized_spoof payment_status=reversed mc_fee=-3.20 mc_gross=-100.00 ipn 3: reason_code=buyer_complaint payment_status=canceled_reversal mc_fee=3.20 mc_gross=96.80 for 3 ipns, txn_type nil. why 1 reversal generate thee ipns? 1 should used clean on end? there 3 of them? i think using mc_gross find ipn matches original amount not idea, because there currency conversion losses.

Read XML Attribute using C# -

<block id="ar0010100" box="185 211 825 278" element_type="h1" seq_no="0" /> this example xml code. in c# need store id's inside of block element in 1 variable, , box's inside of block element. have been trying 2 days, , don't know how narrow down question. xmlnodelist idlist = doc.selectnodes("/block/id"); doesn't work... version of doc.selectnode, doc.getelementby... doesn't return right element/children/whatever call it. i'm not able find documentation tells me i'm trying reference. don't know if id or box children, if they're attributes or what. first time using xml, , can't seem narrow down problem. you can use following code xmlnodelist elemlist = doc.getelementsbytagname("your element"); (int = 0; < elemlist.count; i++) { string attrval = elemlist[i].attributes["id"].value; } demo: https://dotnetfiddle.net/5ppnpk the above code t

ruby - Within a module, are there any reserved class names? -

within module , there reserved class names? module mylibrary class class end class object end class banana < object end end ruby doesn't seem confused. mylibrary::object.new.is_a?(::object) #=> true mylibrary::class.new.class #=> mylibrary::class mylibrary::class.class #=> class mylibrary::banana.new.is_a?(::object) #=> true mylibrary::banana.new.is_a?(mylibrary::object) #=> true mylibrary::banana.ancestors #=> [mylibrary::banana, mylibrary::object, object, kernel, basicobject] just ruby reserved words begin , end. in fact might two. http://docs.ruby-lang.org/en/2.2.0/keywords_rdoc.html just fyi rails has separate list of reserved words.

eclipse - do we get all (i.e. open / closed / merged) pull heads while doing a fetch with * configuration -

while checking out github pull heads through * fetch configuration retrieved list of pull heads in form of ref/pull/* or similar. are these pointing open , closed or pull requests ? , pull requests have been merged , closed ? depends on git version have installed. it true prior git v2.0 build changed match simple v2. release notes: when "git push [$there]" not push, have used traditional "matching" semantics far (all branches sent remote long there branches of same name on there). in git 2.0, default "simple" semantics, pushes: only current branch branch same name, , when current branch set integrate remote branch, if pushing same remote fetch from; or only current branch branch same name, if pushing remote not fetch from. you can use configuration variable "push.default" change this. if old-timer wants keep using "matching" semantics, can set variable "matching"

vhdl - Can I access a constant inside a instantiated entity from outside? -

i have vhdl entity generic parameter list. architecture entity calculates several constants, needed create intended functionality. is possible access 1 of these constants outside? example 1: let's there fifo decides based on depth , outreg best implementation (register based, srl based or blockram based). depending on minimum delay through fifo can vary 1 2 cycles. example 2: consider same fifo cross clock compatible. min delay depends on choosen sync circuits , frequency difference. example 3: division entity needs n cycles calculate a div b . n depends on bits, radix, outreg, is_signed, ... further let's each entity has min_delay constant of type natural of interest other instances. e.g. instantiating entity needs know how long must @ least wait result. i can think of 2 solutions, think neither nice one. solution 1: store algorithmn computation in package it's globally accessable. against encapsulation principle :). outside world needs know delay v

while loop returning same date value even after adding a day each time - c# -

this question has answer here: datetime.adddays() not working expected 2 answers am doing silly here, fromdate value remains has been passed. public list<string> getdates(datetime fromdate, datetime todate) { list<string> dates = new list<string>(); while (fromdate <= todate) { dates.add(fromdate.toshortdatestring()); fromdate.adddays(1); } return dates; } i can't figure out why, please advise. you need assign fromdate , adddays() not modify instance on called: fromdate = fromdate.adddays(1);

webpack: copy a filed without changing it's content -

i deploying project surge.sh surge.sh needs 200.html file enable routing (sub-)pages of single page apps my file looks this: <!doctype html> <html> <head> <link rel="stylesheet" href="gs.1.0.0.css"> </head> <body> <script src="gs.1.0.0.js"></script> </body> </html> when load using import twohundredpage 'copy!./200.html' or import twohundredpage 'file?name=200.html!./200.html' the resulting file looks this: module.exports = __webpack_public_path__ + "9802140cc82d486c4b933fc3da03da99.html" and not work on surge.sh cdn how can load file without changing it's contents? or in other words: just copy it? edit (2015.06.01) i have found no solution question. but managed solve issue this: by not hosting on surge instead on virtual server hapi.js didn't need copy 200.html file more (and configure hapi.js let index.html i.e.

css - fonts not working in subdirectories -

i using several different fonts website, sarkelliancreed.comule.com , , fonts not loading in page: sarkelliancreed.comule.com/contact . in other pages far can tell fonts working. using @import stylesheets different fonts. main stylesheet, main.css , included <link> . why aren't fonts showing up? according css standards @import rules (and @charset rules) must first statements in css files. see link further info: http://www.w3.org/tr/css21/cascade.html#at-import so, if move @import sections top of css file, may solve problem. i recommend validating code @ following site: https://jigsaw.w3.org/css-validator/