Posts

Showing posts from January, 2010

Git Tower - how to overwrite master with a previous commit -

somehow i've created git mess latest commit wrong previous commit right. i tried revert previous commit in tower (right click) created kind of merge didn't fix issue , things messier ever. i've created new branch commit know correct , have tested , looks great. question : possible replace master branch new branch? i want avoid creating bigger mess know if possible or if idea? search results scary don't understand they're going do. for life of me don't know went wrong repo contained 1 branch. ok, if you'd replace master commit in tower/github, here's worked me: click on master branch , find commit you're going use replace master right click , choose "create new branch ..." name branch 'master-new' publish branch github login github , click settings button administer repo make sure 'options' selected in left subnav under repository name field, find 'defaualt' dropdown menu change defaul

Facebook API For Wall Post -

i trying post on facebook wall through fb api , getting error in console. error object { message="(#200) user hasn't a... perform action", type="oauthexception", code=200} code 200 message "(#200) user hasn't authorized application perform action" type :"oauthexception" i trying way. <div id="fb-root"></div> <script type="text/javascript"> (function() { var e = document.createelement('script'); // replacing older version until fb fixes cancel-login bug e.src = document.location.protocol + '//connect.facebook.net/en_us/all.js'; //e.src = 'scripts/all.js'; e.async = true; document.getelementbyid('fb-root').appendchild(e); }()); window.fbasyncinit = function() { fb.init({ appid : 'xxxxxxxxxxxxxxxxxxx', status : true, // check login status cookie : true, // enable cookies allow server

javascript - How to hide and show multiple div(s)? -

i have multiple div(s) in code when click on of div hidden division shown want on click of particular div hidden division of slide down , on clicking outside hides the link code http://jsfiddle.net/evgd6/89/ $(document).ready(function(){ $('.click').click(function(event){ event.stoppropagation(); $(".showup").slidetoggle("fast"); }); $(".showup").on("click", function (event) { event.stoppropagation(); }); }); $(document).on("click", function () { $(".showup").hide(); }); body{margin:50px;} .showup{width:100px;height:100px; background:red; display:none;} .click{cursor:pointer;} <div class="click">click me</div> <div class="showup">something want show</div> <div class="click">click me</div> <div class="showup">something want show</div> <div class=&quo

java - MQJE001: Completion Code '2', Reason '2495 -

i want receive messages ibm mq based on java. write simple code test want. here sample code below. const.mq_qmanager = "qm.creditweb3t.pc"; const.mq_queue_receive = "mq.airports"; mqsimpleconnectionmanager myconnman = new mqsimpleconnectionmanager(); myconnman.setactive(mqsimpleconnectionmanager.mode_auto); mqqueuemanager qmgr = new mqqueuemanager(const.mq_qmanager, myconnman); when new mqqueuemanager . it’s throw error message. error message mqje001: completion code '2', reason '2495' may me figure out what’s wrong here? lot. (1) 1st posting requesting connection queue manager in "bindings mode". means must run code on same server queue manager running. (2) 2nd posting requesting connection queue manager in "client mode" (over network i.e.tcp/ip). means can run code on remote server , connect remote queue manager using network.

excel - How to modify numbers at the end of a cell using a formula -

i have cells in excel containing data of form v-1-2-1, v-1-2-10, v-1-2-100. want convert v-1-2-001, v-1-2-010,v-1-2-100. have 2000 entries if of data follows format shown use find return position of '-'. there 3 instances of character , need find third 1 use position given first instance start position parameter of second find , again third (essentially nesting find). once have position of third '-' know final set of numbers (from returned third position+1 len of string) , use substitute or combination of other excel string functions configure final portion need it. i'm assuming excel has data formatted text. if need further assistance i'm happy knock formula in excel i'm off work , won't able around 9 hours.

c# 4.0 - getdatasourcerowindex nullreference after filter using gridview (Devexpress Winform)? -

i'm using gridview devexpress. after use filter on component, there error nullreference. if don't using filter. there isn't error on code. (int = 0; < gridview1.rowcount; i++) { datarow dr; dr = gridview1.getdatarow(gridview1.getdatasourcerowindex(i)); messagebox.show(dr[0].tostring()); } that code. solution datarow value gridview after filter? maybe problem using rowcount. datasourcerowindex based on index underlying datasource holds. thats not same. if grouping or sorting rowhandle of gridview changing. , rowcount shows how rows in gridview. must not equivalent datasourceindex. try following datarow: 1. foreach (datarow row in ((datatable)gridcontrol1.datasource).rows) { //here can access row via row variable } you have know rowcount property cant used accessing rows safely! if need further dont hesitate asking.

NULL equality in SQL Server 2008 R2 -

i know default null = null not true, so if null = null select 1 else select 2 will give 2 then can change behaviour by set ansi_nulls off and result 1 my question why after setting ansi_nulls off, following select still returns nothing? select * (select 'a', null) ta (c1, c2), (select 'b', null) tb (c1, c2) ta.c2 = tb.c2 i can't answer why behavior documented. from set ansi_nulls (transact-sql) set ansi_nulls on affects comparison if 1 of operands of comparison either variable null or literal null. if both sides of comparison columns or compound expressions, setting not affect comparison. and completeness. in future version of sql server, ansi_nulls on , applications explicitly set option off generate error. avoid using feature in new development work, , plan modify applications use feature.

ruby on rails - Mongoid Relation -

i have model class user include mongoid::document authenticates_with_sorcery! has_one :user_details field :email , type: string field :id_number , type: string field :crypted_password , type: string field :salt , type: string field :fname , type: string field :lname , type: string field :mname , type: string end and want add relation model class userdetails include mongoid::document belongs_to :user #fields field :year , type: string field :block , type: string field :course , type: string field :alumni , type: boolean end but when used in form says undefined method 'year' tried belongs_to :users, has_many :user_detail still same in view =f.text_field :year , placeholder: "year" log error started "/admin/users/new" 127.0.0.1 @ 2014-12-16 20:15:32 +0800 processing admin::userscontroller#new html rendered admin/app/views/admin/users/_form.html.haml (4.8ms) rendered admin/app/views/admin/users/ne

MS excel Vb.net ui -

Image
i new in excel vb.net programming. building excel add-in image attached. have searched did not find way create ui attached image. please let me know if possible or not, if yes, please provide me links. thank much you can add own buttons, graphics excel or office product (word/power point/excel/ etc) right clicking ribbon area, choosing [customize ribbon]. in next window, if want buttons displayed on own ribbon, create new ribbon. add many buttons want, , can separate them if like. you can read more customizing ribbons in office products here .

scrollbar - Polymer core-scaffold nav core-menu does not scroll -

i have polymer core-scaffold looks this: <core-scaffold id="scaffold"> <nav> <core-toolbar> <div>menu</div> </core-toolbar> <core-menu valueattr="hash" selected="{{route}}" selectedmodel="{{selectedpage}}" on-core-select="{{menuitemselected}}"> <template repeat="{{page, in pages}}"> <paper-item hash="{{page.hash}}" noink style="color: #{{page.hash}}"> <core-icon icon="label{{route != page.hash ? '-outline' : ''}}"></core-icon> <a href="#{{page.hash}}">{{page.label}}</a> </paper-item> </template> </core-menu> </nav> ... </core-scaffold> everything works beautifully. drawer pops out, etc. have dozen items in menu, , if screen height insufficient, bottom ones

How to translate this enum from objective-c to swift? -

i don't understand why & , << don't work in swift. please me translate objective-c code examples swift. example 1 uiviewcontroller *viewcontroller = [[uiviewcontroller alloc] init]; viewcontroller.edgesforextendedlayout = uirectedgebottom | uirectedgetop; if (viewcontroller.edgesforextendedlayout & uirectedgebottom) { nslog(@"got it!"); } i'am trying translate in swift got error let viewcontroller = uiviewcontroller() viewcontroller.edgesforextendedlayout = .bottom | .top if viewcontroller.edgesforextendedlayout & .bottom { println("got it!") } example 2 typedef ns_options(nsinteger, kviewcontrolleranchoredgesture) { kviewcontrolleranchoredgesturenone = 0, kviewcontrolleranchoredgesturepanning = 1 << 0, kviewcontrolleranchoredgesturetapping = 1 << 1, kviewcontrolleranchoredgesturecustom = 1 << 2, kviewcontrolleranchoredgesturedisabled = 1 << 3 }; here can

vagrantfile - Vagrant NFS woes -

given following vagrntfile: vagrantfile_api_version = "2" vagrant.configure(vagrantfile_api_version) |config| config.vm.provider "virtualbox" |vb| vb.gui = true vb.memory = 4000 vb.cpus = 2 end ## hold of on these - not sure why don't seem work config.vm.network :private_network, ip: "192.168.0.103" config.vm.synced_folder ".", "/vagrant/", type: "nfs" ## forward web config.vm.network "forwarded_port", guest: 8080, host: 8080 ## forward api config.vm.network "forwarded_port", guest: 1337, host: 1337 ## forward signalr config.vm.network "forwarded_port", guest: 1338, host: 1338 config.vm.box_download_insecure = true config.vm.box = "box-cutter/ubuntu1404-desktop" end why oh why keep getting: the following ssh command responded non-zero exit status. vagrant assumes means command failed! mount -o 'vers=3,udp' 192.168.0.1:

swift - Good programming style with optionals -

i want read enum parameter nsuserdefaults. in case there nothing set in userdefaults want default value. there better way (more elegant) did here "if let" statement? , singleton want access value in other parts of code using if gamestate.learnlevel == level.low {..} how that? class gamestate { var learnlevel:level enum level:int { case low = 1,medium,high } class var sharedinstance: gamestate { return _somemanagersharedinstance } init(){ // load games state let learnlevel = level(rawvalue: nsuserdefaults.standarduserdefaults().integerforkey("learnlevel")) if let learnlevel1 = learnlevel {self.learnlevel = learnlevel1} else {self.learnlevel = level.low} } use nil coalescing operator ?? : let learnlevel = level(rawvalue: nsuserdefaults.standarduserdefaults().integerforkey("learnlevel")) self.learnlevel = learnlevel ?? level.low

php - SQL - Yii - If one of foreign entries matches sort 1 if none sort 2 -

i have table place : id | name and table place_hours_opening : id | day | place_id | time_start | time_end | time_start2 | time_end2 nb : place 1 -> n place_hours_openging in order order places (thanks orderby) open right know before place open later (in chronological order) , because others params come after.. attribute 1 if place opened right , 2 if not. currently have : $criteria = new cdbcriteria(); $criteria->with = array('placehoursopenings'); $criteria->together = true; $criteria->select = array( "case when (placehoursopenings.day = $yesterday , ($ajdstart > $ajdend , $hierfirst <= '$date' , '$date' <= $ajdend )) 1 when (placehoursopenings.day = $yesterday , ($ajdstart2 > $ajdend2 , $hiersecond <= '$date' , '$date' <= $ajdend2) ) 1 when (placehoursopenings.day = $day ,

java ee - Grails/Springs base classloader augmentation -

i'd load base classes (domain, services, controllers) custom classloader. what call chain on classloaders grails (2.4)? tried sub in rootclassloader custom 1 "this class loaded outside of application context" errors. any ideas? i have googled around grails/j2ee/spring start sequence in order find information, maybe looked finding base class loader.

how convert integers in a matrix to their corresponding alphabets in python -

i trying convert matrix of integers corresponding alphabet in python. 1=a,b=2 etc have far xlabels matrix integers. a = np.zeros((15,15)) x in xrange(0,15): y in xrange(0,15): a[x, y] = chr(ord('a')-1 + xlabels[0, 0]) print(a) but error saying valueerror: not convert string float: n replace: a = np.zeros((15,15)) with: a = np.zeros((15,15), dtype=str)

flash - ActionScript 3. Error #1009 -

i put input text on frame 1 , put dynamic text on frame 3. users type in input field , click button. text should appear. doesn't work, gives me error message: error #1009: cannot access property or method of null object reference. code: stop(); function handleclick(pevent:mouseevent):void { var myfirstvar = textfield.text; result.text = "dear " + myfirstvar; } mybutton.addeventlistener(mouseevent.mouse_up, handleclick); this error occurs because result null , doesn't exist in frame 1, when function calls it. if trace result in frame 1, output null : trace(result); // null so none property or method (like text) can applied result: result.text = "dear " + myfirstvar; it same as: nothing.property = something; which impossible. to fix it, can put text field in frame 1. if try create text input dynamically in frame 1 , addchild frame 3, same error occur. note: don't name text field textfield ,

SELinux influences "failed to open stream: Permission denied” PHP error -

yesterday i've spent 5 hours straight discovering seemingly unreasonable error "failed open stream. permission denied", occuring after operations of writing file system: fopen (with "w" , "a" flags), move_uploaded_file, file_put_contents. i've rechecked many times directories owner (user , group - chown, chgrp), have change folder attributes unsecure 777 (rwx chmod ), has no effect. reinstalled apache , php, still facing same error. as appeared after hours of reading various documentation origin of error selinux restrictions automatically applied apache service httpd. i've turned off selinux editing /etc/selinux/config file on fedora (release 20) via changing line: selinux=enforcing to selinux=disabled i restarted computer , annoying error had dissapeared. i have notice questions @ stack overflow regarding issue of "permission denied" on lamp environment touching folder permission concerns not case in case. ( pra

c# - Finding current cursor position in Solution Explorer -

the solution explorer in visual studio nice tool getting overview of code. find annoying have manually expand file , browse contents. pressing sync button highlight current file, not showing in file cursor is. is there automatic way of navigating current position in solution explorer? what missing overview of file editing, highlighting current location, without having manually navigate in view. (this feature exists in eclipse, , dataflex studio.) i using visual studio 2012. if use productivity power tools ( link ) can view classes within file solution explorer

android - How could a custom cursor adaptor handle multiple layout? -

i newbie on android developing. i have listview contains 2 layout user_id | name | food 1 | john | apple 1 | john | banana which indicates have 2 food preference. use custom cursoradapter populate data ui. show layout in way name (first list item) food1 (second list item , should repeat afterwards) food2 food3 in order work built 2 listview layouts - 1 name display , 1 showing preference food. list item has 2 entries cursoradapter, ran 2 times. app runs run following john banana it missed apple. here bindview code in cursoradapter @override public void bindview(view view, final context context, cursor cursor) { viewholder viewholder = (viewholder) view.gettag(); int viewtype = getitemviewtype(cursor.getposition()); switch (viewtype) { case view_type_name: { string namestring = cursor.getstring(fragment.col_question); viewholder.questionview.settext(namestring); break; } case vie

android - Facebook Unity SDK Invitable_friends API Issue -

i using facebook unity sdk. upgraded unity sdk. now, if want invitable friends data. app should game , must contain canvas presence (ref : https://developers.facebook.com/docs/games/invitable-friends/v2.0?locale=en_gb ). game mobile based (ios/android). don’t have canvas app. use invitable_friends api, had provide dummy url of canvas app in facebook developer app settings. read on internet can access invitable_friends data. now, works fine. thinking, right use above method. can thing of problem (my app live on app store). should create canvas app well? yes, should. right can send see invitable friends, sending app request using token not developper/tester/admin fail. in order use tokens need submit app review, , facebook won't approve permission without active game in canvas.

jar - How can I make the app space common for all the different modules (dependent services) I run -

means have 3 different services in application divided , having own datasource connection factory, data handler , having data source different min pool size , max pool size defined them. now if make jars use internally , use integrated application, how become common app space this. what steps need make common app space available entire project integrated these 3 different sources. any kind of reply appreciable.

How to filter Spark Hbase Rdd and obtain results? -

i getting rdd using spark , hbase. want filter rdd , specific value rdd. how can proceed with? here have done now val sc = new sparkcontext(sparkconf) val conf = hbaseconfiguration.create() conf.set(tableinputformat.input_table, "tbl_date") val hbaserdd = sc.newapihadooprdd(conf, classof[tableinputformat], classof[immutablebyteswritable], classof[result]) now want use rdd(hbaserdd) , specific column data sending specific parameter rdd. how can achieve this? what have: val sc = new sparkcontext(sparkconf) val conf = hbaseconfiguration.create() conf.set(tableinputformat.input_table, "tbl_date") val hbaserdd = sc.newapihadooprdd(conf, classof[tableinputformat], classof[immutablebyteswritable], classof[result]) add following: val localdata = hbaserdd.collect() // array of result val filtereddata = localdata.map{ result => result.getcolumncells("mycolfamily", "mycolname").get(0) // assuming want first cell:

twitter bootstrap - Django template render each form field based on criteria -

i'm using django 1.7 bootstrap 3 , want render each form field same way, best utilizing bootstrap has-error fields: <div class="form-group {% if form.field.errors %}has-error has-feedback{% endif %}"> <label class="control-label" for="field">{{ form.field.help_text }}</label> <div class="input-group"> <span class="input-group-addon"><span class="some-icon"></span></span> {% render_field form.field class+="form-control" placeholder=form.field.label id="end-date" aria-describedby="inputerror2status" %} </div> <label class="control-label" for="field">{{ form.field.errors.as_text }}</label> </div> as can see, moment number of fields increase becomes lot of work, not write it, maintain , refactoring becomes hell... not dry. each field need change form.field variables

how to set that only admin gete mail confirmation in magento -

i have problem in magento.how set admin confirmation email after cutomer purchase example if customer purchase product , does't want confirmation email , unchecked email confirmation option want admin email.please me in step step you can use extension disable mail disable mail system customer when customer place order. you need create extension , create method send mail admin event checkout_onepage_controller_success_action when customer place order admin mail.

css - Why isn't this CSS3 animation working in Firefox and Internet Explorer? -

i'm trying create beginner's css3 animation. it's working in chrome, opera , safari doesn't in internet explorer (11) , firefox (34.0) i'm using -moz- prefix, isn't working… don't know why. body{ width:100%; } #center{ width:900px; margin:0 auto; height:800px; display:block; } #center .box{ width:100px; height:100px; background-color:black; margin:0 auto; -webkit-animation: myfirst 5s; /* chrome, safari, opera */ animation: myfirst 5s; /*explorer*/ -moz-animation: myfirst 5s; /*mozilla*/ -webkit-animation-iteration-count: infinite; -moz-animation-iteration-count: infinite; animation-iteration-count: infinite; } @-webkit-keyframes myfirst{ from{backgrond:black;} to{background:yellow;} } @-moz-keyframes myfirst{ from{background:black;} to{background: :yellow;} } @keyframes myfirst { from{background:black;} to{background:

append properties file from java -

from java want read .properties file , if property present want re-set property again. lets .properties file has entry password=123 want check if password entry there replace 123 567. need keep content is. how that? please help one solution can think of rightaway is load properties base .properties file. create new temp properties file , loop through entries original file write same in new file. in loop can change value of property while writing new file. after loop delete original file , rename temp file original file. this approach has couple of limitations, do not use if concerned file last modified/created date, since creating whole new file here. if original file big, approach may cause memory problems. hope helps!

ios - UIWebview - could not open the password protected .xlsx,.docx and .ppt -

i have tried open (using loaddata/loadrequest methods of webview) password protected files in web view controller. can open password protected pdf , zip files. works fine. when tried open other password protected files shows error. (unable read document). if have tried open file in safari, there getting same error. works fine in ipad mail native app. please guide me. problem ? whenever have tried open password protected pdf/ppt files , return below exception **exception sfuzipendofcentraldirectoryerror: not find end of central directory record** through uiwebview , cannot open password protected files except pdf. if want open password protected files, use qlpreviewcontroller . work perfectly

clojure - How to execute a single clojurescript file as a script? -

in clojure, can use plugin lein-exec lein "execute" single clojure file script this: lein exec foo.clj naturally curious whether there similar way "run" single clojurescript file on node.js directly without process of compiling , run .js file(possibly in terminal)? thanks! clojurescript needs compiled js if want execute it. know of there no direct invocation method lein cljsbuild since cljs executes in multiple environments (node, rhino, v8, browser, etc) , each specific how run js, can't make choice you. here couple of quick ways of running cljs script in node (keep in mind compilation take time since java based , startup time bit bad) the easy way the easiest way right (for executing script in node): lein new mies-node hello-world cd hello-world lein cljsbuild once node run.js there more templates node cljs, mies-node 1 of them. the hard (but later more immediate way) if want hard way, install clojurescript compiler , can

inheritance - Static methods called with base class property in specflow step from definition file refer to property as null -

i have global base class in solution of tests inherit from, class contain public iwebdriver property. project base class inherit solution base class , initialize iwebdriver property. stepdeffinition class inherit project base class , beforescenario property call project base class testinitialize initialize iwebdriver. the global base class have testcleanup tag close iwebdriver session uses static method 1 of properties of method iwebdriver, when static method called iwebdriver value null (inside method), although when passed it wasn't. why static method sees null?? [testclass] public class solutiontestbase { public iwebdriver webdriver { get; protected set; } [testcleanup] public void subbasetestcleanup() { if (webdriver != null) { webdriverfactory.quitfromwebdriver(webdriver, testsettings); } } } [testclass] public class projectbasetest : solutiontestbase { public void initialize() { webdriver = we

Scheme explanation - cdr and car -

i've got example : (apply + 2 (cdadr '(1 ((2 . 3) 4)))) this returns 6? why (cdadr '(1 ((2 . 3) 4))) 4?? don't it.shouldn't 3? the result list '(4) , not number 4 . you have list 2 elements, 1 first element, , list ((2 . 3) 4) second element. in other words, cdr of list (cons ((2 . 3) 4)) '()) , or (((2 . 3) 4)) . > (cdr '(1 ((2 . 3) 4))) '(((2 . 3) 4)) this list 1 element - list ((2 . 3) 4) - of course car . > (car (cdr '(1 ((2 . 3) 4)))) '((2 . 3) 4) and, finally, > (cdr (car (cdr '(1 ((2 . 3) 4))))) '(4)

c# - More efficient way to write data table to excel? -

in wpf application, have huge data table ( system.data.datatable ) need write sheet in excel document. heavy part of function: (; < dt.rows.count; i++) { (int colnum = 0; colnum < dt.columns.count; colnum++) newsheet.cells[i + rownumber, colnum + 1] = dt.rows[i][colnum].tostring(); applyrowborderstyle(newsheet, + rownumber, dt.columns.count); } dt datatable, neewsheet excel sheet write to, , applyrowborderstyle(..) adds borders cells in row. runs when data table big, might take 10 minutes or more. there way make run faster? edit: program analyses lot of data , makes lot of sheets, , can't make user anything. must use microsoft excel. sheets table has 42 columns, number of lines changes according how data did program receive, ~500 lines. "applyrowborderstyle" make code run bit faster, doesn't meet requirements.. hope there way make run faster.. found answer! here's function

javascript - Prototype: Difference between these two scripts -

consider these 2 version of constructing object hierarchies in javascript: version 1 function employee() { this.name = "noname"; this.dept = "nodept"; }; function manager() { employee.call(this); this.reports = "nobody"; } //manager.prototype = object.create(employee.prototype); var m = new manager(); console.log(m.name); version 2 function employee() { this.name = "noname"; this.dept = "nodept"; }; function manager() { //employee.call(this); this.reports = "nobody"; } manager.prototype = object.create(employee.prototype); var m = new manager(); console.log(m.name); in first version, name property accessible though don't use prototype inheritance (of course because of call() method). in second version, comment out call() , define prototype chain, , yet name property inaccessible. this leaves me wondering, then, why bother manager.prototype ? note in construct

Wordpress query_posts order by date when excluding a category -

i want exclude category , order results date query_posts while preserving existing query parameters , order results date. according wordpress documentation should add (or over-ride) parameters in following way: global $query_string; query_posts( $query_string . '&orderby=date&order=asc&cat=-1' ); the results right ordering them date doesn't work (asc , desc). only ordering results works fine: global $query_string; query_posts( $query_string . '&orderby=date&order=asc' ); only excluding category, without ordering results, works fine: global $query_string; query_posts( $query_string . '&cat=-1 ); also including categories , ordering results works fine: global $query_string; query_posts( $query_string . '&orderby=date&order=asc&cat=2' ); of course can work around building array of right categories first, use these categories in query_posts. following: $include = array(); $categories = get_catego

ios - How can move event be banned in UITableView during the previous move event datasource operation is in progress? -

each time when user moves row in tableview triggers database operation. until operation completes, user should not allowed initiate new move event. idea how ban it? you can use following delegate method. - (void)tableview:(uitableview *)tableview didendreorderingrowatindexpath:(nsindexpath *)indexpath;

actionscript 3 - Access SharedObject from swf to another swf -

can me how access sharedobject swf swf? have swf file wherein in second frame, saved value through "sharedobject". have .as file wherein call value saved, , pass swf file. pass value if save in first frame on first swf. problem this: if save on second frame, can't pass value anymore. have idea of calling "sharedobject" instead of calling "level1.swf"(the name of 1st swf) have no idea how it. don't want save value on 1st frame either. need help. appriciated. here's .as file because think problem, can post other codes if requested: package { import flash.display.loader; import flash.display.sprite; import flash.events.event; import flash.net.urlrequest; public class reward1 extends sprite { public var loader:loader; public function reward1() { loader = new loader(); loader.contentloaderinfo.addeventlistener(event.complete, onloaded); loader.load(new urlrequest("level1.swf")); } public function onload

ibm mobilefirst - IBM Worklight 6.2 Direct Update fails when application authenticity is enabled (iphone IOS 7) -

i'm deploying worklight 6.2 application iphone (ios 7) environment. managed enable application authenticity iphone. when application authenticity feature enabled, direct update feature fails. on iphone, after tap on "ok" button when receiving new updates, application download update awhile show: direct update failed (direct update failure). see error log in xcode console: ***014-12-16 19:32:16.487 onlinebanking[14685:132821] splash screen image default 2014-12-16 19:32:16.487 onlinebanking[14685:132821] iphone 5 detected. splash image name is: default-568h 2014-12-16 19:32:18.991 onlinebanking[14685:133123] [error] [wl_direct_update] -[wldirectupdatedownloader loginvalidupdatefiledata] in wldirectupdatedownloader.m:428 :: invalid update data format: /*-secure- {"wl-authentication-failure":{"wl_authenticityrealm":{"reason":"invalid gadget request format: \/onlinebanking\/iphone\/0.1skin=default. unknown handler path: 0.1"}}}*/

Spark SQL: NULL handling in IF -

i trying perform if [spark's coalesce] on top of left outer joined output, seems null not getting handled expected. here base tables, sample query, output , expected output- base tables: t1: a,100 b,101 c,102 t2: 101 query: select a.x, a.x1, if(b.x1 null,a.x1,b.x1) t1 left outer join t2 b on a.x1=b.x1; output: a,100,null b,101,101 c,102,null expected: a,100,100 b,101,101 c,102,102 i have tried wrapping above query , performing if on top of it. no success. please suggest missing something. this seems working file: tbl1 1 2 b 3 c file: tbl2 1 c 3 d case class c_tbl1(c1: string,c2: string) sc.textfile("tbl1").map { row => val parts = row.split("\t") c_tbl1(parts(0),parts(1)) }.registertemptable("t_tbl1") case class c_tbl2(c1: string,c2: string) sc.textfile("tbl2").map { row => val parts = row.split("\t") c_tbl2

javascript - HTML Canvas wrongly merging images -

so have problem goes like: i create canvas , set bg using css. i draw grid on canvas. i use function loop through array , depending on found, load .pngs , bind onload drawimage function them. basicly, im drawing more 1 image on canvas. instead of following parameters (x, y), somehow "merges" (if 2 or more) pngs , draws them x/y of recent drawn one. this.drawships = function(){ var canvas = document.getelementbyid("mycanvas"); var context = canvas.getcontext("2d"); (var = 0; < participants.length; i++){ var ship = participants[i]; var loc = ship.location; var img; var offsetx = -20; var offsety = -20; if (ship.name == "hyperion"){ var img = new image(); img.onload = function(){ context.drawimage(img, loc[0] + offsetx, loc[1] + offsety); } img.src = "hyperion.png";

Openssl 1.0.0o for Android -

i need upgrade openssl library openssl-1.0.0o , want know if version has android support. following steps in thread , while trying build in cygwin, error on 'make all': /cygdrive/d/ndk+openssl/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/pr ebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/cygdrive/d/ndk+openssl /android-ndk-r10d/platforms/android-19/arch-arm/ -i. -i.. -i../include -d_windl l -dopenssl_pic -dopenssl_threads -ddso_dlfcn -dhave_dlfcn_h -dtermios -dl_endi -fomit-frame-pointer -o3 -march=i486 -wall -dopenssl_bn_asm_part_words -dopen ssl_ia32_sse2 -dopenssl_bn_asm_mont -dsha1_asm -dsha256_asm -dsha512_asm -dmd5_a sm -drmd160_asm -daes_asm -dwhirlpool_asm -c -o cryptlib.o cryptlib.c /cygdrive/d/ndk+openssl/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/pr ebuilt/linux-x86/bin/arm-linux-androideabi-gcc: /cygdrive/d/ndk+openssl/android- ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/arm-linux-a ndroideabi-gcc: can

c# - MVC 4 - Loading Message or Graphic -

is possible display loading message or graphic while processing function? i have controller carries out functionality before returning view. part of function includes serverxmlhttp process, can take upwards of 30 seconds while connecting 3rd party server. not ideal user observe blank screen user waits xmlhttp.readystate complete. any appreciated :-) this example of javascript loading page inserts between pages. code placed on page before loading. used simple submit button submits search query. can ajax loading gif here: http://www.ajaxload.info/ <div id="divloading" style="margin: 0px; padding: 0px; position: fixed; right: 0px; top: 0px; width: 100%; height: 100%; background-color: #666666; z-index: 30001; opacity: .8; filter: alpha(opacity=70);display:none"> <p style="position: absolute; top: 30%; left: 45%; color: white;"> loading, please wait...<img src="../../content/themes/base/images/ajax-loading

debugging - short key or default setting for Pycharm debug button ("show python prompt") -

Image
i click "show python prompt" button hundreds of times day. there way set clicked default or there short key this? edit -- i told can going to: build, execution, deployment | console | show debug console however cannot find such screen. know is? you can turn on automatic showing of debug console enabling file|settings|build, execution, deployment|console|always show debug console setting.

c++ - Object containing lists of itself recursively -

for practice, trying make recursive directory parser. for sake of parsimony, want contain result recursively too, e.g.: 1 class cdirectory 2 { 3 private: 4 std::string name; 5 std::vector<cdirectory> subdirectories 6 public: 7 //various things, constructors etc. go here 8 } however, i see here line 5 not supported behavior - "the c++ standard (2003) says instantiating standard container incomplete type, invokes undefined-behavior." what, then, do? there no way make object contain list of similar objects? if nothing else, know no means illegal make vector of vectors, that's object contains itself. make vector of pointers std::vector<cdirectory*> subdirectories;

angularjs - $rootScope cyrillic encoding on page reload -

here authetication service (i'm using passportjs): $rootscope.currentuser = $cookiestore.get('user'); now when i'm trying bind $rootscope value: <p ng-bind="currentuser.username"></p> it encodes correct cyrillic symbols. when i'm reloading page get: ΜÑкимбаÐΜв what can problem?

javascript - storing forms and their elements values in a variable -

i have single page web app. for speed, store each 'page' in js. i have problem happens when there form on page. if fill in form, , store in js variable, , retrieve it, forms values have disappeared? i use functions like: var pages_html = {}; var $page = $('#some-page'); store_page($page); $page.remove(); //some stuff on page var $retrieved_page = get_page('some-page'); console.log($retrieved_page.find('#some-input').val()) //consoles log blank / '' function store_page(page){ var page_id = $(page).attr('id'); pages_html[page_id] = $(page); } function get_page(page_id){ var page = pages_html[page_id]; return $(page); } everything else seems work, can store , retrieve pages wish, values of form elements lost. how can work around this? you cannot store that. instead store serialized array. can fill when needed. serializearray returns array of objects have name , value var values = {}; function s

What is "the DataStax Enterprise user name"? -

i trying use beeline terminal client. reading datastax beeline documentation, it states enter datastax enterprise user name. and later enter password. what username/password this? username related internal authentication? if cluster not have internal authentication enabled? doesn't seem stored in configuration files: $ grep -r user /etc/dse/hive /etc/dse/hive/hive-log4j.properties:hive.log.dir=/tmp/${user.name} /etc/dse/hive/hive-site.xml: <value>cfs:///user/hive/warehouse</value> /etc/dse/hive/hive-exec-log4j.properties:hive.log.dir=/tmp/${user.name} /etc/dse/hive/hive-env.sh.template:# hive installation (so users not have set environment variables if have dse, should have received email datastax enterprise registration include username , password

c# - Could not load file or assembly 'MySql.Web, Version=6.7.4.0, Culture=neutral -

i working on asp.net mvc-5 web application. inside login view, when user click on submit , following exception raised:- could not load file or assembly 'mysql.web, version=6.7.4.0, culture=neutral, publickeytoken=c5687fc88969c44d' or 1 of dependencies. system cannot find file specified. now commnted the connectionstringname="localmysqlserver" applicationname="/" />--> </providers> from machine.config file under location:- c:\windows\microsoft.net\framework64\v4.0.30319\config but did not solve problem,, can adivce on please ? thanks edit here whole web.config file:- <?xml version="1.0" encoding="utf-8"?> <!-- more information on how configure asp.net application, please visit http://go.microsoft.com/fwlink/?linkid=301880 --> <configuration> <appsettings> <add key="webpages:version" value="3.0.0.0" /> <add key="webpages:ena