Posts

Reading special field from variable XML File c# -

Reading special field from variable XML File c# - i have got file called xmlfile.xml: <personen> <person> <vorname>manfred</vorname> <telefon/> <zuname>fischer</zuname> <alter>45</alter> <adresse ort="bonn" strasse="neuestr.34"></adresse> </person> </personen> there 2 problems. first of fields of '' variable. maybe xmlfile contains 3 persons or value (of course of study contains @ to the lowest degree one). need print out 'vorname' of each person, how can so? tried code (just short view): reader.readtofollowing("person"); string isbn = reader.getattribute("alter"); console.writeline("age: " + isbn); console.readline(); but doesn't print out age (alter), how working print out age of each person, in case there more one. just quick search , you'll find plenty of resource read xml vi...

Design - Breadcrumbs Javascript -

Design - Breadcrumbs Javascript - recently we've received design uses breadcrumbs, specifies breadcrumb page not exist. in effect, breadcrumb in question, relates section of top-level page. we're wondering if utilize of breadcrumbs not advisable or whether more mutual we're aware of. example: page 1 (main info page, contains 2-4 sections describing topics contained in sub-pages. each topic's text marked using html using h1 or h2). page 2 (is page list products related topics on page 1). the design this: page 1 > our top-level page. user presented 3-4 sets of products grouped hyperlinked topic text (as html h1's or h2's). when user clicks on topic taken page 2: breadcrumb new design specifies this: page 1 > topic text > page 2 and when user clicks topic text "breadcrumb", taken page 1, , css used highlight h1 or h2 topic text user clicked on. the above seems odd in "topic text" breadcrumb not relate page. beingnes...

asp.net mvc - OnActionExecuting gets called when loading images on Firefox & IE but not on Chrome -

asp.net mvc - OnActionExecuting gets called when loading images on Firefox & IE but not on Chrome - i testing code in onactionexecuting action , noticed chrome acting differently firefox & ie. firefox & ie fires onactionexecuting action on images (maybe more?) , chrome not. i requested property: filtercontext.requestcontext.httpcontext.request.currentexecutionfilepathextension gives me extension of requested url. in case was: `".png" why isn't chrome firing action? note: (i have not tested further, stopped when noticed fires images. browsers tested ie & firefox) has asp.net mvc or browser? asp.net-mvc internet-explorer google-chrome firefox action-filter

sql - First active_record insert id is set to NULL automatically -

sql - First active_record insert id is set to NULL automatically - i have schema: create_table :tweets, id: false |t| # we'll utilize id store actual tweet id t.integer :id, null: false t.string :text t.datetime :created_at t.index :created_at end class tweet < activerecord::base end i'm trying utilize active_record, provide own id values on each insert. now when seek insert same thing twice, error first time, works after that: > tweet.create(id: 123, text: 'foo', created_at: time.now)) activerecord::statementinvalid: pg::notnullviolation: error : null value in column "id" violates not-null constraint detail: failing row contains (null, foo, 2014-10-06 15:45:46.149613). : insert "tweets" ("created_at", "text") values ($1, $2) /home/mapleoin/tweetwatch/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/l ib/active_record/connection_adapters/postgresql_adapter.rb:834...

keyboard - How to prevent iOS Messages app from cropping pasted image? -

keyboard - How to prevent iOS Messages app from cropping pasted image? - i'm working on app lets people re-create , paste images. image copied this: nsstring *path = [[nsbundle mainbundle] pathforresource:@"circle" oftype:@"png"]; uipasteboard *pasteboard = [uipasteboard generalpasteboard]; nsdata *data = [nsdata datawithcontentsoffile:path]; [pasteboard setdata:data forpasteboardtype:@"public.png"]; when pasting in notes app, works fine. in messages app, crops right side of image. there way prevent this? you cannot prevent this, since apple's ui idea. although can set transparent borders image though messages.app clips image main part of still visible. ios keyboard sms copy-paste imessage

powershell - Using Import-CSV to make HTTP Request -

powershell - Using Import-CSV to make HTTP Request - wonder if can help. i'm trying utilize powershell import list of domains , generate http request each of them. i've got far: class="snippet-code-html lang-html prettyprint-override"> $csvfilename = "c:\sites\sites.csv" $csv = import-csv $csvfilename -header @("url") | foreach { $http_request = [system.net.webrequest]::create('$csv') $http_response = $http_request.getresponse() $http_status = [int]$http_response.statuscode if ($http_status -eq 200) { write-host "site ok!" } else { write-host "the site may down, please check!" } $http_response.close() } i'm not sure why 'create()' statement won't pick url. ideas? many thanks inside foreach loop, can access current element automatic variable $_ so replace line $http_request = [system.net.webrequest]::create('$csv') $...

java - Wont display int declared in if statement -

java - Wont display int declared in if statement - package assignment_3_1; import java.util.scanner; public class assignment_3_1 { /** * @param args command line arguments */ public static void main(string[] args) { //create scanner scanner input = new scanner (system.in); //obtain bundle weight 1 system.out.print("enter bundle weight (in pounds): "); int packageweight1 = input.nextint(); double weightcalc1 = 5; double weightcalc2 = 15; double weightcalc3 = 34; double weightcalc4 = 45; double weightcalc5 = 60; double weightcalc6 = 60; double pricea = 12; double priceb = 14; double pricec = 17; double priced = 21; double pricee = 33; double pricef = 105; //if weightcalc1 >= packageweight1 base of operations charge 12 if (weightcalc1 >= packageweight1) { system.out.println("the base of operations charge : " + pricea); int baseprice = 12; } ...