Posts

Showing posts from January, 2014

java - What happens when 2 classes create objects of each other? -

java - What happens when 2 classes create objects of each other? - as far know when object created within given class memory allocated particular object. in case: public class kinda { kindb b = new kindb(); // rest of code } public class kindb { kinda = new kinda(); // rest of code } what happens in case on memory allocation side of things when 2 classes create objects of eachother? you'll stackoverflowerror if seek initialize 1 of classes, since initializer of kinda creates new object of type kindb , hence initializer of kindb runs, creates new object of type kinda , kinda 's initializer runs again, creates , initializes new object of type kindb , on ... this infinite recursion, hence stackoverflow. java

python - Pandas - Create new dataframes based on ranked values in select columns -

python - Pandas - Create new dataframes based on ranked values in select columns - i have dataframe columns containing numerical info , other containing text. looks like: age weight blood sugar study grouping gender notes 29 195 126 b female notes of kind 34 180 140 b male different set of notes 48 220 111 c male blah blah 55 189 109 c male more notes i want create sub-divisions of info frame based on rankings of numerical info columns. example, if need 2 oldest patients new dataframe this: age weight blood sugar study grouping gender notes 48 220 111 c male blah blah 55 189 109 c male more notes the rank function looks useful. figure run: df2 = rank.df(axis=0) and find way utilize index of df2 pu

Using C/C++ DLL with Python/Pyserial to communicate with Opticon barcode reader -

Using C/C++ DLL with Python/Pyserial to communicate with Opticon barcode reader - i have opticon opn-2001 barcode scanner im trying communicate with. officially supports c/c++ , .net wanted utilize python if possible. i have opened serial connection device (or @ to the lowest degree port(?) when utilize functions dll gives me communications error (-1) when expecting ok (0). i've never used dll's or serial communication bear in mind. what im wondering if i've made obvious mistakes in calling dll-function or using pyserial. im interested in else having @ sdk. seems expecting 4 byte long comport below. thought work im bit stuck. realize there much can help without actual hardware. give thanks help however! here code have sofar: from ctypes import * serial import * opticonlib = windll('csp2.dll') opticonlib.csp2setdebugmode(1) #logs textfile if using debug version of .dll comport = 3 opticonserial = serial( port=comport - 1, baudrate=9600, bytesize=

XAML is spell check Enabled is not working -

XAML is spell check Enabled is not working - i created little app in xaml. getting problem, enabled isspellcheckenabled="true" istextpredictionenabled="true" still alternative not working.when set wrong word doesn't predict nor check word. istextpredictionenabled used autocomplete features only. check documentation, http://msdn.microsoft.com/library/windows/apps/br209690 states feature textbox determine whether provide autocomplete feature or not. it, in way, doesnot check word spells. to word spell check, please read documentation spellcheck class on msdn at, http://msdn.microsoft.com/en-us/library/system.windows.controls.spellcheck(v=vs.110).aspx you can sample code msdn (look @ lastly section in document). xaml

Using a PNG file as an interactive map in pygame -

Using a PNG file as an interactive map in pygame - i working pygame. want build 2d scrolling game. don't want have programme necessary rects in order create big map. possible utilize png file (which map) , have sprite interact part of image if rect? or import , convert image rects? in advance. i assume "interact" you're referring collision detection (i.e. controlling on map character can , cannot move). that's broad topic lots of resources available. look pygame.mask module (docs here). you're describing, create separate mask images overlaying levels e.g. 1 color areas cannot passed through , areas can. pygame.mask.from_threshold() automatically create mask object can utilize observe collisions between sprites , level. as simple example, consider mario level: a collision mask might this: note boxes aren't accounted on mask despite beingness "part of level;" approach useful static pieces of level. boxes sprite ow

php - Which driver should I install for Yii framework to work with MongoDB in WAMP? -

php - Which driver should I install for Yii framework to work with MongoDB in WAMP? - should install php driver in wamp work mongodb yii framework, or yii driver? when google drivers mongodb work php, different results search of 'mongo driver yii'. what difference between them. better? i think should utilize php_mongo.dll php extension suggested in tutorial. http://www.pronique.com/blog/installing-mongodb-on-windows-the-wamp-way php mongodb yii wamp yii-extensions

data structures - Number of nodes in a B tree -

data structures - Number of nodes in a B tree - in b tree minimum grade t, each non leaf node other root has @ to the lowest degree t children , @ 2*t children. suppose keys {1,2,3...,n} inserted empty b tree minimum grade 2 in sequence 1,2,3.....,n. how many nodes final b tree have? from have understood, sense n/t since minimum number of keys each node can have k, , total number of keys n. correct?? if not tell me going wrong , how should this? the reply (n-2)*log(n-2) t=2 data-structures b-tree

python - add word with each number in one line -

python - add word with each number in one line - i made var input word , output of word encode hex , need made var number if input 10 , output = 1,2,3,4,5,6,7,8,9,10 , need bring together word each number .. output , hexedword1,hexedword2,hexedword3 ... etc .. here code num = raw_input("inset number of students. ") num in range(1, num + 1) print num word = raw_input("insert name of pupil encrypt hex. ") res = "0x" + word.encode('hex') + num print res it's little hard tell asking, understand, encrypted pupil names separated commas number next name there few errors code. one, raw_input("inset number of students. ") returns string, utilize integer. prepare this, num = int(raw_input("inset number of students. ")) there farther things can maintain user giving weird, work. another problem res . each student, res beingness reset. want info added it. done += op

postgresql - Postgres Streaming Replication read query forward -

postgresql - Postgres Streaming Replication read query forward - i know, in case of synchronous streaming replication slave server can take read queries (hot standby). question: need set-up jdbc connection straight slave, or master automatically forwards read request slave. i know there pg-pool-ii load balancing. simple situation when have master , slave? need connection master , decide run query himself or forwards slave, or need straight create connection slave (by this, mean using slave's ip in jdbc). i found nil in docs. feeling no, need specify straight in jdbc connection slave postgres not load balancer. may be.... thanks answers. you connect normal slave , issue queries. there's no point in shipping queries , results twice (once master, on slave, master client). oh, can have "hot standby" server in synchronous/async , streaming/wal-shipping files. shipping wal files can mean standby time behind master server, doesn't matter.

Error using gte projection option with an ISODate objetc n Mongodb shell -

Error using gte projection option with an ISODate objetc n Mongodb shell - i have collection timestamp field stored in isodate format. database populated 3rd party. subset of document looks like: collection{ "_id" : "foobar/201310", "name" : "somename", "processedtime" : "2013-10-01t00:00:00.000z", "value" : 375439 . . . } the info in processedtime field looks 2014-10-21t12:13:12.056790 when query collection next query: db.collection.find({},{processedtime:{$gte : isodate("2014-10-21t00:00:00.000z")}}); i error: unsupported projection alternative "$gte", "code":13097"; i same error when alter isodate in query "new date" or alter $gte $gt i using version 2.4.6 , there configuration piece or syntax problem query? wondering since info goes out nano seconds problem? have looked error , no 1 seems re

ruby - unable to get content-length header working under rails 4.1+puma -

ruby - unable to get content-length header working under rails 4.1+puma - setup is: puma: 2.9.1 rails: 4.1.5 rack: 1.5.2 as per documentation tried contentlength header working adding fallowing application.rb config.middleware.use rack::contentlength unfortunately response still chunked. after investingation found next status in rack::contentlength class: if !status_with_no_entity_body.include?(status.to_i) && !headers['content-length'] && !headers['transfer-encoding'] && body.respond_to?(:to_ary) body.respond_to?(:to_ary) 1 yields false. @ context body instance of rack::bodyproxy in responds_to? overriden: def respond_to?(*args) homecoming false if args.first.to_s =~ /^to_ary$/ super or @body.respond_to?(*args) end i confused here. removing body.respond_to?(:to_ary) resolves issue, dont sense safe removing chunks of code rack lib. help getting content-length header working appreciated. thanks.

java - Alternatives to LinkedBlockingDeque? -

java - Alternatives to LinkedBlockingDeque? - i've java programme runs on multiple threads. 1 of threads wait info thread , processes it. used linkedblockingdeque implement it, such thread block until info available in queue. however, server i'm running on has java se 5, version not have particular class. there alternatives this? for requirements described can utilize linkedblockingqueue available in java 5 java

jquery - How can I skip objects from a JSON file if the value of a key = 0? -

jquery - How can I skip objects from a JSON file if the value of a key = 0? - i have table beingness populated json file, working far i'm trying skip objects have value of 0 key named "member_count". possible? this code: $mygroupstable = $('#my_groups_table'); $.ajax({ url: 'http://testingsite.com/jsondata/mygroups.json', datatype:'json', success:function(data){ $.each(data.groups, function(key, val){ $mygroupstable.append('<tr><td><input type="checkbox" class="groupselector" member_count="' + val.member_count + '" value="' + val.value + '" id="' + val.id + '" name="' + val.name + '" group_name="' + val.group_name + '" /></td><td style="width:10px;"></td><td><label for="' + val.id + '">' + val.group_name + '

android - Best way to remove JSON object from JSON object -

android - Best way to remove JSON object from JSON object - assuming have jsonobject { "poll_answers":{ "213":{ "poll_answer_text":"black", "poll_answer_id":"213" }, "214":{ "poll_answer_text":"white", "poll_answer_id":"214" }, "218":{ "poll_answer_text":"colorful", "poll_answer_id":"218" } } } what relevant/best way remove** jsonobject key "214" (for example) since android remove method returns value mapped key not given object excluding object want remove. solution should like: { "poll_answers":{ "213":{ "poll_answer_text":"black", "poll_answer_id":"213" }, "218&

angularjs - How to navigate on button click -

angularjs - How to navigate on button click - i have button in anuglarjs , have bind property contains url. when click button error. error: [$parse:syntax] syntax error: token 'vm.achreportpath' unexpected, expecting [:] @ column 3 of look [{{vm.achreportpath}}] starting @ [vm.achreportpath}}]. <button class="btn btn-default" id="searchformbtn" data-ng-click="{{vm.achreportpath}}" type="submit" tabindex="5">view report</button> $scope.vm.achreportpath = "www.google.com" please guide me doing wrong. replace data-ng-click="{{vm.achreportpath}}" with href="{{vm.achreportpath}}" if dont have "http://" href="http://{{vm.achreportpath}}" angularjs angularjs-scope

mysql - Django syncdb not respecting collation and encoding -

mysql - Django syncdb not respecting collation and encoding - i'm setting project that'll available in 16 languages i'm trying setup database unicode characters using next init command; databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': database_name, 'user': '', 'password': '', 'host': 'localhost', 'port': '', 'storage_engine': 'innodb', 'conn_max_age': 100, 'atomic_requests': true, 'options': { 'init_command': 'set storage_engine=innodb,character_set_connection=utf8,collation_connection=utf8_unicode_ci', }, } } when check tables created python manage.py syncdb they're set latin1. i've got correct? or making error using init_command collation & encoding? mysql d

variables - Why literals are considered expressions in C++? -

variables - Why literals are considered expressions in C++? - i'm studying c++ programming language using programming priciples , practice using c++. i'm in chapter 4 , in chapter book introduces concept of expression, can't understand @ : the basic building block in programme expression. espression compute value number of operands. simplest look in c++ literal value such 11, 'c', "hello". names of variables expressions. variable represent object name. why literal considered look ? why name of variable considered look ? expressions -in programming languages, in math, in linguistics- defined compositionally (or inductively). expressions made of subexpressions x*2+y*4 made of 2 sub-expressions x*2 , y*4 joined add-on operator + . but need base of operations case (the atomic , simple expressions). these literals ( 2 ) , variables ( x ) - if either of them not look 2*x not look (since both operands of binary multiplication *

vb.net - to read xml using dom cencepts -

vb.net - to read xml using dom cencepts - iam doing xml reading using dom concepts, couldn't retrieve values correctly. i want retrieve below part using loop statement <area id="508" type="paragraph" visible="1" source_ap="true" invert="false" rotation="0" ignoretext="0"> <pagename><![cdata[11187_2014_06_14_000002_0004_nfhez]]></pagename> <pagenumber>1</pagenumber> <left>603</left> <top>868</top> <right>764</right> <bottom>1132</bottom> <polygon ispolygon="0" noofpoints="0"><![cdata[]]></polygon> </area> here total sample xml want retrieve using loop. <?xml version="1.0" encoding="utf-8"?> <articles> <template istemplate="true" twidth="0" theight="0" uwidth=&q

How to over come from deadlock in embedded SQL through C# in SQL Server 2014? -

How to over come from deadlock in embedded SQL through C# in SQL Server 2014? - i facing deadlock problem on dispatching.packagetrace table when below embedded sql invoked through c# programming language in ms sql server 2014. below table design in database: create table [dispatching].[packagetrace]( [packageid] [uniqueidentifier] rowguidcol not null, [partitionid] [numeric](26, 0) null, [conduit] [nvarchar](255) not null, primary key clustered ( [packageid] asc ) go set ansi_padding off go alter table [dispatching].[packagetrace] add together default (getdate()) [datecreated] go below embedded sql invoked through c# programming language in ms sql server 2014: if exists(select * dispatching.packagetrace packageid = 'klaslndsskok230m') begin update [dispatching].[packagetrace] set [conduit] = @conduit [packageid] = 'klaslndsskok230m' end else begin insert [dispatching].[packagetrace] ([p

ios - CloudKit subscription with "CONTAINS" predicate -

ios - CloudKit subscription with "CONTAINS" predicate - i trying setup cloudkit subscription based on testing membership in array. the code i'm using create subscription follows: nspredicate *predicate = [nspredicate predicatewithformat:@"users contains %@", userid]; cksubscription *itemsubscription = [[cksubscription alloc] initwithrecordtype:@"foo" predicate:predicate options:cksubscriptionoptionsfiresonrecordcreation|cksubscriptionoptionsfiresonrecordupdate]; cknotificationinfo *notificationinfo = [[cknotificationinfo alloc] init]; [notificationinfo setalertlocalizationkey:@"record notification"]; [notificationinfo setshouldbadge:yes]; [itemsubscription setnotificationinfo:notificationinfo]; [database savesubscription:itemsubscription completionhandler:^(cksubscription *subscription, nserror *error)

node.js - How to compile string of coffeescript code in javascript? -

node.js - How to compile string of coffeescript code in javascript? - so let's have string of coffeescript code, in javascript file on nodejs. how convert string javascript, without using terminal? have tried coffeescript-compiler, gave me error closed socket. have coffeescript installed globally , coffee-script compiler installed locally. edit: here code: var compiler = require('coffeescript-compiler'); var cc = new compiler(); cc.compile('a = 5', function (status, output) { if (status === 0) { // javascript available string in `output` variable } }); and here error throws: events.js:72 throw er; //unhandled 'error' event error: socket closed. @ socket._write (net.js:637:19) @ dowrite (_stream_writable.js:225:10) @ writeorbuffer (_stream_writable.js:215:5) @ socket.writable.write (_stream_writable.js:182:11) @ socket.write (net.js:615:40) @ docompile (d:\tsa\app\node_modules\coffeescript-compiler

c++ - What is dominance in the context of virtual functions? -

c++ - What is dominance in the context of virtual functions? - code sample: consider next diamond hierarchy: struct { virtual void f(){} void g(){} }; struct b : virtual { virtual void f() override{} void g(){} }; struct c : virtual { }; struct d: b, c { }; int main() { d d; d.f(); //b::f called d.g(); //b::g called } what understand: as far non-virtual function g concerned, clear: name b::g hides a::g , though name a::g reached without beingness hidden through c . there no ambiguity. b::g called. the standard explicitly confirms in 10.2 p.10: [ note: when virtual base of operations classes used, hidden declaration can reached along path through subobject lattice not pass through hiding declaration. not ambiguity. identical utilize non-virtual base of operations classes ambiguity; in case there no unique instance of name hides others. — end note ] [example: additionally, this answer related question pr

php - Simple Array Sum Not Working -

php - Simple Array Sum Not Working - function regex_scrape($regex,$results_page){ preg_match_all($regex,$results_page,$match); homecoming $match; } $continue = true; $prices = array(); $url = ""; while ($continue == true) { $results_page = curl($url); // downloading results page using our curl() funtion $prices2 = regex_scrape('/<span class=\"h3 price-amount\">(.*)span>/',$results_page); $prices = array_merge($prices,$prices2[0]); array looks , can't array_sum or find lowest array value (min) array ( [0] => 45 [1] => 80 [2] => 60 [3] => 40 [4] => 37 [5] => 69 [6] => 34 [7] => 79 [8] => 46 [9] => 91 [10] => 269 [11] => 59 [12] => 60 [13] => 79 [14] => 35 [15] => 67 [16] => 85 [17] => 45 ) echo array_sum($prices); returns 0 why? your illustration array not have consecutive indexes (probably array_merge ). have tried doing array_valu

python - Accessing PIL image subelements, and taking a string from it -

python - Accessing PIL image subelements, and taking a string from it - at moment have image sample single string out of illustration outlines details below (assume image has been loaded memory pil access) # image size of: image[480,640] (binary image example) # take string level (y = 200) start (x = 250) sample_binary = image[x:1,y] but when seek access throwing error asking integer (so understand it, doesn't utilize python strings possibly??), means can access 1 pixel, there anyway can sample line start of image row (x = 0 x = 250) on column (y = 200)? thankyou time without using numpy arrays: from pil import image = image.open("basic_training.png") # line def get_line(i, y): pixels = i.load() # not list, nor list()'able width, height = i.size all_pixels = [] xpos in range(width): cpixel = pixels[xpos, y] all_pixels.append(cpixel) homecoming all_pixels # columns def get_column(i, x): pixels = i.loa

nfa - Closed operations of regular languages -

nfa - Closed operations of regular languages - let x language on alphabet, insert(x) set of strings obtained adding 1 more character 1 of strings in x. insert(x) = { azb : a,b ∈ ∑* , ab ∈ l , z ∈ ∑. } why set of regular languages closed under insert operation? nfa

objective c - "config.h" used by but not bundled with libxml -

objective c - "config.h" used by but not bundled with libxml - libxml uses next line of code in libxml.h doesn't come bundled libxml. #include "config.h" i'm trying utilize xmppframework objective-c, in swift. xmppframework has libxml dependency. you seek including these: #include <stdio.h> #include <libxml/tree.h> #include <libxml/parser.h> as found on: http://wiki.xmlsoft.org/the_libxml2_library#installing objective-c c libxml2

python - Can you set a breakpoint and drop into interactive mode from command line in pycharm 3? -

python - Can you set a breakpoint and drop into interactive mode from command line in pycharm 3? - i working on django project pycharm 3.4.1 . @ command line shell have function imported: >>> import v1.views >>> v1.views.get_data_from_text_file("kk") i have set breakpoint in function's code, when seek execute @ command line using: >>> v1.views.get_data_from_text_file("kk") it doesn't stop. there way drop interactive mode while testing @ command line? but when seek execute @ command line using it won't stop because pycharm debugs importing own specific python files. since you're using command line, interpreter not know where you're setting breakpoints. you can configure script parameters so: the reddish arrow indicates should set in script name, is filled you. orange 1 need place arguments. python django pycharm

What makes Java easier to parse than C? -

What makes Java easier to parse than C? - i'm acquainted fact the grammars of c , c++ context-sensitive, , in particular need "lexer hack" in c. on other hand, i'm under impression can parse java 2 tokens of look-ahead, despite considerable similarity between 2 languages. what have alter c create more tractable parse? i inquire because of examples i've seen of c's context-sensitivity technically allowable awfully weird. example, foo (a); could calling void function foo argument a . or, declaring a object of type foo , rid of parantheses. in part, weirdness occurs because "direct declarator" production rule c grammar fulfills dual purpose of declaring both functions , variables. on other hand, java grammar has separate production rules variable declaration , function declaration. if write foo a; then know it's variable declaration , foo can unambiguously parsed typename. might not valid code if class foo hasn't be

javascript - Marionette: childViewContainer was not found -

javascript - Marionette: childViewContainer was not found - i trying larn how utilize marionette backbone. not sure why getting next error: uncaught childviewcontainermissingerror: specified "childviewcontainer" not found: ul here's fiddle code: http://jsfiddle.net/e7l822c8/ here javascript: window.app = new backbone.marionette.application(); app.addregions({ mainregion: '.js-page' }); app.start(); var themodel = backbone.model.extend({}); var thecollection = backbone.collection.extend({ model: themodel, }); var listview = backbone.marionette.compositeview.extend({ tagname: 'div', classname: 'js-list-container', template: _.template( '#listviewtemplate' ), childviewcontainer: 'ul', childview: itemview }); var itemview = backbone.marionette.itemview.extend({ initialize: function() { console.log('this.model =',this.model); console.log(this); }, tagname: 'li'

Showing just one element on hover event jQuery -

Showing just one element on hover event jQuery - i creating team section. have simple <div> have profile photos of each fellow member , when hover photo shows information. made happen jquery's .hover() . but, when copied same code guess did. yeah, guys right: shows me info team members. what want display them 1 1 , when stop hovering content homecoming initial state. i leave js code below: <script type="text/javascript"> $('.teammemberphoto').hover(function(){ $('.teammembercircle').hide(); $('.teammemberinfo').show(); }); </script> edit, added html: <div class="teammemberscontainer"> <div class="teammember"> <h3 class="teammembername">sarei arlin rodriguez camarillo</h3> <p class="teammemberposition">software developer</p>

ios - How to fix the bug? -

ios - How to fix the bug? - undefined symbols architecture armv7: "operator delete(void*)", referenced from: aes::~aes() in libusc.a(aes.o) "___gxx_personality_sj0", referenced from: _decypttoken in libusc.a(tokenwrap.o) ld: symbol(s) not found architecture armv7 clang: error: linker command failed exit code 1 (use -v see invocation) i hava utilize static library in project,and static library back upwards armv7. ios linker-error undefined-symbol

jquery - form not sending data in ajax.serialize when form contents are updated via javascript -

jquery - form not sending data in ajax.serialize when form contents are updated via javascript - i facing problem when using javscript update inner html of form. want dynamically add together input type same name in form , send form info via jquery ajax serialize. eg. class="snippet-code-js lang-js prettyprint-override"> function addinput() { //update form html add together next <input type="text" value="1" name="addtext" /> <input type="text" value="2" name="addtext" /> <input type="text" value="3" name="addtext" /> <input type="text" value="4" name="addtext" /> <input type="text" value="5" name="addtext" /> } function initiate() { document.myform.action="initiatemultiplereceiptreceiptaction.action?next=0"; var formdata=$('f

MYSQL & PHP trouble with echoing tables -

MYSQL & PHP trouble with echoing tables - so trying echo out how many rows there in table count command, purposely have no rows in table right test if statement, , not working, worst, makes rest of site not work(the page pops no text or numbers show on it), when added row table, worked fine, no rows = no work. here piece of code doesn't work. , help highly appreciated. $query1 = mysql_query(" select *, count(1) `numberofrows` `table1` `user`='$username' grouping `firstname`,`lastname` "); $numberofrowsbase = 0; while($row = mysql_fetch_assoc($query1)) { if(isset($row['numberofrows'])) { $enteries1 = $enteries1; }else{ $enteries1 = $numberofrowsbase; } echo enteries1; } seems have on complicated everything. advise worldofjr should take onboard simplest way total rows table is: select count(*) numberofrows table1; there several othe

angularjs - How to filter a select box based on a typeahead selection -

angularjs - How to filter a select box based on a typeahead selection - when create new job select client , client employees based on property "customeremployeerole". select client typeahead input. need selection filter 2 select boxes client employees have same customerid selected customer. have created plunkr. plunker <label>customer:</label> <input type="text" ng-model="currentitem.customername" typeahead="customer.customername client in customerarray | filter:$viewvalue" typeahead-on-select="selectcustomer($item)"> <label>customerpm:</label> <select ng-options="customer.customeremployeefirstname + ' ' + customer.customeremployeelastname customer.customeremployeefirstname + ' ' + customer.customeremployeelastname client in customeremployeearray | filter: {customeremployeerole : 'pm'}" ng-model="currentitem.customeremployeeid"> &l

Flash ActionScript 3: Reading text from a file -

Flash ActionScript 3: Reading text from a file - there's problem: want load info text file (named "mytext.txt") flash cs5.5 . contains lines, , want store these lines in array. i've got now: var myloader:urlloader = new urlloader(new urlrequest("mytext.txt"); var myarray:array = new array(); myloader.addeventlistener(event.complete, loadcomplete(myarray)); function loadcomplete(myarray:array):function { homecoming function(e:event):void { myarray = myloader.data.split("\n"); for(var i:int = 0; < myarray.length; ++i){ trace(myarray[i]); // check if works @ point } } } for(var i:int = 0; < myarray.length; ++i){ trace(myarray[i]); // check if gets modified } the fact fist part works, loads text file , stores in myarray , , traces it; stores in local version of myarray , doesn't modify reference, for outside of function d

recursion - How to diff all modifications of all checkout files under a directory recursively with Clearcase? -

recursion - How to diff all modifications of all checkout files under a directory recursively with Clearcase? - it's clearcase. i checked out several files under directory, of files in sub-directory, in sub-sub-directory. what want list diff of modifications on these checked out files under directory recursively. thanks in advance. updated @ oct 23 2014: currently figure out 1 solution: for file in $(cleartool lsco -recurse -me -cview -fmt "%n\n"); cleartool diff -serial_format -pred $file; done i utilize bash loop, if create done simple clearcase command, please update answer, thanks. the op suggests using list of checked out files, there no way find diff in 1 cleartool command. xargs (used here) might easier cleartool lsco -recurse -me -cview -fmt "%n\n" | xargs -n 1 cleartool diff -serial_format -pred recursion diff clearcase

Data attribute value from first div using jQuery -

Data attribute value from first div using jQuery - this should easy stuck! need info attribute first div in html chunk obtained using ajax. div can have other elements or text first item in html chunk. html not contain head, body or other start elements. html looks below. <div data-code="us"><span style="background-color:red">test</span><br /></div> the jquery script looks below. function loadcode(url) { $.get(url, function (data1) { var code = ""; //code = $(data1 + ":first").data("code"); // did not work //code = $(data1).data("code"); // did not work alert(code); }); } this should work $(data1).data('code'); jquery

java - Gradle Build fails with Javadoc NullPointerException -

java - Gradle Build fails with Javadoc NullPointerException - i've updated 1 of projects android l new build-tools 21.0.2 , new gradle 2.1. now build project on scheme next exception: import com.tundem.aboutlibraries.r; ^ symbol: class r location: bundle com.tundem.aboutlibraries java.lang.nullpointerexception @ com.sun.tools.javadoc.typemaker.gettype(typemaker.java:83) @ com.sun.tools.javadoc.typemaker.gettype(typemaker.java:44) @ com.sun.tools.javadoc.classdocimpl.superclasstype(classdocimpl.java:496) @ com.sun.tools.doclets.internal.toolkit.util.util.getallinterfaces(util.java:459) 4 warnings @ com.sun.tools.doclets.internal.toolkit.util.util.getallinterfaces(util.java:497) @ com.sun.tools.doclets.internal.toolkit.util.classtree.processtype(classtree.java:194) @ com.sun.tools.doclets.internal.toolkit.util.classtree.buildtree(classtree.java:146) @ com.sun.tools.doclets.internal.toolkit.util.classt

.net - Stream reading variations in C#? -

.net - Stream reading variations in C#? - i've seen this code sample - reads stream buffer : byte[] buffer = new byte[1024 * 32]; int bytesread; while ((bytesread = stream.read(buffer, 0, buffer.length)) > 0) { //... } but looking @ sec parameter of stream.read(..,0,..) zero-based byte offset in buffer @ begin storing info read current stream. so offset 0 each time ? said doesn't overwrite info @ indexes? on contrary : saw this example : int read, offset = 0; while(count > 0 && (read = source.read(buffer, offset, count)) > 0) { offset += read; count -= read; } so here offset offsetted after each reading ( seems more logical me) but must missing : was observation right? when should utilize each case ? nb , pov network stream : sending file. they're both code samples useful, in different scenario. let's pick first illustration add together code: socket socket = ...; byte[] buf

php - Grab a specific value from MySQL database -

php - Grab a specific value from MySQL database - i'm trying value mysql database. need grab price particular item , here how table looks: i'm not sure how go , thing think of grab cost table adding status query grabs results match domain_address . i test calling function <?php echo getpageurl();?> returns http://vauxhallpartswarehouse.co.uk/ (which should match against database entry. //table calls function <td bgcolor="#999999" align="center">price: <?php echo getprice();?></td> <?php function getprice() { $con=mysqli_connect("host","user","pass","db"); $price = mysqli_query($con, "select cost domains domain_address='<?php echo getpageurl();?>'"); mysqli_close($con); homecoming $price; //should 1 result returned since domain_address unique } ?> this doesn't seem want work, , don't know how else grab price. i kn

javascript - createFile() in google Apps Script is not functioning properly -

javascript - createFile() in google Apps Script is not functioning properly - i trying create file. works fine when run next code segment debugger in apps script. however, when run real time spreadsheet, says not have permission phone call createfile. logged identical. issue not not have authorization 1 in spreadsheet , owner. purpose of csv move google drive info bigquery function saveascsv(row) { //doc csv //row = 3; //when uncommented , ran debugger, works. try{ var filename= date.now() filename = filename + ".csv"; var csvfile = convertrangetocsvfile_(filename,row); logger.log(csvfile); //both times ran on spreadsheet , debug equals same. driveapp.createfile(filename, csvfile); spreadsheetapp.getactivespreadsheet().getsheetbyname("new , open").getrange("j" + row.tostring()).setvalue(""); loadcsv(filename); } catch(e){logger.log("b" + e.message);} //no permission create file } function convertrangetocsvfile

iphone - UIPageViewController automatic scrolling in iOS -

iphone - UIPageViewController automatic scrolling in iOS - i making 1 app, in pageviewcontroller should scroll in time interval. have done till manual scrolling. user can scroll images , work. stuck accomplish automatic scrolling user touches. below code. please help me on this. - (void)viewdidload { [super viewdidload]; // additional setup after loading view. _pagetitles = @[@"", @"", @"", @""]; _pageimages = @[@"page1.png", @"page2.png", @"page3.png", @"page4.png"]; // create page view controller self.pageviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"pageviewcontroller"]; self.pageviewcontroller.datasource = self; pagecontentviewcontroller *startingviewcontroller = [self viewcontrolleratindex:0]; nsarray *viewcontrollers = @[startingviewcontroller]; [self.pageviewcontroller setviewcontrollers:viewcontrollers direct

amazon web services - What is m3.medium + RHEL 6.5 equivalent in Microsoft Azure? -

amazon web services - What is m3.medium + RHEL 6.5 equivalent in Microsoft Azure? - i using m3.medium aws instance application next configuration. os: reddish hat linux enterprise edition 6.5 (rhel 6.5) cpu: 1 processor: intel xeon e5-2670 ram: 4gb what m3.medium + rhel 6.5 equivalent in microsoft azure? in series vms closest you'd a2. seek 1 of new d series vms cost fair bit more (standard_d1) closest. rhel isn't supported on azure (officially) closest supported drop you'd centos (see here options: http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-endorsed-distributions/) azure amazon-web-services amazon-ec2

Need assistance with regex -

Need assistance with regex - for regex, want letters a-z 1-4 times followed digit 4-7 times. combination of these 2 should have 8 characters total. ([a-z]{1,4}[0-9]{4,7}){8} i know wrong. can tell me right regex look create work you can utilize lookahead based regular look assert string length 8 characters. ^(?=.{8}$)[a-z]{1,4}\d{4,7}$ explanation | live demo regex

templates - C++ order of type modifiers -

templates - C++ order of type modifiers - in c++ have template functions. example: template<class a,class b> void something(a a, b b){ //do } how compiler guess modifiers of types , b? a, a&, const a& etc... criteria uses pick type modifiers? specified standard? yes standard has rather complex rules on type deduction. far long quote here, knowing behaviour specified exactly c++ plenty satisfy you. note rules pretty much same auto . c++ templates

android - Saving the tick in the checkbox isn't working after quiting and then returning to app -

android - Saving the tick in the checkbox isn't working after quiting and then returning to app - hi have got tick box want user tick , and maintain tick saved when user leaves app or navigate different activity , returning. code of have got sofar doesn't seem working @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.test_ticking, container, false); ch = (checkbox) rootview.findviewbyid(r.id.tickbox1); ch.setonclicklistener(new view.onclicklistener() { sharedpreferences pref = getactivity().getsharedpreferences("pref",0); @override public void onclick(view v) { // todo auto-generated method stub if(pref.getboolean("check", false)) { ch.setchecked(false); pref.edit().putboolean("check", false).commit(); } else {

php - Instantiating twig in a namespaced class -

php - Instantiating twig in a namespaced class - i'm running issues trying figure out how utilize twig in specific way. i'm trying write view class can utilize in application regardless of template scheme installed, way things have alter templates , view class. however, when seek , create twig objects in class, fatal error: class 'template\twig_loader_filesystem' not found errors, , i'm not sure i'm missing. can point me in right direction? here's i've got far... composer.json { "name": "movies", "description": "find movies", "require": { "ext-curl": "*", "twig/twig": "~1.0" }, "autoload": { "classmap": [ "app/classes" ] } } index.php require_once 'app/app.php'; utilize template\template; echo template::render('hello.html', a

objective c - parse.com how can I test if a column exists in a parse data class iOS -

objective c - parse.com how can I test if a column exists in a parse data class iOS - i have persistent store class. classname = testdata it has 10 columns. i want delete column via info browser dashboard. lets column 'test1'. in code want test existence of column. ie. if testdata.test1 exists else else any help much appreciated. many thanks, guy pfquery has method wherekeyexists: https://parse.com/docs/ios/api/classes/pfquery.html#//api/name/wherekeyexists: wherekeyexists: add constraint requires particular key exists. - (void)wherekeyexists:(nsstring *)key parameters: key - key should exist. ios objective-c parse.com

vb.net - regex for replacing only double apostrophes -

vb.net - regex for replacing only double apostrophes - i searched , not find answer. i need replace non-double apostrophes single apostrophe. abc'def''ghi'x -> abc''def''hgi''x ''abc'def' -> ''abc''def'' 'abc''def -> ''abc''def i dont want this: abc''def -> abc''''def all of solutions i've seen fail if apostrophe @ start or @ end. utilize vbnet. help welcome. regex or other form of code appreciated. a simple regex (?<!')'(?!') regex vb.net str-replace

Why are my exceptions not being logged with ServiceStack NLog? -

Why are my exceptions not being logged with ServiceStack NLog? - given nlog config file: <extensions> <add assembly="seq.client.nlog"/> </extensions> <variable name="servicename" value="lo.leads.processor"/> <targets async="true"> <target name="seq" xsi:type="seq" serverurl="http://mywebsite"> <property name="threadid" value="${threadid}" as="number" /> <property name="machinename" value="${machinename}" /> </target> <target name="file" xsi:type="file" layout="${longdate}|${logger}|${level}|${threadid}|${message}" filename="c:\logfiles\leads\processor\processor.log" archivefilename="c:\logfiles\leads\processor\processor.{##}.log" archiveevery="day" archivenumbering="

javascript - How to save and restore multiple values inside a form field (using front-end logic only) -

javascript - How to save and restore multiple values inside a form field (using front-end logic only) - i looking way save table values multiple <input> form fields, , able restore them. why -- need have way of switching between english language , metric systems, without losing precision during conversion. so have below code assumes values entered in english language unit system. if user switches metric, the values converted user. switching english language right nothing, because while can reverse conversion, doing lose precision eventually. don't know how approach problem of saving , restoring multiple values, , want form is restore entered values when user switches english. assume first need have way save values upon original entry. when trying code below, first alter selection english language metric. see values alter converted value. going english language nothing. save , restore buttons nil right well. also, there no differentiation between i

Android Radio Button Animation -

Android Radio Button Animation - hello guys inquire question related custom radio button. designed radio button custom background , flip animation. when click radio button flip , changes background due radio button property first changes background , animate.please help me.i want animate first , alter background. thank by code, can this: animation anim = animationutils.loadanimation(this, r.anim./*your animation*/); anim.setanimationlistener(new animation.animationlistener(){ @override public void onanimationstart(animation arg0) { } @override public void onanimationrepeat(animation arg0) { } @override public void onanimationend(animation arg0) { if(buttonname.ischecked()){ buttonname.setimageresource(r.drawable.imagechecked); }else{ buttonname.setimageresource(r.drawable.imageunchecked); } } }); bu

c - Code explanation -

c - Code explanation - i don't know if right se site posting, i'll seek either way, answer.it suggested this if (data[c] >= 128) sum += data[c]; can turn this: int t = (data[c] - 128) >> 31; sum += ~t & data[c]; can explain me how work? the thought behind happening this. assume data[c] > 128. if true, doing data[c] - 128 results in positive number (ie. sign bit 0). shifting right 31 times results in number 0s in binary. t=00000000000000000000000000000000. now, when ~t becomes 1s , &-ing data[c] gives data[c] again. add together sum , works before. but if data[c] < 128? means data[c] - 128 negative, giving 1 sign bit. means t=11111111111111111111111111111111. ~t 0s. &-ing 0s data[c] gives 0s 1 time again (ie. 0 in decimal). adding 0 sum doesn't alter well. c

mysql - How to Encyrpt data after validation in Ruby on Rails? -

mysql - How to Encyrpt data after validation in Ruby on Rails? - i using devise authentication, register. want save emailid in mysql in encrypted format. utilize gem 'aescrypt'. my controller: def create @dashboard_user = dashboarduser.new(dashboard_user_params) @dashboard_user.created_by=current_dashboard_user.username @dashboard_user.company_id=current_dashboard_user.company_id active_ind = "" email = @dashboard_user.email if params["active"] == nil active_ind = "0" else active_ind = "1" end @dashboard_user.active = active_ind @dashboard_user.email= aescrypt.encrypt(email, "password") respond_to |format| if @dashboard_user.save format.html { flash[:notice] = 'user created.' , redirect_to action: "index"} else @dashboard_user.email = email format.html { render :new } end end end when seek