Posts

Showing posts from June, 2011

java - How to add JCheckBox in JTable? -

Image
first of apologize english neglect explain problem. first want jcheckbox in jtable have. i retrieving student id , student name database in column index 0 , 1. want third column should absent/present take whether student present or absent jcheckbox value. here code jtable values : attendance.java /* * change template, choose tools | templates * , open template in editor. */ package shreesai; import java.sql.connection; import java.sql.preparedstatement; import java.sql.resultset; import java.util.vector; /** * * @author admin */ public class attendance{ connection con = connectdatabase.connecrdb(); public vector getemployee()throws exception { vector<vector<string>> employeevector = new vector<vector<string>>(); preparedstatement pre = con.preparestatement("select studentid,name student"); resultset rs = pre.executequery(); while(rs.next()) { vector<string> ...

Java file deletion fails -

i need delete files within java program , have written code. fails delete file , can't figure why. file not in use , not write protected. public static void delfile(string filetodel) { try { file file = new file("filetodel"); if (file.delete()) { system.out.println(file.getname() + " deleted!"); } else { system.out.println("delete operation failed." + filetodel); } } catch (exception e) { e.printstacktrace(); } } if want delete file, there no need loading it. java.nio.file.files.deleteifexists(filetodel); (where filetodel contains path file) returns true if file deleted, can put in if-clause.

mongodb - Database Scheme for unified profiles fetched from multiple Social Networks (Facebook and Linkedin...) -

the application i'm building allows users login using both facebook , linkedin accounts in order fetch friend these networks. each of friend can user of application. i have couple of problems solve: how should structure database schema? how unify profiles? potential solutions regarding structure: i'm using mongo (but open suggestions). though i'd create collection of users each user document looks this: user = { appid: <id>, connections: [userid] } so, each user has: a unique app generated id (could doc's id simplicity). an array of user's ids. ids of friend's profiles created in app. regarding unifying profiles: should unify users based on email or name? or both? misc i though use loginradius using singly that, , decided kill service. in other words, don't want depend on third party tool because core feature. var userschema = new schema({ name: { type: string, default: '' },...

bash - How to handle no matching files when using ${f%.gz} syntax -

i'm developing script process , move away compressed files dropped folder. the script works long gets dropped folder compressed file. however, if script executes when there no compressed files process bash function ${f%.gz} gives unexpected results. here script, example of problem case afterwards: files="$ingest_dir/*.gz" f in $files justfilename=${f##/*/} syslog -s -l n "archiving \"$justfilename\"" unzippedpath=${f%.gz} syslog -s -l n "moving \"$unzippedpath\"" unzippedname=${unzippedpath##/*/} syslog -s -l n " \"asr_dir/$unzippedname\"" syslog -s -l n "gunzip-ing $f" gunzip $f mv "$unzippedpath" "$asr_dir/$unzippedname" done again, works if there's @ least 1 .gz file in target directory. if there aren't .gz, there other files in directory (which must there other reasons) $files contains expanded $ingest_dir plus /*.gz,...

ios - How to block UIAppearance proxy for some control -

i set custom appearance of ui classes. [[uibarbuttonitem appearance] settintcolor:somecolor]; ... [[uinavigationbar appearance] setbackgroundimage:someimage forbarmetrics:uibarmetricsdefault]; so when create uibarbuttonitem's or uinavigationbar's objects in application have defined appearance. but if want object have standart appearance(not use defined proxy), need set it's properties default values manually. so quesion is: there way block using uiappearance object? thank you. edit: not 100% want use appearancewhencontainedin. [[uibarbuttonitem appearancewhencontainedin:[uinavigationbar class], nil] settintcolor:[uicolor redcolor]]; [[uibarbuttonitem appearancewhencontainedin:[uitoolbar class], nil] settintcolor:[uicolor yellowcolor]]; this way can control behavior degree. setting properties nil use default appearance: [self.navigationcontroller.navigationbar settintcolor:nil];

sql server - Project relational data to XML column - is it possible? -

i have 2 tables of following structure: people id | lastname | firstname | other columns... the second table has xml column: id | myxmlcol | other columns... myxmlcol stores following xml: <mydata> <block> <person id="1" /> ...other nodes </block> ...other blocks </mydata> the id attribute points id column of people table. what need, query myxmlcol , returns: <mydata> <block> <person id="1" lastname="jones" firstname="bob" /> ...other nodes </block> ...other blocks </mydata> is possible make such projection? i'm using sql server 2012. if there can 1 element "person" in single element "block", should suit: update t set myxmlcol.modify(' insert ( attribute lastname {sql:column("p.lastname")}, attribute firstname {sql:column("p.firstname")} ) (/mydata/bl...

how to set color to tab in android? -

i trying below code not work properly public static void settabcolor(tabhost tabhost) { for(int i=0;i<tabhost.gettabwidget().getchildcount();i++) { tabhost.gettabwidget().getchildat(i).setbackgroundcolor(color.parsecolor("#ff0000")); //unselected } tabhost.gettabwidget().getchildat(tabhost.getcurrenttab()).setbackgroundcolor(color.parsecolor("#0000ff")); // selected } i want change default color of tab. thank in advance tabhost tabhost = gettabhost(); for(int i=0;i<tabhost.gettabwidget().getchildcount();i++) { relativelayout tv = (relativelayout ) tabhost.gettabwidget().getchildat(i).findviewbyid(android.r.id.title); tv.setbackgroungcolor(.....); } just use this...hopes works

reflection - Idiomatic way to implement generic functions in Go -

let's want write function check whether predicate matched element in slice: func isin(array []t, pred func(elt t) bool) bool { _, obj := range array { if pred(obj) { return true;} } return false; } obviously, previous code won't compile, since t not exist. can replace interface{} this: func isin(array[]interface{}, pred func(elt interface{}) bool) bool { ... } as happy let predicate perform casting: isin([]interface{}{1,2,3,4}, func(o interface{}) {return o.(int) == 3; }); but then, function won't accept array not of type []interface{} : isin([]int{1,2,3,4}, func(o interface{}) { return o.(int) == 3; }) // not compile and similarly: func isin(arr interface, pred func(o interface{}) bool) bool { _, o := range arr.([]interface{}) { ... } } isin([]int{1,2,3,4}, func(o interface{}) { return o.(int) == 3; }) // panics @ runtime (cannot cast []int []interface) the other alternative have typed functions each array type: isini...

Makefile and gcc error -

in makefile, i'm getting following error when running 'make tests': make: * no rule make target genrangetreetester', needed by tests'. stop. tests: genrangetreetester libgenrangetree.a gcc -wall -l. -lgenrangetree teacher.o manager.o -o genrangetreetester ./genrangetreetester .phony: tests but genrangetreetester , libgenrangetree.a aren't exist why doesn't run gcc call ? thanks. the line tests: genrangetreetester libgenrangetree.a means target tests depends on genrangetreetester . file must present name commands below executed. change makefile this: tests: genrangetreetester ./genrangetreetester genrangetreetester: libgenrangetree.a gcc -wall -l. -lgenrangetree teacher.o manager.o -o genrangetreetester

.net - paypal doesn't pass back variables on mobile browser -

when making purchase using paypal on desktop browser receive custom on0 , os0 variables posted fine, when completing paypal transaction using mobile browser e.g. iphone, ipad, android select few variables return our following process carry out not function correctly. using visual basic.net i spoke paypal regarding , answer generic. stating paypal mobile website not integrated. yet there no way bypass mobile website in customer html form.

c# - Contravariant Value Types -

i have created interface repositories. public interface irepository<t, in tkey> t: class { ienumerable<t> find(expression<func<t, bool>> predicate); ienumerable<t> findall(); t findsingle(tkey id); void create(t entity); void delete(t entity); void update(t entity); } the findsingle method accepts id, used searching on primary key. using in expected allowed pass reference type tkey . out of curiosity decided create concrete class , specify int, see exception. i looked msdn , specifies should not work covariance , contravariance in generic type parameters supported reference types, not supported value types. the class created looks this public class projectrepository : irepository<project,int> { public ienumerable<project> find(expression<func<project, bool>> predicate) { throw new notimplementedexception(); } public ienumerable<project> findall() { ...

javascript - CSS/JS Clock: Strange positioning behaviour in IE8 -

Image
i trying make animated clock without using images. managed of right; however, when 1 of hands reaches 12, jumps way down bottom of dial , gradually moves upwards , reaches correct position points 3. happens in ie8. idea how fix this? this html file: https://dl.dropboxusercontent.com/u/39330021/test/css3-js-clock-3.htm screenshot showing issue: i guess using css3-rotations ie8 matrix filters fallback. ms matrix filters work bit different: bounding-box of rotated element gets expanded , takes more place before rotation. because bounding box's anchor point top left, image (or other content) moves down , right additionally correct transformation. need compensate movement moving box horizontally , vertically. not easy of task. static handling: there few recources on internet helping static examples: ietransformstranslator correcting transform origin in ie dynamic handling: dynamic purpose, if really need support ie8, i'd recommend gsap, famous greensoc...

python - load a float+ string table -

this question has answer here: reading file string , float loadtxt 2 answers i have table contains both floats , strings. when i'm trying load np.loadtxt(file.txt) , got error could not convert string float: \omega_b how can fix it. you can load using dtype option create structured array : np.loadtxt(fname, dtype=[('col1_name', '|s10'), ('col2_name', float)]) or if don't want specify dtypes should use can go suggested @atomh33ls: dtype=none . see additional options np.loadtxt can tune needs.

ruby - Merge two JSON with a matching ID in Rails -

i got 2 json structured this. first 1 comes api: [ { "course_code":"basic 101 - 0913", "name":"basic 101", "start_at":"2013-09-16t00:00:00+02:00", "end_at":"2013-10-13t23:55:00+02:00", "workflow_state":"available" }, {"course_code":"medium 201 - 0913", "name":"medium 201", "start_at":"2013-08-06t16:55:25+02:00", "end_at":null, "workflow_state":"available" } ] the second 1 json export database: [ { "id":1, "course_id":"basic 101", "name":"basic level", "description":"blablabla", "discipline_id":"1", "duration":"28", "created_at":null, "updated_at":null }, { "id":2, "course_id...

assembly - Shutdown OS with NASM -

i have been writing 16-bit operating system , user able shut down computer without hitting power button. there way in assembly me shutdown computer? mov ax, 0x1000 mov ax, ss mov sp, 0xf000 mov ax, 0x5307 mov bx, 0x0001 mov cx, 0x0003 int 0x15

java - How to convert a String FIX message to FIX FIX50SP2 format using QuickFixJ -

need quick help. newbie in quickfixj. have fix message in txt file. need convert fix50sp2 format. enclosing code snippet. string fixmsg = "1128=99=25535=x49=cme34=47134052=20100318-03:21:11.36475=20120904268=2279=122=848=336683=607400107=esu2269=1270=140575271=152273=121014000336=2346=521023=1279=122=848=336683=607401107=esu2269=1270=140600271=206273=121014000336=2346=681023=210=159"; system.out.println("fixmsg string:"+fixmsg); message fixmessage = new message(); datadictionary dd = new datadictionary("fix50sp2.xml"); fixmessage.fromstring(fixmsg, dd, false); system.out.println("fixmessage output:" + fixmessage.tostring()); // print message after parsing msgtype msgtype = new msgtype(); system.out.println(fixmessage.getfield(msgtype)); here output: fixmsg string:1128=99=15835=x49=cme34=47164052=2012090312102051175=20120904268=1279=122=848=336683=607745107=esu2269=1270=140575271=123273=121020000336=2346=501023=110=205 fixmessage output...

use html localStorage in PHP -

my main question is, why below code prints out: false boolean value true i expect variable "boolean" value false i want store data in javascript , later use in php, possible? <!doctype html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>storage test?</title> </head> <body> <script type='text/javascript'> localstorage.save = 'false'; </script> <?php $boolean = "<script type='text/javascript'>" . "document.write(localstorage.save);". "</script>"; echo $boolean; if($boolean = 'true'){ echo "<p>boolean value true</p>"; } else { echo "<p>boolean value false</p>"; } ?>...

XSLT - Creating Dynamic Grid with single XML -

i creating dynamic table(grid) using xslt, i beginner in xslt, have asked question before here xslt - creating dynamic grid please refer it, on above question using 2 xml columns , rows , here trying 1 xml(rows). can find xslt on above question 2 xml section. xml data : <tabledata> <rows> <row id="0" name="a" link-name="yes" hide-id="yes" sort-name="yes"/> <row id="1" name="b" desc="some description" link-name="yes" hide-id="yes" sort-name="yes"/> <row id="3" name="c" link-name="yes" hide-id="yes" sort-name="yes"/> </rows> </tabledata> expected output: <table border="1"> <tbody> <tr> <th> <a onclick="javascript:sortcolumn('item name')"...

php - Issues with form submission -

a few questions here have ask, first of all, matter whether put in form: <form action="whatever.php" method="post"> instead of: <form name="" action="$_server['php_self']" method="post"> i mean listing whatever.php because splits code instead of having massive files of code, , pass error messages etc session variables , destroy them instantly, curious advantages or disadvantages , if doing better? next question form validation, told if not coming database, not bother server side validation , bother client side validation... seems bit odd not bother server side validation, feel should having both regardless of database or not. the action in form doesn't matter much. if you're using framework router urls don't map directly php files. code lives shouldn't determined url, when more advanced code architecture. if not coming database, not bother server side validation , bother cl...

Combining twitter typeahead with JSF inputText -

snippet of html: <h:panelgrid width="100%"> <h:outputtext value="from:"></h:outputtext> <h:inputtext id="departureairport" value="#{searchflightsbean.departureairport}" styleclass="input-block-level blue-highlight" placeholder="enter departure city" required="true"> <f:validatelength minimum="3" maximum="20" /> </h:inputtext> <h:message for="departureairport" styleclass="alert alert-error" /> </h:panelgrid> i want to, eventually, pull data field via ajax, , suggest options user while he/she typing. i have included following in page: <h:outputstylesheet name="css/bootstrap.css" /> <h:outputstylesheet name="css/main.css" /> <h:outputscript name="js/jquery-2.0.2.min.js" /> <h:outputscript name="js/bootstrap-typeahead.js" /> and have following js...

matlab - How to multiply many gpuArray matrices in parallel? -

given matrices a 1 ,...,a n , b 1 ,...,b n stored gpuarray , want calculate matrices c i =a i *b i . all a i 's of same size, , b i 's of same (possibly different) size. how do fast on gpu, assuming n large , sizes of matrices relatively small? possible avoid using cuda? if have matlab r2013b, can use new gpuarray pagefun function.

javascript - get string of values of certain property from JSON -

i'm trying string of isbns google books bookshelf via api. here's attempt isn't working. (i'm trying use this snippet .) $.getjson("https://www.googleapis.com/books/v1/users/115939388709512616120/bookshelves/1004/volumes?key=myapikey", function (data) { console.log(data); var allisbns = []; (i = 0; < data.items.volumeinfo.industryidentifiers[0].identifier.length; i++) { allisbns.push(data.items.volumeinfo.industryidentifiers[0].identifier[i]); } alert(allisbns); }); fiddle looking @ object logged, data.items array (of length data.totalitems seems). furthermore, industryidentifiers[0].identifier seems string, , not array. therefore think wanted loop through data.items instead. also may worth noting should not going explicit index on industryidentifiers unless the spec calls out predefined order. recommend finding identifier type === "isbn_10" : for (var = 0; < data.items.length; i++) { (var j = 0; j < data.i...

ios - Make an image view every time at launch -

i want splash image fade after 1 second after launch. so on top of .xib put image view splash image, ( first actual splash screen shows, when xib loaded image view same image shown, making it's same splash screen ) i use code in viewcontroller.m fade image [uiimageview beginanimations:nil context:null]; [uiimageview setanimationduration:1.0]; [imageloading setalpha:0]; [uiimageview commitanimations]; this works, if user goes xib , later switches back, shows 1 second splash screen again. i tried in viewcontroller.m -(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { [uiimageview beginanimations:nil context:null]; [uiimageview setanimationduration:1.0]; [imageloading setalpha:0]; [uiimageview commitanimations]; return yes; } but apparently it's not getting called. is there other way, make image view fade @ launch? thanks lot, set property in app delegate . eg @property(nonatomic,ass...

c# - Video player for application that loads RTMP feed -

good morning/afternoon. looking integrate rtmp player application creating play local live rtmp feed. recommend players? i've been looking @ osmf strobe media playback have not pulled trigger yet. you can find c# rtmp implementation @ https://code.google.com/p/rtmp-mediaplayer/ it tested work on windows, ios , android. need bass ( http://www.un4seen.com/bass.html ) output audio. video not supported base rtmp client code (netstream) exposes event gives video data arrive server.

java - WLST command to update JDBC DataSource URL -

i use weblogic console navigate data sources , update url in data sources. there way can same using wlst command. need update command. i need update url of data source. we via wlst script in different fashion: edit() # set url , remove target can redeploy without # restarting managed server startedit() cd("/jdbcsystemresources/"+dsname) targets = get('targets') # set array ob empty objects datasource's targets set('targets',jarray.array([], objectname)) cd("jdbcresource/"+dsname+"/jdbcdriverparams/"+dsname) set("url", dburl) save() activate() # reset thge original targets datasource refreshed startedit() cd("/jdbcsystemresources/"+dsname) set('targets', targets) save() activate() the thing found needed here changing url on datasource object not redeploy managed managed servers datasource attached to. if use managed servers, either have set targets empty, save datasource, set origina...

java - Shorten a string in JTabel when cell is too small -

when cell small display whole string, shortens end adding '...'. instance: "this string" becomes "this is..." there way shorten @ beginning? "...a string". thx! jtable default uses jlabel rendering component, need tell label how shorten string. can implementing custom tablecellrenderer . perhaps can use left dot renderer starting point , extend it, if not suits needs.

Google Maps' custom marker doesnt have transparency -

i have png image place custom marker. code simple: <script type="text/javascript"> document.write('<div id="gmap" style="width:960px; height:360px;"></div>'); var map_center = new google.maps.latlng(xxx, xxx); var map = new google.maps.map( document.getelementbyid("gmap"), { zoom: 11, center: map_center, maptypeid: google.maps.maptypeid.roadmap, pancontrol: false, streetviewcontrol: false, maptypecontrol: false, styles: [ { featuretype: 'all', elementtype: 'all', stylers: [ { visibility: "on" }, { saturation: -100 } ] }] }); var pos; var marker; for(var = 0 ; < 10 ; i++) { pos = new google.maps.latlng(xxx, xxx); marker = new google.maps.marker({ position: pos, map: map, title: ...

java - Distribute application with user defined heap size -

we distributing java application exe file using install4j, , setting jvm parameters (e.g. vmparameters="-xmx512m ..." ). problem is, users needs different maxheapsize, , want allow user-defined jvm parameterization (say, launching .exe cmd params). how can achieve this? edit i know launch4j , other executable wrappers, couldn't find of works .exe file (only .jar s) eventually, colleague found answer - create .vmoptions file next .exe , add options want pass jvm (in case -xmx1024mb ).

html5 - Google Chrome 28 doesn't play mp4 videos -

i have issue @ moment cannot .mp4 videos play on google chrome 28, happens on windows 7 machines, not of them. as stands, able replicate issue on 3 windows machines out of five. even if enter direct url .mp4 file in address bar, chrome still won't play it. can here replicate issue? have used few different .mp4 files test, here's one: http://www.w3.org/2010/05/video/mediaevents.html i appreciate help. note: going chrome advances settings , turning off "use hardware acceleration when available" chrome able play video, option turned on default, not perfect solution problem. thanks lot. update: updating video drivers fixed it, again... not ideal solution... we had problem... both webm , theora/ogg worked fine in chrome , mp4 video worked fine on ie9 , in firefox. chrome fails. we manage fix updating video drivers (intel hd on dell pc), looks problem in h.264 acceleration used in chrome , old intel drivers

asp.net - SimpleMembershipProvider in WebSite with Profile -

i created new website in vs2012 - not project - added connection string, created tables, , using aspnet configuration created couple of roles , user, in turn automatically created appropriated tables in database: users, usersinroles, roles, memberships , roles. pretty working expected. 4.5 (simplemembershipprovider) doesn't create stored procedures , code used old membershipprovider. i wanted add fields in profile provider, use membershipprovider: <properties> <add name="mywhatever" type="system.int32" allowanonymous="false"/> </properties> but when try call in code behind, said "profile" doesn't exists. search on web , read vs2012, if create website, instead of project, doesn't come profile default have create custom one. following added following code in appcode cs: namespace mynamespace { public class userprofile : profilebase { public static userprofile getuserprofile(string user...

regex - Perl: search for a match multiple times in a file -

in perl script, opened file , search string. successful. when search same string again right after search, seems script starts searching until end of file, , hence not able find match more. code like: open ( infile, "./input.txt") for($i=0; $i < 3; $i++){ print "i = $i\n"; $found = 0; while (! $found && ($line = <infile>)){ if ( $line =~ /string/ ){ print "found!\n"; $found = 1; } else{ print "not found!\n"; } } } close (infile); the input.txt file: string random2 random2 i expecting output be: i = 0 found! = 1 found! = 2 found! but turns out be: i = 0 found! = 1 not found! not found! = 2 can me this. started learning perl. you're getting because when read file in perl mark last position read in file won't read again, in case read whole file marked end of file , need reset position doing seek beginning again...

php - Fooling around with xml -

i have poorly formed xml in php able contents of, problem strips html tags <content> <whatshere> <![cdata[ <h1>content</h1> ]]> </whatshere> <whatscoming> <![cdata[ <h2>i have no idea</h2> ]]> </whatscoming> </content> i doing: class coretheme_adminpanel_template_helper_grabupdatecontent{ private $_xml_object_content = null; public function __construct(){ if($this->_xml_object_content === null){ $this->_xml_object_content = simplexml_load_file('http://adambalan.com/aisis/aisis_update/test/update_notes.xml'); } } public function whats_here(){ $content = $this->_xml_object_content->whatshere[0]; echo $content; return trim($content); } } when call whats_here() <p>content</p> instead of <h1>content</h1> should. it looks th...

ios - Audio file doesn't play in iPhone 5 -

i use code playing .caf audio file, same code works in iphone 4s , ipad 2 doesn't play @ in iphone 5... this code: -(ibaction)checksound:(id)sender { nsurl *url = [nsurl fileurlwithpath:[nsstring stringwithformat:@"%@/lunatic.caf", [[nsbundle mainbundle] resourcepath]]]; nslog(@"%@",url); nserror *error; self.audioplayer = [[avaudioplayer alloc] initwithcontentsofurl:url error:&error]; self.audioplayer.numberofloops = 0; self.audioplayer.volume = 1; nslog(@"log audioplayer: %@",audioplayer); if (audioplayer != nil) { [self.audioplayer preparetoplay]; [self.audioplayer play]; } if (audioplayer.playing == no) { nslog(@"not playing, error: %@",error); } if([[nsfilemanager defaultmanager] fileexistsatpath:@"file://localhost/var/mobile/applications/0d3f5169-8db1-4398-a09a-db2fbadf57ef/myapp.app/lunatic.caf"]) { nslog(@"file exist"); } else { nslog(@"file doesn't exist...

php - Get information between two strings -

i have following php string $string = "hello world<br>- 8/7/2013<br>hello world"; so basically, need information between dash , space ( - ) , closest line break tag. appreciated! looked hours haven't been successful. don't think preg_replace either. strpos finds index of substring (optionally after specified index), so: $start = strpos($string, '- ') + 2; $end = strpos($string, '<br>', $start); $part = substr($string, $start, $end - $start); ta-da!

How to pass UDT array from excel vba to vb.net -

how pass array of user defined class type byref excel vba vb.net? have similar post deals passing double arrays here , tried using same method udt doesn't work. ideas? sorry answer own question (again) similar other question linked in question, able accomplish in same way answer other question. had change of refraction parameters around. in vb.net code take in parameter object, object's type (which recognizes object() array) , direct cast object array desired class array using following function in vb.net friend function comobjectarraytopointarray(byval comobject object) point() dim thistype type = comobject.gettype dim fibtype type = type.gettype("system.object[]") dim fibarray(0) point if thistype fibtype dim args(0) object dim numentries integer = cint(thistype.invokemember("length", bindingflags.getproperty, _ nothing, comobject, nothing)) redim fibarray(num...

java - Where can I find the list of attributes name? -

i wondering if there list of attributes name referred when using following: however, can set dos attribute using setattribute(path, string, object, linkoption...) method, follows: path file = ...; files.setattribute(file, "dos:hidden", true); in case .ishidden() method referred hidden , isreadonly() ? have tried dos:readonly , other combination, without achieving result wanted. dou know link has list of attribute "reference"? in advance. http://www.kodejava.org/how-do-i-set-the-value-of-file-attributes/ // // set new file attributes. // files.setattribute(file, "dos:archive", false); files.setattribute(file, "dos:hidden", false); files.setattribute(file, "dos:readonly", false); files.setattribute(file, "dos:system", false);

java - how do I solve the brut.androlib.AndrolibException -

i having following exception after decoding apk in debug mode , trying build new apk in debug mode. confused , don't do. when try following getting same result. $java -jar ./apktool.jar d -d meet.apk out $java -jar ./apktool.jar b -d out meet.apk or this $./apktool d -d meet.apk out $./apktool b -d out meet.apk i following output i: checking whether sources has changed... i: smaling... i: checking whether resources has changed... i: building resources... exception in thread "main" brut.androlib.androlibexception: brut.common.brutexception: not exec command: [aapt, p, -f, /tmp/apktool4160944918573250929.tmp, -i, /root/apktool/framework/1.apk, -s, /home/lab2alex/documents/out/res, -m, /home/lab2alex/documents/out/androidmanifest.xml] @ brut.androlib.res.androlibresources.aaptpackage(androlibresources.java:193) @ brut.androlib.androlib.buildresourcesfull(androlib.java:301) @ brut.androlib.androlib.buildresources(androlib.java:248) @ brut.androlib.an...

configuration - Xcode mach-o linker error when archiving project with test targets -

Image
i'm getting mach-o linker errors pointing missing files in test targets when try create archive, can build , run app on both on simulator , device without problems though. i've tried looking @ bundle loader , test host configurations test targets, , both fine. else cause this? in statution, solve issue change bit code enabled build settings. if use 3.party framework in project , these framework not supported bit code compression in release time. must change bit code enabled flag yes no. i hope someone.

delphi - Setting Segoe UI Light programmatically in TJvWizard -

Image
i'm using tjvwizard component , want set header title font use segoe ui light. in form oncreate method i'm doing following: procedure tform1.formcreate(sender: tobject); var i: integer; begin := 0 jvwizard1.pagecount - 1 begin jvwizard1.pages[i].header.parentfont := false; jvwizard1.pages[i].header.title.font.size := 16; jvwizard1.pages[i].header.title.font.name := 'segoe ui light'; end; end; this code sets font size correctly font doesn't change segoe ui light, instead keeps using parent font (which segoe ui.) as workaround, did this: procedure tform1.formcreate(sender: tobject); var i: integer; f: tfont; begin f := tfont.create; f.name := 'segoe ui light'; f.size := 16; := 0 jvwizard1.pagecount - 1 begin jvwizard1.pages[i].header.title.font.assign(f); end; f.free; end; this trick, smells funny me. also, don't know how assign works. keeps reference? should keep f.free line? edit: additional i...

Install4j and Control Panel details -

Image
i'm looking @ install4j "register add/remove item" action , how affects appears in windows control panel programs area. i'm having problem "version" appears in control panel - doesn't match want displayed there, , can't seem figure out that's configured. i use compiler variables store product name , product version. these variables set in media file area under "customize project defaults/compiler variables" under "general settings/application info" in i4j, use "${compiler:product-name}" "full name" , "${compiler:product-version}" "version". these both set in media file. in "register add/remove item" action, "item name" field, use "${compiler:product-name} ${compiler:product-version}". this appears correctly in control panel name (sorry - had redact them posting). however, version appears in control panel not appear way want. i don't ...

amqp - RabbitMQ queue messages -

at rabbitmq web interface @ queue tab see "overview" panel found these: queued messages : ready unacknowledged total i guess "total" messages. "ready" , "unacknowledged" ? "ready" - messages delivered consumer? "unacknowledged" - ? message rates: publish deliver redelivered acknowledge and these messages? "redelivered" , "acknowledge"? mean? ready number of messages available delivered. unacknowledged number of messages server waiting acknowledgement(if client recieved message dont send acknowledge yet). total sum of ready , unacknowledged messages. second question: publish rate how many messages incomming rabbitmq server. deliver rate @ messages requiring acknowledgement being delivered in response basic.consume. acknowledge rate @ messages being acknowledged client/consumer. redelivered rate @ messages 'redelivered' flag set being deliver...

android - Can I set a LayoutTransition with an Animation (instead of Animator)? -

i want make custom transitions on layout. i'd use xml defined "animation" because lets me use percentage values, while "animator" seems take pixel values. problem layouttransition seems take "animator" parameter. layouttransition lt = new layouttransition(); lt.enabletransitiontype(layouttransition.changing); lt.setanimator(layouttransition.disappearing, /*animator*/); view.setlayouttransition(lt); try using animator object defined xml animatorinflater.loadanimator(context, r.animator.your_animation) the xml uses tag: <objectanimator /> this different animation , has different set of properties. these can found at: property animations hope helps.

umbraco6 - Umbraco V6.1.3 Lucene Index Corruption -

just upgraded umbraco v6.1.1 site v6.1.3. went on workstation. copied files web server after deleting there, did same database. set directory permissions , ran site. site (which mvc) runs 2 issues can't fathom , appreciate with. one page errors read past eof error. view it's trying run. error on link in bold. @inherits umbraco.web.mvc.umbracotemplatepage @{ layout = "basepage.cshtml"; } <div class="row-fluid"> <div class="span12"> <h1>@umbraco.field("pagename")</h1> @umbraco.field("pagetext") </div> </div> <div class="row-fluid"> <div class="span12"> @foreach (var page in model.content.children) { <section class="well"> <h3>@page.name</h3> ...

login - Save username and password in a cookie, or send info to url on click -

please note - following post demo site only. not production site. the logic want perform goes this... buttonclick new window opens username/password entered user clicks 'login' user logged in. i have tried this... username:password1@university.edu/portal/server.pt and this... https://university.edu/portal/server.pt?username=someuser&password=somepassword but no avail... this internal company website , not have access outside world. internal demo only edit: assistance on building url has username/password built in can accomplish above logic.

ruby - Redis publish in rails 4 stops server thread -

sorry english, i'm newbie. trying use redis.publish feature rails 4 , redis gem push messages sse. i have block in controller logger.info "test1" $redis.publish "user", "test" logger.info "test2" where $redis - $redis = redis.new(:host => '127.0.0.1', :port => 6379, :db => 1,:timeout => 0) in initializer. server console in production print i, [2013-08-07t22:34:50.138232 #4679] info -- : test1 and nothing. request working, thread stops. by way, $redis.publish "user", "test" @ rails_env=production rails console run , message appear @ client. can me? upd: ruby 2.0-p247, rails 4, redis 3.0.4 don't use 1 connection in initializer subscribe , publish both. i created 2 connections, 1 subscribe in sse writer, 1 in controllers publish, , working normally.

python - Labels Aren't Changing -

i'm going post snippet of code, because essentially, same thing. string = '' time_calc = tk() time_calc.geometry('500x400') time_calc.title("calculate time") time_calc_frame= frame(time_calc).grid(row=0, column=0) jul_box = entry(time_calc) jul_box.insert(0, "julian date") jul_box.pack(side = top) jul_box.bind('<return>') def jd2gd(jd): global string jd=jd+0.5 z=int(jd) f=jd-z alpha=int((z-1867216.25)/36524.25) a=z + 1 + alpha - int(alpha/4) b = + 1524 c = int( (b-122.1)/365.25) d = int( 365.25*c ) e = int( (b-d)/30.6001 ) dd = b - d - int(30.6001*e) + f if e<13.5: mm=e-1 if e>13.5: mm=e-13 if mm>2.5: yyyy=c-4716 if mm<2.5: yyyy=c-4715 months=["january", "february", "march", "april", "may", "june", "july", "august", "september", "oct...

android - Stopwatch on status/ notification bar -

i'm able use stopwatch / timer in activity. how can show stopwatch in notification bar ? i have starttime , elapsedtime values, so: how import/ show working stopwatch on notification bar ? how continue stopwatch on notification bar if app closed ?

r - Evaluating ddply within a function when passed ggplot2 aesthetic mappings as arguments -

i'm working on function create bean plots in ggplot2 , stuck on step calculating medians each group. i've tried couple of solutions @ object not found error ddply inside function , object not found error ddply inside function still unable work. error message returned "error in as.quoted(.variables) : object 'iv' not found" indicates it's not evaluting symbol iv in correct environment. if possible, keep method of passing variables function ggplot2 aesthetic mapping since using same aesthetic mappings violin , rug plots later on in function. the code function: ggbean <- function(data = null, mapping = null, ...){ require(plyr) x <- mapping[['x']] y <- mapping[['y']] # calculate medians each group medfn <- function(mydat, x1, y1){ z <- do.call("ddply",list(mydat, x1, summarize, med = call("median", y1, na.rm=true))) return(z) } res <- medfn(data, x, y) } sample data s...

node.js performance for amazon EC2 instances with ECU's -

i have node.js server. undertsand 1 node process bound 1 cpu/core. have 2 core box, use cluster launch 2 processes utilize 2 cores of box. however, not able understand how work ec2 instances ecu concept. for eg. m1.large instance has 2 vcpus 4 ecu's (effective compute unit) when launch node.js cluster, launches 2 node processes. however, on desktop has 8 cores, launches 8 node processes. now wondering whether node.js sever on m1.large 2 cores , 4 ecus perform better box 2 cores , no ecu's please answer query. amazon ecu virtual core because virtual sever 2 real core of xeon processor.so box real 2 core perform better virtual ecu.and dont think amazon ecu same thing real cpu core amazon elastic cloud . far working nodejs , ec2 on production server set 2 thing utilize max cpu power of m1.large instance. multiple node process behind nginx reverse proxy load-balencer a. set different nodejs process on different port. b. on front of them nginx load bala...

asp.net mvc - RemoteAttribute is not passing parameter to action? -

i trying use remoteattribute validate data element serverside using json. data field is: [display(name = "my number")] [required] [remote("isvalidmynumber","home",errormessage="bummer")] public string mynumber { get; set; } my controller is: public jsonresult isvalidmynumber(string mynumber) { var test = services.validatemynumber(mynumber); return json(test,jsonrequestbehavior.allowget); } my view is: <div class="editor-field"> @html.editorfor(model => model.checkinformation.mynumber) @html.validationmessagefor(model => model.checkinformation.mynumber) </div> the html generated is: <input class="text-box single-line" data-val="true" data-val-remote="bummer" data-val-remote-additionalfields="*.mynumber" data-val-remote-url="/home/isvalidmynumber" data-val-required="the number field required....

c# - Getting my friend from facebook -

i'm learning facebook api writing simple console appliction. i'm trying simple things, code examples found on web (and in stackoverflow). the thing i'm trying do, getting of friends list [name, id]. i run code, #2500 error. here code: class program { static void main(string[] args) { facebookclient fbclient = new facebookclient(); dynamic result = fbclient.get("oauth/access_token", new { client_id = <removed app id>, client_secret = "<removed app secret>", grant_type = "client_credentials" }); fbclient.accesstoken = result.access_token; var friendlistdata = fbclient.get("/me/friends"); jobject friendlistjson = jobject.parse(friendlistdata.tostring()); list<fbuser> fbusers = new list<fbuser>(); foreach (var friend in friendlistjson["data"].children()) { ...

mono - Monodevelop debugging asp.net with xps Metadata file error -

i'm trying run simple asp.net application created monodevelop strange error cs0006: metadata file `/path_to_myhome/c' not found actually don't know how fix it. i've done several search on internet without success. appreciated.

Delphi: how to show up to 4 subpanels as grid -

i way in delphi 7 have on tpanel 1 4 panels/cells grid. can show n x m cells grid, n*m 1 4. each cell resizable splitter, each cell should contain custom tpanel or tframe or whatever. how can it? .net has special component. delphi has such component too? do need implement hand, ie make 4 panels / 3 splitters, , perform align assignments?

ruby on rails - ActiveAdmin building parent objects in child form -

i'd able assign industry_id new business model when create it..or..create new industry instance added new business model when creating new business here models class business < activerecord::base attr_accessible :name, :industry, :owner belongs_to :industry end class industry < activerecord::base attr_accessible :name has_many businesses accepts_nested_attributes_for :businesses end i have tried every way possible create form allow i've had no luck @ all. the formtastic documentation doesn't appear have examples of , neither activeadmin's.

java - Why did I get a "bad operand types for binary operator" error? -

i working on exercise incorporates 1 method another. know getminmax() method has empty array that's irrelevant purpose of exercise. code: public class square{ int area; public square[] getminmax(square[][] arr){ square[] list = new square[2]; return list; } public int getarea(){ return area; } public boolean isdifferencesignificant(square[][] arr){ boolean isit = false; square [] result = getminmax (arr); if((result[1] - result[0])< 0.5) //the line (16) in question isit = true; return isit; } } when compile following error: square.java:16: error: bad operand types binary operator '-' if((result[1] - result[0])< 0.5) ^ first type: square second type: square 1 error i'm lost , want know why error occurred. edit: rohit jain said "you meant - result[1].getarea() - result[0].getarea() " and lochemage said ...