Posts

Showing posts from September, 2010

tcl - what is the different use of " " and {} -

when want implement own procedure have 1 doubt. example, following ok: % proc + {a b} {expr $a+$b} % + 3 4 7 but when using "" instead of {}: % proc + "a b" "expr $a+$b" it give error: can't read "a": no such variable at same time when use \ gives answer: % proc + "a b" "expr \$a+\$b" here, \ not considered $ special char take $a , same second example. can tell me difference between these 3 methods of defining proc? the fundamental difference between quotes , curly braces variables expanded inside of quotes, not in curly braces. in final example, when place backslash in front of dollar sign, removes special nature of dollar sign, variable isn't expanded. this explained on tcl man page . single page remarkably concise , accurate description of language.

Wordpress: when I click on a post, in a category, it loads the category, instead of the post content -

here link site working on friend. http://jayclarkephotography.com/category/wedding/ when click on click on "wedding test" or "long's wedding gallery", loads category, not post itself, messing around in css , of php other day , might have messed up. need - not web designer means have basic understanding of how works. thank help! when click on post ("wedding test" or "long's wedding gallery") takes post. wordpress default when add post creates link after website (for example http://yourwebsite.com/your-post/ ) - if want go http://yourwebsite.com/your_category/your-post/ have set custom taxonomies

asp.net - how to write data from a table row when a table row is clicked using jquery? -

to explain further... have asp.net table , textbox. there multiple rows in table. right now, have jquery code allows users click on rows , find link in row , take user url. here code: <script type="text/javascript"> var selected = null; $(document).ready(function () { $("#<%=orders_data.clientid%>").find("tr").click(function () { $(selected).removeclass("selected"); $(this).addclass("selected"); selected = this; }); $("#<%=orders_data.clientid%>").find("tr").click(function () { var href = $(this).find("a"); href.attr("target", "_blank"); window.open(href.attr("href")) }); }); </script> now, instead of finding

php - How do I make an onclick ajax request for favorites button work properly -

Image
i have list on site has favorites button associated each item on list. using image button click. php is: echo "<img src=\"./images/emptystar.png\" alt=\"favorite\" class=\"favoritebutton\" billid=\"" . $count['id'] ."\" userid=\"". $_session['userid'] ."\" />\n"; i have javascript/jquery make onclick of image submit ajax request php file. $(document).ready(function() { $(".favoritebutton").click(function () { var billid = $(this).attr("billid"); var userid = $(this).attr("userid"); var ajaxrequest; var params = "billid=" + billid + "&userid=" + userid; ajaxrequest.open("post","./ajaxphp/favorites.php",true); ajaxrequest.setrequestheader("content-type", "application/x-www-form-urlencoded"); ajaxrequest.setrequestheader("content-length", params.length); ajaxrequest.setr

Create a Parent div for multiple child divs - Jquery -

my code goes this, <div class="sexample"> <div class="child1 one">...</div> <div class="child2 one">...</div> <table>...</table> <div class="child3">...</div> </div> i want include parent div .child1 , .child2 targeting class .one . tried jquery .wrap method, adding parent div each items. please me this. assuming want result this: <div class="sexample"> <div> <div class="child1 one">...</div> <div class="child2 one">...</div> </div> <table>...</table> <div class="child3">...</div> </div> use wrapall() instead of wrap() : $('.one').wrapall('<div>');

python - Read excel file from StringIO buffer to dataframe with pandas.io.parsers.ExcelFile? -

i'd read string buffer pandas dataframe. seems way use pandas' excelfile functionality. i've tried following: from pandas import excelfile excel_handler excel_data = excel_handler(stringio(file_stream.read()).getvalue()) from on, guess excelfile.parse() can used. this produces following error: <class 'openpyxl.shared.exc.invalidfileexception'> [errno 2] no such file or directory: ' any ideas on how read in file buffer? fixed. had missed part earlier in code file_stream.read() being called. consequently, time excelfile being called, empty string being passed it, causing error. getvalue() needed removed. here's how should go: from pandas import excelfile excel_data = excelfile(stringio(file_stream.read()) dataframe = excel_data.parse(excel_data.sheet_names[-1])

hadoop - Optimized hive query needed -

we have 2 tables containing huge data. , have perform inner join between these 2 tables. joining condition based on 3 columns c1,c2,c3. need in writing optimized query above scenario. please refer data model below. table1 c1,c2,c3,c4,c5 table2 c1,c2,c3 appreciate help. thanks. if understand hortonworks' founder owen o'malley correctly, may optimize writing select t1.* table1 t1 join (select table2.* table2) t2 on (t1.c1=t2.c1 , t1.c1 = t2.c2 , t1.c3 = t2.c3)

html - How can I add a "plus sign/icon" to my portfolio shots??? -

i trying add "plus sign" (its .png file) portfolio section. goal make "plus sign" visible when customers hovering mouse pointer on projects in same time want keep background-color property set up. however, plus sign doesn't show up!? how can that??? on website can see similar effect: http://bjorsberg.se/ here jsfiddle: http://jsfiddle.net/l8hx7/ this part of css (from jsfiddle) needs fixed: .plus{ width: 100px; height: 100px; position: absolute; left: 50%; top: 50%; margin: -49px 0 0 -56px; background: url(img/plus.png) center center no-repeat; } here example of plus sign want add: http://icons.iconarchive.com/icons/visualpharm/icons8-metro-style/512/very-basic-plus-icon.png the style has applied on hover . just replace background-color in .projectshot .over:hover{ appropriate background . don’t need div.plus @ all, , neither need div.inner (you can remove html!): .projectshot .over:hover{ position

objective c - How do i bind to a NSString? -

this question asked before , not answered. i can bind objects so: [[acellview textfield] bind:@"stringvalue" toobject:myobject withkeypath:@"text" options:nil]]; this works easy because have myobject.text value. how bind nsstring? [[acellview textfield] bind:@"stringvalue" toobject:astring withkeypath:@"" // should keypath be? options:nil]]; you can bind individual objects, not temporaries. 1 of reasons why bind key paths have little more sense lifetime of variable, , therefore, binding. make astring property of calling object, , bind self astring key path: [[acellview textfield] bind:nsvaluebinding toobject:self withkeypath:@"astring" options:@{}];

android - Differentiating between user scroll and programatic page change in ViewPager -

i have android.support.v4.view.viewpager in application , differentiate between programmatically-initiated smooth scroll , user-initiated touch scroll. i've had @ viewpager.onpagechangelistener , believe answer may lie in there i'm not sure how. ok, turns out right answer lying in viewpager.onpagechangelistener . in particular lies in using onpagescrollstatechanged(int state) . there 3 states page in viewpager can in: dragging: indicates pager being dragged user. idle: indicates pager in idle, settled state. settling: indicates pager in process of settling final position. so dragging state occurs when current page being physically dragged user. when user has swiped page states occur in following order: dragging -> settling -> idle. now, onpageselected(int position) method called between "settling" , "idle" states. thus, in order determine whether or not page change caused user scroll 1 needs check previous state "draggin

java - Android library to stream local stored audio via RTP -

is possible transmit local stored audio file (e.g. mp3) via rtp? e.g. there mp3 file taken input , converted/packed rtp packets , send on network. there libraries, solutions, examples? thanks! //edit: want make phone call sip , send/stream local stored audio file called, can hear it. check possible webrtc solutions in section 5.... have not worked sounds tailor made trying do. maybe use ondello api. or you have build session sip/rtp connection , providing backdoor (jni , native code) buffer receives microphone raw stream or output buffer microphone raw stream encoded to... doing load rtp stream on sender side prerecord audio. with access buffer, in middle of sip session, can xcopy in-memory version of audio file, swapping stream sip call. party @ other end of call hear audio audio file not microphone content. if not success w/ sip/rtp apis, check java networking lib allows build sip connections ground , swap buffers in manner want. https://github.com/bruno

parsing - Positive identification of a fillable PDF form among non-PDF form files -

i'm looking programmatic approach positively identify fillable pdf form(s) among non-pdf form files. the options believe available are: parse pdf code , content parse file signature identification hex capable language such python parse file hex capable language such python flag telltale signs

vb.net - How do delegates solve cross-threading issues? -

i know can't call gui update function background thread , yet can't see how creating delegate , assigning gui update function it, , calling solves problem. how different calling gui update function itself? how creating function pointer ( delegate ) solve problem? delegates not solve problem, control.begininvoke() or dispatcher.begininvoke() methods do. know how run code on specific other thread, feature provided message loop (aka dispatcher loop) ui thread uses. such loop common solution producer-consumer problem . these methods require delegate object, passed argument. know specific code needs run on ui thread.

tsql - using bcp to copy between servers gives SQLState 22008 -

i'm trying copy data 1 database (on different servers) tables have identical schema, every time run below query error saying following... "sqlstate = 22008 nativeerror = 0 error = [microsoft][sql server native client 10.0]invalid date format" the query this... exec sp_configure 'show advanced options', 1 go reconfigure go exec sp_configure 'xp_cmdshell', 1 go reconfigure go declare @masterservername varchar(40) declare @masterserverusername varchar(20) declare @masterserverpassword varchar(20) declare @slaveservername varchar(40) declare @slaveserverusername varchar(20) declare @slaveserverpassword varchar(20) declare @exportfile varchar (40) declare @exportfile1 varchar (40) declare @exportfile2 varchar (40) declare @exportfile3 varchar (40) declare @exportfile4 varchar (40) set @masterservername='{sql_server_name}' set @masterserverusername='{sql_user_login}' se

extjs - "TypeError: Cannot read property 'launched' of null" in netbeans JSDT running jasmine tests -

i have setup new extjs project , want test netbeans , jsdt + adapter , html test runner. this file structure: root - config -- jstestdriver.conf - public -- application --- controller, model, store, view -- ext // extjs lib. -- test --- lib ---- jasmine + jstd-adapter -- unit // tests the jasmine spec runner ( /test/specrunner.html ) works fine, netbeans jstd shows following error: typeerror: cannot read property 'launched' of null what wrong? here's application init code: ext.onready(function () { testapp = ext.create('app.application', {}, this); jasmine.getenv().addreporter(new jasmine.trivialreporter()); jasmine.getenv().execute(); }); ext.define('app.application', { extend: 'ext.app.application', // ... and tests: describe("basic assumptions", function () { it("has extjs4 loaded", function () { expect(ext).tobedefined(); expect(ext.g

matlab - Deterministically generating secure passwords using a publicly visible function -

i avoid storing list of passwords, instead reliably regenerate them using publicly visible matlab function. function takes secret key, not stored anywhere, set seed of random number generator. is secure approach regenerate account passwords need them? secure mean, more vulnerable knowing secret key is? % start blank slate clear clc % {url, #symbols, #upper, #lower, #numbers} accounts = { ... 'www.foo.com', [3,3,3,3]; ... 'www.bar.com', [0,4,4,4]; ... 'www.box.com', [0,2,3,2]; ... }; key = input('secret key: ', 's'); acc = input('account name (url): ', 's'); % clear display clc % allowed characters s = { ... '@#$%&*=+'; ... % symbols 'abcdefghjkmnpqrstuvwxyz'; ... % upper 'abcdefghjkmnpqrstuvwxyz'; ... % lower '123456789' }; % numbers % find matching accounts idx = strfind(accounts(:,1), acc); % generate password each mat

z3py - Check overflow with Z3 -

i'm new z3 , checking online python tutorial. then thought check overflow behavior in bitvecs. i wrote code: x = bitvec('x', 3) y = int('y') solve(bv2int(x) == y, not(bv2int(x + 1) == (y + 1))) and expecting [y = 7, x = 7] (i.e. when values equal successors not because x + 1 0 , y + 1 8) but z3 answers [y = 0, x = 0]. what doing wrong? i don't think you're doing wrong, looks bv2int buggy: x = bitvec('x', 3) prove(x <= 3) prove(bv2int(x) <= 3) z3py proves first one, gives counter-example x=0 second. doesn't sound right. (the explanation might weird python thing, don't see how.) also note model depend on whether + treats bit-vector signed number in python bindings, believe case. however, bv2int might not so, treating unsigned value. further complicate matters. in case, looks bv2int not quite kosher; i'd stay away until there's official answer z3 folks.

Folder Selection Dialog Box (VBA, Excel 2010) causing files to be unreadable -

this may quite lengthy description, please bear me. problems experiencing excel related custom macros, vba, , file access. background : trying write macro process multiple csv workbooks of data. have files named rawdata_1.csv until rawdata_x.csv x number of files have in particular folder. my code macro looks this: sub importdata() application.screenupdating = false dim strdir string dim strfilename string dim wbtocopy workbook dim intcol integer set master = activesheet **please see below 2 versions of code can go here!** strfilename = dir(strdir & "\*.csv") intcol = 2 while len(strfilename) > 0 set wbtocopy = workbooks.open(strfilename, , true) //do other things need here wbtocopy.close (false) strfilename = dir intcol = intcol + 2 loop application.screenupdating = true end sub problem 1 (tiny problem) : when execute macro, files somehow "change,&quo

java - Executing 2 or more Runnables causes performance issues -

i need factor 64-bit number (n = pq). implemented method searches consequentially numbers in range of [1; sqrt(n)]. it took 27 secs execute on android 1,2 ghz processor (unfortunately, don't know number of cpu cores). decided make parallel. well, 2 runnables giving me results in 51 secs , 3 — in 83. my program nothing calling method in oncreate . final static private int workers_count = 3; final static public int[] pqfactor(final long pq) { stopfactorflag = false; long blocksize = (long)math.ceil(math.sqrt(pq) / workers_count); executorservice executor = executors.newfixedthreadpool(workers_count); (int workeridx = 0; workeridx < workers_count; ++workeridx) { runnable worker = new factortask(pq, workeridx * blocksize, (workeridx + 1) * blocksize); executor.execute(worker); } executor.shutdown(); try { executor.awaittermination(5, timeunit.minutes); } catch (interruptedexception e) { e.printstacktrace(

c - how to execute a command as root -

i develop c code on linux (debian). time time, need execute commands through system() i wonder if possible execute command via system() as root. if not case, there function execute command (or run binary) root can use on c code? we met situation before want execute root command normal user, here our solution (using setuid/suid): assume that: username : tom group : gtom c program file : my_pro.c step 1: write c code tool: my_sudo.c ... int main(int args, char *argv[]) { if (args < 2) printf("usage: my_sudo [cmd] [arg1 arg2 ...]"); // cmd here shell cmd want execute in "my_pro" // can check shell cmd privilege here // example: if (argv[1] != "yum") return; allow yum execute here char cmd[max_cmd]; int i; ( = 2; < args; ++) { // concatenate cmd, example: "yum install xxxxx" strcat(cmd, " "); strcat(cmd, argv[i]); } system(cmd); } step 2

require once - PHP Fatal Error Failed opening required() -

the full error this, [error] [client ::1] php fatal error: require_once(): failed opening required 'src/core/adminsystem.php' (include_path='.:/usr/local/pear/share/pear:/users/everardobarriga/pear/share/pear:/usr/share/pear') in /users/everardobarriga/smgadmin/src/controller/cmdlogin.php on line 3` so have application trying run locally , have updated include_path in php.ini, not allowed modify code can modify include_path know how can modify include_path app working? thanks! add in /users/everardobarriga/smgadmin/ include_path, , should fix it.

java - Managing dependencies in a Maven Project -

i have 2 jars supposed imported maven project. followed tutorial (click here ) , imported jars maven project. basically, executed code in terminal: mvn install:install-file -dfile=myfile.jar -dgroupid=mygroup -dartifactid=com.mygroup.project -dversion=1.0 -dpackaging=jar -dlocalrepositorypath=lib -dcreatechecksum=true , imported library maven project. all works fine. however, jars importing supposed have few dependencies themselves. understand, maven handles internal dependencies automatically. have list of dependencies (with group id, artefact id , version) don't understand write those. in folder 1.0 of library, there file called myjar-1.0.pom. tried writing dependencies there of no use. could tell me way of manually telling maven load few dependencies? i tried specifying these dependencies in main pom.xml results in errors - saying repo-url/dependency/file.pom not found. guess needs mentioned in internal dependency - can't figure out way of manually defining them

javascript - move data from table1 to table 2 using jquery -

i have question. tried implement display data in table button click. trying move data table below continue table. in code, when enter input value json object , click submit button, data display in table continue button , empty table below.when click continue data in above table should move table located below continue button. i got worked work if click submit button second time.. trying implement scenario clicking continue button. suggestions? here code [link http://jsfiddle.net/e254w/11/] yes, simplest 1 (imo) $('#continue').click(function(){ $("#submitid").click(); }); just submit once , continue clicking on continue button. demo.

mysql - Joining 3+ tables using SQL displaying too many results -

im trying create query join these tables using method below. repeating results , not linking correctly. in same rating comment on 4/5 different results etc. producing 18ish results when im expecting 3. willing me problem? select a.company_name, f.job_id, f.job_name, b.user_name, c.comments, c.reliability, c.rating company a, users b, ratings c, usercompjobrating d, company_job e, jobs f d.comp_job_id = e.comp_job_id , b.users_id = d.users_id , c.rating_id = d.rating_id; many thanks, andrew ok tried , saying e.users_id unknown column in 'on clause' select a.company_name, b.job_id, b.job_name, c.user_name, d.comments, d.reliability, d.rating company a, usercompjobrating e, jobs b inner join users c on c.users_id = e.users_id inner join company_job f on e.comp_job_id = f.comp_job_id inner join ratings d on d.rating_id = e.rating_id; i'm ass

regex - Parse SVG transform attribute with javascript -

supposing have svg transform string: transform = "translate(6,5),scale(3,3)"; is there slick regex function use parse usable? here's nifty little snippet of code might need, should cover scenario in case string intend parse has different number of arguments: function parse (a) { var b={}; (var in = a.match(/(\w+\((\-?\d+\.?\d*e?\-?\d*,?)+\))+/g)) { var c = a[i].match(/[\w\.\-]+/g); b[c.shift()] = c; } return b; } running this parse('translate(6,5),scale(3,3.5),a(1,1),b(2,23,-34),c(300)'); will result in this: { translate: [ '6', '5' ], scale: [ '3', '3.5' ], a: [ '1', '1' ], b: [ '2', '23', '-34' ], c: [ '300' ] }

ubuntu - sublime text 3 - change syntax colours -

i change particular syntax highlighting colour in sublime text 3 - how can that? most answers sublime text concern mac os (some windows) - details (paths etc..) relevant ubuntu (or other linux distros) helpful. go folder sublime_text3 binary is. go packages folder open color scheme - default.sublime-package find concern color scheme. open in editor , change values per requirement. archive manager prompt updation of file changes. yes. restart sublime 3. note: sublime 3 packages folder unlike sublime 2 stores packages in .config folder in home

version control - Manually editing using git add --patch <filename> -

so, i've got file i've been working on in branch a, , i'm ready commit it. however, looking @ diff, think it's better put 2 separate commits (well, in case, 2 separate branches, maybe). i've used git add --patch before stage separate hunks, thought use this. problem is, need split 1 of hunks. running git add --patch sda.py , using e edit problem hunk... # manual hunk edit mode -- see bottom quick guide @@ -50,13 +50,74 @@ import pil.image im import constant + +def exp_range(min=none, max=none, step=none): + """ + generate exponentially increasing value scaled , offset such + covers range (min, max]. behaviour similar + exp(x), scaled such final value generated equal + 'max'. 'step' defines granularity of exponential + function. default value 5, corresponding step-size + of tau. + + :type min: float + :param min: minimum value of range (offset) + + :type max: float + :param max: maximum

java - What is the proper return for this method? -

Image
this subclass code ship in asteroids remaking making practice. package comets; public class ship extends spaceobject{ protected double angle; protected double speed; public ship(double xpos,double ypos,double xvel,double yvel){ super(xpos, ypos, xvel, yvel, 10); } public void accelerate(){ this.xvelocity+=.1*math.sin(angle); this.yvelocity+=.1*math.cos(angle); } public double getspeed(){ return speed=math.sqrt(math.pow(this.xvelocity, 2)+math.pow(this.yvelocity,2)); } public shot fire(){ //need return shot return null; } public double getangle(){ return angle; } public void rotateleft(){ angle+=.1; } public void rotateright(){ angle-=.1; } } as can see not sure how return public shot fire() method. have returning null need return shot ship in game can shoot bullets. bellow shot class have constructor shot de

java - Eclipse e3 to e4 migration/adaption(preferred) - recommendations -

what got i got finished e3 application, need dependency injection feature e4, therefore moved kepler. now in e4, e3 plugins working, if run application e3 app. if change application.e4xmi system fails. (somehow expected this) problems how can move e3 plugins e4 perspectives , views working (i got plenty of em! , cannot remove them - need them extended if plugin gets added!) menu contributions, handlers/commands need work (nothing in fragment.e4xmi gets added gui) what did till now i changed api e4 no longer use iworkbench or platformui nor viewpart interfaces (still way go, did in 1 plugin testing purposes) transformed plugin.xml (e3 code) e4 fragment.e4xmi (but found out (link stackoverflow) contributing views/perspectives broken in e4.) i added fragment.e4xmi extension in plugin.xml , removed else (e3-style) resources stackoverflow lars vogel jonas helming edit/updates bug 376486 - eclipse 4 ide not extendable via fragments or processors -

iphone - How to create multicolor text in UILabel for iOS 5.1 and below -

Image
i want create label contain text have different color. this, i have done in ios 6 using nsmutableattributedstring nsmutableattributedstring *text = [[nsmutableattributedstring alloc] initwithattributedstring: self.exerciselbl.attributedtext]; [text addattribute: nsforegroundcolorattributename value: [uicolor colorwithred:(187/255.0) green:(57/255.0) blue:(38/255.0) alpha:1] range: nsmakerange(0, 2)]; [self.exerciselbl setattributedtext: text]; but not work ios 5.1 , below. how achieve same result in ios 5. /**(1)** build nsattributedstring *******/ nsmutableattributedstring* attrstr = [nsmutableattributedstring attributedstringwithstring:@"hello world!"]; // calls don't specify range affects whole string [attrstr setfont:[uifont systemfontofsize:12]]; [attrstr settextcolor:[uicolor graycolor]]; // change color of "hello" [attrstr settextcolor:[uicolor redcolor] range:nsmakerange(0,5)]; /**(2)** affect nsattributedstring ohattributedlabel

haskell - Json parser, incorrectly parsing string as a number -

i'm still pretty new haskell , functional programming in general, i'm writing small program parsec parse json , pretty print means of learning basic concepts. have far: import text.parsec import text.parsec.string data jvalue = jstring string | jnumber double | jbool bool | jnull | jobject [(string, jvalue)] | jarray [jvalue] deriving (eq, ord, show) parsejstring, parsejnumber, parsejbool, parsejnull :: parser jvalue parsejstring = str <- between (char '"') (char '"') (many (noneof "\"")) return . jstring $ str parsejnumber = num <- many digit return . jnumber . read $ num parsejbool = val <- string "true" <|> string "false" case val of "true" -> return (jbool true) "false" -> return (jbool false) parsejnull = string "null" >> return jnul

php - what does this mean return($var & 1); -

this question has answer here: reference — symbol mean in php? 15 answers callback function return return($var & 1)? 8 answers in php in line below return($var & 1); mean, & mean in context? <?php function test_odd($var) { return($var & 1); } $a1=array("a","b",2,3,4); print_r(array_filter($a1,"test_odd")); ?> this bitwise and . so, if $var odd returns 1 . let's $var = 13 , in binary 1101 (because 13 = 2^3 + 2^2 + 2^0 ). when 1101 & 0001 0001 . can either 1 if $var has last bit 1 (meaning it's odd) or 0 if $var has 0 last bite, meaning $var written sum of powers of two, without 2^0` meaning even.

Get List of Cards based on Board - Trello API -

i trying return list of cards based on board user chooses dropdown select menu. demo http://jsfiddle.net/nnesx/1378/ i have created list of boards follows var $boards = $("<select>") .text("loading boards...") .appendto("#output"); // output list of of boards member // assigned trello.get("members/me/boards", function(boards) { $boards.empty(); $.each(boards, function(ix, board) { $("<option>") .attr({href: board.url, target: "trello"}) .addclass("board") .text(board.name) .appendto($boards); }); }); which gives me dropdown select of boards available. once user chooses board want them see cards board. using code cards, cards appear. var $cards = $("<div>") .text("loading boards...") .appendto("#outputcards"); // ou

Android: Cannot be resolved or is not a field , possible help required -

this class package com.example.payrollapplication.details; import com.example.payrollapplication.r; import android.app.activity; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; public class addemployee extends activity implements onclicklistener{ edittext e_name, e_designation, e_phone, e_age, e_basic, e_ot, e_pf, e_otheralloances; button b_save, b_cancel , b_reset; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.employee_entry); e_name = (edittext)findviewbyid(r.id.enameedit); e_designation = (edittext)findviewbyid(r.id.edesignationedit); e_phone = (edittext)findviewbyid(r.id.enumberedit); e_age = (edittext)findviewbyid(r.id.eageedit); e_basic = (edittext)findviewbyid(r.id.ebasicpayedit); e_ot = (edittext)findviewbyid(r.

ember.js - How to traverse through hasMany relationship in console? -

app.cardcategory = ds.model.extend properties: ds.hasmany 'app.cardproperty' app.cardproperty = ds.model.extend symbol: ds.attr 'string' label: ds.attr 'string' popover: ds.attr 'string' unit: ds.attr 'string' ds.restadapter.configure 'plurals', card_property: 'card_properties' i can both cardproperty , cardcategory via app.xxx.find() / find(n) can't traverse through relationship in chrome console. this: app.cardcategory.find(1).get('properties').objectat(1) returns `undefined' whereas: app.cardcategory.find(1).get('properties') returns: class {type: undefined, store: class, _changestosync: ember.orderedset, owner: class, name: "properties"…} i had problems getting data in console i'd know definitive way this. update in response comment. app.cardcategory.find(1).get('properties.length') returns 0 . response to /card_categories/1` following:

How to access the Property value of nested class in c# -

i have following code in assembly. public class { public class b { public static string obj; public static string result { { return obj; } set { obj = value; } } } public class c { string result1; public void invoke() { result1 = "abc"; b.result = result1; } } } i had referenced in application(say eg: client app) , trying access value of obj if invoke value creating instance of class b how can access value set in previous scope without return invoked method? since involved public, can access value outside assembly follows: public class someexternalclass { public void somemethod() { stri

c# - Centering text vertically and horizontally in TextBlock and PasswordBox in windows store app -

i trying center text in textblock , passwordbox. in textblock use textalignment property center text horizontally, still close top. how center text vertically? and in passwordbox there no property associate text alignment, how achieve this?? textalignment horizontal alignment. textblock doesn't suport vertical alignment. i suggest put border around , let border vertical alignment: <border borderbrush="{x:null}" height="50"> <textblock text="your text" verticalalignment="center"/> </border> or other way using height , set padding within textblock. for password box use in wpf : <passwordbox horizontalcontentalignment="center" verticalcontentalignment="center" /> for silverlight need extract actual template of passwordbox (use blend allows edit template , copy that) can change members (on contentelement of type border) template binding like: horizontalalignment="