Posts

Showing posts from March, 2013

android - How to edit the list in the right up corner that contains settings? -

Image
i tried @override public boolean oncreateoptionsmenu(menu menu) { log.v( this.getclass().getname() + "!!!", new exception().getstacktrace()[0].getmethodname() ); menuitem m_item = (menuitem)menu.finditem(r.id.action_settings); if(m_item != null) m_item.settitle("back test"); // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.settings, menu); return true; } but gets null.and also,oncreate seems have null well. there function can modify text on during runtime??? , if so, there easy way find it? you should add items in menu xml. can find on folder res/menu . there have menus available inflation. i suppose have one. how added options: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="htt

ios - Unsigned IPA in xcode 6 -

i'm wondering still possible xcode 6 users create unsigned ipas (for example, without provisioning profiles), installed in jailbroken devices? there bunch of ways on xcode 5, changing configuration of project or trying archive (xcode 6 doesn't allow archive @ if don't have profile), none of them worked. is kind of apple enforcement, or i'm missing something? i have answer you! more assistance try https://www.youtube.com/watch?v=a4kelbsxzvs step 1: goto /applications right click xcode.app , click "show package contents" step 2: goto contents / developer / platforms / iphoneos.platform / developer / sdks / iphoneos7.0.sdk/ and copy file sdksettings.plist desktop step 3: open file copied sdksettings.plist. under defaultproperties, dict find "code_ signing_ required" , change value yes no. save file step 4: copy modified sdksettings.plist file contents / developer / platforms / iphoneos.platform / developer / sdks / iph

c# - First Formula Copied to All Cells in Column -

we using multidimensional array set formulas , values column range of same dimension. problem seeing no matter values in array, column copying first formula in every cell in column. ex: var values = new object[3,1]; values[0,0] = "=$a$2"; values[1,0] = 3; values[2,0] = 4; range.formula = values; when in spreadsheet see formula "=$a$2" in each cell in column. if set first value in multidimensional array not formula works fine. missing something? edit happens excel 2010. it turns out things work if set formulas using: range.formulaarray = values;

machine learning - WEKA Regression Model -

i'm trying build test regression model in weka. problem don't know enough weka accomplish i'm trying do. data set i'm using sample set weka repository. here first few lines of .arff @relation autompg @attribute mpg numeric @attribute cynlinders numeric @attribute displacement numeric @attribute horsepower numeric @attribute weight numeric @attribute acceleration numeric @attribute year numeric @attribute origin numeric @attribute me {'chevrolet chevelle malibu','buick skylark 320','plymouth satellite','amc rebel sst','ford torino','ford galaxie 500','chevrolet impala','plymouth fury iii','pontiac catali','amc ambassador dpl','citroen ds-21 pallas','chevrolet chevelle concours (sw)','ford torino (sw)','plymouth satellite (sw)','amc rebel sst (sw)','dodge challenger se','plymouth cuda 340','ford mustang boss 302','chevr

php - Creating and accessing arrays dynamically -

i'm trying create array dynamically strings. here code i'm trying use: $users = get_users( $args_users ); $user_display = array(); $user_display_sorted = array(); foreach($users $user){ echo $user->id; $first_name = get_user_meta($user->id, 'first_name', true); $last_name = get_user_meta($user->id, 'last_name', true); $name = $first_name.' '.$last_name; array_push($user_display, $user->id); array_push($user_display, $name); $user_display_sorted = asort($user_display); } print_r($user_display); when print array following: array ( [0] => 5 [1] => test person[2] => 6 [3] => adam person ) i output this: array ( [0] [id] => 5 [name] => test person; [1] [id] => 6 [name] => adam person) so i'd foreach loop on user_display_sorted array , access variables this: foreach($user_display_sorted $user_display_sort){ echo $user_display_sort->id; } how can this? you need

android - Where would this maven dependency be coming from? -

i getting warning , error when tries download mysterious + version of gson. pom requesting version 2.3.1 not mysterious +. coming from? have similar issue android support v20 pom requesting v18 trying pull v20. [warning] pom com.google.code.gson:gson:jar:+ missing, no dependency information available org.eclipse.aether.resolution.artifactresolutionexception: following artifacts not resolved: com.google.code.gson:gson:jar:+, com.android.support:support-v4:jar:20.+: failure find com.google.code.gson:gson:jar:+ in file://c:\dev\git\myapp\main/../repo cached in local repository, resolution not reattempted until update interval of repo has elapsed or updates forced i have tried force update doing mvn install -u didn't either. in pom.xml <dependency> <groupid>com.google.code.gson</groupid> <artifactid>gson</artifactid> <version>2.3.1</version> </dependency> do mvn clean and then mvn d

In Jess, how would I add a slot to a template through a rule? -

as example, have: (deftemplate animal (slot has-feathers (default false)) (slot name (default "george")) ) and in rule have: (defrule bird-test ?a <-(animal (has-feathers ?)) => (printout t ?a.name " bird" crlf) "add slot 'bird' ?a or animal" ) how this? , thank in advance edit: guys! think understand need do. in addition ernest's proposal of providing slot front, might consider multislot can act container sorts of properties rules might detect animal. (deftemplate animal (slot name) (slot has-feathers) (multislot props)...) you can write the (defrule bird-test (declare (no-loop true)) ?a <-(animal (has-feathers true)(props $?ex )) => (modify ?a (props $?ex isbird)) (printout t ?a.name "'s props: " ?a.props crlf) ) alternatively, general kind of deftemplate can used express kinds or properties dynamically: (deftemplate is-a (slot thing) (slot property)) bu

sql - how to remove duplicate rows -

i have following query retrieve bunch of data somehow creates duplicate rows records.i tried distinct no use what doing wrong here select distinct dbo.tblassessmentecosystemcredit.managementzoneid, assessmentecosystemcreditid,dbo.tblassessmentecosystemcredit.assessmentversionid , (coalesce(dbo.tblmanagementzone.sitevaluecurrentscore,0) -coalesce(dbo.tblmanagementzone.sitevaluefuturescore,0)) lossinsitevaluescore, 5 savetype, dbo.ufn_varbintohexstr(dbo.tblassessmentecosystemcredit.rowtimestamp) rowtimestamp, dbo.tblvegetationzone.eecid, case when dbo.tblvegetationzone.eecid > 0 3.0 else 1.0 end eecoffsetmultiplier dbo.tblassessmentecosystemcredit inner join dbo.tblvegetationtype on dbo.tblassessmentecosystemcredit.vegtypeid = dbo.tblvegetationtype.vegtypeid inner join dbo.tblmanagementzone on dbo.tblassessmentecosystemcredit.managementzoneid = dbo.tblmanagementzone.managementzoneid inner join dbo.tblvegetationzone on dbo.tblvegetationzone.vegetationzoneid = db

Sbt Native Packager Debian installation uses root user instead of daemon user -

i creating debian package of scala play 2.3.8 application sbt native packager ( "com.typesafe.sbt" % "sbt-native-packager" % "1.0.0" ). startscripts being generated use custom user start , stop app intended. problem is, installation dpkg -i package.deb seems start app directly after installation root user. /var/run/neeedo-app/running.pid owned root user , further stop or start attempts fail because file cant overwritten daemon user. this build.sbt: import com.typesafe.sbt.sbtnativepackager._ import nativepackagerkeys._ import com.typesafe.sbt.packager.archetypes.serverloader.systemv name := """neeedo-api""" version := "1.0-snapshot" scalaversion := "2.11.1" maintainer in debian := "neeedo-team <neeedo@neeedo.com>" packagesummary in debian := "neeedo api application" serverloading in debian := systemv packagedescription := "neeedo api application" daemonu

java - LibGDX Box2D: Cannot get Fixture to render -

i have been trying libgdx's version of box2d, , looked @ demo created few months back, , code looks fine, , google search results, code fine, life of me, cannot fixture render. here (minimalist example) code, , life of me, cannot work note: built wrapper around libgdx game class, should self-explanatory : public class testbox2d extends eggame { int width; int height; static final vector2 zero_gravity = new vector2(0f, 0f); orthographiccamera camera; world world; body body; box2ddebugrenderer box2ddebugrenderer; rayhandler rayhandler; ... // removed constructor, nothing special here. @override protected void init() { width = gdx.graphics.getwidth() / 2; height = gdx.graphics.getheight() / 2; camera = new orthographiccamera(width, height); camera.position.set(width / 2, height / 2, 0); camera.update(); world = new world(zero_gravity, true); box2ddebugrenderer = new box2

c++ - Cmake cannot find QGLWidget -

i have simple bouncing ball program wrote in qtcreator on windows couple years ago, , i'm trying rebuild on linux (ubuntu 14.04) using cmakelists instead of qt project files. cmakelists.txt file (loosely based off cmake file in this question below. cmake_minimum_required ( version 2.6 ) project ( bouncyball ) find_package ( qt4 components qtgui qtopengl required ) set (qt_use_qtopengl true) include(${qt_use_file}) add_definitions(${qt_definitions}) include_directories( ${qt_qtopengl_include_dir} ${opengl_include_dir} ) find_package ( bullet required ) add_executable ( bouncyball main.cpp bouncyball.cpp bulletwidget.cpp ) target_link_libraries( bouncyball ${qt_libraries} ${bullet_libraries} ) cmake configures , generates build files without errors, fails compile following error: [ 33%] building cxx object cmakefiles/bouncyball.dir/main.cpp.o /usr/bin/c++ -dqt_gui_lib -dqt_no_debug -dqt_opengl_lib -isystem /usr/include/qt4 -isystem /usr/include/qt4/qtopengl -isystem /

sql - select from table where both id exist -

i need select single table both id exists in column having matching id in column. query below gives rows single matching id. select * customer_appdata appdata_id in(11,12) id customer_id appdata_id 6 65 4 7 65 12 8 65 8 9 66 11 10 66 12 so here want last , second last rows(9,10) have both 11 , 12 common id 66. this query selects rows customer_appdata of 12 or 11 , uses exists see if other row in table. select * customer_appdata c1 appdata_id in (11,12) , exists ( select 1 customer_appdata c2 c2.appdata_id in (11,12) , c2.appdata_id <> c1.appdata_id , c2.customer_id = c1.customer_id )

playframework - Play framework and javascript Assets router -

i using play 2 framework scala. i want use @routes.assets.at(...) in javascript path assets. framework not compile contents in assets directory. is possible? or alternative? my solution: # in controller, scala code def jsroutergen = action { ok( routes.javascriptrouter("jsrouter")( routes.javascript.assets.at // intellij tell wrong, right :) ) ).as("text/javascript") } # in html template # add in <head> <script src='@routes.application.jsroutergen'></script> <!-- other js needs router come after --> # in js jsrouter.controllers.assets.at('/use/it/like/in/html/template'); note 2 pairs: jsroutergen : defines js router code jsrouter : name of router use in js code change them like, make sure match.

Spring Data Neo4J 4.0.0 : What is the right sequence of calls to lookup by property? -

i doing simple camel case lookup on node in neo4j 4.0.0.m1: e.g. userrepository.findbyuserid(string userid); i can see in log file correct cypher query generated: match (u:user) u.userid = {0} return u and can run code in neo4j browser expected result of 1 node being returned. can see correct json getting generated e.g. 21:53:39.819 [tomcat-http--37] info o.n.o.session.request.defaultrequest - post http://localhost:7474/db/data/transaction/commit, request: {"statements":[{"statement":"match (u:user) u.userid = {0} return u","parameters":{"0":"145"},"resultdatacontents":["graph"]}]} and can run postmaster , expected result of 1 node being returned. however, running through code named query in graphrepository returns every node currently, believe, in neo4jsession . here userrepository: @repository public interface usernoderepository extends graphrepository<user> { @qu

objective c - Problems exporting Mac App from Xcode to the computer desktop -

Image
i have frustrating problem exporting compiled copy of mac app desktop , have run. first background... the app contains 2 referenced subprojects. first project creates archive , second 1 creates framework. both used main project perform functions. the app runs fine within xcode. problem start when archive , try export desktop see how runs on it's own. use regular procedures when try , start app desktop, won't load. there's message saying dynamic loader can't find framework object. part of error report looks helpful says this... dyld error message: library not loaded: @rpath/jxls.framework/versions/a/jxls referenced from: /users/user/buntingsimulator.app/contents/macos/baseball situation simulator reason: image not found jxls exist it's not in exported mac app bundle. have suggestions on or for? suspicions lay in value of @rpath , how subproject referenced or built within main project. thanks in advance. this added in after got answer

looping through objects in objects and then adding properties to another object in javascript -

want able add properties object in object separate object, have got working point getting nan returned?? var votes = { "alex": { president: "bob", vicepresident: "devin", secretary: "gail", treasurer: "kerry" }, "bob": { president: "mary", vicepresident: "hermann", secretary: "fred", treasurer: "ivy" }, "cindy": { president: "cindy", vicepresident: "hermann", secretary: "bob", treasurer: "bob" }, "devin": { president: "louise", vicepresident: "john", secretary: "bob", treasurer: "fred" }, "ernest": { president: "fred", vicepresident: "hermann", secretary: "fred", treasurer: "ivy" }, "fred": { president: "louise", vicepresident: "alex", secretary: "ivy", treasurer: "ivy" }, "g

java - How do I repeat a string in jgrasp without using a loop -

i cannot find way make repeat in way looks xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx import java.util.scanner; public class square { public static void main (string [] args) { scanner kb = new scanner (system.in); system.out.print("enter positive integer no greater 15: "); double square= kb.nextdouble(); double k=1; string i= ""; while (k<square+1) { k++; i=i+"x"; } } } the final output has letters x in square type formation if enter 8 square variable 8 across , 8 down. knew outcome of going wrong dont know hot make appear above. output looks like x xx xxx xxxx xxxxx xxxxxx xxxxxxx xxxxxxxx if i'm using 8 square use second loop. construct string in first loop, , print repeatedly in second. or nest 1 loop inside , print characters inner loop, lines outer one.

matplotlib - Python Violin Plots -

Image
how can violin plots can in r using ggplot2 ? in ggplot2 can create nice violin plots like: ggplot(dat,aes(value,prob)) + geom_violin() + geom_jitter(alpha=0.1) + scale_y_log10() + labs(x="test values", y="prob") and can obtain nice plots this: how can same in python? i've looked @ matplotlib.pyplot.violinplot not able similar this. using seaborn (note using development version; things work little different in current release, violinplots): sns.violinplot(x=value, y=prob, inner=none, color="white", cut=0) sns.stripplot(x=value, y=prob, jitter=.3, color="black", alpha=.1, size=4) the functions both return matplotlib axes object, , can ax.set_yscale("log") on object use log axis. note sets scale after fitting kde (i'm not sure ggplot does).

javascript - Is There a Way to Include Markdown in HTML/Websites? -

i'm adding section website , want put guide on page people looking @ particular section of site. i'd use markdown formatting , presentation. there way inside of html file? i've tried using strapdown supports bootstrap themes , use own html around markdown text. haven't been able find stackoverflow post explains how either. markdown not part of html standard. need parse markdown "codes". there plenty of libraries can though. here stackoverflow's own parser (for .net server side) a parser written in javascript and many many more (search friend).

migration - jar file in Jboss for com.ibm.ws.runtime.jar -

i new jboss , working on project migrate application websphere 7 jboss eap 6.3 getting compilation error in java file implementing spring factorybean importing "com.ibm.websphere.sca.servicemanager" class of ws.runtime-7.0.0.0.jar. can tell me alternative jar can use in jboss this. i have class implements spring frameworks factorybean interface can used in spring configuration create service objects.it delegates websphere servicemanager create service. need change class or find alternative way can create service objects using jboss servicemanager, below class used in websphere: import org.springframework.beans.factory.beannameaware; import org.springframework.beans.factory.factorybean; import com.ibm.websphere.sca.servicemanager; public class servicefactorybean implements factorybean, beannameaware { private string beanname; private class<?> clazz; /** * default constructor. */ public servicefactorybean() { super(); } /* * (non-javadoc) * @see org.sprin

javascript - AJAX JSON data is not display in jqGrid -

i new jqgrid trying show data when click of 1 colmodel @ time need display data in jqgrid received data server , pass function , shown data not display data no error how display in it?? gridland.jqgrid({ datatype:'local', data: val, colnames:clnms, colmodel:collmdls, rownum:10, rowlist:[10,20,30], pager: "land_details_table_pager", gridview:true, //rownumbers:true, // sortname: 'id', viewrecords: true, sortorder: 'asc', caption:"land detail", height: '100%', autowidth:true, shrinktofit:false, oncellselect: function(rowid, index, contents, event) { var cm = gridland.getgridparam('colmodel'); var rowdata = gridland.getrowdata(rowid); alert("rowdata====>"+json.stringify(rowdata)); var slnno = rowdata['s

WPF Animation execute twice -

i faced issue regarding animation execute twice, please check code: <grid> <grid.columndefinitions> <columndefinition width="auto"/> <columndefinition width="*"/> <columndefinition width="auto"/> </grid.columndefinitions> <listview x:name="lsthandled" grid.column="0" visibility="visible"> <listviewitem>jimmy</listviewitem> <listviewitem>jimmy</listviewitem> <listviewitem>jimmy</listviewitem> <listviewitem>jimmy</listviewitem> <listviewitem>jimmy</listviewitem> <listviewitem>jimmy</listviewitem> <listviewitem>jimmy</listviewitem> <listviewitem>jimmy</listviewitem> <listview.triggers>

ssl - Https with TLS 1.2 in Xamarin -

i'm using httpclient in xamarin request https tls 1.2 , got error below; system.aggregateexception: 1 or more errors occurred ---> system.net.webexception: error writing headers ---> system.io.ioexception: authentication or decryption has failed. ---> mono.security.protocol.tls.tlsexception: authentication or decryption has failed. @ mono.security.protocol.tls.recordprotocol.processalert (alertlevel alertlevel, alertdescription alertdesc) [0x00013] in ///library/frameworks/xamarin.ios.framework/versions/8.9.1.3/src/mono/mcs/class/mono.security/mono.security.protocol.tls/recordprotocol.cs:574 @ mono.security.protocol.tls.recordprotocol.internalreceiverecordcallback (iasyncresult asyncresult) [0x000d0] in ///library/frameworks/xamarin.ios.framework/versions/8.9.1.3/src/mono/mcs/class/mono.security/mono.security.protocol.tls/recordprotocol.cs:376 --- end of inner exception stack trace --- @ mono.security.protocol.tls.sslclientstream.endnegotiatehandshake (iasy

javascript - Bypass Anti-ClickJack in C# WebBrowser Control? -

in application need invoke click button in webbrowser (httprequests not suffice in situation) , unable invoke clicks button. after further digging, found site has piece of code: <script type="text/javascript"> if (self === top) { var anticlickjack = document.getelementbyid("anticlickjack"); anticlickjack.parentnode.removechild(anticlickjack); } else { top.location = self.location; } </script> i wondering if possible bypass anticlickjack button can pressed normal. thanks!

javascript - How to update jQuery-UI progress bar with AJAXcall (files scan) -

i want hash files in specific folder ajax , update progress, meaning don't want ajax stop @ first reply. searched online , thing found right answer doesn't work. my jquery( mixed js): jquery(document).ready(function($) { $('#progress').progressbar(); document.getelementbyid('save').onclick = function() { var div = document.getelementbyid('save_log'); var security = $('#save_security').val(); div.innerhtml = ''; xhr = new xmlhttprequest(); xhr.open("post", checkit.admin_ajax, false); xhr.onprogress = function(evt) { //var json = json.parse(e.currenttarget.responsetext); //var percentcomplete = ( json.currentfile * 100 ) / json.filescount; var progress = evt.currenttarget.responsetext; $('#progress').progressbar("value", progress); } xhr.onreadystatechange = function() { if (xhr.readystate == 4) { console.log(xh

data structures - Optimal solution for the "celebrity" algorithm -

among n persons,a " celebrity " defined who known not know anyone . problem identify celebrity, if 1 exists, asking question of form, " excuse me, know person on there? " (the assumption answers correct, , celebrity answer.) goal minimize number of questions. is there solution of order less obvious o(n^2) here? using analysis of celebrity problem here brute-force solution. graph has @ n(n-1) edges, , can compute asking question each potential edge. @ point, can check whether vertex sink computing indegree , outdegree. brute-force solution asks n(n-1) questions. next show how to @ 3(n-1) questions , linear place. an elegant solution. our algorithm consists of 2 phases: in elimination phase, eliminate 1 person being celebrity; in verification phase check whether 1 remaining person indeed celebrity. elimination phase maintains list of possible celebrities. contains n people. in each iteration, delete 1 person list. e

Android In-app Purchase V3 Error: Authentication is required -

Image
i implementing google in-app purchase v3 , followed steps stated on here in official documentation here . have uploaded app in google playstore alpha testing , have downloaded playstore url real device giving me error error authentication required. need sign google account. my code in-app purchase here: public class buypointsfragment extends fragment //in app billing variable start // debug tag, logging static final string tag = "com.myapp"; // user have premium upgrade? boolean mispremium = false; // user have active subscription infinite gas plan? boolean msubscribedtoinfinitegas = false; // skus our products: premium upgrade (non-consumable) , gas // (consumable) static final string sku_premium = "premium"; static final string sku_gas = "gas"; // sku our subscription (infinite gas) static final string sku_infinite_gas = "infinit

linux - Looking for "des" binary? -

i unable find linux binary "des", seems exist according man page . or if has alternate method, wanting decrypt des encrypted strings shell. if debian based distribution, can packages provide files online using http://packages.debian.org . looked des , can't find executable. also, man page section 7 not command references lie. don't think either. as doing des encryption command line, quick google gave me this .

Eclipse Javascript Editor wrong string recognition with Reactjs syntax -

Image
when write jsx in following format in default javascript editor, slash , grater signs interpreted string. , when press enter @ end eclipse automatically adds " + " i using eclipse 4.3.0. how fix this? disclaimer i'm author of typescript.java i suggest you install typescript.java 1.1.0 provides jsx support inside eclipse. provides jsx editor syntax coloration jsx (and javascript): validation, hyperlink, hover, completion done using typescript tsserver:

html - node.js code to open a page in browser with localhost URL -

i have written simple server using node.js. @ moment server responds writing "hello world" browser. the server.js file looks this: var http = require("http"); http.createserver(function(request, response) { response.writehead(200, {"content-type": "text/plain"}); response.write("hello world"); response.end(); }).listen(8080); i use url in browser trigger "hello world" response: http://localhost:8080/ i want able open basic html page when pass url this: http://localhost:8080/test.html i have looked through many tutorials , stackoverflow posts there not out there on specific task. know how achieve simple modification server.js file? if wish open .html file through nodejs of " http://localhost:8080/test.html " such url, need convert .html page .jade format.use rendering engine of expressjs framework.express rendering engine render .jade file on nodejs server.

java - Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected ':' at line -

i have seen same questions on stackoverflow, tells comma , spaces in json. did nt helped me. i having json of format pojo {"binary":[ { "attributeindex": 4, "attributevalue": "no", "binaryvalue": "1,0" }, { "attributeindex": 4, "attributevalue": "yes", "binaryvalue": "0,1" } ]} pojo public class binpojo { /** * @param args */ int attributeindex; string attributevalue; string binaryvalue; , public class binarypojo { /** * @param args */ jsonarray binary; i trying attributeindex,attributevalue,binaryvalue values getting error caused by: com.google.gson.jsonsyntaxexception: com.google.gson.stream.malformedjsonexception: expected ':' @ line 1 column 65 @ com.google.gson.gson.fromjson(gson.java:818) @ com.google.gson.gson.fromjson(gson.java:768) @ com.google.gson.gs