Posts

Showing posts from May, 2015

localdb - Cannot restore database with .mdf extension in sql server -

Image
i have back-up database localdb server .mdf file: c:\thesis - source code\sis-jen\sis\app_data\sis_db.mdf and backed-up extension of .bak : c:\thesis - source code\sis-jen\sis\app_data\sis_db.mdf.bak now, want restore back-up file new server(my pc/server), cannot restore using .bak file: c:\thesis - source code\sis-jen\sis\app_data\sis_db.mdf.bak i've got error: restore of database 'c:\thesis-source code\sis-jen\sis\app_data\sis.db.mdf' failed can me fix error? check restore statement - use [master] go restore database [sis_db] disk = n'd:\sis_db.bak' file = 1, move n'sis_db' n'd:\sis_db.mdf', move n'sis_db_log' n'd:\sis_db_log.ldf', nounload

linux - Tap interfaces and /dev/net/tun device, using ip tuntap command -

i'm using ip tuntap create tap interface, this: $ sudo ip tuntap add mode tap tap0 afterwards, set interface , address common ip commands. can see interface , addressed simple ifconfig . now, told teacher creating tap interface (named tap0 in case), find /dev/net/tap0 node, , able write in or read it. however, can't find it. "just" have /dev/net/tun . do have deal tun node, or supposed have tap0 node? it's been long time since question asked, thought idea post actual answer future reference. tap interfaces, tun interfaces, virtual interfaces provided in-kernel tun/tap device driver. interface driver provides character device /dev/net/tun mentioned in question. by issuing: $ sudo ip tuntap add mode tap tap0 we instruct ip tuntap create network interface named tap0 , accomplished using proper ioctl(2) calls on aforementioned device file /dev/net/tun talk underlying tun/tap device driver, can observe in ip tuntap 's source code

How to write ruby function to check for case insensitive word "error" in a file and return a property -

the function written me given below. work properly? else please correct me. def log_file( file ) parsed_data = {} read_lines( file ) {|line| if line.match(/error/i) parsed_data[:property] = "error" end } return parsed_data end the function may work properly, it's impossible tell you're using methods defined externally such read_lines . also, it's not idiomatic ruby (especially explicit return , multi-line {} block). here's possible alternative def def log_file(file) file.open(file).each_line |line| return({ property: "error" }) if line =~ /error/i end {} end also, doesn't make lot of sense me return hash, given "error" string hard-coded. return "error" or nil. def log_file(file) file.open(file).each_line |line| return "error" if line =~ /error/i end nil end or true/false def success?(file) file.open(fil

Gtk Perl: Removing an item from a Gtk2::ComboBox by its name, rather than index -

while working perl , gtk2, have programmatically remove option drop-down (combobox). while i'm aware $combo_box->remove_text ($position) trick in 1 shot, need remove option based on name (entered user). i'm unable find method can return index of item name. out? it's bit unclear mean "name"; combo box items don't have names. if combo box textual, each item made of text, text isn't name. have same string in items instance, make unclear 1 want delete. i think you're going have implement youself, iterating on combo box's underlying tree model. it's if want delete first match, continue searching find of them.

matlab - Can I give headernames to columns in a structure field? -

i have structure multiple fields , these fields have multiple columns. give columns of these fields names instead of 1,2,3... not going reference columns names clarity. instance: structure.field1 consists of 3 columns of data , name these instance columns: 1 = time 2 = place 3 = date how can without use of tables sticking structure!! i solved problem implementing table inside structure. @dev-il suggestion

php - Why does the XMLReader stop reading this XML file? -

i reading xml file <?xml version="1.0" encoding="utf-8"?> <articlelist xml:lang="de"> <articlegroup id="bdb"> <oldarticle>no</oldarticle> <article articlenr="103154" artikelgruppennr="bdb" artikelgruppenname="instant-kameras" setartikel="0"> <name>fujifilm instax mini hello kitty set</name> <brand id="fuj">fujifilm</brand> <tecdat> <group name="ausstattung"> <proberty name="eingebautes blitzgerät">ja</proberty> </group> </tecdat> <tecdat> <group name="stromversorgung"> <proberty name="stromversorgung">2x mignon (aa)</proberty> </group> </tecdat> <tecdat> <group name="allgemein"> <proberty name="farbe">rosa</proberty> <proberty name="breite (mm)">169</proberty&g

ios - supportedInterfaceOrientationsForWindow returns UIInterfaceOrientationMaskPortrait but my viewcontroller show in landscape -

i handling orientations in appdelegate.m file. supportedinterfaceorientationsforwindow returns uiinterfaceorientationmasklandscape of view controllers , uiinterfaceorientationmaskportrait 1 viewcontroller. when move landscape viewcontroller viewcontroller want portrait supportedinterfaceorientationsforwindow returns uiinterfaceorientationmaskportrait view controller appears in landscape. please me i've been stuck long time. testing on iphone 6, ios 9. let's view a 1 of landscape views of app , b intended portrait view. now, when device held in portrait on , b accessed, view doesn't change orientation portrait (since device in portrait). i'd suggest 'tell' system b in landscape while preparing segue , in viewdidload b's view controller, change orientation portrait. this way, no matter previous view's orientation, b open in portrait when loads. use following code change orientation. in case using segue use code in - (void)

android - Text to Speech API not calling setOnUtteranceCompletedListener -

what want: want notified when texttospeech program has done speaking , want perform gui task when finishes speaking task. what know: setonutterancecompletedlistener can used call should notify me has findished speaking.it's depriciated in api level 15 still should work. setonutteranceprogresslistener other , better way receive call backs starting finsishing , error notifications. minimum api level 15 required implement interface. changed minimum sdk version 15 , tried method didn't work me well. here code public class speakingnotepad extends appcompatactivity implements texttospeech.onutterancecompletedlistener{ button btnspeak; edittext ettext; texttospeech speaker; speechrecognizer voicerecognizer; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_speaking_notepad); init(); } private void init() { speaker = new t

javascript - Multi Step Form using fieldset -

i have code in html , javascript using fieldset change step form. want in every fieldset has own form tag, when submitted in 1st fieldset changing 2nd fieldset here's html code <div class="formhandler"> <fieldset> 1 <form> <input type="text"> <?php echo form_button('previous', 'kembali', array('class'=>'previous action-button')); echo form_submit('submit', 'next', array('class'=>'next action-button')); ?> </form> </fieldset> <fieldset> 2 <form> <input type="text"> <?php echo form_button('previous', 'kembali', array('class'=>'previous action-button')); echo form_submit('submit', 'next', array('class'=>'next action-button'));

laravel - store API response data on cache on server php -

i using api. resquest-response time on api takes long time. so, due problem, want store response on server not on browser. because, want display result cache similar searches. know, there limitations on accuracy on cached data, that's part don't want include here. i using laravel framework , using code current moment in laravel documentation. $expiresat = carbon::now()->addminutes(10); cache::put('key', 'value', $expiresat); the problem code is, stores cache on browser only. want store on server. have heard memcached not implement it. have heard of apc_store() think stores on local. so, how can store cache on server? similar cache::put() , can use cache::pull() check data saved (on server). // check cache data $cacheddata = cache::pull($key); // new data if no cache if (! $cacheddata) { $newdata = 'new data'; $expiresat = carbon::now()->addminutes(10); // save new data cache $cacheddata = cache::put($key

html - display using foreach, but adjust space between row and columns -

i'm displaying same image 24 times 3 * 8 matrix in a4 size (using foreach ). the problem is, need add space manually every row , column. should not break page. 3 * 8 matrix should place in same page. my css is foreach method <div id="qr" style="display: inline-block; width:6.9cm; height:4cm;" > (image) </div> end foreach i'm asking how increase space between 2 rows without page break. if add width 6.9 7.2 increase, eigth row goto second page, while printing when using display:inline-block, or display:inline css properties, remove white spaces (space/tab between tags).

php - how to save acf_form using ajax without page refresh -

i have theese 3 acf_form. want show these form 1 one want save every form on button click through ajax without page refresh. right it's refreshing page whenever update. show through display none & block using js. <div class="setupnew"> <h2>setup deals attract new clientele</h2> <p>example: buy $15 $30 services</p> <a href="javascript:void(0)"><p id="newdealstxt">[click here setup] </p></a></div> <?php acf_form($args = array( 'post_id' => $post_id, 'field_groups' => array(2029), 'form_attributes' => array( 'id'=>'newdeals' ), )); ?

django - Wirecloud authentication using keystone only? -

the instructions providing fiware based authentication wirecloud suggest installing keyrock (a frontend/backend combo of horizon/keystone ge). frontend (horizon) necessary if application secured wirecloud instance (and possibly backend services). point avoid, if possible , have configure/style/maintain etc. second frontend. possible authenticate directly using django plugin this ? pros , cons? wirecloud linked use of django.contrib.auth , authentication plugin based on should work. moreover, instructions using keyrock using python-social-auth so, in fact, can use authenticating using of the backends supported python-social-auth : github, twitter, openid, ... in regard, don't see problem in use of plugin proposing (although have not tested it). the advantage of using keyrock backend provided wirecloud enables operators , widgets propagate credentials third-party services using keyrock authentication (e.g. orion context broker, object storage, ... , in general, ser

c++ - how to apply optical flow vector to detected circle only -

i working on traffic sign detection project. circular traffic sign has been detected, want calculate optical flow vector traffic sign not whole image. find radius of detected circle not sure how use create circular mask iplimage provide "cvgoodfeaturetotrack" , "cvcalcopticalflowpyrlk()" any suggestion please ? say have center , radius of traffic sign, i.e.: cv::point center(200, 300); int radius = 50; the region of interest, goodfeaturestotrack work can controled cv_8uc1 mask has same size input image: cv::mat mask = cv::mat::zeros(grayframe.size(), cv_8uc1); cv::circle(mask, center, radius, cv::scalar::all(255), -1); finally call function our new mask filled 255s according traffic sign: cv::goodfeaturestotrack(grayframe, corners, 100, 0.01, 10, mask);

javascript - Confirm box depending on input value -

i'm new javascript don't judge hard (any suggestions or comments highly appreciated). i have form in rails app (haml file): = simple_form_for(@book, remote: true) |f| .row .form-group = f.input :book_title, as: :string, label: "title of book" %br = f.input :pages_number, as: :string, label: "number of pages" %br .form-actions = f.button :submit, "create", class: "btn btn-success" = link_to t('buttons.cancel'), '#', onclick: "$.modal.close()", class: 'btn btn-warning pull-right' the action in controller opens form: def new @book = book.new end the action in controller saves form: def create end what i'm trying check whether input number of pages bigger 10. i want create confirm box. i trying save @pages_number = params[:pages_number] in create action, , use data: (@pages_number < 10 ? { confirm: "are sure?" } : nil) in view,

select - SQL - set min or max value in calculation -

my database items contains specifications (id, name, length, height, weight, quantity, etc). i want select id, name, length*3 + height*5 'newvar' items order newvar desc however, in order formulas work in calculation of newvar , if 'length' smaller 10, want reflected 10 in calculation. same goes 'height': if greater 10, need reflected 10 in calculation. how can achieve this? you can accomplish couple of case conditions return 10 if length or height < 10 or > 10 respectively. select id, name, ((case when length < 10 10 else length end) * 3 + (case when height > 10 10 else height end) * 5) newvar items order newvar desc http://sqlfiddle.com/#!2/2bfb1/2

c# - ASP.NET WEBForms - see steps in real time -

let's assume have page button. on button click have event function called. protected void btnclick(object sender, eventargs e) { panelsteps.visible = true; panelsteps_detailsaboutrecords.controls.add(new literal { text = "dads"}); system.threading.thread.sleep(5000); // wait 5 seconds panelsteps_detailsaboutrecords.controls.add(new literal { text = "bda" }); system.threading.thread.sleep(5000); // wait 5 seconds panelsteps_detailsaboutrecords.controls.add(new literal { text = "cdsa" }); system.threading.thread.sleep(5000); // wait 5 seconds panelsteps_detailsaboutrecords.controls.add(new literal { text = "ddsa" }); system.threading.thread.sleep(5000); // wait 5 seconds panelsteps_detailsaboutrecords.controls.add(new literal { text = "dase" }); } in browser see panel after entire function executed. why? , how can see in browser steps

objective c - AVMutableCompositionTrack scaleTimeRange in IOS9.1 won't work for when creating a fast forward video -

i using scaletimerange method create slow motion , fast video in ios. works fine in ios 8 not in 9.1 more. seems me apple fucked , changed stuffs. here codes double currentrecordingrate = [[recordingspeedratearray objectatindex: i] doublevalue]; [currenttrack scaletimerange:cmtimerangemake(duration, currentasset.duration) toduration:cmtimemake( currentasset.duration.value*currentrecordingrate, currentasset.duration.timescale)]; if currentrecordingrate larger 1, work fine (creating slow motion video) if it's lower 1, can't final video @ all. keep giving me error. experience kind of problem in ios 9.1 when trying slow motion , fast forward video? i using example codes example: how slow motion video in ios

c# - Reading dot data in csv file using OleDB -

i'm using oledb reading csv file , loading database table. data loaded incorrectly. in file csv data 12.34.56.78 after reading data becomes 12.345678. last 2 dots disappear. how can read , load correctly?

android - Can I register a new app to existing GCM server? -

the app working on must implement push service. have alternative app developed using javascript , such , developed in parallel (different package name, etc). app has push implemented , server working. given server url , senderid used (based on guides): instanceid instanceid = instanceid.getinstance(this); string token = instanceid.gettoken(serverrequests.senderid, googlecloudmessaging.instance_id_scope, null); then used token register on server instructed. problem not receiving messages. there missed? work without having make modifications (highly unlikely) on server ? check api-key valid using method here: https://developers.google.com/cloud-messaging/http checking validity of api key if receive authentication errors when sending messages, check validity of api key. example, on android, run following command: # api_key=your_api_key # curl --header "authorization: key=$api_key" \ --header content-type:"applic

github - Git repo size increased post BFG Repo Cleaner use -

i have cleaned repo bfg repo cleaner $ git clone --mirror ssh://git@example.com/some-big-repo.git $ java -jar bfg-1.12.8.jar --strip-blobs-bigger-than 100m some-big-repo.git output above command: slf4j: failed load class "org.slf4j.impl.staticloggerbinder". slf4j: defaulting no-operation (nop) logger implementation slf4j: see http://www.slf4j.org/codes.html#staticloggerbinder further details. using repo : some-big-repo.git scanning packfile large blobs: 1064306 scanning packfile large blobs completed in 6,655 ms. found 17 blob ids large blobs - biggest=548483051 smallest=154402960 total size (unpacked)=6732468925 found 13643 objects protect found 175 tag-pointing refs : refs/tags/alpha_7_0_0_27, refs/tags/alpha_7_0_0_28, refs/tags/alpha_7_0_0_29, ... found 1886 commit-pointing refs : head, refs/heads/cli-ps-command-shows-tag-and-branch, refs/heads/ibis-15065-ibis70, ... protected commits ----------------- these protected commits, , contents not altered: * com

windows - .lnk not showing up with get-childitem -

os: windows 7 pro sp 1 powershell-version: 5.0.10514.6 i use command list of startmenu shortcuts: get-childitem "c:\programdata\microsoft\windows\start menu\" -recurse the command return except "windows media center.lnk" should under "...\start menu\programs" the same thing happends if use dir command i can see file if use file explorer know exists! any idea on why not showing up?

excel - VBA function error when other users try to use it -

Image
i've made short function find whether name "given name surname" or "surname, given name", when run user (on pc), result function in error #name? : function findname_function(namecell string) string dim findcomma long dim findname string findcomma = instr(1, namecell, ",") if findcomma <> 0 findname = vba.right(namecell, len(namecell) - findcomma) else findname = vba.left(namecell, instr(1, namecell, " ") - 1) end if findname_function = findname end function this how function called: this formula: ="hello "&findname_function(index(table_hp_effective_contact_list;match(siteid;table_hp_effective_contact_list[site];0);4))&"," i believe use function udf (user defined function) , #name error indicates function can't found or executed. make sure store udf on discoverable location , has permission run. not clear question -where- stored udf , security settings on client machi

android - How i Add my App in default dialer options -

i want add app in default options . when 1 making call show app options like skype,viber etc . i have used following line of code not worked. <intent-filter > <action android:name="android.intent.action.call_privileged" /> <category android:name="android.intent.category.default" /> <data android:scheme="tel" /> </intent-filter>

Type Rank IN Ndepend -

1)in our application have found 2 different ranks 1 287 , 1 409. 1 best rank .what code changes developer has better rank methods. 2)with of rank how can our method passed rules of ndepend . type rank or method rank, higher or lower value, not better or worse. it indicates popularity of type, if used lot or not. internally famous page rank algorithm used on graph of types , graph of methods. type rank documentation here . recommendations: types high typerank should more tested because bugs in such types more catastrophic.

oauth - angular2 http.post method throws typeerror{} exception -

i tried change existing angularjs library angular2 need. http.post method in below code throws typeerror {} exception. please stuck on this. login() { return new promise((resolve, reject) => { if(typeof jssha !== "undefined") { var signatureobj = (new oauthutility()).createsignature("post", this.magentooptions.baseurl+"/oauth/initiate", this.oauthobject, {oauth_callback: "http://localhost/callback"}, this.magentooptions.clientsecret, null); let headersinitiate = new headers(); headersinitiate.append('authorization',signatureobj.authorization_header); headersinitiate.append('content-type','application/x-www-form-urlencoded'); let url = this.magentooptions.baseurl + "/oauth/initiate"; let callback = "oauth_callback=http://localhost/callback"; try{ this.http.post(url, callback,{headers: headersinitiate})

c# - Dynamically hide a row in a DataGrid -

i want hide 1 row of datagrid when user selects row. how can that? private void datagridcommands_selectionchanged(object sender, selectionchangedeventargs e) { (int = 0; < datagriddata.items.count; i++) { if ((datagriddata.items[i] datafortable).msgtype == _qf.elementat(datagridcommands.selectedindex).mcode) { //need hide 1 row datagriddata } } } i not know logic want use hidding row datagrid, show simple sample. the point need retrive container of row , hide it. let's see how. xaml: <stackpanel> <datagrid autogeneratecolumns="true" canuseraddrows="false" selectionchanged="datagrid_selectionchanged" name="datagrid" /> </stackpanel> and code-behind: public partial class window3 : window { private observablecollection<person> people = new observablecollection<person>(); public window3() {

jquery - How to hide and show elements inside viewed parent block when scrolling -

i'm trying make elements appear when in viewed block (like in div) , when scroll goes down hidden elements should visible: hidden format. im losing logic when trying apply it. please me, how this. $('div').scroll( function(){ $('ul li').each( function(i){ var bottom_of_object = $(this).position().top + $(this).height(), bottom_of_window = $('div').scrolltop(), distance = $(this).offset().top; if($('div').scrolltop() >= distance){ $(this).css({ 'opacity': '1', 'visibility': 'visible', 'text-shadow': 'none' }) } if(bottom_of_window <= bottom_of_object){ $(this).css({ 'opacity': '0', 'visibility': 'hidden', }) } }); }); div { height: 420px; overflow: auto; margin: 100px au

c - Detecting if data in a struct has been corrupted before reading it -

someone has told me there techniques in embedded c can check if data has been corrupted. more interested in detecting whether data has been corrupted because of other process corrupting ram memory. i have tried find information on internet couldn't find anything. one "surround" members of struct boundary values , before read these members, check these values still expected ones: #define boundary_value 0xdeadbeef typedef struct { uint32_t top_boundary; int32_t some_data[4]; uint32_t bottom_boundary; } tmydummystruct; tmydummystruct getsomedata( void ) { return (tmydummystruct){ .top_boundary = boundary_value, .some_data = {1, 2, 3, 4}, .bottom_boundary = boundary_value, }; } bool isdatacorrupted( tmydummystruct* data_struct ) { if( data_struct->top_boundary == boundary_value && data_struct->bottom_boundary == boundary_value) { return false; } return true; } the other te

php - Is it possible to extract all names of a facebook group and some basics details about who added them? -

i admin of private facebook group use business, extract names group , date , person added them. i'm interested know there possible way ? ideas or suggestions ? about extraction format, doesn't matter... you can extract members names, members id, group description, member role. first generate login url using facebook-php-sdk-v4-5.0-dev: $fb = new facebook\facebook([ 'app_id' => app_id, 'app_secret' => app_secret, 'default_graph_version' => 'v2.4', // or use v2.5 latest version ]); $helper = $fb->getredirectloginhelper(); $permissions = ['user_managed_groups']; $redirecturl = 'http://localhost/fbapp.php'; $loginurl = $helper->getloginurl($redirecturl, $permissions); echo '<a href="' . $loginurl . '">log in facebook!</a>'; after generating login url implement code response handling , getting require

ftp - FTPSClient file upload and download always size 0 and exception -

installed filezilla server , enabled ftp on tls settings in settings , started server. through eclipse java client tried connect server upload , download file using below code using commons-net apache library. ftpsclient ftpclient = new ftpsclient(false); // connect host ftpclient.connect(mserver, mport); int reply = ftpclient.getreplycode(); system.out.println("the reply code "+reply); if (ftpreply.ispositivecompletion(reply)) { // login if (ftpclient.login("******", "*******")) { // set protection buffer size ftpclient.execpbsz(0); // set data channel protection private ftpclient.execprot("p"); // enter local passive mode ftpclient.enterlocalpassivemode(); // upload file using storefile file firstlocalfile = new file("e:/test.txt"); string firstremotefile = "hello.t

java - How to install Maven 3 on Ubuntu 15.10/15.04/14.10/14.04 LTS/13.10/13.04/12.10/12.04 by using apt-get? -

try: sudo apt-get install maven if works ignore rest of post. intro i started setting ubuntu 12.10 on april 2013 , normal sudo apt-get install maven not working maven 3 then. the manual installation in post useful if dig in deeper ubuntu kernel in regards apt-get , finds list of applications available installation on ubuntu . can potentially useful more recent releases of ubuntu ubuntu 15.04 , etc. if face same problem did ubuntu 12.10. automatic installation via apt-get: checkout manual installation if current ubuntu can not install maven via common 'apt-get install maven'. sudo apt-get update sudo apt-get install maven make sure remove maven 2 if ubuntu not fresh or if using maven 2 before: sudo apt-get remove maven2 manual installation via apt-get adding maven 3 repository (ubuntu 14.04 check out update 1): this can useful if ubuntu apt-get repositories list not date. maven 3 required set system , turns out of documents out there referring h

git - Can rewriting history of a single-developer branch be dangerous? -

i use branches backup of wip. coming want have git diff back, can have again overview on changes while continuing work. so reset wip-commit ( git reset head^ ) , start work again. when need commit again (a definitive commit or wip-commit ) , push remote origin i wonder if new diverging commit create problems collaborators pulling same branch . i know if make changes , commit. if pull branch never touch it, , consequentially pull second new diverging wip-commit? is safe enough agree not touch branches of collaborators? if last commit has not been pushed, git reset head^ not mess up. if have pushed, recommend against it, if other collaborators not modifying branch. let's make initial commit a , push it, git reset head^ , make commit b . when try push it, error because b has same parent a , , git cannot fast forward merge on server. error message recommend git pull in case. once do, have new merge commit merges a , b . now, around doing force push (thus bl

php - Why this code giving output 200? -

solve problem please... function abc($a, $b) { echo $c = $a+$b; } echo 0*( abc(10,10) ); // giving output 200!!!!! echo "<br />"; echo 6*( abc(10,10) ); //giving output 200!!!!! echo "<br />"; echo 30*( abc(10,10) ); //giving output 200!!!!! any 1 in this? what echo 0 * (echo (10 + 10)). precedence of parenthesis, first echo 10 + 10 (= 20), echo 0 * (void) , seems void implicitly cast int(0) , void return of function abc , output 200. 6 * void , 30 * void = 0 either, output same. edit: is, step step, happens: echo 0 * (abc(10 + 10)): 1) calls abc 2) echoing 10 + 10 (so outputs 20 @ moment.) 3) returning abc (it returns void because don't specify return value) 4) evaluates 0 * (abc(10 + 10)) = 0 * void = 0 * 0 = 0 5) echoing 0 (so ouputs 0 right after 20 step 2) ). the steps second , third lines same, since 6 * 0 , 30 * 0 equals 0 too.

javascript - How to create Twitter widget? -

i want create twitter widget web application. i don't want use widgets provided twitter because if there thousands of users have create separate widget everyone, not possible. i want display tweets timeline of user logged in web application. i have force web application user sign in twitter before accessing timeline. how that? is there having detail idea it? please me. by using code,you can add own twitter widget .you can customize it. echo "<ul id='news'>"; $twit_usr = 'username';//please enter twitter username //$num_tweets = '60'; $reader = new xmlreader(); $reader->open( 'http://api.twitter.com/1/statuses/user_timeline/'.$twit_usr.'.xml/' ); while ( $reader->read() ) { if ( $reader->nodetype == xmlreader::element ) { $name = $reader->name; if( $name == "status" ) { while( $reader->read() ) {

asp.net mvc - How to ues JsonConvert.DeserializeObject to convert array to Model in C# -

Image
there data. how convert model? {"test": ["123","456"]} if have json string , want map c# class construct can use intigrated visual studio function paste json classes . copy json select edit –> paste special –> paste json classes if visual studio make class: public class rootobject { public string[] test { get; set; } } to deserialize call: var json = "{\"test\": [\"123\",\"456\"]}"; var myobject = jsonconvert.deserializeobject<rootobject>(json);

ios - How to know WebView has been already load url in Swift? -

how know did webview had load url inside ? my way (using delegate ) : var loadstates=false func loadpage() { if loadstates==false { let url = nsurl (string: "https://www.google.com/"); let requestobj = nsurlrequest(url: url!); webview.loadrequest(requestobj); } } func webviewdidfinishload(webview: uiwebview) { hideactivityindicator(webview) loadstates=true } have better way ? wevview.isempty()==true syntax in swift way?

recursion - Getting rid of outer parentheses on a list -

the particular problem have creating solution question 4.16b of structure , interpretation of computer programs . here procedure needs created transforms (lambda (a b) (define u 'u) (define v 'v) 'e1)) into: (lambda (a b) (let ((u '*unassigned*) (v '*unassigned*)) (set! u 'u) (set! v 'v) 'e1)) my procedure (see below) not this, instead transforms into: (lambda (a b) (let ((u *unassigned*) (v *unassigned*)) ((set! u 'u) (set! v 'v)) ('e1))) here have problem list of sets! produced make-sets (see below) , rest of body ( ('e1) above) produced cons current-element rest-of-body (see below). added lists, while want have them single statements, i.e., (set! u 'u) (set! v 'v) instead of ((set! u 'u) (set! v 'v)) , 'e1 instead of `('e1). procedure: ;; b. write procedure scan-out-defines takes procedure body , returns ;; equivalent 1 has n

c++ - How to get left click notification on an edit control? -

i want track event of single left-click on edit control. override pretranslatemessage function below: bool cmyclass::pretranslatemessage(msg* pmsg) { switch(pmsg->message) case wm_lbuttondown: { cwnd* pwnd = getfocus(); if (pwnd->getdlgctrlid == my_edit_ctrl_id) { //do thing } break; } } the problem when click on edit control, other control become disabled (for example buttons don't respond clicks etc.) how can fix problem? or how can track click notificationn on edit box? you need this: bool cmyclass::pretranslatemessage(msg* pmsg) { switch(pmsg->message) { case wm_lbuttondown: { cwnd* pwnd = getfocus(); if (pwnd->getdlgctrlid() == my_edit_ctrl_id) // << typo corrected here { //do thing } break; } } return __super::pretranslatemessage(pmsg); //<< added } btw bit a

java - dl4j canova example not working -

deeplearning4j canova example not working.i getting output of eval.stats nan (accuracy).i import org.slf4j.loggerfactory; public class imageclassifierexample { public static void main(string[] args) throws ioexception, interruptedexception { // path labeled images string labeledpath = system.getproperty("user.home")+"/lfw"; list<string> labels = new arraylist<>(); for(file f : new file(labeledpath).listfiles()) { labels.add(f.getname()); } // instantiating recordreader pointing data path specified // height , width each image. recordreader recordreader = new imagerecordreader(28, 28, true,labels); recordreader.initialize(new filesplit(new file(labeledpath))); // canova dl4j datasetiterator iter = new recordreaderdatasetiterator(recordreader, 784,labels.size()); // creating configuration neural net. multilayerconfiguration

wso2esb - Delete Request with formData not passing trough WSO2 API Manager -

i trying delete request formdata parameter. reason parameter not being passed server side. when call directly server formdata passed, through wso2 does not . can please. there setting need activate or something. i reproduce scenario in latest api manager pack. anyway when send delete request server, resource deleted identified request uri not entities in request. can find more information on spec . the delete method requests origin server delete resource identified request-uri. according debug session had in synapse code, code written in way delete request has not entity in it. form data sent in request ignored request. done design.