Posts

Showing posts from 2011

mysql - Finding and displaying duplicate values using WHERE IN to compare two values -

i have mysql database compare duplicated values based on 2 values in column. example database field_one | field_two | field_three ------------------------------------ aaa | 123 | no1 bbb | 456 | no1 aaa | 123 | no2 ccc | 456 | no3 aaa | 123 | no3 i return these results field_one | field_two | field_three ------------------------------------ aaa | 123 | no1 aaa | 123 | no2 here query i've been using i'm not sure how desired result. when run query in phpmyadmin browser gets stuck. database large too. select * table_name field_three in (select field_one , field_two table_name field_three in ('no1', 'no2') having count(*) > 1) thanks solved i changed where @gordon linoff 's query . select t.* table_name t join (select field_one, field_two table_name t group field_one, field_two having count(*) = 2 -- or mean &g

c++ - No error for not initializing reference variable of class -

i newbie , have basic doubt relationship between object creation , constructors. program- 1 #include<iostream> using namespace std; class xxx{ private: int x; public: xxx(){cout<<"constructer called"<<endl;} }; int main(int argc, char *argv[]) { xxx x1; //constructor called return 0; } output- constructor called program- 2 #include<iostream> using namespace std; class xxx{ private: int x; public: xxx(){cout<<"constructer called"<<endl;} }; int main(int argc, char *argv[]) { xxx x1(); //constructor xxx() not called. return 0; } output- blank information helpfule xxx x1; creates object of class xxx , therefore, calls default constructor of class xxx . xxx x1(); declares function returns object of class xxx , function name x1 , takes no parameter. not instantiation of class xxx , therefore, there no constructor being called.

objective c - iOS app exhausting memory during download of very large file -

i know variations of question have been asked in 1 form or many times on here - i've been searching these posts extensively days , think problem unique. allow me describe: i have ios app on ipad 4 downloads large (260mb 650mb) file disk. memory usage increasing during download proportional amount of data downloaded. @ around 500mb, app receives low memory warnings, , around 650mb killed low memory. i've repeatedly used instruments try track down allocation coming - i've ran allocations, vm allocations, leaks, memory monitor, , activity monitor multiple times. i've taken many heapshots memory increases. instruments has never shown large amounts of allocations coming app! memory remains flat. leaks doesn't report anything. instead i've been relying on set of functions asking kernel memory usage, found on thread here: vm_size_t usedmemory(void) { struct task_basic_info info; mach_msg_type_number_t size = sizeof(info); kern_return_t

"Window > Android SDK and AVD Manager" in Eclipse not showing -

i'm using ubuntu 10.04 lts , trying install required bits development. have sdk downloaded , unzipped home directory, have eclipse installed. set sdk path set in preferences, installed adt plugin. for reason menu option doesn't show up. it wont let me post images. here 's link android enthusiasts page (where told me post here) has screenshots

Nested Form Model in Rails not saving items added with jQuery -

i'm following ryan bate's railscast ( #197 ) nested model forms. if submit form has 3 fields added in controller: 3.times { @prof.experiences.build } ...they save properly. if field, however, added via jquery, isn't saved. has else had experience sort of problem before? edit: html generated without jquery: <div class="fields"> <table> <tbody><tr> <td>position title:</td> <td><input id="applicant_profile_experiences_attributes_0_title" name="applicant_profile[experiences_attributes][0][title]" size="30" type="text"></td> </tr> <tr> <td>employer:</td> <td><input id="applicant_profile_experiences_attributes_0_employer" name="applicant_profile[experiences_attributes][0][employer]" size="30" type="text"></td> </tr> <tr> <td>responsibilities</td> <td>&

How do I check for binary vs. text in an HttpWebRequest in c#? -

is there way determine if response httpwebrequest in c# contains binary data vs. text? or there class or function should using this? here's sample code. i'd know before reading streamreader if content not text. httpwebrequest request = (httpwebrequest)webrequest.create("http://www.someurl.com"); request.method = webrequestmethods.http.get; using (webresponse response = request.getresponse()) { // check somewhere in here if response binary data , ignore using (streamreader reader = new streamreader(response.getresponsestream())) { string responsedetails = reader.readtoend().trim(); } } in general , web sites tell in content-type header kind of data they're returning. can determine getting contenttype property response. but sites have been known lie. or not anything. i've seen both. if there no content-type header or don't want trust it, way can tell kind of data there, reading it. but then, if don't trus

php - joomla 2.5 templates / articless encoding - obfuscating -

i have created application customer using joomla! 2.5.8 publishing framework. template built using aritseer, , articles custom php , html code, using sourcerer plugin. i want protect parts of template have company branding, , couple of articles being editable. surely there concise tutorial how this, cannot locate it. all assistance appreciated !

servicemix - What is the correct URL to make available the FAB feature in karafe? -

at http://fuse.fusesource.org/bundle/faq.html#how_do_i_enable_fab_support_in_my_osgi_container_ , instructed do: features:addurl mvn:org.fusesource.fuse/fuse-fuse/7.0.1.fuse-084/xml/features features:install fuse-bundle in karafe enable fab. results in: could not add feature repository: java.lang.runtimeexception: url [mvn:org.fusesource.fuse/fuse-fuse/7.0.1.fuse-084/xml/features] not resolved. please verify feature repository url correct , network connection works fine. can advise url should use , find such information on ongoing basis? also, where, more generally, official place such documentation. have not found redhat's stewardship terribly helpful in regard. thanks you need add maven repository apache karaf configuration file. see etc directory, there file org.ops4j.pax.url.mvn.cfg add fusesource repo fab distribution is. notice easier use jboss fuse or fuse esb enterprise, have fab enabled out of box. the repo url is: http://repo.fusesource.com/nexu

php - Need Help To Solve Images Disppeared After Again Form Submiitted? -

i have multiple image upload options in form , working fine , update file name in mysql database columns? when uploads image1 image move on server , showing next html table columns problem when upload image file option2 after form submit image1 on next image1 file option disappeared , in mysql database image1 columns blank ? multiple images uploading functions $id=$_request['id']; if(isset($_post['submit'])) { if (!empty($_files['image']['name'])) { $rnd_1 = rand(11111,99999); $file_name= $rnd_1.'_'.$_files['image']["name"]; $file_path = "uploads/"; $image = new imgmark(); $image->font_path = "arial.ttf"; $image->font_size = 25; $image->water_mark_text = "© www.edge.pk"; $image->color = 'cc003e'; $image->opacity = 50; $image->rotation = 0; if($image->convertimage('image', $file_name, $file_path)) $demo_image = $image->

python - Changing global variables within a function -

i'm new programming, , i'm looking advice on do. program i'm trying write need several numbers user. want use function test if user input number or not each of values entered. if input isn't number, want function keep asking number until 1 entered. want know if there better way pass value global variable other explicitly declaring each variable in function global. i'm unsure if there better way this... rownum = none def numtest(c, d): x = false while x not true: try: c = raw_input(d) c = float(c) x = true except: print "the value entered isn't valid number, please try again." global rownum rownum = c numtest(rownum, "enter number of rows: ") print rownum # want use numtest function on several variables... # e.g. # numtest(contourlevel, "enter number of contour levels: ") # numtest(cellsize, "enter cell size: ") #

c++ - No member function declaration in class template -

i have template class named skiplist , nested class named iterator in it. skiplist follows following definition: template <typename key_t, typename mapped_t, size_t maxlevel = 5> class skiplist { typedef std::pair<key_t, mapped_t> valuetype; public: class iterator { iterator (const iterator &); iterator &operator=(const iterator &); iterator &operator++(); iterator operator++(int); iterator &operator--(); iterator operator--(int); private: //some members }; iterator has copy constructor , declaring outside class after definition this: template <typename key_t, typename mapped_t,size_t maxlevel> skiplist<key_t,mapped_t,maxlevel>::iterator(const skiplist<key_t,mapped_t,maxlevel>::iterator &that) but following error: skiplist.cpp:134:100: error: iso c++ forbids declaration of ‘iterator’ no type [-fpermissive] skiplist.cpp:134:100: error: no ‘int skiplist<k

mongodb - Searching for ranges in mongo -

what's efficient way find data in mongo, when input data single value, , collection data contains min/max ranges? e.g: record = { min: number, max: number, payload } need locate record number falls within min/max range of record. ranges never intersect. there no predictability size of ranges. the collection has ~6m records in it. if unpack ranges (have records each value in range), looking @ 4b records instead. i've created compound index of {min:1,max:1} , attempt search using: db.block.find({min:{$lte:value},max:{$gte:value}) ... takes anywhere few tens of seconds. below output of explain() , getindexes() . there trick can apply make search execute faster? njmongo:primary> db.block.getindexes() [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "mispot.block", "name" : "_id_" }, { "v&qu

angularjs - How do I access the child ngModel from a directive? -

like in this question , want add .error on form field's parent .control-group when scope.$invalid true. however, hardcoding form name in ng-class="{ error: formname.fieldmodel.$invalid }" means can't reuse in different forms, plus i'd rather not repeat declaration everywhere. i figured directive looks work: <div class="control-group" error-on="model1, model2"> <input ng-model="model1"> <input ng-model="model2"> </div> so when either model1 or model2 not valid, .control-group gets .error added. my attempt here . possible access models directive, given model names? if there's better approach, i'd love hear too. i don't think writing custom directive necessery use-case ng-form directive created situations those. directive's documentation: it useful nest forms, example if validity of sub-group of controls needs determined. taking code exampl

.htaccess - GZIP Compression help. Can't get it to work (2) -

i working on site speed optmization. having problems gzip compression. put code in .htaccess file, upload online , not work. when check tool http://www.gidnetwork.com/tools/gzip-test.php says page content not compressed . check gtmetrix.com , still no luck. here code put in .htaccess file: <ifmodule mod_deflate.c> addoutputfilterbytype deflate text/plain addoutputfilterbytype deflate text/html addoutputfilterbytype deflate text/xml addoutputfilterbytype deflate text/css addoutputfilterbytype deflate application/xml addoutputfilterbytype deflate application/xhtml+xml addoutputfilterbytype deflate application/rss+xml addoutputfilterbytype deflate application/javascript addoutputfilterbytype deflate application/x-javascript </ifmodule> i tryied without <ifmodule mod_deflate.c></ifmodule> : addoutputfilterbytype deflate text/plain addoutputfilterbytype deflate text/html addoutputfilterbytype deflate text/xml addoutp

Include several HTML pages with JavaScript into one PHP page -

earlier asked fixing clock below , bam! solution instantaneous. since have added several of these clocks single php page. 1 tokyo, 1 london, 1 madrid , 1 denver - great. problem (now) way i've been able "include" individual php pages made of html below. if "view source" on php page, see multiple html pages embedded within complete opening , closing html, head , body tags. my question: ok have multiple html pages embedded within 1 another? works across major browsers ( google chrome , firefox, internet explorer, safari , opera ). should going in different way? can't seem call header information within head of php file , make work (specifically call jquery & scripts/jclock.js). long loads on first clock isn't necessary on ones following, can't seem rid of html , use javascript code per clock , echo ' <div id='us_pacific"></div> ' (which how clock gets printed page within html within body tags.) any thoughts?

How to create white css box shadow -

i have following box shadow css on site. looks great in chrome, firefox , ie not recreate effect i'm looking for. want white solid shadow on bottom of box. how make work browsers? box-shadow: 0px 10px -14px 14px #fff; -webkit-box-shadow: 0px 10px -14px 14px #fff; -moz-box-shadow: 0px 10px -14px 14px rgb(255, 255, 255); use article or code: -moz-box-shadow: 13px 13px 0px 0px #ffffff; -webkit-box-shadow: 13px 13px 0px 0px #ffffff; box-shadow: 13px 13px 0px 0px #ffffff;

d3.js - tickValues in d3 not working as expected -

i trying make simple graph have 1 tick value, @ max of y axis. had working, moved things around because needed have things contained within function , though did not change code not working expected. i've been staring @ on hour , appreciate second set of eyes. first, code: function almviz() { ... this.x = d3.time.scale(); this.x.range([0, this.width]); this.y = d3.scale.linear(); this.y.range([this.height, 0]); } function loaddata(viz) { ... viz.yaxis = d3.svg.axis() .orient("left") .ticksize(0) .tickvalues([d3.max(viz.y.domain())]) // 1 tick @ max .tickformat(d3.format(",d")); viz.y.domain([0, d3.max(level_data, function(d) { return d[category.name]; })]); ... viz.svg.append("g") .attr("class", "y axis") .call(viz.yaxis); } var viz = new almviz(); loaddata(viz); however, y-axis wonky. tick has right text, gets placed in w

python - Django user setup for nose tests -

i tried seting user nose tests doesnot work in global scope defined: from django.contrib.auth.models import user import nose.tools noz inside test class defined: def setup(self): self.client = client() user = user(username="test", password="test") user.save() the user saved, have tested noz.set_trace() when test function calls same user's login, assertion error raised: nosetests --verbosity 1 creating test database alias 'default'... > <app-path>/tests.py(59)testtestuser() -> response = self.client.login(username=u'test', password=u'test') (pdb) user.objects.all() [<user: test>] the testtestuser function defined like: def testtestuser(self): """ tests if django user 'test' setup properly.""" noz.set_trace() # login test user response = self.client.login(username='test', password='test') noz.assert_equal(response,

wordpress - Cant' Display Custom Post Type Title Base on Taxonomy Terms -

trying list custom post type titles based on filtered custom taxonomy terms getting list of post titles instead of getting list of queried post. here code using: <?php $loop = new wp_query( array( 'post_type' => 'photos', 'technique' => 'zevar', 'post_child' => 0, 'posts_per_page' => 10 ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php the_title(); ?> <?php endwhile; ?> as can see have custom post type called "photos" , custom taxonomy registered "technique". under taxonomy "technique" have terms 1 of them "zevar". can please let me know doing wrong here? your taxonomy query not correct. check following code. <?php $loop = new wp_query( array(

syntax - why am I getting this format error ‘%c’ expects type ‘int’ -

why getting error or conflicting types function? player character want output, show player going next error tictac.c:94: warning: format ‘%c’ expects type ‘int’, argument 2 has type ‘char *’ tictac.c:94: warning: format ‘%c’ expects type ‘int’, argument 2 has type ‘char *’ code void move(char player) { int place; printf("player %c, enter placement: \n", &player); scanf("%d", &place); if (place == 1) board[0][0] = player; else if (place == 2) board[0][1] = player; else if (place == 3) board[0][2] = player; else if (place == 4) board[1][0] = player; else if (place == 5) board[1][1] = player; else if (place == 6) board[1][2] = player; else if (place == 7) board[2][0] = player; else if (place == 8) board[2][1] = player; else if

javascript - how to show $ sign in graph values in HTML web page -

Image
i creating graph working fine want values shows above bar graphs should have $ values idea how add dollar sign values. here image of graph want should show $17 , values comes. here html code <!doctype html> <html> <head> <title>graph 2</title> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript" src="graph_script.js"></script> </head> <body> <div id="container" style=" height:285px; width:400px;float:left;margin:200px 0 0 335px; position:absolute;"> </div> <script type="text/javascript"> $(document).ready(function(){ var b; b=17; bb=17.60; cc=21; a=10; var n=$; var chart = new highcharts.chart({ chart: { renderto: 'container', defaultseriest

sencha touch - Using sqlite database in SenchaTouch2 -

how use sqlite database in senchatouch2..in model used lik, proxy: { type : "sql", database : "contactsdb" } getting error..plz provide sample code that's have. put inside config of model. config: { identifier: { type: 'uuid' }, fields: [ {name: 'username', type: 'string'}, {name: 'password', type: 'string' }, ], proxy: { type: "sql", database: "fullcontact", } }, remeber include reference: requires:['ext.data.identifier.uuid','ext.data.proxy.sql',],

c# - How to use Routing in asp.net 3.5 in web form -

i have used following code, not able access querystring ...... public class routehandler : iroutehandler { string _virtualpath; public routehandler(string virtualpath) { _virtualpath = virtualpath; } public ihttphandler gethttphandler(requestcontext requestcontext) { foreach (var value in requestcontext.routedata.values) { //requestcontext.httpcontext.items[value.key] = value.value; // requestcontext.httpcontext. //system.web.httpcontext.items[value.key] = value.value; } return (page)buildmanager.createinstancefromvirtualpath(_virtualpath, ypeof(page)); } global.asax............. private void registerroutes(routecollection routes) { routes.add("home", new route("home", new routehandler("default.aspx"))); datatable dt = getmyurl(); if (dt != null && dt.rows.count > 0) { foreach (datarow dr in dt.rows) {

Create lightbox on Kirby CMS for blog post -

i have blog settled on kirby cms . have images attached on blog posts, style img contains max-width: 100%, every image has url itself... i'd open these links lightbox instead of page. problem can't use php these cases since not static page, have css, html , java, believe. lightbox utilizes css , javascript display image in modal window. need load lightbox javascript , css files jquery in template , add attribute rel="lightbox" images make work. why isn't working you?

Loading multiple images using http request GWT -

i need load 400-500 images on single page @ time. there quick way of doing so. can, in fact, load images using loop takes long? many in advance umesh as ie slow in rendering...please not add images @ time... as mentioned size of images in comment user cannot see images @ time..so must scroll down see remaining images ...so why can't use scroll event... at first shot loop first set of images (let 50) ..from can use window scroll event .. on scrolling can append next set of 50 images... this increase document load time...not in internet explorer in remaining browsers...

The VS 2012 Update 2 installation hang at the beginning -

i'm installing vs2012 update 2, whenever tried install, installation hang @ beginning while applying "microsoft portable library multi-target pack" , not able progress @ all. i'm running windows 8 x64 latest updates , vs2012 ultimate. anyone encountered same situation? got working? btw, have 2 win8 x64 machines, both have issue.

Unable to run spring struts maven project on WebLogic 10.3.3 using Eclipse -

if build project war , deploy on weblogic, works well, if run on server using eclipse, got error: caused by: bean type class com.opensymphony.xwork2.objectfactory name xwork has been loaded bean - zip:d:/documents%20and%20settings/admini/.m2/repository/org/apache/struts/struts2-core/2.3.12/struts2-core-2.3.12.jar!/struts-default.xml:29:72 - bean - zip:h:/runtime/weblogic1033/user_projects/domains/crmframeworkdomain/servers/adminserver/tmp/_wl_user/_auto_generated_ear_/nefp93/war/web-inf/lib/struts2-core-2.3.12.jar!/struts-default.xml:29:72 stacktrace <2013/4/20 下午06時59分34秒 cst> <error> <http> <bea-101165> <could not load user defined filter in web.xml: org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter. unable load configuration. - bean - zip:h:/runtime/weblogic1033/user_projects/domains/crmframeworkdomain/servers/adminserver/tmp/_wl_user/_auto_generated_ear_/nefp93/war/web-inf/lib/struts2-core-2.3.12.jar!/struts-default.xml:29

jquery - cgi.pm redirect does not print to Target _top -

i not sure how information need give here .. bear me please while try explain scenario. apologies if there "padding" i have application in use cgi::session security. various pages pulled in combination of jquery, perl, ajax calls etc. when print 1 of password-protected pages check logged-in status of cgi::session record , redirect homepage if necessary following perl: print $cgi->redirect( -url => $homepage); this works expected. however ... there div in 1 of password-protected pages contains control panel ... pulled in via jquery , ajax call. decided add security saving of data when user clicks "ok" ... invokes ajax call perl (controlpanelsave.pl). in perl decided add same check cgi::session logged-in flag (the user may have been sitting long on control panel , when click save had timed out - or maybe bad person had found javascript). perl checks , redirects homepage if not logged in. the problem have homepage printed inside control panel di

Error in implementing particle swarm optimization in power system using MATLAB -

i'm trying solution of economic load despatch using particle swarm optimization. i've written code during updating velocity , particle position in second iteration, not generate power value of generator adds 850. somehow algorithm isn't converging. please try run in matlab clear clc %initialization c1 = 2.0, c2 = 2.0 wmax = 0.9, wmin = 0.4 count = 0,countv=0 p1min = 100,p1max = 600 p2min = 50,p2max = 200 p3min = 100,p3max = 400 v1min = -50, v1max = 300 v2min = -25, v2max = 100 v3min = -50, v3max = 200 pd = 850 counter=0 i=1:10000 sum1=0; if count<10 g(i-counter,1) = (p1max - p1min)*rand() + p1min g(i-counter,2) = (p2max - p2min)*rand() + p2min g(i-counter,3) = (p3max - p3min)*rand() + p3min sum1=round(g(i-counter,1)+g(i-counter,2)+g(i-counter,3)) if sum1==pd count=count+1; else g(i-counter,:)=[] counter=counter+1; end end end i=1:10

user interface - GUI for Knopflerfish Config Admin -

does know gui config admin of knopflerfish? want achieve dynamic configuration management without editting configuration files manually. possible @ all? here osgi blog read to set config admin data, take @ felix webconsole, felix fileinstall, or knopflerfish environment. support range of (g)uis create configuration records. but not find gui knopflerfish :( i don't know if you're still interested in topic, anyway hope can you. tried far possibility change configadmin data via: felix fileinstall (download bundle http://felix.apache.org/downloads.cgi ) , add init.xargs list of bundles install , start. every modification make in pair "properties = value" of file mybundle.cfg notified bundles registered managedservice pid = mybundle. explanation added completeness not gui tool! knopflerfish console: here can enter "configuration" submenu "enter configuration", "list" see available configurations relative pids , "

driver - Why linux disables kernel preemption after the kernel code holds a spinlock? -

i new linux , reading linux device drivers book rubini & corbet. confused @ 1 statement related spinlocks ; book states if nonpreemptive uniprocessor system ever went spin on lock, spin forever; no other thread ever able obtain cpu release lock. reason, spinlock operations on uniprocessor systems without preemption enabled optimized nothing, exception of ones change irq masking status. further book states the kernel preemption case handled spinlock code itself. time kernel code holds spinlock, preemption disabled on relevant processor. uniprocessor systems must disable preemption in way avoid race conditions. question : on uniprocessor system, if kernel preemption disabled whenever kernel code (executing on behalf of user process) holds spinlock, how process ever chance run , hence try @ acquring spinlock ? why linux kernel disables kernel preemption whenever kernel code holds spinlock? the answer first question reasoning behind second. sp

ClassCastException: fragment cannot be cast to android.app.activtity -

i have class extends fragment , there button on once click initialises new class extends activity.. wanted pass data(e.g. string) on button click activity caller fragment. firstactivity extends fragment on button click intent startcontact = new intent(getactivity(), contact.class); getactivity().startactivityforresult(startcontact,1); contact extends activity on button click bundle bundle = new bundle(); bundle.putstring("listofcontacts", tapo1); intent intent = new intent(contact.this, first_activity.class); intent.putextras(bundle); setresult(result_ok); startactivity(intent); finish(); firstactivity onactivityresult @override public void onactivityresult(int requestcode, int resultcode, intent data) { // todo auto-generated method stub super.onactivityresult(requestcode, resultcode, data); multiautocompletete

javascript - Changing type of an input -

i want change type of input on click of button doesn't work. tried this: $('.addphoto').click(function(){ $(this).siblings('.auto_image').prop("type", "file"); }); it doesn't @ all. searched on google , came across this: change type of input field jquery it says possible straight dom, how select class of sibling dom? you can replace element don't think can change type attribute see example. $('.addphoto').on("click",function(){ $(this).off("click").replacewith("<input type='file' class='addphoto'/>"); }); or $('.addphoto').one("click",function(){ $(this).replacewith("<input type='file' class='addphoto'/>"); }); http://jsfiddle.net/eczp4/ here jquery documentation replacewith() http://api.jquery.com/replacewith/

Use Taleo to Authenticate a Username and Password -

i want create custom login on external site use taleo authenticate username , password (meaning, literally, check if user exists). there way of doing this? i'm having trouble finding answer in taleo's api methods. you can using library : https://github.com/polzme/taleo don't hesitate ask help.

Breeze not updating nullable datetime field -

i'm setting nullable datetime field on server field not being updated in database. private bool beforesaveleaseentry(lease leaseentry, entityinfo info) { if (info.entitystate == entitystate.added) { leaseentry.createddate = datetime.utcnow.tolocaltime(); } if (info.entitystate == entitystate.modified) { leaseentry.lastupdateddate = datetime.utcnow.tolocaltime(); } return true; } createddate not nullable , updated. lastupdateddate nullable , never updated. the code hit when run tracer on sql server field never included in update code. exec sp_executesql n'update [dbo].[leases] set [contractno] = @0 ([leaseid] = @1) ',n'@0 varchar(25),@1 int',@0='test6',@1=27415 sorry this, in breeze v 1.1.3 added entityinfo.forceupdate boolean property never made main breeze documentation, appeared in release notes. this property may used force server side u

cmd - Invoking 64-bit console from 32-bit python -

i'm attempting write script gather output of few basic windows commands set of files, , finding vssadmin commands frustrating. command relatively simple os.system('vssadmin list writers>> x:\foo\vss.txt') the problem i'm writing in python 32-bit , want make sure function on 64-bit windows. when executing this, return is: vssadmin 1.1 - volume shadow copy service administrative command-line tool (c) copyright 2001-2005 microsoft corp. error: volume shadow copy service component encountered unexpected error. check application event log more information. can invoke 64-bit command line 32-bit python , decide whether invoke bit-depth detecting function, or there more elegant solution? follow-up : using mbu jumping off point found following command trick: os.system('%systemroot%\\sysnative\\cmd.exe /c vssadmin list writers > x:\\foo\\vss.txt') under windows 2008 or newer can launch c:\windows\sysnative\vssadmin.exe . u

csv - How do I read in MATLAB a text file of doubles with variable number of columns per line? -

my file looks this: 1 2 3 4 5 6 7 8 9 ... i'm looking matlab one-liner (or two) can turn into: c{1} = [1 2 3 4] c{2} = [5 6] c{3} = [7 8 9] here one-liner, broken several lines readability c = cellfun(@(x) sscanf(x, '%f').', ... regexp(... regexprep(... fileread('test.txt'), ... '(\r|\n$)', ''), ... '\n', 'split'), ... 'uni', 0).';

asp.net - Creating a custom cachedependency for documents in ravendb -

i'm trying create cache dependency expire documents i'm caching using asp.net cache. came this: public class documentcachedependency : cachedependency { private readonly idisposable _subscription; public documentcachedependency(idocumentstore store, string docid) { _subscription = store.changes().fordocument(docid).subscribe(ondocumentchanged); finishinit(); } private void ondocumentchanged(documentchangenotification documentchangenotification) { notifydependencychanged(this, new eventargs()); } protected override void dependencydispose() { _subscription.dispose(); base.dependencydispose(); } } is idea performance wise or should use "fordocumentsstartingwith" / "foralldocuments". or should create index. answer depends on number of documents being cached, guess i'm asking is, ravendb optimizing me out of box when register hundreds of change listeners, or client set

c# - Wrong data type OleDB Create Table -

i m using following function create access table: public static void createtable(string path, string tablename, string[] columnnames) { try { string connectionstring = creadteconnectionstring(path); oledbconnection myconnection = new oledbconnection(connectionstring); myconnection.open(); oledbcommand mycommand = new oledbcommand(); mycommand.connection = myconnection; string columnam = "[" + columnnames[0] + "] text"; (int = 1; < columnnames.length; i++) { columnam = columnam + ", [" + columnnames[i] + "] text"; } mycommand.commandtext = "create table [" + tablename + "](" + columnam + ")"; mycommand.executenonquery(); mycommand.connection.close(); console.writeline("access table " + tablename +

Get four numbers random in a array -

i have array string[] arr={"a","b","c","d","e","f","a","d","m","e"}; i want random 4 different numbers array. how must do? list<string> shuffled = collections.shuffle(arrays.aslist(arr)); list<string> fourrandoms = shuffled.sublist(0, 4); or, if want leave array untouched: list<string> shuffled = collections.shuffle(new arraylist<string>(arrays.aslist(arr))); list<string> fourrandoms = shuffled.sublist(0, 4); edit: remove duplicates array, use set: set<string> uniquevalues = new hashset<string>(arrays.aslist(arr)); list<string> shuffled = collections.shuffle(new arraylist<string>(uniquevalues)); list<string> fourrandoms = shuffled.sublist(0, 4); learn standard java collections, , avoid using arrays completely. should use set beginning if duplicates not allowed.

iphone - ios : unable to make core plot graph smaller -

Image
am trying plot line chart in iphone app using core plot. unable draw graph small size in iphone screen. have set in storyboard (actually want smaller this, since want fit 2 graphs in screen, minimum size started showing plots, though showing 2 plot out of 5) and getting displayed in phone i removed padding graph & tried, in vain. in above scenario, have set padding to: self.graph.plotareaframe.paddingbottom = 2.0; self.graph.plotareaframe.paddingtop = 2.0; self.graph.plotareaframe.paddingleft = 2.0; self.graph.plotareaframe.paddingright = 2.0; and have set graph hosting view's bounds bounds of view in storyboard. kindly help. think should possible draw small graph, not sure why not allowing it. setting wrong? i increased yrange (plotspace.yrange) , worked! shows 5 data plots.

How does a public key verify a signature? -

trying better grapple on how public/private keys work. understand sender may add digital signature document using his/her private key obtain hash of document, not understand how public key can used verify signature. understanding public keys encrypt, private keys decrypt... can me understand? your understanding of "public keys encrypt, private keys decrypt" correct... data/message encryption. digital signatures, reverse. digital signature, trying prove document signed came you. that, need use have: private key. a digital signature in simplest description hash (sha1, md5, etc.) of data (file, message, etc.) subsequently encrypted signer's private key. since signer has (or should have) trust comes from. has (or should have) access signer's public key. so, validate digital signature, recipient (1) calculates hash of same data (file, message, etc.), (2) decrypts digital signature using sender's public key, , (3) compares 2 hash values. if match

ASP.NET WebForms: Short-circuit validation -

i have grid text box validating: <telerik:radtextbox id="txtmerchmin" runat="server" text='<%# bind("merchandiseminimumamount") %>'></telerik:radtextbox> <asp:requiredfieldvalidator id="required" runat="server" errormessage="* required" controltovalidate="txtmerchmin"></asp:requiredfieldvalidator> <asp:comparevalidator runat="server" id="isnumbers" type="double" operator="datatypecheck" controltovalidate="txtmerchmin" errormessage="* must numeric" /> <asp:comparevalidator runat="server" id="isnonnegative" type="double" operator="greaterthanequal" controltovalidate="txtmerchmin" amounttocompare="0" errormessage="* should non-negative"/> <asp:comparevalid

functional programming in R -

i have been reading functionals github . 1 suggestion in page use call_function if 1 working list of functions. here code page: call_fun <- function(f, ...) f(...) f <- list(sum, mean, median, sd) lapply(f, call_fun, x = runif(1e3)) the output posted as: # [[1]] # [1] 498 # # [[2]] # [1] 0.498 # # [[3]] # [1] 0.49 # # [[4]] # [1] 0.29 however, not able replicate above results. got error: error in fun(x[[4l]], ...) : not find function "f" am missing here? you have redefined function sd : sd = 2 call_fun <- function(f, ...) f(...) f <- list(sum, mean, median, sd) lapply(f, call_fun, x = runif(1e3)) #error in fun(x[[4l]], ...) : not find function "f" restart session or rm(sd) .

html - fadeIn/fadeOut and addClass/removeClass from divs JQuery -

i using below jquery code add , remove class has display:none property , add class has display:block 3 different divs positioned relatively. have side navigation has 3 links that, when clicked, want displays different divs on page, 1 fading out , other fading in. $(document).ready(function () { $('#what-we-do, #location').hide(); $('#who-we-are').show(); }); $(function () { $("#show-main-who").mousedown(function () { $('#what-we-do, #location').fadeout('fast', function () { $(this).addclass('hide-info'); $(this).removeclass('show-info'); }); }); $('#show-main-who').mouseup(function () { $('#who-we-are').fadein('fast', function () { $(this).removeclass('hide-info'); $(this).addclass('show-info'); }); }); }); $(function () { $("#show-main-what").mousedown(function () {

.net - C# :Does Client machine need SQL Server installed on it while connecting to other machine having SQL Server installed on it (the Server machine) -

i have written c# windows application form runs on client machine , connects sql server on machine.while building connection in c# have used dlls like 1)microsoft.sqlserver.management.smo. 2)microsoft.sqlserver.management.connectioninfo 3)microsoft.sqlserver.management.sdk.sfc the client machine on aplication built having sql server installed on it. importing , accessing dlls not problem. however on other client machine on going run c# windows application not having sql server installed on it. so cause problem.will connection fail on client machine due absence of sql server. if yes, way around solve problem without installing sql server on client machine. ps: asking beforehand avoid last minute hassle on day of installation. the pieces needed connect sql server built .net framework. long used when coding client piece can connect sql database without mssql installed on client. using system.data; using system.data.sqlclient; sqlclient ps: asking before

php - Using a Service Account, getAccessToken() is returning null -

i running following php code, using client libraries found here: https://code.google.com/p/google-api-php-client/ . not errors of code, when call getaccesstoken() , returns null. i have allowed access service account on personal calendar, , have granted full access project via api console. any ideas? require_once 'google-api-php-client/src/google_client.php'; const client_id = 'blahblahblah'; const service_account_name = 'blahblahblah@developer.gserviceaccount.com'; const key_file = 'path/to/privatekey.p12'; $google_client = new google_client(); // created initialized static dependencies $client = new google_oauth2(); // need google_oauth2 $key = file_get_contents(key_file); $client->setassertioncredentials( new google_assertioncredentials( service_account_name, array('https://www.googleapis.com/auth/calendar'), $key ) ); var_dump($client->getaccesstoken()); for reason, seemed work

php - mysql_fetch_array skipping first row -

edit : quick responses guys - ended switching mysql_fetch_assoc() , using do...while , go. i using same process create , populate tables - works fine except first row skipped in every table . use pair of eyes can't seem pinpoint issue. in advance. $query = "select * members"; $results = mysql_query($query); $row = mysql_fetch_array($results); //echo <table> start , headings; while ($row = mysql_fetch_array($results)) { echo "<tr><td>".$row['last name']."</td>"; echo "<td>".$row['first name']."</td>"; echo "<td>".$row['middle name']."</td>"; echo "<td>".$row['sfx']."</td>"; echo "<td>".$row['prf']."</td>"; echo "<td>".$row['spouse/so']."</td>"; echo "<td>&

c++ - My + operator changing the value of my class -

const polynomial operator +(const polynomial lhs, const polynomial rhs){ //lhs 1 polynomial result(lhs); result+=rhs; //when add rhs result increments lhs , lhs 3 cout<<"item: "<<rhs<<endl; return result; } int size; monomial *polynome; // polynome array of monomials //p[0]= 2, p[1]=3x etc. i using default copy constructor(i didnt define one) maybe thats problem since have pointer array dont know. rather not share += operator unles necessary since seem working fine terribly implemented take 30 minutes explain whats going on. driving me crazy, solutions? edit: defining deep copy constructor solved problem. lot tips! i'm going hazard wild guess class looks vaguely this: // not write code this. default copy semantics incorrect. struct polynomial { polynomial(size_t order) : coefs(new double[order+1]) {} double * coefs; }; attempting m