Posts

Showing posts from March, 2014

html - Buttons jumping around on page load -

please have how buttons jumping around when each page loads. how preload relative positioning / fb api prevent happening on each page? http://kundalinilive.com the facebook iframe inserted dom after fact , size has effect on positioning of buttons. can fix adding width/height created <iframe> existing .fb-like div .fb-like { height: 25px; width: 450px; }

javascript - jQuery complete replace DOM of element with another DOM - faster way? -

i'm using jquery's ajax getting new content server. data loaded in json: $.ajax({ url: url, data: { 'ajax': '1', }, datatype: 'json', success: somefunction }); for server-side application limitation, i'm not able setup more json variables inside have load content. why have load result jquery, search , replace elements on page, (used in somefunction ): var somefunction = function(data) { var con = $('<div></div>').html(data.content); // $(data.content) not working $('div#maincontent').html(con.find('div#ajax-content').html()); ... // same process 3 more divs } edit: please, note have same process replace 3 divs! there more that, example, it's enough hope. question: logic way, expect loading result dom ( $(data.content) ), parsing html ( con.find('dix#ajax-content').html() ) , dom ( $('div#maincontent').html() ) seems me loosing resources , dec...

java - Verify the change of background color of the Textfield -

how can verify if textfield changed background color after action commited or form submitted? thank you! i can't provide more if don't provide code. here's demo can have look. basically, can css values webelement.getcssvalue method . http://jsfiddle.net/ruuys/ <input id="txttest" /> <button id="submit" onclick="document.getelementbyid('txttest').style.background = 'orange';">submit</button> webelement btnsubmit = drvier.findelement(by.id("submit")); btnsubmit.click(); webelement txttest = drvier.findelement(by.id("txttest")); string color = txttest.getcssvalue("background-color"); // color should "orange" in case

failover - ActiveMQ: Reject connections from producers when persistent store fills -

i configure activemq producers failover (i'm using stomp protocol) when broker reaches configured limit. want allow consumers continue consumption overloaded broker, unabated. reading activemq docs, looks can configure activemq 1 of few things when broker reaches limits (memory or disk): slow down messages using producerflowcontrol="true" (by blocking send) throw exceptions when using sendfailifnospace="true" neither of above, in case..i'm not sure happens? reverts tcp flow control? it doesn't of these things designed trigger producer failover. producer failover when fails connect not, far can tell, when fails send (due producer flow control, example). so, possible me configure broker refuse connections when reaches limits? or best bet detect slow down on producer side, , manually reconfigure producers use different broker @ time? thanks! your best bet use sendfailifnospace , or better sendfailifnospaceaftertimeout . throw exc...

android - Using onInterceptTouchEvent -

in code, use predetermined xml layout generate views in activity. don't create them programmatically, therefore can't find way override onintercepttouchevent method! there way this? extend class interested in: package com.myapp; public class mylayout extends relativelayout { // don't forget include super constructors... public void onintercepttouchevent(...){} } then, can use class in xml this: <com.myapp.mylayout android:id="@+id/my_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- acts relativelayout, except custom code --> </com.myapp.mylayout>

I want to remove img tag on click of button from javascript -

i have added here 2 functions moveoutid() creating img tag on click of button , addes image src img tag show image on webpage. , moveinid() removing selected image img tag. function moveoutid() { var sda = document.getelementbyid('availablefruits'); var len = sda.length; var sda1 = document.getelementbyid('orderfruits'); (var j = 0; j < len; j++) { if (sda[j].selected) { alert(baseurl + "/img/" + sda.options[j].value + ".jpg"); var img1 = document.createelement('img').src = baseurl + "/img /" + sda.options[j].value + ".jpg"; var di = document.getelementbyid('d'); di.appendchild(img1); var tmp = sda.options[j].text; var tmp1 = sda.options[j].value; sda.remove(j); j--; var y = document.createelement('option'); y.text = tmp1; try { ...

shell - Getting previous day's date in Unix -

i using following code assign previous day's date variable yesterday : yesterday=`tz=gmt+24 date +%y%m%d`; echo $yesterday; the value assigned correctly when execute command during morning hours. during night hours (around 9 pm), not getting previous day date, same date today. my server located in pdt timezeone. tried "tz=pdt+24" assigning, got same result. fyi, using solaris 5.10. what can reason bizarre situation? i cannot exact test on solaris. on linux works getting last day(yesterday): kent$ date -d'yesterday' +%y%m%d 20130520 so type "yesterday", don't have special date . cool, isn't it?

osx - How to bring all the app's windows to front when making active just one? -

in application have 4-5 windows on screen simultaneously. while working of windows can go behind other app's windows (behind xcode or safari example). then, when make 1 of application's window active other 3-4 windows remain on back. is there way can bring app's windows front, when make 1 of them active? p.s. know can use [nsapp windows] , call orderfrontregardless in loop, don't know how catch moment when 1 of windows becomes active. any kind of or hint appreciated! this code trick me: -(void) applicationdidbecomeactive:(nsnotification *)notification { // todo: go on windows here , bring them active (nswindow * window in [nsapp orderedwindows]) { [window orderfrontregardless]; } } don't forget set file app's delegate in order code work.

python - "Unicode error" when reading a file -

this first post on here, don't hope isn't in wrong topic or something, i've run unusual problem python app i'm writing. basically, i'm trying read text file , insert part of tkinter text widget. text file contains usual "\n" line breaks, when run code bizarre error haven't been able cook workaround for: (btw, sorry lousy set-up here... not sure how work new code-entering system; seems "play own rules" , have own syntax, copied/pasted below: exception in tkinter callback traceback (most recent call last): file "c:\python33\lib\idlelib\run.py", line 107, in main seq, request = rpc.request_queue.get(block=true, timeout=0.05) file "c:\python33\lib\queue.py", line 175, in raise empty queue.empty during handling of above exception, exception occurred: traceback (most recent call last): file "c:\python33\lib\tkinter\__init__.py", line 1442, in __call__ return self.func(*args) file...

android - please help me get sharedpreferences saved value from other class -

i saving value in sharedpreferences in 1 class , trying access class null pointer exception. value enter url web service. please me. urlsetting.java public class urlsetting extends activity { edittext editurl; textview savedurl; button bsaveurl, bback; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.urlsetting); savedurl = (textview)findviewbyid(r.id.savedurl); editurl = (edittext)findviewbyid(r.id.editurl); bback = (button)findviewbyid(r.id.back); bsaveurl = (button)findviewbyid(r.id.saveurl); bsaveurl.setonclicklistener(buttonsaveurlonclicklistener); bback.setonclicklistener(new button.onclicklistener(){ @override public void onclick(view arg0) { // todo auto-generated method stub intent intent = new intent(urlsetting.this, login.class); /*intent.setclass(urlsetting.this, login.class);*/ startactivity(intent...

vba - Export MS Access queries to notepad -

i want export queries (names query code) notepad/word document. i'm not @ vba code found code site in web exports queries query code notepad. code: sub exportqueries() dim db object dim qdf object dim ff long set db = currentdb ff = freefile() open "c:\queries.txt" output #ff each qdf in db.querydefs print #ff, "query: " & qdf.name & vbcrlf print #ff, "sql:" & vbcrlf print #ff, qdf.sql & vbcrlf next qdf close #ff end sub but want export queries in macro i'm using. how extract queries used in specific macro? can give me code plz? my macros - alerts_mcr ebac_mcr there few more macros i'm using. to programmatically describe in robust way non-trivial exercise. resulting vba code have : take list of macros, inspect each action of each macro see if invokes query, either directly (e.g., via openquery ) or indirectly (e.g., doing runcode calls vba function invok...

qooxdoo : Show FPS on screen ? -

simple question : how show frame per second ( fps ) on screen , e.g. on qx.ui.basic.label ? further question, how limit fps 30 ? note: i'm using qx.desktop . qooxdoo not offer such functionality. can try calculate fps not trust on because measurement influence frame rate. use fps counter on chrome that: http://www.mobitechie.com/browser/how-to-enable-fps-counter-on-chrome-brower/

ajax - Trap message/exception in jquery to ELMAH -

in mvc3 application, returning messages stored procs. if 'successful', i'm moving forward else displaying custom error page. when message else, want trap in elmah. problem facing return message not error i'm not able figure out how handle it. still want display custom error page after catching error in elmah. please help. $.ajax({ url: "../xyz", type: 'post', datatype: 'text', async: false, data: json.stringify({ abcdata: abcdata, strdeb: strdeb, strcre: strcre }), contenttype: 'application/json; charset=utf-8', success: function (data) { if (logout != "logout") { if (data.tolowercase() != "successful") { **//alert(data.tostring()); window.location.href = "../error";** } else { window.location.href = "../abc"; } ...

c# - How to order by two fields? -

this question has answer here: multiple “order by” in linq 6 answers how order startdate , userlikeproduct ? need sort startdate show userlikeproduct first. public ienumerable<check> gethomeceeck() { return this.query() .where(c => c.ispublish && c.ishomepageproduct) .orderby(c => c.startdate) .take(30) .tolist(); } if understand correctly, want order 1 , other? use .thenby(lambda) after .orderby(lambda) . if not meant let me know , i'll remove answer .orderby(c => c.startdate).thenby(c => c.like)

jquery - How to get the content outside of an element -

below code, goal when user clicks button class named click_me , want alert content inside class named content . i've tried doing: js: alert($(this).closest('.content').html()); but didn't work. html: <tr> <div class="content">hello</div> <div> <div> <ul> <li></li> <li></li> <li></li> </ul> <ul> <li><input type="button" class="click_me" value="click me"/></li> <li></li> </ul> </div> </div> </tr> try this: alert($(this).closest('tr').find('.content').html());

visual studio - error LNK1104: cannot open file 'libboost_serialization-vc110-mt-gd-1_53.lib' -

i use boost serialization create simple xml file, when debug, got error "error lnk1104: cannot open file 'libboost_serialization-vc110-mt-gd-1_53.lib'" have tried fixed problem followed answer in this question but can't find folder "stage" in boost folder, downloaded boost here you need build boost libraries first. open console , go root folder of boost. type bootstrap and type b2 variant=debug,release link=static runtime-link=static for building debug , release configuration static linking. can find more information in getting started guide

html - PHP - POST Method - What happens when content exceeds content length header? -

i don't mean post content limit imposed php.ini, mean in request header content length set 1mb, 2mb of actual content sent. 1 - first 1mb not passed php file once received whole data passed php file. 2 - additional data , previous data not passed php file.

subprocess - Run python script in different shell levels -

//starting perl script os.system('./start.pl') //make command used , o/p redirected file os.system('make > file') i beginner in python. whenever run perl script(start.pl), new subprocess created , shell enters new subshell , rest lines in python script goes un-entered. kindly me run other commands after shell enters new sub shell. automating interactive applications pure python pretty difficult , requires lot of knowledge sockets, select, tty. make life easier, recommend using pexpect kind of task.

vb.net - Parsing a semi colon delimited String -

i required write program visual basic 2008 in process delimited string formatted such: word;submitter;correctguesses;incorrectguesses i need able edit number of correct or incorrect guesses when matching value found both word , submitter. believe may need use combination of instr , mid functions, have little knowledge of how these work. if explain these functions in context, and/or possibly provide code achieve this, preferably commented can see how functions working. me complete final part of project. added more code tinstaafi's answer. however, highlight fact has solved crux of problem. dim correct integer dim incorrect integer dim mystring string = "word;submitter;correctguesses;incorrectguesses" dim mystringsplit() string = mystring.split(";") correct = mystringsplit(2) incorrect = mystringsplit(3) ' if answer correct correct = correct + 1 'if answer incorrect incorrect = incorrect + 1 mystringsplit(2) = cstr(correc...

Sharing facebook post using javascript sdk -

i can share link on facebook using this: fb.ui( { method: 'feed', name: 'tagbin', link: 'https://tagbin.in', picture: '', caption: 'tagbin-share', description: 'tagbin provide simple, consistent interface sharing links.' }, function(response){ if (response && response.post_id) { alert('post published.'); } else { alert('post not published.'); } }) but opens dialogue box, can without opening dialogue box. thanks.... on wall -->no on groups-->yes better go dilog otherwise lead spamming

html5 - Allow users to edit PDF documents on IPAD -

my application has list of pdf forms , allows end users fill forms(edit forms) , send server. application ipad application works fine on desktop.but when launch application in ipad , pdf opens text , not show pdf fields (like radio buttons ,checkbox , pdf submit button created using acrobat). , there no way edit pdf forms in ipad(this form displayed in iframe). ipad's browser has built in pdf viewer not allow users edit forms. there plugin can use purpose ? or there many app on appstore editing pdf on ipad. there way integrate app in our application ? how achieve ? you try out pdf.js , pdfedit or pdfstudio . xournal supports annotations. these opensource.

xml - All tags one level, order group and sort in xslt -

i have issue xml (salesorder). import file (csv) xml-structure. tool used automatic creates xml file same structure. tags on same level. <?xml version="1.0" encoding="utf-8"?> <order> <env> <sendercode>1234</sendercode> <test>n</test> </env> <hdr> <ordernumber>100</ordernumber> <orderdate>201206080000</orderdate> </hdr> <row> <linenumber>1</linenumber> <article>a</article> </row> <row> <linenumber>2</linenumber> <article>b</article> </row> <row> <linenumber>3</linenumber> <article>c</article> </row> <row> <linenumber>4</linenumber> <article>d</article> </row> <hdr> <ordernumber>101</ordernumber> <orderdate>201206080000</orderdate> </hdr> <row...

model - rails belongs_to foreign key is null -

i have following models class user has_many :projects, :through => :bids has_many :bids, :dependent => :destroy end class project attr_accessible :name, :user_id has_many :users, :through => :bids has_many :bids, :dependent => :destroy belongs_to :projectmanager, :class_name => "user", :foreign_key => "user_id" end class bid attr_accessible :project_id, user_id belongs_to :user belongs_to :project end as can see, project class has both *has_many* , *belongs_to* same model ( user ) in project controller new have def new @project = project.new @project.gencontr = current_user where current_user devise current logged in user. when save project, column user_id in projects table null. can show me go wrong on one...thank you on create action def create @project = project.new(prams[:project]) @project.projectmanager = current_user ....... end

android - Tab navigation in new HoloEverywhere not displays fragment after screen rotation -

yesterday downloaded new holoeverywhere library . currently, have problem tab navigation after screen rotation. my home activity: public class mainactivity extends activity implements tablistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setuptabs(); } private void setuptabs() { string[] titles = { "first", "second", }; actionbar supportactionbar = getsupportactionbar(); (int = 0; < titles.length; i++) { actionbar.tab tab = supportactionbar.newtab(); tab.settext(titles[i]); tab.settag(myfragment.tag); tab.settablistener(this); supportactionbar.addtab(tab, false); } supportactionbar.setnavigationmode(actionbar.navigation_mode_tabs); supportactionbar.setselectednavigationitem(0); } @override public void ontabselected(tab tab, fragmenttransaction fragmenttransaction) { final stri...

c# - Visual Studios adding folder to release directory -

i trying pull in dependency, xulrunner exact. folder of binaries , executable called xulrunner.exe. code initializes xulrunner use passing in location of xulruner.exe api of dll program uses. how visual studios copy on entire directory of xulrunner release folder on build can package xulrunner program , use relative address when specifying file path xulrunner.exe. you can add post-build & pre-build events project in visual studio. go properties of project , there tab called 'build events'. http://msdn.microsoft.com/en-us/library/42x5kfw4(v=vs.80).aspx should give necessary information.

variables - Android: How to retrieve values from an AsyncTask? -

i've been researching day trying find out how retrieve values computed in doinbackground async task. no luck @ all. i'm doing basic httpurlconnection request , parsing xml data webpage using dom. store data in 2 different arrays ///////////inside doinbackground: for(int x=0; x<10; x++) { username[x] = element.getfirstchild().getnodevalue(); score[x] = anotherelement.getfirstchild().getnodevalue(); } now, want output values onto textview. among many other things, have attempted: protected void onpostexecute(string result) { (int xx = 0; xx<10; xx++) { themaintextview.append(username[xx] + " scored " + score[xx] +"\n"); } } nothing have attempted works. recurring error i'm receiving nullpointerexception . doing dramatically incorrect? know of other (even obscure) methods try? ignore loops if helps...i've omitted lot of code. assume want retrieve 2 values...a username , s...

How to apply the Rewrite rules in php page links so that while rendering the page links get converted to rewrite rule -

i using apche mod_rewrite applying reules in .htaccess file, options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{the_request} ^[a-z]{3,}\s([^.]+)\.php [nc] rewriterule ^ %1.html [r,l,nc] rewritecond %{request_filename}.php -f rewriterule ^ %{request_uri}.php [l] rewriterule ^(.*)\.html$ $1.php [nc] it works when enter url http://localhost:6060/index.php redirect http://localhost:6060/index.html however need convert links in page if links appeared in .php converted .html extention <a href="index.php">home</a> while rendering convert <a href="index.html">home</a> no need write php code @ all. apache has module called mod_proxy_html . you'll haver ensure apache override settings allow use of directive, , have loaded following modules: loadmodule proxy_module modules/mod_proxy.so loadmodule proxy_http_module modules/mod_proxy_http.so loadmodule...

vb.net - How to pass text from one form to opened form at back? -

i have 2 forms. 1 invoiceentry , listofsuppliers. there control "txtsnam" in invoiceentry.listofsuppliers contains datagrid has names of suppliers. when user presses f9 on textbox listofsupplier form opened. user select name of supplier grid , press enter. on press enter want pass name of supplier "txtsnam".i have used code not working me: on invoiceentry: private sub txtsnam_keydown(sender object, e system.windows.forms.keyeventargs) handles txtsnam.keydown` if e.keycode = keys.f9 dim lov new supplierlov lov.showdialog() end if end sub on listofsuppliers: private sub radgridview1_keydown(byval sender object, byval e system.windows.forms.keyeventargs) handles radgridview1.keydown if e.keycode=keys.enter invoiceentry.txtsnam.text=radgridview1.currentrow.cells(0).value.tostring end if end sub i tried of property not working. placed breakpoint on line 2 executes bt text doesnot appear in txtsnam solutio...

Facebook Privacy Policy Compliance. Please update your privacy policy -

the past few hours keep getting following message please update privacy policy my_app_name avoid enforcement action. the url may missing or returning error. also, sure privacy policy displays on website or app. more info, refer >platform policy ii.3 , external resource: http://www.applicationprivacy.org/platform-requirements/facebook/ . on guide lines of submission .. these apps not eligible app center: a page tab app desktop web game off of facebook.com so why eligible privacy update afterall?? , still have entered required info in app details tab , still error of invalid submission before can submit app detail page must first comply app center >guidelines. please make sure have specified how app integrates facebook , >have met requirements. click here update integration. i use instead negative feedback..as ve seen in similar questions and last not least, ve not spotted broken url.. :s

Share a object between Main and Child window as a means of passing data back and forth (C#) -

this problem has 3 files: options.cs (a datastore option values) mainwindow.cs (the main window program, appearnce modified based on options inside options datastore - once class decalred object) optionswindow.cs (the child window user sets option value, window saves changes options datastore when user presses button inside window) what want share data between main window form , child window form in c#. main window called mainwindow , child window optionswindow . i have data store called options . object stores various user options. (some type int , bool ) these options used mainwindow appearance purposes. so user makes changes in optionswindow , these variables changes saved in useroptions object of type options declared inside optionswindow . i did because need easy , simple way move set data in childwindow, save data object , use data in mainwindow why did not declare useroptions object inside mainwindow ? because can't access data declared in mai...

javascript - html: stop page refresh when entering a value -

i have table created in html form. the first column displays data pulled web server , second column allows changing value , submitting new value web server. have table pulling live data web server needs refreshed every 20 seconds. @ moment have entire page refreshing every 20 seconds. the problem when page refreshes if have started type value table cell value lost after refresh. have tried javascript retain values in cookies , has worked far. wondered if there way stop refresh happening if cursor has been selected in input box in table cell. <form id=form1 name=f1 method=post action=/scripts/write-tags autocomplete=on> <input type=hidden name=tag1 value=9> <input type=hidden name=tag2 value=61> <input type=hidden name=tag3 value=44> <input type=hidden name=tag4 value=25> <input type=hidden name=back value=/savetest.htm> <input type=hidden name=page value=1> <table id=data b...

ruby on rails - subdomain-fu gem tld_size -

what mean tld_size in subdomain-fu gem. example deafult having, subdomainfu.tld_sizes = {:development => 1, :test => 0, :production => 1} in initializers/subdomain-fu.rb i have debugged , found answer, if config follows means, subdomainfu.tld_sizes = {:development => 1, :test => 0, :production => 1} if url test.lvh.me:3000 means subdomain-fu gem's current_subdomain return test. if set tld_size below, subdomainfu.tld_sizes = {:development => 1, :test => 0, :production => 0} then url test.lvh.me:3000 means subdomain-fu gem's current_subdomain return test.lvh thanks...

c# - Entity Framework 5 not loading property -

i'm working on ef5 code-first database , giving me lot of trouble on foreign key. sorry if answered somewhere else looked @ countless of questions on here , none helped far. i have user class public class user { [key()] [hiddeninput(displayvalue=false)] public int userid { get; set; } [required] public string username { get; set; } [required] [datatype(datatype.password)] public string password { get; set; } [scaffoldcolumn(false)] public customclass custom { get; set; } } and custom class public class customclass { [key()] [hiddeninput(displayvalue = false)] public int customclassid { get; set; } [required] public string name { get; set; } } and datacontext public class silkdbcontext3 : dbcontext { public dbset<user> users { get; set; } public dbset<customclass> customclasses { get; set; } } now, problem can save poseanimation through controller. can post , update user basic prope...

asp.net mvc 4 - InitializeSimpleMembership filter issue -

i have mvc 4 application out of box simple membership mechanism implemented. have discovered every single time call of controllers in application onactionexecuting method in initializesimplemembershipattribute filter executed! though have commented out initializesimplemembership attribute on account controller so: [authorize] //[initializesimplemembership] public class accountcontroller : controller { the filter still getting called! call coming from? i delete initializesimplemembership file in filters folder default. want initialize once @ start best place global.asax now keep structure of application_start() method consistent in global.asax, add config file being called method. create new 1 add authconfig. authconfig has default oauth code, makes sense keep authentication methods together. the method in called registerauth called global.asax once @ start up. add //local authentication websecurity.initializedatabaseconnection("mydbconnection...

xaml - Different item templates in ComboBox -

in winrt xaml have combobox displays complex item. is possible declare , bind 2 different item templates 1) "normal" selected item (combobox closed) , 2) list in popup when user wants choose item (combobox open)? i found itemtemplate work both, want display items different template if user wants choose item. use item template selector. define 2 properties selectedtemplate , dropdowntemplate in selector class. check whether container wrapped in comboboxitem. if yes choose dropdowntemplate. if not choose selectedtemplate. public class comboboxitemtemplateselector : datatemplateselector { public datatemplate selectedtemplate { get; set; } public datatemplate dropdowntemplate { get; set; } protected override datatemplate selecttemplatecore(object item, dependencyobject container) { var comboboxitem = container.getvisualparent<comboboxitem>(); if (comboboxitem == null) { return selectedtemplate; ...

jQuery load(function) for an image file -

i'm making website lots of background images , (of course) affects speed ratio , bandwidth. i have page wich contains 17mb of images data. of hidden , appears when click on target galleries. the problem when page loading downloads every single image if not displayed @ first. i'd make jquery request browser load images if necessary. i know how use load(function) .div not entire file. the website i'm working on : http://www.adiwatt.com the page i'm talking : http://www.adiwatt.com/realisations.html many thanks

ruby on rails - How do I prevent getting a routing error while trying to access a href -

i have href rendered "www.yahoo.com", when user clicks on instead of re-directing http://www.yahoo.com page says route not found error. how fix this? try this: <%= link_to "click me", "http://www.yahoo.com" %> it's need put http:// before address. updated (according comment) ok this: let, @url = "www.yahoo.com" now, <%= link_to "click me", "http://#{@url}" %>

c# - How to set a default color to the Pie slices in WPF Pie chart -

i using wpf pie chart labels using article zag studio .this chart refreshes new values every 1 min. works fine, why color of pie slices changes every refresh? there possible way set default color.the pie chart displaying has 2 slices. what have tried, <customcontrols:labeledpiechart> <customcontrols:labeledpiechart.palette> <dv:resourcedictionarycollection> <resourcedictionary> <style targettype="dvc:piedatapoint"> <setter property="background" value="green"/> </style> <style targettype="dvc:piedatapoint"> <setter property="background" value="purple"/> </style> </resourcedictionary> </dv:resourcedictionarycollection> </customcontrols:labeledpiechart.palette> </customcontrols:labeledpiechart> this above snippet returns exception 'set prop...

sdl - TTF_RenderText with integer -

is posible use ttf_render_textsolid controlled 1 integer? try use stringstreams this: stringstream _minutes; stringstream _seconds; stringstream _miliseconds; _minutes << minutes << ":"; _seconds << seconds << ":"; _miliseconds << miliseconds; (the variable minutes, seconds , miliseconds scoped) but when compile this, compile then, run , says : core dumped. error in memory part. mmh happens? doing along lines of: stringstream ss; ss << minutes << ":" << seconds << ":" << miliseconds; const string str = ss.str(); sdl_surface* surf = ttf_rendertext_solid(textfont, str.c_str(), textcolor); should work without problem. do not store const char* comes out of though! str goes out of scope, const char* won't valid anymore.

symfony - Doctrine annotation error in production server -

i have error in production server which doesn't occur in localhost : annotationexception: [semantical error] annotation "@sensio\bundle\frameworkextrabundle\configuration\route" in method my\bundle\controller\mycontroller::indexaction() not exist, or not auto-loaded. this error happened in local when tryed update packages composer , this didn't solve it, had reinstall symfony , upload again, and still happening . cache has been cleared guess it's not cache thing. appkernel.php <?php use symfony\component\httpkernel\kernel; use symfony\component\config\loader\loaderinterface; class appkernel extends kernel { public function registerbundles() { $bundles = array( new symfony\bundle\frameworkbundle\frameworkbundle(), new symfony\bundle\securitybundle\securitybundle(), new symfony\bundle\twigbundle\twigbundle(), new symfony\bundle\monologbundle\monologbundle(), new symfony\bundle\swiftmailerbundle\swiftm...

windows - Openfire Cluster Hazelcast Plugin Issues -

Image
windows server 2003r2/2008r2/2012 , openfire 3.8.1 , hazelcast 1.0.4 , mysql 5.5.30 -ndb-7.2.12-cluster-gpl-log we've set 5 servers in openfire cluster . each of them in different subnet , subnets located in different cities , interconnected each other through vpn routers ( 2-8 mbps ): 192.168.0.1 - node0 192.168.1.1 - node1 192.168.2.1 - node2 192.168.3.1 - node3 192.168.4.1 - node4 openfire configured use mysql database successfully replicating master node0 slave nodes (each node uses it's own local database server, functioning slave). in openfire web admin > server manager > clustering able see cluster nodes . openfire custom settings hazelcast : hazelcast.max.execution.seconds - 30 hazelcast.startup.delay.seconds - 3 hazelcast.startup.retry.count - 3 hazelcast.startup.retry.seconds - 10 hazelcast config node0 (similar on other nodes except interface section) (%programfiles%\openfire\plugins\hazelcast\classes\hazelcast-cache-config.xml): ...

java - Phonegap debugging remote user -

a user complaining problem can not reproduce in emulator or vm. how can determine , fix bug? the application not crash or show error message not function suppose to. have no access users phone. can not tell if problem caused javascript or java. if user running android, have them provide logcat dump using app such alogcat

actionscript 3 - As3 - Script Error on Arrays -

please inspect me coding: function createrandomlist():void { var newlist:array = [0,1,2]; var curlist:array = item[selectedlevel - 1] //selectedlevel = 1; var normal:int = curlist[0]; var tempboo1:boolean = false; var tempboo2:boolean = false; var tempboo3:boolean = false; while (curlist[0] + curlist[1] + curlist[2] > 0) { if (number(curlist[0]) == 0 && tempboo1 == false) { newlist.splice(newlist.indexof(0), 1); tempboo1 = true; } if (number(curlist[1]) == 0 && tempboo2 == false) { newlist.splice(newlist.indexof(1), 1); tempboo2 = true; } if (number(curlist[2]) == 0 && tempboo3 == false) { newlist.splice(newlist.indexof(2), 1); tempboo3 = true; } var temp:int = math.floor(math.random()*(newlist.length)); curlist[temp] -= 1; generatedlist.push(number(newlist[temp])); ...

android - ImageView doesn't adhere to layout rules when image is set -

i'm setting image on relative layout scaled. when image set, layout alignment rules broken. image supposed align left hand side, shifts. larger image further left hand edge image placed. other layout items text rely on placement of image move. scaled image looks fine apart placement. the image 200px, actual size of bar's height 70dp. resize image id know why happens. edit - have tried setting image dynamically image.setimageresource(r.drawable.placeholder); <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="@drawable/footer" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@id/icon" android:layout_width="wrap_content" ...

sql server 2008 - Remove the Null Value from the result generated from MAX() used in query sql -

when use query: select max(dt_logdate) ums_logentry_dtl c_inputmode='r' , vc_deviceid=10 the table gives maximum date, if condition not satisfied returns data table null. there null row. need empty data table. how remove null on noresult? you use having clause: select max(dt_logdate)   ums_logentry_dtl  c_inputmode='r' , vc_deviceid=10 having max(dt_logdate) not null

Python - dump dict as a json string -

what missing? want dump dictionary json string. i using python 2.7 with code: import json fu = {'a':'b'} output = json.dump(fu) i following error: traceback (most recent call last): file "/usr/local/lib/python2.7/dist-packages/gevent-1.0b2-py2.7-linux-x86_64.egg/gevent/greenlet.py", line 328, in run result = self._run(*self.args, **self.kwargs) file "/home/ubuntu/workspace/bitmagister-api/mab.py", line 117, in mabloop output = json.dump(fu) typeerror: dump() takes @ least 2 arguments (1 given) <greenlet @ 0x7f4f3d6eec30: mabloop> failed typeerror use json.dumps dump str >>> import json >>> json.dumps({'a':'b'}) '{"a": "b"}' json.dump dumps file

vb.net - Translating row entries to column reading from file -

here working code : dim commands() = { "stmotd -a {0}", "stmotd -b 15 {0}" } dim objlines = file.readalllines("c:\temp\sobj.txt") 'dim getcount = objlines.length using sw new io.streamwriter("c:\temp\mpadd.txt", true) each line in objlines each cmd in commands sw.writeline(string.format(cmd, line)) next next end using now "say" sobj.txt file contains following entries" winmac winppc winvpn the output i'm getting above code is: stmotd -a winmac stmotd -b 15 winmac stmotd -a winppc stmotd -b 15 winppc stmotd -a winvpn stmotd -b 15 winvpn but want output : stmotd -a winmac winppc winvpn stmotd -b 15 winmac winppc winvpn i know must easy, in need of here. ! try: (i cannot test code right now-is head) dim commands() = { "stmotd -a ", "stmotd -b 15 ...

asp.net mvc 4 - How to add a json file as content to a MVC 4 Web Application -

i have json file include content mvc 4 web application. add file content folder , mark 'build action' 'content' , 'copy output directory' 'do not copy'. if browse http://[my site]/content/myjsonfile.json http 404. mess around of build actions , copy output selections , still doesn't work. change json file extension txt , works. bug? site published using windows azure. feedback. the problem webserver doesn't recognize filetype. add line web.config: <system.webserver> <staticcontent> <mimemap fileextension=".json" mimetype="application/json; charset=utf-8" /> </staticcontent> </system.webserver>

node.js - Posting xml to a url in nodejs -

i developing client program hit post url , response below code var http = require('http'); var fs = require('fs'); var postdata = "<?xml version = '1.0' encoding = 'utf-8'?><rest><contact>aa</contact></rest>"; fs.readfile('sampledata.xml', 'utf8', function (err, filedata) { if (err) { return console.log(err); } else { console.log("\n data : \n\n" +filedata); var options = { host: 'kkk', port: 1, path: '/root', method: 'post', headers: { "content-type" : 'application/xml' } }; var reqclient = http.request(options, function(res) { res.setencoding('utf8'); res.on('data', function (chunk) { //console.log('body: ' + chunk); }); }); //posts data server reqclient.write(postdata); ...

Finding syntax errors in large javascript file in Visual Studio -

is there way tell visual studio compile particular javascript file , highlight syntax errors, or tell vs include javascript syntax errors line numbers errors listing? @ moment have vs2010, know if possible in 2012 too. visual studio doesn't compile javascript. executed in broswer. if crashes, browsers console tell in of cases. access browsers console (dev-tools) keyboardshortcut (e.g. chrome/firefox cmd+alt+i on mac or ctrl+shift+i on windows). in cases (jquery wrong selector) there no error message; if have syntax errors missing brackets or that, find error message @ console. perhaps looking extension like: http://visualstudiogallery.msdn.microsoft.com/288a2b0f-1357-47b4-8215-1134c36bdf30

How can I get around memory problems in R? -

i'm applying function image(cp) gps data when throws following error error in image(as(x, "spatialgriddataframe"), ...) : error in evaluating argument 'x' in selecting method function 'image': error: cannot allocate vector of size 12.3 mb the spatialpointsdataframe of relocation gps data has 2 columns. 1 coordinates, other id of animal. i'm running on 32 bit system 4 gigs of ram. how around this? one way might work no thinking required: library(raster) r <- raster(cp) image(r) but, cp "gps data" it's not @ clear why imageable. one thing can plot it: plot(cp) that work spatialpointsdataframe . if want create image somehow you'll need specify details.

javascript - Building a Graph Editor - How to create a data driven graph -

Image
i'm developing graph-editor uses drag , drop build hierarchical graphs (containing nodes , links), each node in graph should linked table in our database (sql server), did lot of research libraries based on javascript or/and json specifications draw nodes , links, there lot of great examples follow. have no idea way can link graph database (sql server, oracle, mysql...). thought architecture : i have looked @ d3 library , creates data driven charts think uses flat files, , not relational databases. first can please tell me if architecture thought out? , secondly can give me ideas way can link graphs dbms. thanks lot. lets node deserialized following poco: public class node { public int id {get;set;} public string name {get; set;} public list<int> outboundconnection {get;set;} public list<int> inboundconnection {get; set;} } the id field database. use keep track of object. assuming each row/node/.. has unique id, need keep around ...

java - How to reduce if statements -

the program below functions necessary how reduce amount of if statements. have been told if function contains 2 or more if statements doing wrong. suggestions? i've tried using switch statements hasn't worked because case can't boolean. for(int = 1; < 100; i++) { if(i % 10 == 3) { system.out.println("fizz" + "(" + + ") 3%10"); } if(i / 10 == 3) { system.out.println("fizz" + "(" + + ") 3/10"); } if(i % 10 == 5) { system.out.println("buzz" + "(" + + ") 5%10"); } if(i / 10 == 5) { system.out.println("fizz" + "(" + + ") 5/10"); } if(i / 10 == 7) { system.out.println("fizz" + "(" + + ") 7/10"); } if(i%10 == 7) { ...

eclipse - Android Library Dependencies broken after SDK/ADT-Update -

Image
today, updated android sdk , eciple adt recent versions (adt rev 22). after restarting eclipse quite unhappy build paths whenever reference custom libraries. an example shown in screenshot: my custom "android utilities library" compiles fine, depends on shows build path errors. e.g. when investigate build path settings "android ura library" shows me error android_utilities_library.jar missing under "android dependencies" (which in fact true, libraries built individual class files in bin/classes ). after reading solution build path errors library projects tried clean , manually build projects in correct order, no avail. i've never dealt before, don't know how attack problem. any appreciated. thx! installing new build tools did trick. not automatically included when updated sdk (probably need run update twice guess).

sql server - IF statement in SQL WHERE clause -

is possible pass in value stored procedure tell whether or not append or statement sql select statement? i've tried not valid: select xyzname xyz_fields (xyztype = 'this') union (if @status=1 or (xyztype = 'that')) union (if @status2=1 or (xyztype = 'somethingelse')) kind of building clause in sql rather hitting db again application? you can use dynamic sql this. declare @sqlquery varchar(100) set @sqlquery = ' select xyzname xyz_fields xyztype = ''this'' ' if(@status=1) set @sqlquery = @sqlquery + ' or xyztype = ''that'' ' if(@status2=1) set @sqlquery = @sqlquery + ' or xyztype = ''somethingelse''' exec(@sqlquery) single qoutes in query escaped prefixing single qoute. in query where xyztype = 'this' should be where xyztype = ''this''