Posts

Showing posts from June, 2011

Java clarification on instance and static variable usage from within instance and static methods? -

question in book asking: restrictions placed on instance variable , static variable access within definition of: 1.) instance method? 2.) static method? is response concept correct? -an instance method cannot directly access instance variable while static variable can directly accessed since 1 copy used throughout class. (each object share static variable static methods in class. instance variable available each object , each object has own copy of instance variable.) static method cannot access instance members of class. static method can access members of static variable. an instance method cannot directly access instance variable wrong. while static variable can directly accessed since 1 copy used throughout class. correct. (each object share static variable static methods in class. correct. an instance variable available each object , each object has own copy of instance variable.) correct. a static method cannot access instance

virtualbox - how to update eclipse from 3.8.0 to 4.2 or 4.3 in ubuntu VM -

as title, used sudo apt-get update eclipse, turns out "e: update command takes no arguments", command should use? apt-get update updates sources updates. should run first. then run apt-get install eclipse update eclipse sources gained in first command

python - Preview form in a template based on a dropdown options in Django -

i working on application preview html emails. on initial creation page, want user able preview email before submitting it. here have far views.py def mail_create(request): context = requestcontext(request) if request.method == 'post': form = mailform(request.post) if form.is_valid(): if '_preview' in request.post: post = form.save(commit=false) context_dict = {} subject_line = form.cleaned_data['subject_line'] headline = form.cleaned_data['headline'] mail_body = form.cleaned_data['mail_body'] image = form.cleaned_data['image'] context_dict = {} context_dict['mail'] = mail context_dict['subject_line'] = subject_line context_dict['headline'] = headline context_dict['mail_body'] = mail_body

android - Google direction and voice navigation -

i have been working on android project. came 2 question. q1. how implement navigation drive ? logic , work - able draw path between 2 address. , thought that, use onlocationchanged(current) method call https://maps.googleapis.com/maps/api/directions/output?parameters current location , destination through method draw path on map. upon every onlocationchanged() method call, redraw path on map again. " how navigation ? " q2. how implement voice navigation work q1 ? - did research, can't find seems helpful. know that, in return json /api/directions, there direction instruction in it. " use voice return json ? or there better way ? " would helpful link or example in details. in adavnce here know, hope helps out. regarding first question: after retrieving directions , necessary data, have draw direction once , once! yes, have use onlocationchanged() not redraw whole thing again.. if notice in of navigation application still keep main ro

matlab - Using fgoalattain -

i'm trying use matlab goal seek solution , in process, display iterations. i've setup simple example follows: cf = [10,20,30,40]; options = optimset('display', 'iter'); fgoalattain(@(r) sum(cf)/r - 50, 0.1, 0, 1, [], [], [], [], [], [], [], options); matlab doesn't show iterations. can replace "options" "asdasdasd" , doesn't complain. answer matlab returns 6522 when should 2 (sum(10,20,30,40)/r - 50 == 0). can please kindly point out i'm doing wrong?

php - PHPMailer: Attach a file located on server -

i'm trying send (up 4) attachments using phpmailer. files on server. this how script works: user sees job or resume , contacts them using contact form. contact form stores data along attachments on server. review message filtering out spams/scams. if message genuine send message through. i have information stored on server , im able send information via email attachments not sending. here code used send mail: if ($_get['status'] == 'approve') { $id = $_get['id']; dbconnect($dbuser, $dbpass, $db); $sql = "select * $db.mail id = $id"; $results=mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($results, mysql_assoc)) { $id = $row["id"]; $to = $row["to"]; $from = $row["from"]; $subject = $row["subject"]; $message = $row["message"]; $file1 = $row["file1"]; $file2 =

android - How can I launch a event when I check or uncheck CheckBoxPreference in PreferenceScreen? -

i hope execute function when check or uncheck checkboxpreference in preferencescreen, how can ? thanks! <preferencescreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="apppreference" android:summary="@string/preferencesummary" android:title="@string/preference" > <checkboxpreference android:defaultvalue="true" android:key="alwayshideicon" android:title="@string/alwayshideicontitle" android:summary="@string/alwayshideiconsummary" android:layout="@layout/sms_custom_preference_layout" /> </preferencescreen> public class smspreference extends preferenceactivity{ @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); addpreferencesfromresource(r.xml.smspreference); setcontentview(r.lay

javascript - Stopping script from changing document.location.href? -

a site browsed (cheezburger.com) has apparently vulnerabilities had injected lines <script>document.location.href="http://net-cheezburger.cu.cc/"</script> messages. firefox redirected there , x-frame-options stopped framing resulting empty screen. is there other ways prevent script working in firefox adding caps policy document.location.href on cheezburger sites? blocks legitimate changes too. alert greasemonkey script in wrong place know what's going on if try other malicious scripts. i'd temporary fix until site fixed. i'm wondering there way programmatically intercept script or redirection. if i've understood correctly can't change inline scripts greasemonkey there other options? since you're on firefox (a modern browser), use object.freeze turn location object read-only: object.freeze(document.location); document.location.href = "http://google.com"; // no navigation happens console.log(document.locat

jquery - Append HTML with Anchor Tags instead of Checkbox or Checkboxes Javascript -

i trying functional example of append html checkbox snippet work anchor tags well. thanks! i have been working on months... thanks can offer solution. i've been searching time. sincerely, sean wichert, sr. :) 512-730-1069 (call me if solution well, & please leave voicemail it's google voice number use through gmail headset & don't typically have open unless need make call. <!-- head starts here --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <!-- working javascript checkbox html output below --> <!-- need make work anchor tags question. --> <script type='text/javascript'>//<![cdata[ $(window).load(function(){ $('input[type="checkbox"]').click(function () { var title = $(this).closest('.pdt-checkbox').find('.html-code-insert').html(); var tempid = $(this).attr('id&#

heroku - How to setup paperclip to upload multiple files to s3 -

i'm pretty new rails , i'm trying setup rails application use paperclip multiple image uploads s3. what i've done: environments/production.rb config.paperclip_defaults = { :storage => :s3, :s3_credentials => { :bucket => env['s3_bucket_name'], :access_key_id => env['aws_access_key_id'], :secret_access_key => env['aws_secret_access_key'] } } in model: has_attached_file :avatar, styles: { large: '640x480#', medium: '300x300>', thumb: '100x100#' } # validate attached image image/jpg, image/png, etc validates_attachment_content_type :avatar, :content_type => /\aimage\/.*\z/ i'm not sure other information include here. went through guide on heroku setup. when try upload image don't error or in heroku logs. doesn't show items in s3 bucket. here's log heroku: 2014-03-10t02:33:32.836518+00:00 app[web.1]: started patch "/projects/1-casper-fire-ems-station-n

How do you get data from a server via Ruby and then pass this data into Java/Android classes? -

i making simple todo list android application using ruby (specifically activerecord) data database containing users (made of attributes name, emails, todo lists etc). problem want pass user data ruby java/android code (for example load users information after login). similarly, how pass data java/android code ruby, may update users information on database when necessary? please keep in mind must use ruby. the basic idea data hitting url on web mobile android app: you need create web services in ruby return data in different formats json, html, yaml, xml can parse on mobile app. prefer json/xml formats data easy parse on mobile site. here go, creating restful api in rails there many tutorials , example available on web below: tutorials or screencasts on building rest web service on rails http://pivotallabs.com/building-a-fast-lightweight-rest-service-with-rails-3/ http://railscasts.com/episodes/350-rest-api-versioning http://gavinmorrice.com/blog/posts/21-bu

java - JdbcOdbc Error. i cant connect to the ODBC driver -

i'm studying program , i've tried solve myself, seems can't understand went wrong. how can connect database? :) here code below: package payroll.system; import java.io.ioexception; import java.io.datainputstream; import java.io.fileinputstream; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; import javax.swing.jdialog; import java.io.*; import java.util.*; import java.net.*; public class clsconnection { string url = ""; string username = ""; string password = ""; public connection setconnection(connection conn, string username, string password ) { try { properties props = new properties(); string filename = "makedb.ini"; fileinputstream in = new fileinputstream(filename); props.load(in); string drivers = props.getproperty("jdbc.drivers"); if(drivers != null) system.setp

javascript - Why is Chrome Dev Tools inspector showing different values than in code? -

Image
a picture worth thousand words. maybe i'm tired don't know, has me stuck reason , makes no sense ever. can point me in right direction? > right click images , open in new tab stand alone code /** * @file maestro.class.js * * @external $m main maestro object * @external $m.core maestro core object */ /** * modified version of class.js cater static inheritance , deep * object cloning. based on class.js (javascript mvc -- * justin meyer, brian moschel, michael mayer , others) * (http://javascriptmvc.com/contribute.html) * * - portions adapted prototype javascript framework, version 1.6.0.1 (c) 2005-2007 sam stephenson * - portions extracted jquery 1.7 * - string utilities methods removed , added string prototype. documentation * added , making code closure compiler advanced safe andrew donelson. * * class system javascript * * setup method called prior init -- nice if want things without needing * users call _super in init, normali

linux - init.d autostart python script after reboot (Centos) -

has 1 script autostart python script after reboot (centos). i tryed code, not working #! /bin/sh # chkconfig: 2345 95 20 # description: almagest # script (not sure if necessary though) # processname: www-almagest # /etc/init.d/www-almagest start case "$1" in start) echo "starting almagest" # run application want start python ~almagest_clinic/app.py &> /dev/null & ;; stop) echo "stopping example" # kill application want stop kill -9 $(sudo lsof -t -i:8002) ;; *) echo "usage: /etc/init.d/www-private{start|stop}" exit 1 ;; esac exit 0 chkconfig script on i found solution https://github.com/frdmn/service-daemons/blob/master/centos absolute path worked me

javascript - how to get variable value within function? -

how can return variable value within function? var mystring = "px"; var mymethod = function(){ if(mystring == 'percent') { return '%'; } else { return mystring; // should return 'px' } $('div').css('width','200'+mymethod()); //not working demo as i'm having problem this: var scalc = this.classname.split('-')[4]; var fncalc = function(){ if(scalc == 'plus'){ return '+'; } else if(scalc == 'minus'){ return '-'; } else if(scalc == 'multiply'){ return '*'; } else if(scalc == 'divide'){ retutn '/'; } else{ return '+'; } /*bugging me much*/ }; i'm not seeing error in console? you're missing curly brace end function. var mystring = "px"; var mymethod = function() {

Python's JSON library decoder -

i have 2 machines - 1 having windows os , other 1 has linux. have installed python on both of them. in file /lib/json/__init__.py there loads method has code _default_decoder = jsondecoder(encoding=none, object_hook=none, object_pairs_hook=none) return _default_decoder.decode(s) where s str or unicode instance containing json document. on windows machine, output texts unicode objects on linux machine rather str objects. dont know why happening. want them unicode objects on both machines. please help. i have written following code on python shells of both machine: >>> import json >>> json import * >>> default_decoder = jsondecoder(encoding=none, object_hook=none,object_pairs_hook=none) >>> default_decoder.decode(json.dumps({'aaa':'bbb'})) on windows machine get: {u'aaa': u'bbb'} whereas on linux is: {'aaa': 'bbb'}

html - JavaScript not working in compatibility mode in IE -

i have basic idea in java script.i got template , sample java script site. tried rotate images background of page working fine in browser except ie compatibility mode.i working in sap portal development here compatability mode must.so here stuck,please give idea overcome problem.i used pie.htc overcome css3 support.there option there javascript support. css file: #slideshow { position:relative; height:350px; z-index:-1; } #slideshow img { position:absolute; top:0; left:0; z-index:8; opacity:0.0; } #slideshow img.active { z-index:10; opacity:1.0; } #slideshow img.last-active { z-index:9; } #slideshow img { /* set rules fill background */ min-height: 100%; min-width: 1024px; /* set proportionate scaling */ width: 100%; height: auto; /* set positioning */ position: fixed; top: 0; left: 0; } @media screen , (max-width: 1024px){ img.bg { left: 50%; margin-left: -512px; } } #page-

ios - UIKit: Initial first responder? -

when app launches, initial first responder? according uikit docs first responder can set becomefirstresponder message. however, if message isn't sent, initial first responder? uiapplication? key window? also, there property anywhere points current first responder? in both macos & ios, each window has own uiresponder (or, more precise, each window is uiresponder -- uiwindow descends uiresponder), means each window can have own first responder. on macos, there can many open windows (each 1 first responder) , under ios, there 1 uiwindow displayed @ 1 time. each window have first responder (whether window itself, or text field receiving keyboard events, or whatever). can query each window's responder chain walking down each of them via " nextresponder " api . i'm simplifying things little sake of nice, simple summarized answer hope helps. here more information ios responder chain , shows how initial view (e.g. first responder) gets event

php - Stuck on mocking 3 classes for 1 unit test -

in authentication.php have following function create test for: function showmodal() { $registration = new registration; $registration->needshowmodal = store::isusersupported() ? false : true; } in test case far, have mocked store: function testshowmodal() { $mockstore = $this->getmockclass(‘store', array('isusersupported')); $mockstore::staticexpects($this->any()) ->method('isusersupported') ->will($this->returnvalue(true)); } i’m guessing next need create mockregistration , pass , mockstore authentication controller, along lines of: $controller = new authentication($mockstore,$mockregistration); however, when create authentication keeps complaining expects request , response object first 2 params.. maybe that’s not right way. how can best write test isusersupported == true , isusersupported == false? i’m dealing 3 different classes in test that’s i’m getting stuck. as method

javascript - jquery make rainbow pattern with list -

my html <div id="mainmenu"> <span>thing 1</span> <span>thing 2</span> <span>thing 3</span> <span>thing 4</span> <span>thing 5</span> <span>thing 6</span> <span>thing 7</span> </div> how can thing 6 , thing 7 have colors? stops @ them because 1-5 colors = ['red','orange','yellow','green', 'blue']; //roygbiv $('#mainmenu span').each(function(i){ this.style.color = colors[i]; }); let wrap around: this.style.color = colors[i % colors.length]; the expression i % colors.length yields remainder after division of both operands , in range of [0, colors.length) . it's referred modulo operator. an neater version can made: $('#mainmenu span').css('color', function(index) { return colors[index % colors.length]; }); demo see also: css(propertyname, function(

linux - PHP Downloadscript - Which HTTP-statuscode for maximum connections? -

i have programmed downloadscript in php, allows user download files server. i have programmed, 2 connections per download available, works. my question is, http-statuscode can/must send inform users downloadmanager maximum connections reached, when have 2 connections per download? there no "maximum connections" code, either 429 or 503 you're looking for: 429 many requests the 429 status code indicates user has sent many requests in given amount of time ("rate limiting"). the response representations should include details explaining condition, , may include retry-after header indicating how long wait before making new request. 10.5.4 503 service unavailable the server unable handle request due temporary overloading or maintenance of server. implication temporary condition alleviated after delay. if known, length of delay may indicated in retry-after header. if no retry-after given, client should handle response 500 r

c# - convert string to bigint , this is really a string, is that possible? -

i convert true string store in database after it, example of data using "taskcode21" possible convert "biginteger" , store in database, because datatype of field created in bigint in database ? i think best way change field type string

c# - How to invoke a control within a IF statement -

i have searched quite bit looking how invoke control within if statement awhile , haven't been able find on this. i'm sure i'm missing if show me how great. here short piece of code give idea of problem is. if(cardpanelopponent.getchildatpoint(new point(i, x)) == null) { opponentcard.location = new point(i, x); cardpanelopponent.invoke(new action(() => cardpanelopponent.controls.add(opponentcard)) break; } this line taking place in async environment getting cross thread exception. how can run if statement while on different thread ui. if code running in worker thread you're not allowed call getchildatpoint or set location in it. need pass control ui thread. if(cardpanelopponent.invokerequired) { cardpanelopponent.invoke(new action(() => { if(cardpanelopponent.getchildatpoint(new point(i, x)) == null) { opponentcard.location = new point(i, x); cardpanelopponent.con

Is Unix md5 different to python's hashlib.md5? -

i run echo lol | md5 in mac terminal , returns: 59bcc3ad6775562f845953cf01624225 but run print hashlib.md5("lol").hexdigest() in python 2.7 , get: 9cdfb439c7876e703e307864c9167a15 what doing wrong? echo appends newline @ end default, give different hash. in python, newline ending >>> print hashlib.md5("lol\n").hexdigest() 59bcc3ad6775562f845953cf01624225 standard echo command, newline ending omitted. $ echo -n lol | md5sum - 9cdfb439c7876e703e307864c9167a15 -

android - how to show dynamic listview in fragments? -

i have slider menu on use fragments.i want show list view (json data on list view) on fragment.that's code public class fragmentlist extends fragment { listview sweepstakes_list; @override public view oncreateview(layoutinflater inflater, viewgroup container,bundle savedinstancestate) { view view = inflater.inflate(r.layout.fragment_home, null); //here use code return view; } } how show dynamic listview in fragments? use async task. call async task whenever want update list view.

Unix errors running C++ program involving struct tm -

i wrote inventory program groceries in c++ using visual studio 2012 , runs smoothly , expected. file read in command line argument , used fill deque grocery objects. function used check if grocery object expiring used time_t , struct tm. when trying run program on unix, error involving fstream here lines of code getting errors: int main (int argc, char** argv) { deque<grocery> groceries; deque<grocery>::iterator iter; string filename = ""; if (argc > 1) { filename = argv[1]; fstream filedata; filedata.open(filename, ios::in | ios::out); //**error** //error check if (!filedata) { cout << "error openeing file. program aborting.\n"; return 1; } string name; string expdate; string type; string quantity; while (!filedata.eof()) { grocery temp; getline (filedata,name,'\t');

linux - GUI reporting tool to mine data from postgresql and create reports -

so have database in postgresql. , create report based on data inside, card view layout or so. basically coordinator using tool save pdf. so free available reporting tools can this? should have option of creating default template layout based on data mined postgresql whenever new data added. preferred os - linux, if not windows thanks in advance if free, open source , linux options jasper reports, birt or pentaho, otherwise, there plenty of paid solutions out there, of them work on windows, example of nice , friendly report designer dbxtra , it, can design report or dashboard pure drag , drop in less 10 minutes , without sql or programming knowledge.

python - What magic does staticmethod() do, so that the static method is always called without the instance parameter? -

i trying understand how static methods work internally. know how use @staticmethod decorator avoiding use in post in order dive deeper how static methods work , ask questions. from know python, if there class a , calling a.foo() calls foo() no arguments whereas calling a().foo() calls foo() 1 argument 1 argument instance a() itself. however, in case of static methods, seems foo() called no arguments whether call a.foo() or a().foo() . proof below: >>> class a: ... x = 'hi' ... def foo(): ... print('hello, world') ... bar = staticmethod(foo) ... >>> a.bar() hello, world >>> a().bar() hello, world >>> a.bar <function a.foo @ 0x00000000005927b8> >>> a().bar <function a.foo @ 0x00000000005927b8> >>> a.bar(1) traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: foo() takes 0 positional arguments 1 given >>> a(

node.js fetch mysql data using two tables -

table lists id | user_id | name 1 | 3 | lista 2 | 3 | listb table celebrities id | user_id | list_id | celebrity_code 1 | 3 | 1 | aa000297 2 | 3 | 1 | aa000068 3 | 3 | 2 | aa000214 4 | 3 | 2 | aa000348 i looking json object [ {id:1, name:'lista', celebrities:[{celebrity_code:aa000297},{celebrity_code:aa000068}]}, {id:2, name:'listb', celebrities:[{celebrity_code:aa000214},{celebrity_code:aa000348}]} ] moved answer since details getting long, , thought additional references useful future readers. since using mysql, check out group_concat . object, want group_concat on concat enated string. if live schema more {id:2, name:'listb', celebrity_codes:['aa000214','aa000348']} you'll have simpler query. if make sqlfiddle of basic schema (basically create tables plus inserts of above sample data), might write you. :-) to clear, while group_concat can th

Replace the existing data in CSV file using php or CodeIgniter -

if a in php write @ end of file , w write @ beginning of file what if want edit existing data in csv file , location of data in middle row. should use update existing data or edit it? below code in controller , view.. need know the edit , delete automatically update csv file . thank in advance :) controller <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class datacast_ctr extends ci_controller { function __construct() { parent::__construct(); $this->load->library('csvreader'); $this->load->helper('csv'); } public function index() { $this->load->library('csvreader'); $filepath = 'c:\xampp\htdocs\datacast\bin\pdw_table.csv'; $data['csvdata'] = $this->csvreader->parse_file($filepath); $this->load->view('datacast_view', $data); } function write_csv() {

java - Android: Button to the south -

i've got vertically orientated linearlayout 2 components: first listview , beneath button . want listview fill space still button fits beneath. in java (swing) using borderlayout setting listview center , button south. how possible in out android context? in layout xml set android:layout_height="0dp" , android:layout_weight=1 listview.

php - Separate date in the format {day-month-year} -

i have code print date in format sun, 09 mar 2014 08:31:14 gmt i want take date , shorten can print the day the month the year but want print each separately , want print month in numbers here code tried $date = $item->pubdate; echo '.$date.'; you should make use of createfromformat of datetimeclass <?php $dt='sun, 09 mar 2014 08:31:14 gmt'; $date = datetime::createfromformat('d, d m y g:i:s o', $dt); echo "day : ".$date->format('d'); // 09 echo "month : ".$date->format('m'); //03 echo "year : ".$date->format('y'); //2014 demo

c# - Combine images into a movie -

my project record desktop video daily, now point of record desktop images in *.jpeg need combine them video, don't know ffmpeg have seen this article , , wonder if can make press of button in c#, can combine images delete them on form load or something edit: got code: ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s wxh foo.avi don't know type in project!

android - Samsung Galaxy Tab can't detect intent filter browsable -

This summary is not available. Please click here to view the post.

python - sendMessage() takes at most 3 arguments (4 given) error in wxPython -

i developing gui app python v2.7 , wxpython v3.0 on windows 7 os. using pubsub module sending information main gui thread update gui. using wx.callafter() send messages main gui loop. problem : in programm there instance need send 2 lists using wx.callafter() shown below: wx.callafter(pub.sendmessage, 'update', lista, listb) i following error: sendmessage() takes @ 3 arguments (4 given) any work around without modifying method receiving messages? wx.callafter(pub.sendmessage, 'update', lista) works charm. thank time. answer : using following imports from wx.lib.pubsub import setuparg1 wx.lib.pubsub import pub i should use following solved problem: from wx.lib.pubsub import setupkwargs wx.lib.pubsub import pub you can send messages keyword value, have this: from wx.lib.pubsub import pub ... wx.callafter(pub.sendmessage, 'update', arg1 = lista, arg2 = listb) the arg1 , arg2 must same listener arguments (so listeners of

solr oracle DIH outofmemory -

i use solr4.5.try import 7 million rows data solr. database oracle.the db-data-config.xml is: <dataconfig> <datasource driver="oracle.jdbc.oracledriver" url="jdbc:oracle:thin:@localhost:1521:orcl2" batchsize="700" user="solrdata" password="solrdata" /> <document> <entity name="claim" query="select * td_performanc_status_monitor"> </entity> </document> </dataconfig> i had try set batchsize,but failed.i don't know why "batchsize" not work.maybe used wrong xml. way, start solr use command"java -jar start.jar". i found page: http://lucene.472066.n3.nabble.com/dih-import-quot-out-of-memory-quot-problem-batchsize-and-autocommit-not-working-td528211.html and placed jdbc driver d:\solr-4.5.0\example\solr-webapp\webapp\web-inf\lib still didn't work. please tell me how index data. thank you.

php - How to access external library in magento? -

i have make file in magento root. below foldername/pay.php this files call api , work lib. when call through direct in browser url. i want call within magento function. pay.php have class , add file within magento module file , make object shows error of object reference. what should do? please suggest me. thanks in advance magento dev put library @ [magento]/lib folder for example library phpexcel have put in [magento]/lib/phpexcel and include library in magento file before call. $includepath = mage::getbasedir(). "/lib/phpexcel/classes"; set_include_path(get_include_path() . ps . $includepath); so have create object of phpexcel library access it $objphpexcel = new phpexcel(); for reference download phpexcel export , check directory structure way access external library in magento. it create object in [magento]\app\code\local\conlabz\mreport\controllers\adminhtml\exportcontroller.php hope you

javascript - Bug in d3.js Stacked chart morphing -

Image
i've created stacked chart animation/update app. there appears nan values being passed y , height variables. unsure wrong. if toggle data charts fill up. jsfiddle but problem may occur first in setting yaxis svg.select("g.y") .transition() .duration(500) .call(methods.yaxis); it looks goes wrong in bar rect enter/exit code. //_morph bars var bar = stacks.selectall("rect") .data(function(d) { return d.blocks; }); // enter bar.enter() .append("rect") .attr("class", "bar") .attr("y", function(d) { return methods.y(d.y1); }) .attr("width", methods.x.rangeband()) .style("fill", functi

c# - Should I GetReadLock() while iterating through RouteCollection? -

i have misunderstandings use of routetable.routes.getreadlock() while overriding getvirtualpath method in custom route class. according msdn docs there 2 scenarios in not have call getreadlock: public methods of routecollection class such getvirtualpath , getroutedata call getreadlock internally. therefore, not have explicitly call getreadlock when call public method of routecollection class retrieve data collection. since i'm overriding getvirtualpath , getroutedata seems there won't internall calls , unless it. in .net 3.5 , following line works smoothly: using (routetable.routes.getreadlock()) { // iteration on routes } in .net 4.5 , i'm receiving error: recursive read lock acquisitions not allowed in mode. so question is: should bring force dark magic in order lock it, or microsoft has aleardy handled readlock() scenario in .net 4.5 ? thank sharing experience!

c# - How to check a string contains another string -

this question has answer here: how can check if string exists in string 8 answers i have string of numbers separated commas ,how check if string contained in string . for example : if have string : 67,782,452,67632,9,155,323 how check 155 in previous string using linq ? i assume want check if 1 of items in string given string. split string first delimiter , , use contains or any : string[] items = "67,782,452,67632,9,155,323".split(','); bool contains = items.contains("155"); contains = items.any(i => == "155"); the problem contains -check on string "1550" contain "155".

ireport - Calculate intermediate summary in jasper reports -

i trying calculate intermediate result in jasper(using ireport designer),intermediate result shown in bold below, unit-id  currency  amount a01       usd           150 a01       usd           300 a01       cad           200 a01       cad           200 -------------------------------- a01       usd           450 a01       cad           400 -------------------------------- a02       rs              150 a02       rs              300 a02       cad           200 a02       cad           150 -------------------------------- a02       rs              450 a02       cad           350 ------------------------------- is there way using same records (without hitting db again calculate summary) ? like, calculate intermediate sum currency-wise , display summary when unit changes(a01 a02).? if group unit-id , currency able display result when currency changes, want display it(all together) when unit-id changes, i using stored procedure result in jasper.

using xml file if i select the jdfpath then i have to get the detaiks of all jdfpath in javascript c# asp.net -

its xml file have deails of node selected in javascript im new xml , javascript can write in pageload <system> <cl_system>ret</cl_system> <rtppath>c:\\</rtppath> <jdfpath>d:data</jdfpath> <orginalpath>@fdsf</orginalpath> <url>http://localhost:1764/insert.aspx</url> <uid>http://localhost:1764/insert.aspx</uid> <password>qwee</password> <localpath>d:\</localpath> <thumbnailurl>http://localhost:1764/insert.aspx</thumbnailurl> <printer_path>http://localhost:1764/insert.aspx</printer_path> <jmf_url>http://localhost:1764/jmf.aspx</jmf_url> <ftp_path>http://localhost:1764/jmf.aspx</ftp_path>

c# - Slow execution of queries on a Microsoft Access database via ADO .Net -

i reimplementing c++ layer c# layer @ company. sql queries executed in layer on microsoft access database via odbc datasource. database .mdb file , odbc datasource uses following driver : microsoft access driver (*.mdb). the c++ layer uses windows odbc api execute sql queries via odbc datasource. instance sqlexecdirect function called execute sql query. the c# layer uses ado .net odbcconnection class execute sql queries via odbc datasource. the execution of several sql queries takes less 1 minute when using c++ layer. execution of same sql queries takes approximatively 20 minutes when using c# layer. know why execution slower when using c# layer ? any appreciated i have found why execution of queries slow when using c# layer. forgot dispose idbcommand objects.