Posts

Showing posts from January, 2010

javascript - How to call to a function, with a string -

javascript - How to call to a function, with a string - i creating string headlines of table, making checkbox each headline, , should hide col if unchecked , show if checked. function set checkbox in div. i calling function when page loaded (onload in body) this function: function getfirstrow(table) { var table = document.getelementbyid(table); var row = table.getelementsbytagname('tr')[0]; var cells = row.getelementsbytagname('th'); var str = ""; (var i=0; < cells.length; i++) { str += "<input type='checkbox' onclick='hideorshowcol('treestable', "+i+", this);' checked='checked' />" + cells[i].innerhtml + " "; } document.getelementbyid("hideandshow").innerhtml = str; } and hide/show function: function hideorshowcol(table, col, e) { alert(e.checked); var iftoshow = ""; if (e.checked) iftoshow = ...

css - Include images as Inline in sass without Compass? -

css - Include images as Inline in sass without Compass? - i want add together images base64 in sass. have been locking @ compass feels way bulky , not i'm looking for. there way include images or other files inline in css without using compass? if utilize grunt, can utilize grunt-data-uri task in order accomplish conversation of regular url() string base64. datauri: { dist: { src: ['dist/styles/*.css'], dest: 'dist/styles/', options: { target: [ 'img/low-res/embeded/*.*' ], fixdirlevel: true } } }, essentially, task every images contained within embeded folder in .css. there, convert url() base64. css css3 sass

ios5 - Handle UIButton in Child View Controller of Container View Controller -

ios5 - Handle UIButton in Child View Controller of Container View Controller - i working on creating custom container viewcontroller class , able create 5 sub viewcontrollers , able move 1 kid view controller other kid using next api: transitionfromviewcontroller:fromviewcontroller toviewcontroller:toviewcontroller duration:1.0 options:0 animations:^{ } completion:^(bool finished) { }]; child view controllers occupying part of parent view controller. each time when user swipe making previous controller goes off , nowadays controller comes on displayable area. now have buttons on kid viewcontrollers , when click on them not getting events or trigger action method of kid view controller. parent view controller getting callbacks buttons childview getting displayed. please help asap. adding code snippet below (though little bigger, help analyze if doing mistake). ...

ember.js - Ember router: Asynchronous model (promises?) -

ember.js - Ember router: Asynchronous model (promises?) - [this new 1.0.0-pre.4+ router.] i want homecoming ember route's model method record needs asynchronous callbacks load, instance because requires load multiple (nested) models. what's best way this? here sample code hypothetical blog app illustrates problem: app.router.map -> @resource 'filteredarticles', path: '/:filter' app.filteredarticlesroute = ember.route.extend model: (params) -> blog = app.blog.find(1) # user's blog singleton property = switch params.filter when 'published' 'publishedarticles' when 'draft' 'drafts' when 'all' 'articles' # homecoming list of articles `blog` record. # `blog` hasn't finished loading :( blog.get(property) i'm in middle of rewriting travis ci newest ember version , faced same problem - fetch repositories slug (e.g. emberjs/ember.js ), not...

gps - How to track status of an users over static image in android? -

gps - How to track status of an users over static image in android? - as shown in image, static image overlayed on map view , want track users status using gps whether in yellowish or red, possible ? i think possible, you'll need downwards math bit it. don't think of 'in color someone' find image center coordinates, , see how far away user that. android gps maps

vba - Trouble referencing temporary, unsaved workbook when copying worksheets -

vba - Trouble referencing temporary, unsaved workbook when copying worksheets - i have bunch of worksheets want re-create new, temporary workbook -- without saving it. worksheet.copy copies worksheet new, unnamed'ish (book1, book2, book3, etc) workbook. want sheets copied same workbook. worksheets after first, have tried using worksheet.copy after:=xlwb.sheets(1) , not know how reference newly created workbook when setting xlwb workbook-object. maintain receiving run-time error 9, 'subscript out of range'. i appreciate help can give. edit: next relevant dims: dim xlapp excel.application dim xlwb excel.workbook dim xlwbold string dim xlws excel.worksheet dim xlwbnew excel.workbook dim xlwsold excel.worksheet dim xlrng excel.range dim xlrngold excel.range xlwbold = activeworkbook.name set xlapp = new excel.application xlapp.visible = true '*** quite of import set excel.visible,_ ...

asp.net mvc 4 - jQuery get "distinct" elements from a document -

asp.net mvc 4 - jQuery get "distinct" elements from a document - i creating footnotes helper asp.net mvc. have generated on page set of links similar to: <a rel="footnote" href="#fn:footnote1" data-text="note" data-ref="1">1</a> i want generate bottom section containing actual notes. goal take href , data-text each link , create li element @ bottom of page. this html generated section: <div id="6c708d57-abc0-4e53-ab0c-913f0b8c8020" class="footnote"> <hr /> <ol></ol> </div> and corresponding script: <script type="text/javascript"> $(function () { var footnotes = $('#6c708d57-abc0-4e53-ab0c-913f0b8c8020 ol'); $('a[rel="footnote"]').each(function () { var reference = $(this).text(); var text = $(this).attr('data-text'); var href = $(this).attr('href').substri...

python - Default filter in Django model -

python - Default filter in Django model - is possible set default filter in django models? something like: class mymodel(models.model): timestamp = models.datetimefield(default=datetime.utcnow) active = models.booleanfield(default=true) class meta: ordering = ['-timestamp'] filtering = [active=true] you'll have override manager: class mymodelmanager(models.manager): def get_queryset(self): homecoming super(mymodelmanager, self).get_queryset().filter(active=true) class mymodel(models.model): timestamp = models.datetimefield(default=datetime.utcnow) active = models.booleanfield(default=true) objects = mymodelmanager() class meta: ordering = ['-timestamp'] get_queryset get_query_set before django 1.6 python django model

android - Calling Multiple Layouts in One Activity on 2 different Call Backs -

android - Calling Multiple Layouts in One Activity on 2 different Call Backs - what doing initializing layout on start of activity. whenever button on layout clicked initializing layout in same activity. whenever click doing working regarding insertion of database record. on ignoring database part getting java null pointer exception in logcat. kindly have , guide me package com.example.emp_management; import android.app.activity; import android.content.contentvalues; import android.database.sqlite.sqlitedatabase; import android.os.bundle; import android.provider.syncstatecontract.columns; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.toast; import com.example.emp_management.databasehelper; public class administrator_work extends activity{ @override protected void oncreate(bundle adminkakaam) { // todo auto-generated method stub super.oncreate(adminkakaam); s...

c++ - Using javascript objects with UTF-16 property names -

c++ - Using javascript objects with UTF-16 property names - i'm calling service returns utf-16 json data. question if json object has utf-16 strings property names there simple way reference these properties? for example, here how response info looks after calling json.stringify on it: "{"c\u0000o\u0000n\u0000t\u0000e\u0000n\u0000t\u0000s\u0000":{ ... in code i'd data['contents'] . there simple way around avoids either hardcoding strings unicode escape sequences? update: changed indicate strings utf-16. here's illustration (visual c++) of phone call generate json output: wchar_t* str = _t("contents"); yajl_gen_string(g, (unsigned char*)str, wcslen(str) * sizeof(tchar)); javascript c++ ajax utf-8 yajl

html - How to center text for one of the column -

html - How to center text for one of the column - i know funny have never heard best way center specific column within table tags col i have table <table> <colgroup> <col /> <col style="text-align: center;" /> </colgroup> <tbody> <tr> <td> </td> <td> must in center </td> </tr> <tbody> </table> but doesn't center text, wonder why? while in perfect world, solution work, css cascade doesn't quite work way. feat not, because css selectors powerful. see it, best alternative utilize :nth-child or :nth-of-type . or, add together classname cells (either manually or preferably programmatically), that's taking easy way out ;-) further reading: can utilize css3 selectors how :nth-child works. update: apparently, though, possible apply styles actual colgroup : http://jsfiddle.net/aryqx/. html css

c++ - Add library to existing project netbeans -

c++ - Add library to existing project netbeans - i adding extensions (another persons) existing project @ company. want import existing library boost it. using netbeans debugging existing project. in order import library netbeans 2 steps followed: include directories linker-> add together library. however when right click on existing project alternative of linker->add library not appearing. (though have included directories alternative there). can please guide me how should add together library through linker existing project? project in c++ assuming using unix/linux variants: directories headers , library linking 2 different things. include directories have headers needed, after compilation actual compiled code resides in libraries (*.a, *.so, etc...) might required. for example, if using pthreads, apart headers need include, need libpthread. when linking, need provide flag linking pthread i.e: -lpthread can search using find or locate on unix schem...

How do I get an OAuth access token in python? -

How do I get an OAuth access token in python? - (i asked on superuser got no response ...) i'm trying follow tutorial dropbox api @ http://taught-process.blogspot.com/2012/05/asdlasd-asda-sd-asd-asdasd.html but when lastly part #print token future reference print access_token what <dropbox.session.oauthtoken object @ 0x1102d4210> how actual token? should like: oauth_token_secret=xxxxxxx&oauth_token=yyyyyyy (i'm on mac) look around in properties , methods of object, apply "dir" on object. in case: dir(access_token) i'm pretty sure you're gonna find in object give token need. python oauth dropbox

validation - Rails validate only in admin namespace -

validation - Rails validate only in admin namespace - in rails app have 2 user-logic: user, , admin for illustration routing line_item such: namespace :admin resources :line_items, :only => [:edit, :update, :destroy] end resources :line_items, :only => [:new, :create, :update, :edit, :destroy] but in admin part must vailation line_item model: validates :notes, :presence => {:message => i18n.t(:notes_not_chosen)} validates :quantity, :presence => {:message => i18n.t(:quantity_not_chosen)} validates :price, :presence => {:message => i18n.t(:price_not_chosen)} validates :description, :presence => {:message => i18n.t(:description_not_chosen)} but in admin controller! how have validations in admin line_item controller, didn't have in user part? i don't think can validations based on controller request came through. can add together user attribute model , set in controller. can base of operations validatio...

c# - How to escape html.actionLink tags in string.format -

c# - How to escape html.actionLink <a></a> tags in string.format - to create url within translatable text utilize {0} placeholder. so do: @string.format(@translationhelper.gettranslation("label-clicktocontinue"), @html.actionlink( @translationhelper.gettranslation("text-here"), "login", new { model.username, model.uniqueid } ) ) translation keys: label-clicktocontinue = "click {0} continue" text-here = "here" but prints escaped string source: &lt;a href="/login/login?username=alberttest3&amp;amp;uniqueid=f3647fed-bab4-4575-bb5f-98ed27edff43"&gt;label-requestnewofficewizard&lt;/a&gt; how create sure it'll not show html-tag, url? this not supported actionlink helper. html encodes text. either write own custom helper doesn't encode text or simply: <a href="@url.action(login, new { username, model.unique...

Drupal 7 - Blocks: how do you specify it a list of pages except certain pages? -

Drupal 7 - Blocks: how do you specify it a list of pages except certain pages? - i created block want appear on these paths: example.com/sample/1 example.com/sample/2 example.com/sample/3 example.com/sample/4 example.com/sample/6 however, don't want appear on: example.com/sample/5 under visibility setting block, can select show block on "only listed pages" , come in /sample/* howevever, how tell not show in /sample/5 without typing out other paths individually? there "except" or "not" indicator somehow how * indicates all? use the context module handle placement of block. allows specify paths block should display on, should not (by starting path ~) for example, in context can specify paths so: sample/* ~sample/5 this tells drupal display block on paths match "sample/*" except "sample/5" drupal-7 block

visualization - NetworkX-style spring model layout for directed graphs in Graphviz / PyGraphviz -

visualization - NetworkX-style spring model layout for directed graphs in Graphviz / PyGraphviz - networkx graph analysis, pygraphviz drawing, , they're designed work together. however, there's @ to the lowest degree 1 respect in networkx's graph drawing (via matplotlib) superior pygraphviz's graph drawing (via graphviz), namely networkx has spring layout algorithm (accessible via spring_layout function) directed graphs while pygraphviz has several spring layout algorithms (accessible via neato program, , others) lay out directed graphs if undirected graphs. graphviz / pygraphviz layout programme handles direction in graph dot , dot creates hierarchical layouts, not force-directed layouts. here illustration shows difference between networkx , pygraphviz spring layouts of directed graphs: import networkx nx import pygraphviz pgv import matplotlib.pyplot ppt edgelist = [(1,2),(1,9),(3,2),(3,9),(4,5),(4,6),(4,9),(5,9),(7,8),(7,9)] nxd = nx.digraph() nxu =...

ruby on rails - Sign in function not working -

ruby on rails - Sign in function not working - i've built app allows users sign up, sign in, , sign out (my own devise ground up, if will). the app allows users sign up, when trying sign in next error: // (needless i'm @ stand still, ever can figure out genius in they're own right) nomethoderror in sessionscontroller#create undefined method `-' nil:nilclass rails.root: /users/user/sites/rails_projects/sample_app1 app/controllers/sessions_controller.rb:11:in `create' request parameters: {"utf8"=>"✓", "authenticity_token"=>"/seaqnrmf5x0pd4fvwbu8uwvajtnw4lpkixg+8hl0pq=", "session"=>{"email"=>"anthonypane@example.com", "password"=>"[filtered]"}, "commit"=>"sign in"} here session_controller contents: class sessionscontroller < applicationcontroller def new @title = "sign in" end def create user = user.au...

java - Why is my ListView method throwing a 'Stale object state' exception? -

java - Why is my ListView method throwing a 'Stale object state' exception? - currently within app getting stale object exception when phone call method updates listview database. i have been careful close of cursors when querying database, manage cursor when returned through utilize of 'startmanagingcursor' still issue. at moment, when add together new item database, recall listview update method within private method of class. object throwing exception. i have read of people 'refreshing' session, , believe database versions come this? overall i'm stuck , cant solve this. updated error: 02-13 13:23:06.588: e/androidruntime(287): fatal exception: main 02-13 13:23:06.588: e/androidruntime(287): android.database.staledataexception: access closed cursor 02-13 13:23:06.588: e/androidruntime(287): @ android.database.abstractwindowedcursor.checkposition(abstractwindowedcursor.java:217) 02-13 13:23:06.588: e/androidruntime(287): @ an...

c# - Using Settings.settings or a SQL database? -

c# - Using Settings.settings or a SQL database? - i learning c# using visual studio , running issues. i developing windows form application. application meant track user's running stats. in settings: select how many days run , each day add together workout (ie: 1: 100m sprints 2: 50m sprints 3: run mile). then in main windows form user able add together times , save it. meanwhile graph projected of times- allow user track progress. my question should store times? right store settings in settings.settings doc. times should utilize settings file or sql database of sort? sqlce or sqlite or other simple inproc database improve settings file. settings not meant grow every user input, task database, much easier query info using sql . answering question in comments: there difference between user data , user preferences. have decide in app. i go settings file regarding user preferences. form layout, colors, sounds, window size , on. since settings mana...

oop - is there a universal definition for "static class"? -

oop - is there a universal definition for "static class"? - i thought knew know static classes until switch java , learned cannot done static class in c#, can done in java. so if "a static class class cannot instantiated , cannot have instance members , sealed , cannot derive class other object", guilty of assuming true in 1 programming language true in programming languages. is there universal definition "static class" or whatever people implemented language wanted be? there's no standard many oo concepts or how languages implement concepts java doesn't have static classes, nested static ones. different things. oop class object static

oracle - How to substitute bind variable in pl/sql developer tool -

oracle - How to substitute bind variable in pl/sql developer tool - i run sql script in pl/sql developer next example. variable vtest varchar2; (exec/set) :vtest := 'abc' select :vtest dual; select :vtest ||'xyz' dual ; select * table columnname = :vtest; you can in test window. first grant debug connect session <schema> then open new test window. declare bind variables @ bottom of screen. give them name, type , value there. sql oracle plsqldeveloper

asp.net mvc - Plupload only working on MVC home -

asp.net mvc - Plupload only working on MVC home - i have bizarre problem plupload hoping help me with. i using mvc , amazon s3 and, taking sample works fine. so in homecontroller index view. therefore if navigate localhost/ works no problems. if navigate localhost/home "add file" button not clickable due _flash_container beingness in way. even if utilize firebug out way "add file" button doesn't anything. does have idea? my code follows: @model mvc3pluploadtoamazons3.viewmodels.fileuploadviewmodel @{ viewbag.title = "index"; } <h2>upload amazon s3</h2> <div id="uploader"> <p>you browser doesn't have flash, silverlight, gears, browserplus or html5 support.</p> </div> <input type="hidden" name="key" value="@model.fileid-${filename}"> <input type="hidden" name="awsaccesskeyid" value="@model.publickey"...

java - Add JPanel to frame using if statement -

java - Add JPanel to frame using if statement - i'm trying add together jpanel frame on click of jmenuitem. i've looked in past posts , i've tried using: getcontentpane().add(myjpanel) revalidate(); repaint(); to no avail. game class constructor size set , background colour now. oh , sorry messy code, had deleted non working original , done give thought of i've tried. suggestions appreciated. package game; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jmenu; import javax.swing.jmenubar; import javax.swing.jmenuitem; import javax.swing.joptionpane; import javax.swing.swingutilities; public class main extends jframe{ static boolean gameactive = false; game game; jmenubar menubar; jmenu file; jmenuitem startgame; jmenuitem checkscore; jmenuitem closegame; int userscore; public main() { game = new game(); gameactive = false; //set jmenubar menubar = new jmenubar()...

delphi - Using DCEF with cppbuilder -

delphi - Using DCEF with cppbuilder - is possible utilize dcef (delphi chromium embedded) under c++builder ? how can configure ide ? delphi c++builder chromium-embedded

how to call external dll function from java code -

how to call external dll function from java code - please help me. need phone call external dll library function java code. utilize netbeans 7.2. dll's functions are: boolean isvalid(string word) list<string> getwords(string word) i'm follow this example. don't know how declare dll functions. , found link. doesn't work me. (sorry bad english) i stumbled upon same problem of "calling dll java" , first frustrated complexity. yet, there elegant solution (might interesting people on there in processing.org habitat..) given rather "general" form of question (maybe, downrating not justified that), suppose, rather easy-going solution indicated. in other words, solution avoids messing aronud header files, conversions, etc., source code not available. my recommendation jna (https://github.com/twall/jna), simplifying wrapper around jni. works great, type mapping straightforward (e.g. pchar = lpcstr buffer -> string), though us...

jquery - Ajax post fails if there is a js file request after -

jquery - Ajax post fails if there is a js file request after - an ajax post request in process of page loading. found random fault, , readystate 0 when fault occurs. after careful checking, found rule. if there js file request after post request, fails. if post request lastly request in process of page loading(or there image file request after), success. i don't know why. there official explain this? thanks. the js code when page loading: $(document).ready(function(){ ... loading operaion ... $.ajax({ //get login info cache:false, type:'post', url:"/login_bar", data:"admin_type="+$("#container>div:eq(0)").attr("name")+"&item_id="+$("#life_container").attr("name"), async:'false', datatype:"json", success:function(json){ // operation ...... }, error:...

java - Traversing a results site -

java - Traversing a results site - consider site: http://prernaclasses.com/stuenggmarks.asp?hformno=220456 gives marks of candidate roll no. 220456 @ end of url. there method traverse roll no.s code , store marks. source code results page is: http://pastebin.com/8ziyydki could please give reference how it, specially using java. great if gave soultion involve java only. java

c - What does a double-percent sign (%%) do in gcc inline assembly? -

c - What does a double-percent sign (%%) do in gcc inline assembly? - i came across code looks this: asm volatile ( # [...] "movl $1200, %%ecx;" # [...] ); i know movl $1200, %ecx in x86. confused why there 2 percent signs. gcc inline assembly uses %0, %1, %2, etc. refer input , output operands. means need utilize 2 %% real registers. check howto great information. c gcc x86

regex - Google spreadsheets translate returns double quotes -

regex - Google spreadsheets translate returns double quotes - i using googletranslate() function translate 1 language in google spreadsheets. have sentence in 1 (known) language @ column a1 'lorem ipsum dolor sit down amet' , want translation of in english language @ column b1. used this: =googletranslate(a1, "li", "en") the result is: "lorem ipsum dolor sit down amet". there double quotes now. want translation single quote (like before), found google's bug (yes, said google's bug lol). solution maybe in within regular look or else... how can replace double quotes (in beingness , end only) of translated sentence in google spreadsheets? based on docs looks google spreadsheets allows search regex , not replace, in case can: find: "(.*?)" replace: '\1' you can of course of study other programme using same regexen. regex spreadsheet

c++ - GetClipboardData(CF_TEXT) -

c++ - GetClipboardData(CF_TEXT) - how using getclipboarddata(cf_text); without calling , utilize process id of in c++? , getclipboarddata(cf_text) belong library? getclipboarddata() win32 api function. the handle returned getclipboarddata() must first locked globallock() , can retrieve char* pointer of ansi text in clipboard (note if want retrieve unicode text, should utilize cf_unicodetext format). a sample code retrieve text clipboard , store in convenient std::string class instance follows (error management omitted simplicity): std::string getclipboardtext() { // seek opening clipboard if (! openclipboard(nullptr)) ... // error // handle of clipboard object ansi text handle hdata = getclipboarddata(cf_text); if (hdata == nullptr) ... // error // lock handle actual text pointer char * psztext = static_cast<char*>( globallock(hdata) ); if (psztext == nullptr) ... // error // save text in string class instance std::...

graphics - reconstructing a curve from its stroke -

graphics - reconstructing a curve from its stroke - i trying reconstruct curves (pdf) graphics. these consist of outline of curve ("stroke"). typical illustration (monotonic in x, y increasing on hump , dropping) shown. original stroke-width appears 1.0, of secondary interest. i include svg representation below. @ nowadays rather rough effort floodfill curve , effort lean until got midline. seems fragile. there improve algorithm given have analytical outline (as lines , cubic beziers?) <svg xmlns="http://www.w3.org/2000/svg" > <g transform="scale(25., 25.)"> <g transform="translate(-110., -235.)"> <path fill="none" stroke="red" stroke-width=".05" d="m114.06 242.46 l114.12 242.28 l114.18 242.16 l114.3 242.04 c114.36 241.98 114.36 241.92 114.42 241.92 l114.48 241.86 c114.54 241.8 114.66 241.74 114.72 241.74 l114.78 241.74 c114.9 241.68 115.02 241.68 115...

php - contents of text area not posting -

php - contents of text area not posting - i have form located @ https://pnrbuilder.com/_popups/feedback_popup.html the form uses post pass input php page sends email contents of post redirects user. the input fields work fine textarea content doesnt create email. any thought im doing wrong? the php page: <?php /* first bit sets email address want form submitted to. need alter value valid email address can access. */ $webmaster_email = "support@email.com"; /* bit sets urls of supporting pages. if alter names of of pages, need alter values here. */ $feedback_page = "feedback_form.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html"; /* next bit loads form field info variables. if add together form field, need add together here. */ $emailaddress = $_post['emailaddress'] ; $issuetype = $_post['issuetype'] ; $comments = $_post['comments'] ; /* next function checks email i...

php - Select DISTINCT rows of multiple columns in mysql -

php - Select DISTINCT rows of multiple columns in mysql - i have table called sk_messages .it's construction following: msg_id msg_from_user_id msg_to_user_id msg_text msg_date msg_status 1 12 14 hai... 23-12-2013 unread 2 12 14 .... ... unread 3 13 14 ... .. unread my requirement want display messages current user status single message should displayed sender if sends multiple messages status unread.that is,from above context, single message of user having id 12, should displayed.i have tried next query,but doesnt work. select distinct (msg_from_user_id), msg_text, msg_date sk_messages msg_to_user_id = '$user_id' , msg_status = 'unread' order msg_date $user_id id of login user try group user id. select msg_text, msg_date sk_messages msg_to_user_id = '$us...

html - CSS padding while retaining the defined size? -

html - CSS padding while retaining the defined size? - according standard, adding padding html element in css grow element amount defined. example: .elem { width: 100px; height: 100px; padding: 20px; } will add together 20 pixels .elem's sides, causing actual width , height 140px total. since pretty impractical in web design (having calculate , maintain track of resulting sizes), wondering if somehow possible reverse instead. set padding, , inner text area shrinks instead. element stays @ 100*100px, has padding of 20px within it, , don't have worry messing design while experimenting padding. is possible? perhaps through language compiles css (haven't looked much)? , perhaps more minor question: why work way in first place? use box-sizing : elemselector { -moz-box-sizing: border-box; -ms-box-sizing: border-box; -o-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } this value property decl...

ios - How to access XML data from SOAP web-service response in iPhone? -

ios - How to access XML data from SOAP web-service response in iPhone? - i using soap web service , in able read string response if web service return. when web service homecoming string , xml don't know how access xml response. ex. http/1.1 200 ok content-type: text/xml; charset=utf-8 content-length: length ` <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <getcountriesresponse xmlns="http://www.myurl.com/"> <getcountriesresult> <code>string</code> <profile>xmlxml</profile> </getcountriesresult> </getcountriesresponse> </soap:body> </soap:envelope>` in don't know how access these response of code , profile tag xml. c...

javascript - Web Audio: No sound in right channel -

javascript - Web Audio: No sound in right channel - i'm trying create custom panning command using web sound api, can't sound come out of right channel using channel splitter , merger nodes: var context = new webkitaudiocontext(), destination = context.destination, osc = context.createoscillator(), gainl = context.creategainnode(), gainr = context.creategainnode(), splitter = context.createchannelsplitter(2), merger = context.createchannelmerger(2); osc.frequency.value = 500; osc.connect(splitter); splitter.connect(gainl, 0); splitter.connect(gainr, 1); gainl.connect(merger, 0, 0); gainr.connect(merger, 0, 1); osc.noteon(0); gainl.gain.value = 0.1; gainr.gain.value = 0.5; osc.noteoff(2); merger.connect(destination); am missing obvious here? there's jsbin preview of above code here: http://jsbin.com/ayijoy/1/ i'm running chrome v24.0.1312.57, in case that's of use. my best guess happens because oscillator outputs ...

windows phone 8 - WinPhone8 WebBrowser -

windows phone 8 - WinPhone8 WebBrowser - i using webbrowser component in app display generated html on page in app. when navigate page there noticeable lag when browser command disappears off page , 1/2 sec later rest of page disappears. having run application analysis on it, each time happens app responsiveness drops 0 , appears doing gc collection. is there anyway avoid lag when closing page. take @ latency modes of garbage collector : http://msdn.microsoft.com/en-us/library/bb384202.aspx hope helps :) windows-phone-8

asp.net - .DataSource outputs a duplicate list? -

asp.net - .DataSource outputs a duplicate list? - when user selects value drop downwards list , clicks on button, value added sec list (which displayed on screen). the problem beingness when user clicks on button, selected value added sec list drop downwards list duplicated , added original drop downwards list. so have 1, 2, 3 in original drop down, user selects '1' , presses button. '1' added sec list , displayed on screen when user clicks on drop downwards contains 2, 3, 1, 2, 3 iv went through code break point , think has .datasource. protected void updatepage() { int id = system.convert.toint32(id.value); list<contractor> allcontractors = new list<contractor>(); clarkedbdatacontext db = new clarkedbdatacontext(); allsubcontractors = (from boqcontractors in db.boq_contractors boqcontractors.bill_of_quantity_id == tempboqid select boqcontractors.contractor).tolist(); re...

iphone - UICollectionViewController multithread image loading -

iphone - UICollectionViewController multithread image loading - i'm having problem loading images asyncronously between view controllers. have tableview controller opens collection view controller when click on row. when collection view opens, hangs while images downloaded internet. i set next code in collectionview:cellforitematindexpath:, results in synchronous loading, , makes programme lag. -(uicollectionviewcell *) collectionview:(uicollectionview *)cv cellforitematindexpath:(nsindexpath *)indexpath{ static nsstring *cellidentifier = @"collectioncell"; collectioncell *cell = [cv dequeuereusablecellwithreuseidentifier:cellidentifier forindexpath:indexpath]; nsdata *imagedata = [nsdata datawithcontentsofurl:[self.theimage objectatindex:indexpath.row]]; cell.itemimage.image = [uiimage imagewithdata:imagedata]; homecoming cell; } my question is, where , how implement code such collection view loads empty cells while images downloading (and a...

Laravel export to my domain server? -

Laravel export to my domain server? - i sense left in dark when comes trying uploading laravel website. need virtual host access public folder on localhost. how can done on site? getting this: www.smks.co.uk and if access public unusual error www.smks.co.uk/public if utilize shared hosting, hosting provider doesn't allow build virtual host. need alter directories , configuration little bit. have uploaded several websites shared hosting using this method. laravel

android - Arrayindex out of bound comes when collapse the expandble list group -

android - Arrayindex out of bound comes when collapse the expandble list group - i m using expandble list view , collapsing using expand.collapse throwing ans exception- arrayindexoutofbound. expandablelistview mexpandablelist.setongroupclicklistener(new ongroupclicklistener() { @override public boolean ongroupclick(expandablelistview parent, view v, int groupposition, long id) { // todo auto-generated method stub if(pause!=1234){ mexpandablelist.collapsegroup(pause); system.out.println(pause+" clicked"); } pause=groupposition; homecoming false; } }); hi can utilize this @override public boolean ongroupclick(expandablelistview parent, view v, int groupposition, long id) { // todo auto...

php - Capturing SQL notices from Propel ORM -

php - Capturing SQL notices from Propel ORM - i have big sql function want execute on postgresql database via php/propel using prepared statement so: $sql = "lots of sql statements"; $statement = $propelpdo->prepare($sql); $statement->execute(); in sql statements i'm trying execute, there many calls "raise info ..." , "raise warning ..." show debugging information. executing sql command line, can see notices helps debug sql: psql -h hostname database username < lots_of_sql_statements.sql my question: there way capture info , warning notices raised in sql php can log them later analysis? running sql on lot of different records , great able log notices instead of having go command line each individually see debugging info. well if utilize actual propel objects can grab messages catching propelexception try { $propelobject ->setsomething('foo') ->save() ; } grab (propelexcepti...

codec - Is re-encoding JPEG images an idempotent operation? -

codec - Is re-encoding JPEG images an idempotent operation? - i aware jpeg compression lossy. have 2 questions: given operation t: 1. take jpeg-80 image 2. decode byte buffer 3. encode given byte buffer jpeg-80 is t idempotent operation in terms of visual quality? or quality of image maintain degrading repeat t? same hold true jpeg-xr codec? thank you! edit: since there have been conflicting answers, great if provide references! by definition, lossy operation discards info simplifying representation in way (ideally) isn't noticeable end user. however, encoder has no magic method determining pixels of import , aren't, encodes pixels equally, if artifacts! in other words, encoder treat lossily-compressed image same lossless image. lossy image farther simplified, discarding additional info in process, because encoder knows, user intends represent artifacts. here examples of jpeg generation loss: http://vimeo.com/3750507 http://en.wikipedia.org/w...

c++ - Linking glut to Qt -

c++ - Linking glut to Qt - i want combine opengl glut qt. i'm using windows. version of qt 4.7.4, 32 bit. i followed tutorial: http://www.youtube.com/watch?v=1nzhsky4k18 i checked other questions of people didn't gave me answer. the part before including glut works fine. when seek include glut doesn't work. errors are: undefined reference glutinit_atexit_hack and more undefined references glutfunctions. i copied glut-libraries , headers appropriate folders in mingw folder. wasn't sure if right folder. c++ qt opengl qt4 glut

ios - UIView Animate and completion block -

ios - UIView Animate and completion block - i'm trying animate tableview's offset down, in completion block move up. code not doing in completion block: -(void)viewdidappear:(bool)animated { if (true) { nslog(@"animating table view"); [uiview animatewithduration:.25 animations:^{ self.tableview.contentoffset = cgpointmake(self.tableview.contentoffset.x, self.tableview.contentoffset.y - 60); } completion:^(bool finished){ nslog(@"completion block"); }]; } } "completion block" never gets outputted... ideas? edit: ok, has uirefreshcontrol: - (void)viewdidload { [super viewdidload]; if (true) { uirefreshcontrol *refresh = [[uirefreshcontrol alloc] init]; refresh.attributedtitle = [[nsattributedstring alloc] initwithstring:@...

c# - How to define variable as lambda function -

c# - How to define variable as lambda function - (lambda function may or may not i'm looking for, i'm not sure) essentially i'm trying accomplish this: int areaofrectangle = (int x, int y) => {return x * y;}; but gives error: "cannot convert lambda look type 'int' because not delegate type" the more detailed problem (that has nil question, know ask) is: i have several functions branch overridden onlayout , several more functions each of depend on. readability , set precedent later expansion, want functions branch onlayout similar. that, need compartmentalize them , reuse naming much possible: protected override void onlayout(layouteventargs levent) switch (layoutshape) { case (square): dosquarelayout(); break; case (round): doroundlayout(); break; etc.. etc.. } void dosquarelayout() { part layershape = (int layer) => { //...

c++ - Enum Class "could not convert to unsigned int" -

c++ - Enum Class "could not convert to unsigned int" - i have enum class this: typedef unsigned int binary_instructions_t; enum class binaryinstructions : binary_instructions_t { end_instruction = 0x0, reset, set_step_time, set_stop_time, start, add together }; and trying utilize members of enum in switch statement this: const std::string& function(binary_instructions_t arg, bool& error_detect) { switch(arg) { case (unsigned int)binaryinstructions::end_instruction: homecoming "end"; break; } translate_error = true; homecoming "error"; } why cast (unsigned int) required when underlying type unsigned int ? that's because "enum class" "strongly-typed", not implicitly convertible other type. http://en.wikipedia.org/wiki/c%2b%2b11#strongly_typed_enumerations c++ casting enum-class ...

python - How to specify xml output for nose programatically -

python - How to specify xml output for nose programatically - i running tests script nose. want able specify xunit xml output file. documentation says can --xunit-file=file option. i have noseargs = ['--with-xunit', '--xunit-file=output.xml', '--tests=mytest'] nose.run(argv=noseargs) after running this, output.xml file isn't there. i've found if swap 2 arguments looks like: noseargs = ['--xunit-file=output.xml', '--with-xunit', '--tests=mytest'] nose.run(argv=noseargs) it create nosetests.xml file in working directory. looks --with-xunit argument needs processed first, file needs specified. there particular how file should specified i'm missing? nose eats first argument of argv because on commandline it's name of program. this works with: noseargs = ['foo', '--with-xunit', '--xunit-file=output.xml', '--tests=mytest'] nose.run(argv=noseargs) python ...

ASP.NET "Re-establish Session" Performance Hit -

ASP.NET "Re-establish Session" Performance Hit - after user has established session asp.net, each subsequent http request how much of stateserver session objects immediately , automatically fetched , deserialized? example: are all session objects fetched moment request received , session re-established, or... after session re-established session objects fetched , deserialized individually each request httpcontext.session["..."] made? the reply has huge impact on how can utilize session. example, if have pre-fetched important amount of user info session, , stateserver session deserialized upon each http request, experience noticeable performance hit. if pre-fetched user info deserialized when request specific session keys, me there no worry. update after marking reply question, discovered asp.net appfabric server 1.1 has alternative have session restored on-demand rather all-at-once. controlled useblobmode in web.config. session loads...

android - how to use runOnUiThread without getting "cannot make a static reference to the non static method" compiler error -

android - how to use runOnUiThread without getting "cannot make a static reference to the non static method" compiler error - i have main class; clientplayer extends activity { and service lotteryserver extends service implements runnable { when trying utilize runonuithread in run method of service getting compiler error of, "cannot create static reference non static method" how prepare this?, how using code shown here; @override public void run() { // tried both clientplayer.runonuithread , lotteryserver.runonuithread // both don't work clientplayer.runonuithread(new runnable() { public void run() { toast.maketext(getapplicationcontext(), "from within thread", toast.length_short).show(); } }); } // end run method runonuithread not static method. if u want run runnable on uithread can utilize this handler handler = new handler(looper.getmainlooper()); this c...