Posts

Showing posts from April, 2012

oracle11g - Visual Studio, SSRS, Oracle sys_context('USERENV', 'OS_USER') -

i using visual studio 2012, oracle 11g , ssrs 2012. i have developed report checks session userid determine if can view report or not against table stored in oracle db. everything works correctly in preview mode visual studio 2012; however, when report deployed ssrs 2012 data not returned, , expected if us. select comp_flag, mbr_mmis_idntfr, last_name, first_name, middle_name, org_code, org_name, org_phone, last_verified_date, rac_start,rac_end, rac_code tpl_chip_mv (comp_flag <> 'n') , (1 =(select count(user_id) expr1 report_auth (user_id = concat('hlan\',upper (sys_context'userenv', 'os_user')))))) why work correctly in visual studio 2012 preview mode , not in ssrs 2012? can work in ssrs? the problem os_user different. when you're running locally in preview mode, account running visual studio own personal account. os_user database sees personal operating system user. when you're deployin...

django - How to setup the initial value in select control? -

i'm trying setting select control on form, not achieving expected results. me, strangest thing working in previous control, same type. this function involved: class proofmspe(crearevidencia): model = vrl02 form_class = vrl02form def get_form(self, form_class): form = super(proofmspe, self).get_form(form_class) form.fields['miembro'].queryset = self.pipol if self.pipol.count() == 1: form.fields['miembro'].widget.initial = [self.pipol[0].id] form.fields['meta'].initial = self.meta form.fields['meta'].widget.attrs['disabled'] = true return form the meta 's control select , got expected behavior, ie automatically selects initial value ( form.fields['meta'].initial = self.meta , inthe next lines, disabled ( form.fields ['meta']. widget.attrs ['disabled'] = true ). output in rendered template: <!-- begin meta--> <div class=...

unix - How do I retrieve the current song name and time left from pianobar using python? -

i'm creating alarm clock gui using tkinter , python on raspberry pi. when alarm goes off want start playing pianobar. can enough, want display name of song on gui, , cannot figure out how current song being played. have tried using pipes "|", , redirecting ">" have gotten nowhere. advice help. you need use event command interface. man page: an example script can found in contrib/ directory of pianobar's source distribution. ~/.config/pianobar: user = <username> password = <password> (although i'd suggest password_command) event_command = ~/.config/pianobar/event_command.py ~/config/event_command.py #!/usr/bin/env python import os import sys os.path import expanduser, join path = os.environ.get('xdg_config_home') if not path: path = expanduser("~/.config") else: path = expanduser(path) fn = join(path, 'pianobar', 'nowplaying') info = sys.stdin.readlines() cmd = sys.argv...

jquery - replace character at certain position inside javascript -

this question has answer here: how replace character @ particular index in javascript? 17 answers if have string inside javascript function like function somefunction(){ var mystr = "12345678911"; var maskedstr = ""; } how can use mystr values * maskedstr contain string like var maskedstr = "1234567*91*"; function somefunction(){ var mystr = "12345678911"; var maskedstr = mystr.replace("9", "*"); }

javascript - PouchDB about 3x slower inserting 4800 documents over websql -

been exploring use of pouch db potentially leverage offline sync instead of doing our own. have cordova app pulls data rest api , saves web sql store. part of around 5k physical locations various stores. timed on cordova app, , download stores & save them, along request project information in 11 seconds. saving of these 5k records documents in pouch db takes 30 seconds. not counting request time. here's do: let db = pouchproxy.getdb(); this.render("loading", { message: "saving locations" }); // stores api let stores = res.stores; let docs = []; // check saved stores, checking ids start store_ db.alldocs({ include_docs: true, startkey: 'store_', endkey: 'store_\uffff' }).then((results) => { // go through saved stores (let row of results.rows) { let doc = row.doc; // number id. _id 'store_idnumfromapi' let id = parsefloat(doc._id.split('store_')[1]); if (isnan(id)) { throw "cannot nan...

java - Iterate a list of objects and compare properties -

i trying iterate list containing helper class objects , compare properties of helper . based on comparison if validation fails,i wanted show error message user. below code snippet. public static void main(string[] args) { map<string, string> errormap = new hashmap<string, string>(); simpledateformat format = new simpledateformat("dd/mm/yyyy"); list<helperdto> helpers = new helpertest().gethelpers(); (helperdto helperdto : helpers) { string helperpkey = helperdto.gethelperpkey(); string employeepkey = helperdto.getemployeepkey(); string helperstart = helperdto.gethelperstart(); string helperend = helperdto.gethelperend(); if (helperstart == null || "".equals(helperstart)) { errormap.put("helperst_" + helperpkey, "helper start required"); } if (helperend == null || "".equals(helperend)) { errormap.p...

installation - visual studio 2013 update 2 taking to long to configur -

Image
i have installed visual studio 2013 version 2 , installation process stuck , not giving me error... help me should do? if installation process stuck wait long time. times happens takes long. or cancel installation process , re-start. there no solution this. there no such problem can solve while installation going on. advice not try thing foolish change system configuration , other application misbehave.

asp.net - web service page System.IndexOutOfRangeException -

public class getareafromcity : system.web.services.webservice { [webmethod] public getareabycityid classforgetcity(int city_id) { string cs =configurationmanager.connectionstrings["foodinnconnectionstring"].connectionstring; using (sqlconnection con = new sqlconnection(cs)) { sqlcommand cmd = new sqlcommand("spgetcitybyid",con); cmd.commandtype = commandtype.storedprocedure; sqlparameter parameter = new sqlparameter("@id", city_id); //to assiate parameter object cmd object cmd.parameters.add(parameter); getareabycityid getareabycityid =new getareabycityid(); con.open(); sqldatareader reader = cmd.executereader(); //as weakreference read data wewant tostring retrive column value & polute property city_id values while (reader.read()){ getareabycityid.city_id = convert.toint32(re...

sql - Adding a column Migration with a default value in ruby on rails -

i using sqlite3 , following work: class addnametogoal < activerecord::migration def change add_column :goals, :goal_name, :text, default: goal.exercise.name end end or maybe makes more sense i'm trying do: add_column :goals, :gname, :text, default: goal.find(row_id).exercise.name how above work. i doubt work that's want. specifically, user associated exercise through exercise_id column. belongs_to :user belongs_to :exercise has_many :workouts, dependent: :destroy (this model goal)... i user able choose own name goal can give them hint name goal after exercise's name , if choose leave blank default exercise's name. more importantly must happen on sql side later when have collection drop down requires name of goal need name corresponds exercise. <%= f.collection_select(:goal_id, @goals, :id, :goal_name, :include_blank => "please select") %> the exercise model made in rails have id, name, other columns. exercise m...

Angularjs orderBy in ng-repeat not working as expected -

i have following div in template: <div ng-repeat="item in billing_history | orderby:'-timestamp'">{{ item.date }}</div> console.log(json.stringify($scope.billing_history)) gives me following: { "may, 2015":{ "date":"may, 2015", "timestamp":1432921230 }, "march, 2015":{ "date":"march, 2015", "timestamp":1427846400 }, "february, 2015":{ "date":"february, 2015", "timestamp":1425168000 } } no matter what, displayed: february, 2015 march, 2015 may, 2015 i've tried orderby:'-timestamp' , orderby:'+timestamp' i'm not sure why isn't working. see going wrong? you cannot use order-by filter object literal (or wont work expected). have object literal there no specific guaranteed ordering keys (and values). need convert array. example: angu...

OpenCV supported camera types -

i using opencv 2.4.10 , wondering if hook usb 2.0 camera uses 10 bit analog digital converter , has resolution of 1328 x 1048, opencv support type of camera? if does, how store pixel information? (i have not purchased camera yet , buy different 1 if software won't work it, can't go test myself). clearly didn't google enough https://web.archive.org/web/20120815172655/http://opencv.willowgarage.com/wiki/welcome/os/ list hasn't been updated while though

java - How to train an Italian language model in OpenNLP on Hadoop? -

i implement natural language processing algorithm on hadoop italian language i have 2 questions; how can find stemming algorithm italian ? how integrate in hadoop ? here code string pathsent=...tagged sentences...; string pathchunk=....chunked train path....; file filesent=new file(pathsent); file filechunk=new file(pathchunk); inputstream insent=null; inputstream inchunk=null; insent = new fileinputstream(filesent); inchunk = new fileinputstream(filechunk); posmodel posmodel=postaggerme.train("it", new wordtagsamplestream(( new inputstreamreader(insent))), modeltype.maxent, null, null, 3, 3); objectstream stringstream =new plaintextbylinestream(new inputstreamreader(inchunk)); objectstream chunkstream = new chunksamplestream(stringstream); chunkermodel chunkmodel=chunkerme.train("it",chunkstream ,1, 1); this.tagger= new postaggerme(posmodel); this.chunker=new chunkerme(chunkmodel); insent.close(); inchunk.close(); you need grammatical s...

wix - CustomActionData with semi-colon separated, causes string overflow - What are the common workaround to this solution? -

there few attempts of questions answerered in regards ice03 (string overflow) customactiondata, cannot seem determine/conclude correct (or accepted) practice of how go around issue. my current resolution reduce length of key-value-pair keeping both key , property names short, i.e. from: <customaction id="mycustomactiondata" property="mycustomactionca" value="mykeyname1=[some_property_name];mykeyname2=[some_descriptive_propname]"/> to: <customaction id="mycustomactiondata" property="mycustomactionca" value="k1=[k1];k2=[k2]"/> but feel i'm sweeping problem under rug , sooner or later, i'll encounter again (also, based on assumptions of additional question below). the more obvious solution re-evaluate , re-design least amount of data needs passed down c# customaction (the classic "why want declare function method pass 20 parameters?" question code-reviewers). obviously, langu...

linux - How can I detect if some file in a subdir changed? -

basically have big directory (>10gb)(each subdir has few other subdirs) , want sth files changes. can't go through files , check, because takes long , uses 90% of cpu :(. this how looks basically: dir dir/suba dir/suba/subasuba dir/suba/subasubb ... dir/subb dir/subb/subbsuba dir/subb/subbsubb ... dir/subc dir/subd ... my thought this(file "test" in subbsuba chaged): check dir -> dir changed -->check suba -> suba didn't change -->check subb -> subb changed --> check subbsuba -> subbsuba changed --> check files but sadly change of file effects modification date of direct parent directory :( as @aereaux pointed out need inotify , available in linux since 2.6.13. see http://en.wikipedia.org/wiki/inotify there inotify-tools available command line usage well. http://techarena51.com/index.php/inotify-tools-example/

spring - primefaces treetable expand not working if jsf page location is changed -

primefaces treetable expands if xhtml webpage in webcontent folder doesn't expand if move same webpage web-inf/views/jsf folder. i'm new jsf , don't know , change. if webpage in web-inf/views/jsf folder root node visible. it's not expanding if click it. html code <?xml version="1.0" encoding="utf-8" ?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> <h:head> <f:facet name="first"> <meta http-equiv="x-ua-compatible" content="ie=9" /> </f:facet> </h:head> <h:body class="page"> <h:outputstylesheet name="philos.css" /> <h:outputstylesheet name="primefaces.css" /> <h:form> ...

html - Reduce PHP execution time -

i have php script retrieves information via api games high scores. problem each player takes around half second , amount of users continuing add more 100 takes 50 seconds page load, long. there way can reduce loading time, or have store data after retrieve , update every 30 minutes or so. this code: ($i = 0; $i <= $totalmembers - 1; $i++) { $currentline = $lines[$i]; $data = explode("\t", $currentline); $nameparsed = rawurlencode($data[1]); $c = curl_init('http://services.runescape.com/m=hiscore_oldschool/index_lite.ws?player=' . $nameparsed); curl_setopt($c, curlopt_returntransfer, true); curl_setopt($c, curlopt_timeout, 0); $html = curl_exec($c); //$htmltrimmed = trim($html); $oneline = trim(preg_replace("/[\n\r]/", ",", $html)); if (curl_error($c)) die(curl_error($c)); // status code $status = curl_getinfo($c, curlinfo_h...

filenames - How do I get the name of Postscript file object? -

using postscript, want retrieve name of file being executed. know can file object using 'currentfile', how name? i want include name in document. thanks. ghostscript has .filename operator that'll it. no idea portability. tiny viewable example: /times-roman findfont 12 scalefont setfont newpath 100 200 moveto currentfile .filename pop show

wordpress plugin - How to pass a variable to reveal modal -

hello developing own functionality plugin on wordpress , stuck on trying pass variable page modal opens after link clicked displaying delete confirm dialog the link opening modal is <a href="<?php echo $passing_var?>" data-reveal-id="deletemodal" class="deletelink"> <i class="fi-trash size-24 icolored"></i> </a> the modal window code <div id="deletemodal" class="reveal-modal" data-reveal aria-labelledby="modaltitle" aria-hidden="true" role="dialog"> <h2>are sure want delete? <?php echo get_the_title( $passing_var ); ?> </h2> <p class="lead">this cannot undone</p> <a class="deletebutton button" href="#">delete</a> <a class="close-reveal-modal">&#215;</a> </div> how can pass $passing_var main page modal window? set...

jquery - Safari Hero Carousel Fix -

i working on wordpress blog theelementmag.com . works in every other browser safari. in safari images in carousel @ top not inline , post images on bottom different sizes. please me figure out how can fix safari issue. use http://www.paulwelsh.info/jquery-plugins/hero-carousel/ , foundation 5. pointers extremely appreciated. you have @ least 1 javascript error breaking carousel. start learning use developer tools in firefox (or firebug ) or chrome or safari or ie see javascript loading on site , errors.

python - What is more 'pythonic' for 'not' -

i have seen both ways, way more pythonic? a = [1, 2, 3] # version 1 if not 4 in a: print 'is not more pythonic?' # version 2 if 4 not in a: print 'this haz more engrish' which way considered better python? the second option more pythonic 2 reasons: it one operator, translating 1 bytecode operand. other line not (4 in a) ; 2 operators. as happens, python optimizes latter case , translates not (x in y) x not in y anyway, implementation detail of cpython compiler. it close how you'd use same logic in english language.

php - Can someone explain to me how this appending a table with ajax works? -

so using mottie's fork of tablesorter plug in , has been working me. have couple pages have large records of data need deal with. assume best way of going using ajax fill table. there example in documentation not know javascript or ajax not sure how working. http://mottie.github.io/tablesorter/docs/example-ajax.html a couple specific questions be. what code on assets/ajax-content.html like? piece wanted know about. how getting records , sending them back. i don't understand how ("#ajax-append").click(function() is working. how receiving 'html' parameter on line $.get("assets/ajax-content.html", function(html) { any appreciated. thanks from examples, can determine it's returning html. back-end script want same. example page, tbody contains following: <tr> <td>bruce</td> <td>evans</td> <td>22</td> <td>$13.19</td> <td>11%</td> <td>ja...

Cannot run unit tests on modules with dependencies on dojo 1.x using the Intern -

we starting out getting unit tests running in intern on our dojo-based project. what happens when intern tries load module under test's dependencies following error: /<path/to/dev/folder>/app/node_modules/intern/node_modules/dojo/dojo.js:406 match = mid.match(/^(.+?)\!(.*)$/); ^ typeerror: cannot read property 'match' of null @ getmodule (/<path/to/dev/folder>/app/node_modules/intern/node_modules/dojo/dojo.js:406:15) @ mix.amd.vendor (/<path/to/dev/folder>/app/node_modules/intern/node_modules/dojo/dojo.js:832:17) @ /<path/to/dev/folder>/app/src/simplebuilding/model/modelerror.js:10:1 @ exports.runinthiscontext (vm.js:74:17) @ object.vm.runinthiscontext (/<path/to/dev/folder>/app/node_modules/intern/node_modules/istanbul/lib/hook.js:163:16) @ /<path/to/dev/folder>/app/node_modules/intern/node_modules/dojo/dojo.js:762:8 @ fs.js:334:14 @ fsreqwrap.oncomplete (fs.js:95...

How to create chart with highchart in which bar doesn't start from 0 in y axis? -

i'm working this chart, , thing i'm trying create example "apples" bar not start 0 on y axis. instead of that, want start from example 25%, , end in 75% (so bar in chart (its height) 25 75, when @ values in y-axis). have idea of how that? change? you can use column range chart type. see this official demonstration . here sample of apples ( jsfiddle ): $('#container').highcharts({ chart: { type: 'columnrange' }, xaxis: { categories: ['apples'] }, yaxis: [{ min: 0, max: 100 }], series: [{ data: [ [25, 75], ] }] });

c++ - using tuple with visual studio 2008 -

i have older code uses: #include <tuple> this project visual studio 2008 project. according microsoft, possible to use tuple 2008 see here . however, cannot compile , getting error: error 34 fatal error c1083: cannot open include file: 'tuple': no such file or directory what works me installing service pack 1 here

Javascript "clockwork arithmetic" -

i'm trying remember called "clockwork arithmetic" in javascript i've read long time ago in tutorial slideshows/carousels. (term might wrong since can't find useful in google) it shorthand of following code: a = + 1; if (a > total) = 0; essentially incrementing until reached total, , when reached total reset 0. used create carousels scroll indefinitely scroll beginning (index 0). does how write above 2 lines of code in 1 line using said clockwork arithmetic? think used "remainder" operator % don't remember else. this called modular arithmetic , , used in clocks: a familiar use of modular arithmetic in 12-hour clock, in day divided 2 12-hour periods. if time 7:00 now, 8 hours later 3:00. usual addition suggest later time should 7 + 8 = 15, not answer because clock time "wraps around" every 12 hours in javascript, can modulo operations using % operator : the % operator yields remainder of operand...

asp.net mvc 3 - Exporting a hyperlink in Pivot Grid -

i have pivot grid exports both gridview , pivotgrid. gridview export correctly creates hyperlinks users. however, pivotgrid export not. question is, there way export hyperlink still hyperlink? below code have in controller export. public actionresult exportpivotgrid() { //a fresh copy of data session["ipdreportsdata"] = ipdreport.getreportdata(session["adhocdatasource"].tostring(), sccview.classes.helper.officeid); var pivotgridsettings = new pivotgridsettings(); pivotgridsettings.name = "exportpivotgrid"; pivotgridsettings.beforeperformdataselect = (s, e) => { mvcxpivotgrid pivotgrid = s mvcxpivotgrid; //get current layout of pivot grid string layout = (string)(session["ipdcurrentpivgridlayout"]); pivotgrid.loadlayoutfromstring(layout, devexpress.web.aspxpivotgrid.pivotgridweboptionslayout.defaultlayout); }; ...

c++ - Asynchronous download a list of URLs with Boost.Asio -

i novice in asynchronous programming , boost.asio . have basic question. there example on boost.org . use downloading list of links. following client code http asynchronous client. int main(int argc, char* argv[]) { try { if (argc != 3) { ... return 1; } boost::asio::io_service io_service; client c(io_service, argv[1], argv[2]); io_service.run(); } catch (std::exception& e) { std::cout << "exception: " << e.what() << "\n"; } return 0; } i see how can download url code. however, couldn't realize how asynchronously ( edit: simultaneously?) download list of urls. me change code obtaining purpose? the asynchrony in sample exists in fact connections handled asynchronously . enables many downloads run simultaneously on single thread (in code sample question, that's main thread). so sample asynchronous. looking concurrency other code :) --> execute io_service::run call ...

Visual Studio Online: How to create a build definition with MVC Unit Testing that accesses a remote server? -

i using: visual studio 2013 development visual studio online builds/testing ms build an azure vm house mvc web app , sql database the current project n-tier mvc application mvc test project. application runs on azure vm (in cloud), accessible locally being part of company domain. have created unit tests test controller actions , passing locally. when check-in , build project vso, unit test(s) fails following error: test method enrollment.studentenrollment.tests.controllers.homecontrollertest.searchwithnotermorfilterdefaultsort threw exception: system.data.sqlclient.sqlexception: network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified) i assuming error has vso not being able access vm due being on different domai...

jquery - Google analytics event tracking on javascript form -

how can add "_gaq.push([‘_trackevent’" code tell google track form submit event? not working right now! i want track successful form subbmit events. submithandler: function(form) { $('#loadinglizings').show(); $(form).ajaxsubmit({ type:"post", data: $("#lizings").serialize(), url:"assets/process_lizings.php", cache: false, success: function() { _gaq.push([‘_trackevent’, ‘form’, ’submitted’, ’lizings_form’,, ’true’]); $('#lizings :input').attr('disabled', 'disabled'); $('#lizings_form').fadeto( "slow", 0.05, function() { $('#loadinglizings').hide(); $('#lizingssuccess').fadein(); }); }, error: function() { $('#lizings_form').fadeto( "slow"...

python - Tiny numerical difference in sum-of-squares depending on numpy procedure call used -

i writing function computes sum of squares of errors. x , y vectors of same length; y observation data, x data computed model. the code like: >> res = y.ravel() - x.ravel() >> np.dot(res.t, res) >> 1026.7059479504269 >> np.sum(res**2) >> 1026.7059479504273 now @ last 2 digits. can tell me reason it? both calls should result in same operations. know difference comes from? floating point addition not associative--the order in operations performed can affect result. presumably np.dot(res, res) , np.sum(res**2) perform operations in different orders. here's example np.sum(x**2) != np.sum(x[:50]**2) + np.sum(x[50:]**2) (and neither equals np.dot(x, x) ): >>> np.random.seed(1234) >>> x = np.random.randn(100) >>> np.sum(x**2) 99.262119361371433 >>> np.sum(x[:50]**2) + np.sum(x[50:]**2) 99.262119361371461 >>> np.dot(x, x) 99.262119361371447

excel - VBA - Open files in folder and print names -

i want open of files in folder , have print out names of files. i have set code opens files cannot print name. have separate code print name open 1 file. i'm failing @ combining 2 correctly. ideas? code opens excel files: ‘set path progress folder sub openfiles() dim myfolder string dim myfile string myfolder = “c:\users\trembos\documents\tds\progress" myfile = dir(myfolder & "\*.xlsx") while myfile <> "" workbooks.open filename:=myfolder & "\" & myfile myfile = dir loop end sub code prints 1 file name: 'set path tds_working sub tds() workbooks.open ("c:\users\trembos\documents\tds\progress") end sub 'set dim sub loopthroughdirectory() dim objfso object dim objfolder object dim objfile object dim integer 'create instance of filesystemobject set objfso = createobject("scripting.filesystemobject") 'get folder object set objfolder = objfso.getfolder("c:\users\trembos\...

java hadoop: FileReader VS InputStreamReader -

i want use java class on hadoop hdfs, must rewrite functions. problem is, if use inputstreamreader app read wrong values. here code (so it's work, want use uncommented code part): public static geotimedatacenter[] readcentersarrayfromfile(int iteration) { properties pro = new properties(); try { pro.load(geotimedatahelper.class.getresourceasstream("/config.properties")); } catch (exception e) { e.printstacktrace(); } int k = integer.parseint(pro.getproperty("k")); geotimedatacenter[] centers = new geotimedatacenter[k]; bufferedreader br; try { //path pt=new path(pro.getproperty("seed.file")+(iteration-1)); //filesystem fs = filesystem.get(new configuration()); //br=new bufferedreader(new inputstreamreader(fs.open(pt))); br = new bufferedreader(new filereader(pro.getproperty("seed.file")+(iteration-1))); for(int =0; i<centers.length; i++){ ...

angularjs - How to use star-rating jquery plugin in angular js modal? -

Image
i want use star-rating plugin in project. have criteria on user have rate. displaying criteria in modal window. using angular bootstrap ui modal. not getting how use plugin in angular. my modal's design looks like: please help. thanks in advance.

java recursion test if arraylist are equal -

i have code make more efficient recursion. trouble don't know start. code compares 2 arraylists , b see if equal. assume sizes of both arrays equal. the code is public boolean isequal(a b) { boolean answer = false; if (lessthanorequalto(b) == true); (int = 0; < dlist.size(); i++) { if (dlist.get(i) == b.dlist.get(i)) answer = true; else answer = false; } return answer; } i have written public boolean isequalrecursion(a b) { if dlist.size() == 0; return false(); } else { } i know stopping case 0 when size 0 nothing happens. have no idea write next any appreciated thanks i think pretty start you. looks through elements, assuming array, , checks if equal in size. public boolean isequal(arraylist<?> a, arraylist<?> b) { if (a.size() != b.size()) return false; (int = 0; < a.size(); i++) { if (!isequal((arraylist<?>)a.get(i), (arraylist<?>)b.get(i))) { ...

java - How to import the LibGdx sample project -

Image
i need import project mentioned in link . i not using git, hence have downloaded project zip folder , extracted. please let me know how import libgdx sample project ? this project 3 years ago, perhaps apis libgdx not supported 100% cycle of listener aplication, or project not prepared exported, , simple guide. not know truth looking @ repo comes mind following. i think easiest wayit create new project, libgdx. copy, android asset data folder in new project android asset, , main folder, extract files , copy core of new project. change name package com.matsemann.libgdxloadingscreen; packege name , change other posible error in files. take class somecoolgame in "somecoolgame.java": package com.matsemann.libgdxloadingscreen; // public class somecoolgame extends game { /** * holds our assets */ public assetmanager manager = new assetmanager(); @override public void create() { setscreen(new loadingscreen(this)); } ...

objective c - NSTreeController: how do I find the parent of a node? -

i'm looking similar method to: nsoutlineview parentforitem: nstreecontroller. i need know parent of node in tree. nodes in nstreecontroller instances of nstreenode , , nstreenode has read-only parentnode property - use that. the short snippet below gets parent node of first node in tree-controller's selectednodes array: let selectednode = tree.selectednodes.first! as! nstreenode let parentofselectednode = selectednode.parentnode!

java - Searching for SessionID, SessionKey in a HTTPS Session -

i trying find solution getting sessionid , more important sessionkey. found solution based on java: http://jsslkeylog.sourceforge.net it using following class log rsa-sessionkey: /** * transformer transform <tt>rsaclientkeyexchange</tt> , * <tt>premastersecret</tt> classes log <tt>rsa</tt> values. */ public class rsaclientkeyexchangetransformer extends abstracttransformer { public rsaclientkeyexchangetransformer(string classname) { super(classname, "<init>"); } @override protected void visitendofmethod(methodvisitor mv, string desc) { string premastertype = "ljavax/crypto/secretkey;"; if (classname.endswith("/premastersecret")) { premastertype = "[b"; } mv.visitvarinsn(aload, 0); mv.visitfieldinsn(getfield, classname, "encrypted", "[b"); mv.visitvarinsn(aload, 0); mv.visitfieldinsn(getfield, classname, "premaster", premas...

asp.net mvc 4 - jQuery 2.1.4 issue -

i added autocomplete field view , works fine until make selection error in function: // support: android 2.3 // workaround failure string-cast null input jquery.parsejson = function( data ) { return json.parse(data + ""); }; it says there invalid character. if change this, don't error: // support: android 2.3 // workaround failure string-cast null input jquery.parsejson = function( data ) { if (data !== undefined) return json.parse(data + ""); else return null; }; is there missing here? code simple , have used in numerous views: <table> <tr> <td> @html.displaynamefor(x=>x.state)&nbsp @html.textboxfor(x=>x.state, new { id = "txtstate", style = "width:50px"}) </td> <td> ...

java - Insert JTable data into database -

i facing problem jtable when inserting jtable values database. example have 3 columns, , user enters corresponding data 3 columns, jtable has several rows , have 1 submit button @ bottom of table. after filling data rows, when user press submit button, data inserted database. works fine without problems. now consider user enters 10 rows , didn't click submit button, because of power failure system shutdown suddenly. want store these 10 rows in collection , when application started again want insert these 10 rows values automatically database. please consider user information critical information. don't know how this. rightly said @madprogrammer have take of temp tables, add action listener ***jtable***after insertion of row data transfer data temp tables. -- after click on submit button, there should check if data present in temp tables, first insert these data main table.and truncate or delete data temp tables. here collection not work you. hope may you....

css - matrix scale transition not working -

i have use transform matrix animate transform: scale of element. i want scale 0 1. if use following code works properly: .container { width: 200px; height: 100px; background: yellow; transform: scale(0); transition: transform 1s; } .container.open { transform: scale(1); } https://jsfiddle.net/w4kuth78/1/ if use matrix itself, not working. .container { width: 200px; height: 100px; background: yellow; transform: matrix(0, 0, 0, 0, 0, 0); transition: transform 1s; } .container.open { transform: matrix(1, 0, 0, 1, 0, 0); } https://jsfiddle.net/m7qpetkh/1/ am doing wrong or not working? i'm wondering, because doesn't work in chrome , firefox... the console_log debug output says @ scaling 0 1 matrix gets set matrix(0,0,0,0,0,0) matrix(1,0,0,1,0,0). edit: total confusion... if change scalex , scaley values in matrix 0.1 or 0.01 works... wow when animating or transitioning transforms, transform function l...

php - foreach loop in json encode array -

i sending preformatted html ajax json, json have below code, i trying pull data array db , echoing array data, not able put foreach loop in json_encode, because seems code wrong @ foreach loop, how can achieve that? echo json_encode(array('returnnews' => '<div class="news-item-page"> <h3 class="text-info" style="margin-top:0">'.$latestnews->news_subject.'</h3> '.$latestnews->news_content.' </div> <div class="row"> <div class="col-md-6"> <ul class="list-inline blog-tags"> <li> <i class="fa fa-tags"></i>'. ...

java - SessionFactory calling openSession throws noSuchMethoderror exception -

i using hibernate 3.2.5.ga , when invoking opensession of sessionfactory , returns session object of type org.hibernate.classic.session : public org.hibernate.classic.session opensession() throws hibernateexception; i using spring batch 2.2.7.release , when setting sessionfacotry in hibernateitemreaderhelper , exception thrown when opensession in invoked because expects session of type : org.hibernate.session : java.lang.nosuchmethoderror: org.hibernate.sessionfactory.opensession()lorg/hibernate/classic/session; anyone knows solution this? p.s. can not upgrade hibernate . it odd use org.hibernate.classic.session implementation in sessionfactory after version 3 version 4 seeing how both available ( org.hibernate.classic.session , org.hibernate.session) after version 3. may know spring classic used compatibility hibernate 2.1, deprecated of hibernate 3. advice you should not using hibernateitemreaderhelper spring internal class. it's introduced in ...

ruby on rails - Engineyard Deployment: How to detect in deployhooks that its the first attempt to execute 'rake db:seed' -

Image
i having trouble detect first attempt of deployment after server instance booted. need run command rake db:seed first time set default users , other details in database. have no idea if possible. can me please the best way find out sending --extra-deploy-hook-options while running deployment command , check in after_migrate.rb if config[:initial] present or not. command like ey deploy -e myapp_staging --config=initial:true after_migrate.rb hook looks like: on_app_servers if config[:initial] == 'true' $stderr.puts "seeding data" run "cd #{config.release_path}" run "bundle exec rake db:seed" else $stderr.puts "skipping seeding process" end end for more information ey deploy