Posts

Showing posts from March, 2014

cocoa - WebView changeFont: and changeColor: with no selection reset changes when i type -

ok, title bit confusing. have subclass of webview. can type in it. now, if change font fontpanel, or color colorpanel while having nothing selected, , type character, new character in new font or new color. if change font popupbutton, set selectedfont in nsfontmanager, when type character, font resets font of previous character. is there way keep "temporary" font or color change? i looked @ webview class reference docs , doesn't seem can that. have first way, every time, achieve want.

javascript - iScroll not working on iPhone for jquery show/hide -

i building phonegap application iscroll used scrolling. facing problem when dynamically append controls div , show/hide div on click. div shows , hides automatically. have given code samples below. apperciate help. first tried scroll.refresh() alone, since did not work, tried destroying , recreating according forum post in google. but, not work either. html <div class="wrapper" id="wrapper"> <main class="content" id="scroller"> <ul> <li> <span id="usertype-link"> </span> <div class="b-preferences__select b-preferences__select--type" id="search-user-type-div"> </div> </li> </ul> </main> </div> js $('#search-user-type-div').hide(); $('#usertype-link').bind('clic

html - Submenu in Wordpress doesnt show IE-11 -

Image
i have problem submenu in ie-11. following menu in different browsers , versions ok in ie-11 not appear. this site has address: there i asked question on topic, result has zero. ask experienced people! menu in wp doesnt show in ie-11 check compatibility of css property correctly used in css file, of attribute supported "div.clipped" in code

How to acces the string inside XML cdata in android -

i trying make android app reads online xml file. xml file includes cdata. , need text inside cdata. how this? in advance! <id> <![cdata[ 10217 ]]> </id> public static string getcharacterdatafromelement(element e) { nodelist list = e.getchildnodes(); string data; for(int index = 0; index < list.getlength(); index++){ if(list.item(index) instanceof characterdata){ characterdata child = (characterdata) list.item(index); data = child.getdata(); if(data != null && data.trim().length() > 0) return child.getdata(); } } return ""; }

c# - IDataParameter InvalidCastException -

the microsoft enterprise library data access application block contains following method: private static idataparameter[] createparametercopy(dbcommand command) { idataparametercollection parameters = (idataparametercollection)command.parameters; idataparameter[] parameterarray = new idataparameter[parameters.count]; parameters.copyto(parameterarray, 0); return cachingmechanism.cloneparameters(parameterarray); } if command.parameters tdparametercollection (a teradata .net provider class implements idataparametercollection ), parameters.copyto(parameterarray, 0) throws invalidcastexception: "unable cast object of type system.data.idataparameter[] type teradata.client.provider.tdparameter[]". my first question: how , why happening? the exception message suggests parameters have been copied parameterarray , there attempt afterwards convert parameterarray idataparameter[] tdparameter[]. (in case, tdparameter implements idataparameter .) my se

asp.net mvc 3 - How to add same column multiple times in mvcgrid in mvc3 view -

below code mvcgrid . model contains properties name , productcode , avgwaight . want add column productcode 2 times. @ runtime argument exception thrown "column 'productcode ' exist in grid" @html.grid(model).columns(columns => { columns.add(c => c.name).titled("product name ").setwidth(200).sortable(true).filterable(true); columns.add(c => c.productcode).titled("product code").setwidth(200).sortable(true).filterable(true); columns.add(c => c.avgweight).titled(" avg. weight").setwidth(300).sortable(true).filterable(true); }).withpaging(5) how add same column multiple times, different titles. thank in advance do way, worked me. @html.grid(model).columns(columns => { columns.add(c => c.name).titled("product name").setwidth(200).sortable(true).filterable(true); columns.add(c => c.productcode).titled("product code").setwidth(200).sortable(true).filterable(tru

javascript - Texturing a sphere with Three.js does'nt work on smartphones -

i have troubles using three.js. want apply texture on sphere (an image). code works without problem... until try on smartphone. try bug firefox , remote debugger, did not find issue. here code : <!doctype html> <html> <head> <meta charset="utf-8" /> <title>test</title> <meta name="viewport" content="initial-scale=1.0" /> <script src="./three.min.js"></script> <script src="./sphere.js"></script> <style> html, body, #container { margin: 0; overflow: hidden; } </style> </head> <body> <div id="container" style="width: 300px; height: 200px;"></div> <script> init(); </script> </body> </html> and : var renderer, scene, camera

php - Override core Magento DB connection using environment variables -

i trying use environment variables loaded magento application override default database connection credentials. i've managed 'almost' working using getenv('my_custom_var'), trying use same method override database credentials, sensitive data can stored within htaccess. e.g # .htaccess file setenv db_username root setenv db_password password123 setenv db_host localhost my app.php (within app/code/local/mage/core/model/app.php - copy of 1 core pool) // function overrides core 1 protected function _initbaseconfig() { varien_profiler::start('mage::app::init::system_config'); $this->_config->loadbase(); /* read db connection config environment variables */ $connection = $this->_config->getnode('global/resources/default_setup/connection'); $connection->setnode('host', getenv('db_host')); $connection->setnode('username', getenv('db_username')); $connection->se

json - Ember #<Object> has no method 'set' -

i'm extracting json data in routes follows: app.collectionroute = ember.route.extend({ setupcontroller: function(controller, model){ $.getjson('../returnitems.json', function(data){ controller.set('returnitems', data); }) } }); which gives me object can iterate on in template with: {{#each destination in controller.returnitems}} now want remove via controller following code: this.get('controllers.collection').get('returnitems')[returnindex].set('hasitems', false); which gives following error: uncaught typeerror: object #<object> has no method 'set' but when use: this.get('controllers.collection').get('returnitems')[returnindex].hasitems = false it tells me use , set?! you shouldn't doing ajax calls in setupcontroller hook. should use model , aftermodel hooks ember waits until promise succeeds before transitioning route. now, can't call set method b

ruby on rails - Parameter not being passed to partial -

i have rails 4 application user accounts can created in 2 ways: new users (sign up) or admin users (add account). my thought process send requests new action in user controller, have logic in there see if it's new user or admin user , handle request accordingly. here's template: new_by_admin.html.erb: <%= form_for(@user) |f| %> <div class="col-md-6 col-md-offset-3"> <h1 class="centertext">add user</h1> <%= render 'add_user_fields', f: f %> <%= f.submit "create account", class: "btn btn-large btn-primary" %> </div> <% end %> in controller, works fine: user_controller.rb: def new @user = user.new if !signed_in? @user.confirmation_code = user.new_confirmation_code elsif signed_in? && current_user.admin? new_by_admin else redirect_to root_url end end def new_by_admin @user = user.new

java - Spring JdbcTemplate Prepared Statements with SQL Server 2012 -

i'm trying use prepared statements jdbc template , sql server 2012. used execute statement: jdbctemplate.query(preparedstatementcreator psc, preparedstatementsetter pss, resultsetextractor rse); from java part, ok. query executed, , need, issue database performance. when fire tracing, can see statement being prepared, executed, unprepared! i'm not sure why. than, whole point of prepared statements lost, since query execution plan being erased cache, , has prepared again next usage. please, have idea why sql server unprepareing statements, , how prevent happening? thanks in advance!

regex - Java String tokens -

i have string line string user_name = "id=123 user=aron name=aron app=application"; and have list contains: {user,cuser,suser} and have user part string. have code this list<string> username = config.getconfig().getlist(configuration.att_cef_user_name); string result = null; (string param: user_name .split("\\s", 0)){ for(string user: username ){ string userparam = user.concat("=.*"); if (param.matches(userparam )) { result = param.split("=")[1]; } } } but problem if string contains spaces in user_name , not work. ex: string user_name = "id=123 user=aron nicols name=aron app=application"; here user has value aron nicols contain spaces. how can write code can me exact user value i.e. aron nicols if want split on spaces right before tokens have = righ after such user=... maybe add look ahead condition like split("\\s(?=\\s*=)") this regex split on \\s space

netbeans - What is format of customs.json configuratin file? -

for php project uses custom html tags template part of framework define netbeans customs.json file, can contain these new tags. empty file in nbproject directory called customs.json looks 1 below. there descrition of can define , how in file? (e.g. definition tag can inside of tag ... tr must inside of table tag ... custom tags ...) customs.json { "attributes": {}, "elements": {} } afaik there no documentation, easy way add definitions use custom tag/custom attribute in html file, netbeans mark error or warning bulb icon on left of line "error". click on bulb icon , ide offer define custom element, custom attribute, custom attribute on specific element etc. these action add definitions customs.json file. once this, show in code completion common tags/attributes.

opengl texture format for floating-point gpgpu -

i wish process image using glsl. instance - each pixel, output squared value: (r,g,b)-->(r^2,g^2,b^2). want read result cpu memory using glreadpixels. this should simple. however, glsl examples find explain shaders image post-processing; thus, output value lies in [0,255]. in example, however, want output values in range [0^2,255^2]; , don't want them normalized [0,255]. the main parts of code (after trials , permutations): glteximage2d(gl_texture_2d, 0, gl_rgba16f, width, height, 0, gl_bgr, gl_float, null); glreadpixels(0, 0, width, height, gl_rgb, gl_float, data_float); i don't post entire code since think these 2 lines problem lies. edit following @arttu's suggestion, , following this post , this post my code reads follows: glteximage2d(gl_texture_rectangle_arb, 0, gl_rgba32f_arb, width, height, 0, gl_rgba, gl_float, null); glreadpixels(0, 0, width, height, gl_rgb, gl_float, data_float); still, not solve problem. if understand correctly - no mat

c# - Pagination logic : Inserting ... instead of middle pages when there are lots of pages -

i trying create pagination on latest news section of site. i've managed page navigation working each page output @ bottom of screen along next , previous buttons however, want try , reduce size of pagination field when have large number of pages overall. in mind want try , mimic following behaviour: when total number of pages less 7, output pagination as: <previous> 1 2 3 4 5 6 7 <next> however, if total number of pages not less 7, output first 2 pages, last 2 pages , 2 pages either side of current page link current page. in place of missing page, there should single ... i've managed way towards behavour using following code: @if (totalpages > 1){ <ul class="pager"> @if (page > 1){ <li><a href="?page=@(page-1)">previous</a></li> } @for (int p = 1; p < totalpages + 1; p++){ var linkclass = (p == page) ? "disabled" : "active"; if ((p >= pag

Using batch file to enumerate through registry keys -

i'm trying query install location of installed software. each new version of creates it's own key in registry following pattern: hklm\software\mysoftware\<version> example: windows registry editor version 5.00 [hkey_local_machine\software\mysoftware\0.2.0] "installdir"="c:\\program files\\mysoftware" how can query installdir of latest version installed on computer? @echo off setlocal enabledelayedexpansion regedit /e /s hklm\software\mysoftware c:\export.txt set version_candidate=000 /f "tokens=4,5,6 delims=\." %%a in ('type c:\export.txt ^|findstr /r "[0-9].[0-9].[0-9]"') ( if %%a%%b%%c gtr !version_candidate! set version_candidate=%%a%%b%%c ) set version=%version_candidate:~0,1%.%version_candidate:~1,1%.%version_candidate:~2,1% regedit /e /s hklm\software\mysoftware\version c:\export2.txt /f "tokens=2 delims==" %%a ('type c:\export2.txt ^|find /i "installdir"') (

Why does the vim gt command does not set alternate file as expected? -

launch vim without arguments, , perform experiment. files a, b, c , d used in experiment below need not exist. execute :e a execute :tabe b execute :tabe c execute :tabe d execute :ls press enter remove output of previous command execute gt execute :ls this output of step 5. :ls 1 "a" line 0 2 "b" line 0 3 #a "c" line 0 4 %a "d" line 1 press enter or type command continue this shows "c" alternate file (marked # ) , "d" current file (marked % ). far, see expected per documentation. if there existing current file, becomes alternate file when make other file current file. but output of step 8 following. :ls 1 %a "a" line 1 2 "b" line 0 3 "c" line 0 4 &q

java - login facebook android notworking -

when install app eclipse on real device works ok login face book sample app but when exporting apk , install manually mobile when hit login hit ok facebook permission again login screen i don't know why not working apk version my code : public class loginactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_login); loginface.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { // call logout twitter function // start facebook login session.openactivesession(loginactivity.this, true, new session.statuscallback() { // callback when session changes state @override public void call(session session, sessionstate state, exception exception) { if (session.isopened()) { // make request /me api request.executemerequestasync(session, new reques

installer - NSIS: How to press "Next" button automatically when MUI_PAGE_INSTFILES is complete -

i'm making installer nsis , have following pages: !insertmacro mui_page_welcome !insertmacro mui_page_directory !insertmacro mui_page_instfiles !insertmacro mui_page_finish on each page must press "next" button. how press "next" button automatically when installation complete in mui_page_instfiles? have defined mui_finishpage_noautoclose in script? from manual : mui_finishpage_noautoclose not automatically jump finish page, allow user check install log.

r - Setting Directory -

i wondering if possible set web site, http or ftp, directory on r. i found similar question, , suggests using rcurl , curloption . did not find kind of command. perhaps misunderstanding comments. if can set directory, want set here: ftp://amrc.ssec.wisc.edu/pub/aws/10min/rdr/

javascript - ng-if inside ng-repeat not working as expected -

i have repeater i'm using return views accordion. i'd conditionally load views, i'm wanting add ng-if condition on repeaters elements check , see if current == true it's not working. i'm using angular 1.0.8. i have fiddle <div data-ng-view></div> showing same view edit: angular 1.0.8 not support ng-if went switch statement. <div ng-switch="group.current"> <div ng-switch-when="true"> <div data-ng-view></div> </div> </div> problem at <div ng-if="group.current == 'true'"><div data-ng-view></div></div> replaced with <div ng-if="group.current === true"><div data-ng-view></div></div> check updated @ http://jsfiddle.net/rajumjib/guwsh/15/

cocoa - NSURL: Display Relative URLs? -

has come across solution or addition nsurl make relative file url based on this: nsurl * = [nsurl urlwithstring:@"/users/me/scripts/python/test.py"]; nsurl * = [nsurl urlwithstring:@"/users/me/new-scripts/python/test.py"]; nsurl * rel = [nsurl urlfrom:from to:to]; nslog(@"%@",rel); --> ../../new-scripts/python/test.py and i'm looking able take relative path "../../new-scripts/python/test.py" , combine absolute url new url. [nsurl urlwithstring:@"../../new-scripts/python/test.py" relativetourl:[nsurl fileurlwithpath:@"/users/me/scripts/python/test.py"]]; haven't come across on google, , trying implement myself can end having lot intricacies correctness. wondering if apple or or if c/posix functions exist already? thanks! i came accross https://github.com/karelia/ksfileutilities , doesn't work file urls. wrote this. http://pastebin.com/fkyjvwpu #import <foundation/foundation.h> nsst

ruby - program using while with array values -

i trying write small program goes through array's values outputting each individual value. when reaches 15 stops , outputs "too big". why logic below wrong, makes sense me.. x = [10,11,12,13,14,15,16,17,18] def counting x[y] while y < 15 puts y else puts "too big" end puts counting i'm learning sorry if simple solution. if want 1 liner: x.each {|y| y < 15 ? puts(y) : puts("too big") || break } if insist using while, can done following: i = 0 while x[i] < 15 ? puts(x[i]) : puts("too big") || break i+=1 end

spring - SCORM: Web based SCORM player in Java -

i'am looking free scorm player can integrated java website.i need on integration part.please help.thanks in advance. we people add scorm players applications, time. i'm not aware of free integratable option. however, open-source tools, such moodle, can provide scorm 1.2 player you. if willing license software, our scorm cloud , scorm engine solutions designed provide player scorm 1.1, scorm 1.2, scorm 2004 (2nd, 3rd, & 4th editions), aicc, pens, , tin can api. our solutions compatible java environment. the scorm cloud provides free testing sandbox, debug log, can see 2 way communication between course , scorm player. if need example courses, started , benchmark with, offer free library of scorm courses (in every version , style) here . if want build own player adl's official specification documentation, found here , best place begin. recommend starting scorm 1.2, widely-used version of standard. if have specific questions, feel free ask. we&

Sonarqube 4.2 & PHP -

since updated sonar 4.2 , php plugin 2.1 there no way use results or execute external tools phpcs , phpmd. we used phpcs quite extensively before - wanted know there way our phpcs rules in sonar else php analysis run not use us. have not found way define own new rules, found few come plugin (for comparison had 580 rules before, , have 28). hope can ;) thanks, susanne we hope include ability write custom rules in java: http://jira.codehaus.org/browse/sonarphp-270 in meantime, please join user list , tell rules you'd see re-implemented.

android - Phonegap: new FileTransfer(); returns undefined -

i want download file in phonegap using filetransfer, "referenceerror: filetransfer not defined" error (line 3 on below code). using phonegap 3.3.0; file , filetransfer plugins added config.xml(and showing on build.phonegap.com). building via web interface function descargarepo2(id) { try { var filedownloadedit = new filetransfer(); alert("hecho: " + filedownloadedit); } catch (e) { alert("el error de filetransfer es: " + e); } var uri = encodeuri("http://dl.dropbox.com/u/97184921/editme.txt"); var filepath = "www/data/"; filedownloadedit.download( uri, filepath, function(entry) { console.log("download complete: " + entry.fullpath); alert("file downloaded. click 'read editable downloaded file' see text"); }, function(error) { //alert("download error source " + error.source); //alert("download error targ

Toast after seconds set by timepicker when screen off android -

i can detect when screen turns off in way: intentfilter intentfilter = new intentfilter(intent.action_screen_on); intentfilter.addaction(intent.action_screen_off); registerreceiver(new broadcastreceiver() { @override public void onreceive(context context, intent intent) { if (intent.getaction().equals(intent.action_screen_off)) { toast.maketext(mainactivity.this, "screen off", toast.length_short).show(); } else if (intent.getaction().equals(intent.action_screen_on)) { toast.maketext(mainactivity.this, "screen on", toast.length_short).show(); } } }, intentfilter); i need same thing, toast have appears after seconds can set through timepicker . every time screen turns off, if set 10 seconds, after 10 seconds toast. how can it? need service? manually can this: new handler().postdelayed(new runnable() { @override public void run() { // here code } }, 30 * 1000);

numpy - Python: Efficiently sample an n-dimensional distribution from density array -

i have n-dimensional distribution have estimated gauissian kernel density have stored n-dimensional array. need perform 2d kohonen map fitting underlying distribution. the simplest way of doing in python found far use newc module neurolab . however, module requires cloud or points , need sample n-dimensional array recover points correspond original density distribution. what efficient way perform such sampling? alternatively, there kohonen map modules work directly density arrays?

asp.net mvc - Unit Testing account MVC controller Error - real MembershipService is still being used -

i have following account controller public class accountcontroller : controller { public imembershipservice membershipservice { get; set; } protected override void initialize(requestcontext requestcontext) { if (membershipservice == null) { membershipservice = new accountmembershipservice(); } base.initialize(requestcontext); } public accountcontroller(imembershipservice membership) { membershipservice = membership; } [httppost] public actionresult login(loginmodel model, string returnurl) { if (modelstate.isvalid) { if (membershipservice.validateuser(model.emailorusername, model.password)) { ..... } } } from unit testing project want simulate login public class accountcontrollertest2 { [test] public void login_usercanlogin() { string returnurl = "/home/index"; string username = "user1";

javascript - Toggling through values of a Json object using Jquery -

i have list of tasks can have 4 possible states taken json object. "not done", "done", "doing", "later" this states stored in object loaded via json. var states = { status: ['doing','done', 'later' ] }; tasks loaded json object. var tasks = [ {id: 1, text: 'do something.', status: 'doing'}, {id: 2, text: 'undo thing.', status: 'done'}, {id: 3, text: 'redo again.', status: 'started'}, {id: 4, text: 'responsive', status:'later'} ]; the html this. <ul> <li><a href="#1">do - <span class="status">doing</span> </a></li> <li><a href="#2">undo thing - <span class="status">done</span> </a></li> <li><a href="#2">redo again. - <span class="status">started</span> </a>&

jquery - Minification of Javascript and increasing performance -

here code html: <div class="board"> <table id="mastermind_table_one"> <tr id="one"> <td></td> <td></td> <td></td> <td></td> </tr> </table> <table id="mastermind_table_two"> <tr id="two"> <td></td> <td></td> <td></td> <td></td> </tr> </table> <table id="mastermind_table_three"> <tr id="three"> <td></td> <td></td> <td></td> <td></td> </tr> </table> </div> here code javascript: $('.next_round').click(function() { var count = 3; var counter = setinterval(timer, 1000); function timer() { count = count - 1; if (count === 0) { $('#mastermind_table_two&#

c++ - Questions about the logic and scope of a destructor that frees a linked list from memory -

i have class called stopwatch i'm working on (so please ignore of incompleteness below). interface supposed abstraction of stopwatch in real life. right i'm trying write destructor, free memory linked list represents laps. class stopwatch { typedef enum {unstarted, running, paused, finished} state; typedef struct { unsigned hours; unsigned minutes; unsigned seconds; } time; typedef struct { unsigned n; // lap number time t; // lap time lap* next_ptr; } lap; public: stopwatch(); ~stopwatch(); void right_button(); // corresponds start/stop/pause void left_button(); // corresponds lap/reset private: state cur_state; lap* first_ptr; } stopwatch::stopwatch() { cur_state = unstarted; first_ptr = null; } stopwatch::~stopwatch() { // destroy laps (lap* thisptr = first_ptr; thisptr != null;) { lap* tempptr = thisptr; thisptr = thisp

android - See notification of other app -

what api should use app see if i've received notification example facebook, , write in 1 textbox "facebook!"? your best bet use notificationlistenerservice , added in api level 18. here's example: public class facebooknotificationlistener extends notificationlistenerservice { @override public void onnotificationposted(statusbarnotification sbn) { final string packagename = sbn.getpackagename(); if (!textutils.isempty(packagename) && packagename.equals("com.facebook.katana")) { // } } @override public void onnotificationremoved(statusbarnotification sbn) { // nothing } } in androidmanifest <service android:name="your.path.to.facebooknotificationlistener" android:permission="android.permission.bind_notification_listener_service" > <intent-filter> <action android:name="android.service.notification.notif

How to add userName who execute the report in birt -

i used develop report in ssrs , newbie in birt, there're bunch of handy global functions in ssrs can used can't found in birt. tried develop report needs show sysuser executing report can't find easy way implement in birt. can suggest me easy way it? need install maximo , use para username? thank in advance! you can use following javascript: packages.java.lang.system.getproperty("user.name") this run java method system.getproperty("user.name") returns current user.

string - Best way to check if a character is a number of letter in javascript? -

in javascript whats best way check if character (length 1), number (i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) or letter (i.e. z, z)? thanks i wrote little test case you, @ least numeric checking function. considering fact functions returns true either numberic 1 or string '1' literal, using array seems fastest way (at least in chrome). var isnumericchar = (function () { var arr = array.apply(null, array(10)).map(function () { return true; }); return function (char) { return !!arr[char]; }; })(); however, if accept might return false 1 , switch statement faster.

grails - How to display “where value is in dynamic list” in HQL/GORM? (MongoDB) -

i using mongodb gorm. in shopping cart, have stored product id in mongodb , want corresponding product details stored in mysql. when product id, able display them individually. def cart = u.mycart println cart[0] it array list. how can elements , query list in mysql? looks fit getall , if productid identifier.

java - AsyncTask Error when Network is not Stable -

i still new android development. wanna ask asynctask. i developing android apps using fragments, achartengine, , asynctask parse json file server. if connection stable , runs well, fine. fragment parse json file according url have selected. however, have problem when connection not stable. how produce problem. i connected access point. i ran apps. fine. changed landscape portrait landscape , vice versa. moved between fragment. there no problem. whereas, when tried disconnect ap. problem started. moved fragment did't show exception prepared. showed previous graph created when connection fine. this error talking. i want load graph using url everytime fragment started. this how generate fragment. private void displayview(int position) { // update main content replacing fragments fragment fragment = null; switch (position) { case 0: fragment = new homefragment(); break; case 1: fragment = new backbonefragment(); br

java - Disable text below barcode image in Code39Bean -

this code creates barcode image along text below image . need remove text image . code39bean not have property disable . public static bytearrayoutputstream generatebarcodeimg(string inputid) throws exception { bytearrayoutputstream baos = new bytearrayoutputstream(); code39bean bean = new code39bean(); final int dpi = 150; /** * configure bar-code generator , makes narrow bar width * 1 pixel. */ bean.setmodulewidth(unitconv.in2mm(1.0f / dpi)); bean.setwidefactor(3); bean.doquietzone(false); try { /** set canvas provider monochrome png output. */ bitmapcanvasprovider canvas = new bitmapcanvasprovider(baos, barcodeconstant.content_type, dpi, bufferedimage.type_byte_binary, false, 0); /** generate bar code. */ bean.generatebarcode(canvas, inputid); /** signal end of genera

Python Lists -Syntax for '[' -

i need declare values in list. values looks this: ["compute","controller"], ["compute"] ,["controller"] i know list syntax in python example = [] i not sure how include square brackets , double quotes in list. please help. i tried following: cls.node = ["\["compute"\]","\["controller"\]"] cls.node = ["[\"compute\"]","[\"controller\"]"] both did not work. i think mean list not dictionary because syntax of list : you can using following format '"hello"' : cls.node = ['["compute"]','["controller"]'] cls.node = ['["compute"]','["controller"]'] demo: s = ['["hello"]', '["world"]'] in s: print [output] ["hello"] ["world"]

ios7 - How to get and set private instance variable/ property from outside a class Objective C? -

i have class myconfig property/ variable nsstring * url . private, don't want able set url outside of myconfig class. example, don't want following allowed: myconfig * myconfig = [[myconfig alloc] init]; myconfig.url = @"some url";// want forbid my goals: forbit setting of variable/ property via dot notation use automatically generated/ standard getter ( myconfig.url ) , setter ( [myconfig seturl] ) - don't want write getters , setters myself what have: myconfig.h @interface myconfig : nsobject @property (readonly) nsstring * url; @end problem : standard getter not working! myconfig * myconfig = [[myconfig alloc] init]; [myconfig seturl];// instance method "-seturl:" not found (return default type "id") this shouldn't case according this right? is there better way achieve goal? you try creating public property getter such have , create private version in implementation file such below. myconfig.h