Posts

c# - value cannot be null in wcf using xml -

i'm triyng converto string xml when code running "value cannot null" how cani fix ? project run in windows phone 8 public string baslıkbul(baslıkı ba) { sqlconnection bag = new sqlconnection(configurationmanager.connectionstrings["baglantı"].connectionstring.tostring()); bag.open(); sqlcommand yap = new sqlcommand("select baslık ad=@ad",bag); yap.parameters.addwithvalue("@ad", ba.ad); yap.executenonquery(); sqldataadapter da = new sqldataadapter(yap); dataset ds = new dataset(); da.fill(ds); string s = ds.getxml(); /// line running xmlreader okuyucu = xmlreader.create(new stringreader(s)); while(okuyucu.read()) { if(okuyucu.nodetype==xmlnodetype.element) { switch(okuyucu.name) { case"baslık": s = convert.tostring(okuyucu.readstri...

How can I use R to remove a file extension that is not alphanumeric extension -

this example of file name mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year initially mod09a1.a2000049.h19v11.005.2006268194400.hdf.sur_refl_day_of_year.tif i used function file_path_sans_ext remove ".tiff" still want remove ".sur_refl_day_of_year". need file name mod09a1.a2000049.h19v11.005.2006268194400.hdf only. try: sub("(\\.hdf).*", "\\1", myfilename)

c - Return result less than 2seconds -

i have exercise tells me calculate square root, program returns result in 6 seconds, how can return square root in less 2 seconds? this implementation 1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* ft_sqrt.c :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* by: wjean-ma <wjean-ma@student.42.fr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* created: 2015/07/13 13:28:12 wjean-ma #+# #+# */ 9 /* updated: 2015/07/14 16:48:21 wjean-ma ### ########.fr */ 10 /* ...

c++ - GetOpenFileName API intermittently slow on 2003 server -

when running code below on windows server 2003, there intermittent slowdowns while getopenfilename common dialog initializes. startup time varies @ around ~30 seconds. code below scratch program made exemplify problem i'm having in larger project problem exists in both. one important note, when network interfaces disabled, time taken initialize closer normal - typically ~2 seconds. enabled again, problem returns. i have put initialization time against other programs file open common dialogs (like notepad) not have same problem, or without network interfaces enabled. code: getnewfilename.h: #define _twinmain wwinmain #include "windows.h" #include <string> #include "resource.h" using std::wstring; #define isolation_aware_enabled 1 #if defined _m_ix86 #pragma comment(linker,"/manifestdependency:\"type='win32' name='microsoft.windows.common-controls' version='6.0.0.0' processorarchitecture='x86' public...

javascript - using hta with frameset - drop image does not work -

i working framesets in local hta (html-application) in internet explorer 10+. want drop files (images) dropzone (div or body). - hta without frames works - htm , without frames works (all browsers) - hta frames show image in frame index.hta: <frameset cols="40%,60%" > <frame src="start1.htm" name="start1" application="yes" > <frame src="start2.htm" name="start2" application="yes" > </frameset> start1.htm <html> <body ondragstart="return false;"> <div id="dropspot" style="border: 1px dashed #555; height: 200px"> </div> function init() { // set drop-event handlers. var droparea = document.getelementbyid("dropspot"); droparea.addeventlistener("drop", drophandler, false); droparea.addeventlistener("dragover", donothing, false); } function drophandler(event) { // use our donothing() func...

python 3.x - Python3 tk TreeView dynamic column width -

relevant code below. looking way dynamically size ttk treeview widget's column fit text inside it. have treeview (within class) minwidths on columns, text fill "notes" column infinitely long , column needs resize take string. limit max size needless still want dynamic hold large string of text if needed neat when string shorter. there 2 solutions really, either dynamic sizing or calculating pixel width required given string, font.measure() mentioned doesn't seem applicable python 3.x any great, i'd tiny thing sorted can finish up! sql.connect(dbfile) dbconnection: cursor = dbconnection.cursor() self.treestudentlog = ttk.treeview(self.mainframe, columns=("type","points", "notes"), height=21) yscrollbar = ttk.scrollbar(self.mainframe, orient='vertical', command=self.treestudentlog.yview) xscrollbar = ttk.scrollbar(self.mainframe, orient='horizontal', command=self.treestudentlog...

angularjs - Injecting $state (ui-router) causes circular dependency -

when put $state there error...how can fix it? i want use $state navigate page dont know how ? suggestion ? there other way navigate user page ? app.factory('mainauthinterceptorservice', ['$q','$state', '$injector', '$location', 'localstorageservice', function ($q,$state, $injector, $location, localstorageservice) {....} im using authservice.logout(); and need redirect user page ... one simple fix use $injector service reference $state service, so: app.factory('mainauthinterceptorservice', ['$q', '$injector', '$location', 'localstorageservice', function($q, $injector, $location, localstorageservice) { var $state = $injector.get('$state'); // inject state manually ... // interceptor logic } you can use $state object usual. there similar question created user great answer explains issue in depth: injecting $state (ui-router) $htt...