Posts

Showing posts from August, 2011

url - Querying HBase Stargate for a hexadecimal rowkey via Ruby -

i have hbase table (in part) utilizes hexadecimal bytes construct rowkeys. i'm able query hbase shell fine follows get 'my_table', "xyz:\x7f\xff\xff\xff\xff\xff\xff\x82" however, want use stargate api (or 1 of many ruby gems serve wrapper) query hbase remotely. if run exact same query above, 404 not found. note : , \ characters url-encoded. curl "http://myhbaseserver.domain:8080/my_table/xyz%3a%5cx7f%5cxff%5cxff%5cxff%5cxff%5cxff%5cxff%5cx82/content:raw" => 404 not found i know format correct returns table list when call / endpoint. it's not throwing connectivity error. thoughts on whether these characters being escaped? thanks! \x not need encoded, convention used hbase represent non-ascii byte value. \x7f should converted %7f in url

domain driven design - DDD Invariants Business Rules and Validation -

i looking advice on add validation rules domain entities, , best practices implementation. did search , did not find looking for, or missed it. i know recommended way validating properties not null, in range, or length, etc... have seen several ways using isvalid() , other discussions enforcing in constructor entity never in invalid state, or using preprocessing , postprocessing, , others using fluentvalidation api, how invariants impact dry , srp. can give me example of put these sorts of checks, when using app service, bounded context, domain service, aggregate root, entity layering. go, , best approach? thanks. when modeling domain entity, best consider real-world implications. let's dealing employee entity. employees need name we know in real-world employee must have name. impossible employee not have name. in other words, 1 cannot 'construct' employee without specifying name. so, use parameterised constructors! know employees name cannot

javascript - MongoDB fetch from remote API if document not found -

we're in process of rebuilding our current customer portal scratch. our current portal has bunch of cron jobs sync of our client, contact, , invoice records our whmcs billing system, horrible way it. 1 of our developers has suggested using mongodb cache data pulled via whmcs api, work nicely, suggested remembered having setup mongodb if find id didn't result in page, trigger javascript routine on mongodb go , make api call fetch required record. that sounded fantastic, after many hours of googling , reading through mongodb documentation, can't life of me find way on mongodb side. coudl php side (especially since we're using yii2), clean solution mongodb side.. hoping perhaps has come across such use case, , can provide example of doing mongodb?

multithreading - C# Update ProgressBar from Thread -

i have windows form in xaml contains progress bars. threads spawned, jobs run, , status of jobs shown progress bars. it's working ok, want limit number of jobs can run @ 1 time. protected int executingthreads = 0; int maxthreadcount = 3; object lockobj = new object(); public virtual void start() { inqueue = new queue<xelement>(); loadqueue(); while (inqueue.count != 0) { xelement request = inputqueue.dequeue(); system.threading.threadpool.queueuserworkitem(new system.threading.waitcallback(dowork), request); /* lock (lockobj) { executingthreads++; while (executingthreads == maxthreadcount) thread.sleep(1); } */ } /* while (executingthreads != 0) thread.sleep(1); */ } to limit number of jobs running @ 1 time, added code that's shown here commented out lock , sleep

oop - JavaScript: Assign values of arguments object as fields in an Object -

i converting object constructor form of function obj(arg1, arg2, arg3, arg4, ..., argn-1, argn) { this.name = arg1; this.field = arg2; this.etc = arg3; ... } //obj to form of function obj() { var args = array.prototype.slice.call(arguments); var defaultargs = { 'field' : default ... }; ... check args, etc } //obj here code far: function dsobj () { var args = array.prototype.slice.call(arguments); var defaultargs = { 'fields' : values or functions returning values ... }; var options = {}; (var in defaultargs) { if (typeof(args[i] == 'undefined')) { options[i] = defaultargs[i]; } else { options[i] = args[i]; } //check if user supplied argument } //for each possible argument (var name in options) { this.name = options[name]; //trying make fields - wrong } //for each final parameter } //constructor dsobj so, need last part of above constructor. started programmi

ios - Xcode 6: Keyboard does not show up in simulator -

the keyboard not show when run simulator , click in uitextview. how re-enable keyboard? it used work doesn't - don't know might have clicked accident... tips appreciated! i had same issue. solution follows: ios simulator -> hardware -> keyboard uncheck "connect hardware keyboard" mine checked because using mac keyboard, if make sure unchecked iphone keyboard come up.

insert month codeigniter and jquery (beginner learner) -

problem when insert month..on segment show 01,02,03 when insert database show 1,2,3,4 how set 01,02,03 view code $.post("<?php echo base_url('account/save'); ?>", { new_sum:$("#test<?php echo $row['br_loc'];?>").val(), status:$("#status<?php echo $row['br_loc'];?>").val(), sum:$("#sum<?php echo $row['br_loc'];?>").html(), year:<?php echo $this->uri->segment(4)?>, month:<?php echo $this->uri->segment(3)?> }, function(data) { }); }); controller public function save() { $data = array('date_send'=>date("y-m-d"), 'ac_month'=>$this->input->post('month'), 'usr_approve'=>$this-&

ember.js - Access component properties from within yield block -

i have component ui-button-group access properties on yield block. the ui-button-group component has open property. ui-button component can passed property toggled on click. property bound open property of parent ui-button-group component. {{#ui-button-group }} {{#ui-button action="finalize"}} finalize invoice {{/ui-button}} {{#ui-button togglepropery=component.open}} <span class="caret"></span> {{/ui-button}} {{#ui-dropdown }} <li><a href="#">delete</a></li> {{/ui-dropdown}} {{/ui-button-group}} as temporary work around have setup property on controller , passed both ui-button-group , 'ui-button`. anyone know way access component instance within yield block? i pulled off modifying _yield function in component include component context. here working example. http://jsbin.com/xuvuz/2/ update in current release 1.6.0 view property in pas

javascript - calling remote div using bootstrap modal -

i have lot of time trying call remote div using bootstrap's modals when call remote file, calls full page, , need div remote page what can do... here litte piece of code i'm using call remote page <!-- menu list --> <li class="left"><a href="register.php" data-toggle="modal" data-target="#basicmodal"><?php echo $lg["sign_up"]; ?></a></li> and here remote page: <html> <head> <title><?php echo $lg["name"]; ?></title> <!-- header links --> <?php require("includes/inc.headerlinks.php"); ?> </head> <body> <!-- our beautiful menu bar --> <?php require("frames/frame.topbar.php"); ?> <div class="wrapper"> <div id="body"> <div class="modal-header"> <button type="b

java - Sharing model classes in a maven module between apps -

i have webapp model classes containing hibernate annotation defines database properties (e.g. @column, @entity, etc). i'm creating new app writes same database. is idea put model classes maven module shared between apps? that correct approach in case. both scale able , reusable. maven dependencies can used across apps , support versioning well. if mvc type of app developing, models @ best should kept separate , share able across modules.

How to make horizontal lines with words in the middle using CSS? -

anyone have idea how make horizontal lines words in middle using css? the design looks below: ---------------- title ------------------ if understand question correctly <strike> tag used. the <strike> tag not supported in html5 . html5 use <del> tag instead. if meant horizontal lines words in middle... try this: html: <h2><span>this test</span></h2> <p>this content other</p> css: h2 { width: 100%; text-align: center; border-bottom: 1px solid #000; line-height: 0.1em; margin: 10px 0 20px; } h2 span { background:#fff; padding:0 10px; } jsfiddle: http://jsfiddle.net/s5y2x/ credits above code: https://stackoverflow.com/a/5214204/3739658 i tested on firefox , chrome

android - Fields are Nots accommodating in the same page -

Image
i trying create registration page should contain first name, last name, gender, user name, password, email, blood group, address, dob when trying create these list, field not accommodated in same page i able accommodate till email.the rest of fields(i.e blood group,address,dob) not getting accommodated in same page. how add field in same page? code layout page <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview1" android:layout_width="match_parent" android:layout_height="wrap_content"> <linearlayout android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <textview android:id="@+id/fname

mule - How do you configure a method-entry-point-resolver for a method with InboundHeader annotations in a java component? -

i have following component defined in flow: <component doc:name="graduationservice"> <method-entry-point-resolver> <include-entry-point method="getgraduationdateswithpidmorstudentid"/> </method-entry-point-resolver> <spring-object bean="graduationservice" /> </component> i trying call 'getgraduationdateswithpidmorstudentid' method defined in 'graduationservice' bean. here method signature looks like: public object getgraduationdateswithpidmorstudentid(@payload payload payload, @inboundheaders("studentid") string studentid, @inboundheaders("pidm") string pidm ) { ....... } i getting following error: message : failed find entry point component, following resolvers tried failed: [ explicitmethodentrypointresolver: not find entry point on: "edu.ucdavis.iet.apis.students.graduation.service.graduationservice" ar

ubuntu - Using jetbrains appcode IDE on Linux -

in download page of jetbrains website there no download option linux. googled "jetbrains appcode ide on linux". peoples "it's crossplatform". possible run jetbrains appcode ide on linux? can't run on linux(ubuntu/debian) edit: mentioned c++ ide features of appcode needed. if ios features not working, there no problem. appcode requires xcode, requires os x. any workarounds xcode installed , running on linux violate apple's terms of use, , getting appcode install on linux violation of jetbrains' licensing agreement. appcode support c++, there jetbrains c++ ide called clion .

objective c - didReceiveMemoryWarning from UITableView with Images created with url data followed by app termination due to memory pressure -

i setting uitableview, , on side of each cell image 80x80. tableview works when number of cells less 8, more , scroll performance can have minor delay. lot more cells (around 50), scroll performance fine long dont make big swipe down quickly. also, when there lot of cells, if stay on view long , scroll , down, app receive memory warning, , crash. tips helping save memory? of these images pretty large (5000 x 1000), or how clear memory when didreceivememorywarning called? i'm using arc if relevant. here code use set cells: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { customtableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"articlecell"]; if(cell == nil){ cell = [[customtableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:@"articlecell"]; } cell.titlelabel.text = nil; cell.imageright.image = nil; article *article = [self.articles objectatindex:inde

javascript - Typescript Angularjs Controller Scope undefined when calling from Directive -

i'm quite new angularjs , typescript. i'll try keep things short here: the directive (directives/bikedirective.ts): class bikedirective { constructor() { var directive: ng.idirective = {}; directive.restrict = "e"; directive.scope = { move: "=" }; directive.template = '<div>the bike</div>'; directive.link = (scope, element, attrs: any) => { element.on('click', (e) => { scope.move('moving!'); }); } return directive; } } export = bikedirective; the controller (controllers/mycontroller): class mycontroller { whatever: string; constructor(public scope) { this.whatever = "whatever"; scope.vm = this; } onmove(msg: string) { console.log(this.whatever); } } export = mycontroller; the html: <div ng-controller="mycontrolle

java - How to compare a number from different lines of input? -

i had question trying according metric, have determine best line, no. of spaces divided no. of characters in line. line best such ratio gets printed out. can that, if line lower such ratio comes out, not printed. how compare ratios?? see here: import java.util.scanner; public class bestline { public static void main(string[] args) { scanner s = new scanner(system.in); system.out.println("enter line of text: "); double temp = 0.0; while (s.hasnextline()) { string sentence = s.nextline(); string chars = sentence.trim(); int whtspacs = sentence.length() - chars.length(); int totchars = chars.length(); double ratio = (double) whtspacs/totchars; if (ratio < temp) { break; } temp = ratio; system.out.println("best line far is: " + sentence); } system.out.println("best line was: " ); } } thanks telling me using

javascript - Angularjs focus unexpectedly requires an async setTimeout to work -

ok stackoverflow, riddle me this. i have button click on toggles visibility of input. in scope function changes visibility use javascript set focus on input tag. want know why not work unless wrap in settimeout ? $scope.toggle = function() { if ($scope.hideinput) { settimout(function(){ input.focus(); }, 0); // that's right, zero! } $scope.hideinput = !scope.hideinput; }; here's working jsfiddle button correctly sets focus , button doesn't: http://jsfiddle.net/pss99/1/ can tell reason why. first can't focus element, css display:none . so in 1 (broken) method, focus element before displayed. because angular go line line , $scope.hideinput = !scope.hideinput; trigger watcher digest -loop. in loop input set display: block . the timeout move focus command it's own thread, , $scope.hideinput = !scope.hideinput; trigger digest , too. digest curiously fast enought display element before input.focus(); executed. this ex

WPF GridSplitter strange behavior when Column Width="Auto" -

Image
i have pretty simple layout, look: <grid> <grid.columndefinitions> <columndefinition width="*" minwidth="200"></columndefinition> <columndefinition width="5"></columndefinition> <columndefinition width="auto" minwidth="50"></columndefinition> </grid.columndefinitions> <border grid.column="0" borderbrush="red" borderthickness="2"> <!-- picture--> <image source="/resources/previewtest.png"></image> </border> <gridsplitter grid.column="1" width="5" horizontalalignment="center" verticalalignment="stretch" resizebehavior="previousandnext"></gridsplitter> <expander grid.column="2&

javascript - Uncaught TypeError: Cannot set property 'innerHTML' of null -

i making barcode scanning app using phonegap-1.4.1 android. need define n array code[] can store barcode text scanned , need define variable k act counter incremented 1 after every scan can store detail in code[k] . here previous javascript file have defined array , variable counter. localstorage["counter"]=0; var code = new array(100); localstorage.setitem("code", json.stringify(code)); and here js file calling stored array , printing value stored in array "id" . myvalue1 barcode text obtained scan. var barcodeval = localstorage.getitem("myvalue1"); var test2 = localstorage.getitem("code"); code = json.parse(test2); var k = parseint(localstorage.getitem("counter")); code[k] = "code[k]"; document.getelementbyid(code[k]).innerhtml = barcodeval; k = k + 1; localstorage["counter"]=k; localstorage.setitem("code", json.stringify(code)); i calling

node.js - How to pass data to client out of "app.get"? -

how pass data client out of "app.get"? there 2 server(front, back) clients connect front server, front server server, server db when client logs in front server front server pass request server back server search log in information db after search, server return result front server however, because front server http server app.get ("/ login /: id / password), function (request, response) { // send login data server // because dont know db result can't response 'response' variable }; when front server received result of log in the code out of "app.get" so can't access response variable ( response.end( "result" ) ) how pass result of log in client? you can pass response client side of response object. app.get("/ login /: id / password), function (request, response) { // send login data client side var logindata = { name: 'admin', password: 

html - Star ratings not expected behaviour -

Image
i understand using same ids , names , might causing issue. the star rating segment that: <span class="rating"> <tr> <td>quality</td> <td> <span class="rating"> <% (1..5).each_with_index |quality, i| %> <%= radio_button_tag "rating-input-1-#{i+1}", quality, endorsement.quality == quality, class: 'rating-input', id: "rating-input-1-#{i+1}" %> <%= label_tag "rating-input-1-#{i+1}", nil, class: 'rating-star' %> <% end %> </span> </td> </tr> <tr> <td>cost</td> <td> <span class="rating"> <% (1..5).each_with_index |cost, i| %> <%= radio_button_tag "rating-input-1-#{i+1}", cost, endorsement.cost == cost, class: 'rating-input', id: "rating-input-1-#{i+1}" %> <%= label_tag

c# - How to use array in two different forms? -

this question has answer here: how share data between forms? 1 answer i'm trying use 1 array declared in 1 form, plot graph zedgraph, in different form. how need declare array , where? short answer: don't declare array in first form. declare in separate component/class/whatever instead, , let both forms access array there. way, array should independent of forms, , both can use it.

parsing - Ez-Vcard retrieval of email and address -

there inbuilt functions in getting structuredname , formattedname. email there no such method. using maven project , have added dependency in pom.xml. <dependency> <groupid>com.googlecode.ez-vcard</groupid> <artifactid>ez-vcard</artifactid> <version>0.9.4</version> </dependency> vcard.getformattedname().getvalue() is working fine , fetching name. vcard.getemail().getvalue() is not working. there library missing? or method fetch details vcard. i using fetching telephone details , null. please advice. for(telephone tel: vcard.gettelephonenumbers()) { string number=tel.gettext(); } thanks arun use getemails() method, so: for (email email : vcard.getemails()){ string value = email.getvalue(); }

angularjs cacheFactory is empty -

i store keys in cache using angularjs cachefactory myapp.factory('somecache', function ($cachefactory) { return $cachefactory('somecache', { capacity: 10 // optional - turns cache lru cache }); }); in code : somecache.put(key, value); i see keys , values in console. problem , when redirect page, not in website ( e.c www.ebay.com) , come cache object empty, needd preserve data on page. any idea ? ishay the behaviour see $cachefactory expected. angularjs-cache not persist between page refreshes. see also: angularjs: date expiration $cachefactory what need use persist data between page refreshes localstorage or sessionstorage explained on site: dom storage guide you should use excellent ngstorage module.

thread handling c++ linux OS -

i have 3 functions in project written in c++. in same .cpp file , have 2 header files. now, have 3 corresponding threads that, second thread takes output first thread,and last thread waits until second thread end operations.note threads in "forever loop" i.e. while(1){....} source.cpp looks this: #include <iostream> #include "source.h" #include "glob_variables.h" #include "armadillo" #include <vector> using namespace arma; using namespace std; void source::first_function(int size) { for(int i=0;i<size;i++) { container.push_back(i);//container global variable vector of type int declared in glob_variables.h } } //~~~~~~~~~~~~~~~~~~~~~~ void source::second_function() { //sleep until first function fills the vector set set size matrix.n_rows matrix.set_size(container.size(),33); for(int i=0;i<container.size();i++) { for(int j=0;j<50;j++) { matrix(i,j)=i+j;//matrix global variable in

android - Sencha ExtJs 5 build native app -

is possible generate android native app extjs 5 project? i've googled lot on topic , still not clear if possible generate .apk file. find instructions on generating native apps using sencha touch , phonegap/cordova, that's not i'm looking for. so once again, know if it's possible package extjs 5 project (not touch) native app. to create native application, can copy build of extjs 5 application (generated sencha cmd) android application, , load index.html webview component.

amazon ec2 - Which tool makes deployments of java applications on EC2 easier? -

i have (simple spring-boot) java application want deploy , run on our ec2 platform. there (apart custom ec2 solution) opsworks , beanstalk, think opsworks better fit because easier extend. which tool fill best gap between user code , ec2 platform? want to: be able startup , shutdown application, i.e. want usual exit hooks run on application restart/stop/shutdown notice when application startup fails. (deploy should not marked successful or application shall no healthy). guess part needs preparation in user code, container or run script can notified once setup successful. the default java config of opsworks adds additional apache httpd in front of tomcat. don't additional component because introduces additional parts have debug in case of errors (timeout configs example). so recommend war or jar solution? use opsworks? , if use opsworks, use additional layer/tool managing deployments? deployment must possible on command line (so can automate alpha deploys jenkins). m

java android change action_settings text -

is there anyway change action_settings text in run time? possible in strings.xml file want in run time. tried before? i not sure if on right path, want display time @ location of "settings" text. settings appear on right top corner of application. on title bar. thinking change text of settings label resource, should work. you can use settitle . for example menuitem settings = menu.finditem(r.id.action_settings); settings.settitle("your title"); you can call code in onprepareoptionsmenu . i hope you.

iplimage - How get the color format in Opencv? -

in c++, how can color format (rgb or bgr example), object cv::mat or cv::iplimage ? the image type not part of image specification in opencv. user needs know , track actual color format. in cases, not problem since format of source of image known. rule of thumb, rgb image sources (webcams, files etc.) represented bgr, should check particular domain.

xsd pattern not working with more than two regex separated by OR ( | ) -

i facing problem following xsd pattern ... <xsd:pattern value="\d+(,\d+)*(,[*])|\d+(,\d+)*|\d+(,[*])(,\d+)+" /> in above pattern want allow user enter following patterns only: 1,2,3 1,*,3 1,2,* but when try enter 1,2,* gives me following exception ... unknown exception occurred while updating = input string: "*" i not see wrong expression can improved , doing might prevent error. fault might in way results of regular expression used, not regular expression itself. the regular expression given in question \d+(,\d+)*(,[*])|\d+(,\d+)*|\d+(,[*])(,\d+)+ . testing in notepad++ v6.5.5 shows matches 3 example lines, expression not anchored start , end of line. adding 1 ^ , 1 $ not sufficient because of precedence of | . using expressions matches lines: ^(\d+(,\d+)*(,[*])|\d+(,\d+)*|\d+(,[*])(,\d+)+)$ could use ^\d+(,\d+)*(,[*])$|^\d+(,\d+)*$|^\d+(,[*])(,\d+)+$ seems harder read , understand. within regular expression the [*]

jQuery menu is displayed behind my div element -

in page have 2 divs - 1 holding jquery menu , other jquery.datatable (extension datatables.net). <div id='divmenu'/> <div id='divtable'/> i render data table in second div $('#divtable').append(mytable); mytable.datatable({...}); then dynamically construct jquery menu , append first div $('#divmenu').append(mymenu); mymenu.menu(); now when i'm expanding menu of submenu actions go under(behind) second div. can advise anything? thank you... you need use z-index css property. documentation .

c++ - Compiling Qt 5.3 from sources fails -

i compiling qt 5.3 sources , getting errors, in particular one: error: ‘qv4::property::property(const qv4::property&)’ private my configure options are: ./configure -no-compile-examples -no-opengl -no-openssl -no-fontconfig this result of gmake: make[3]: entering directory `/home/niko/qt-everywhere-opensource-src-5.3.1/qtdeclarative/src/qml' g++ -c -pipe -o2 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -wall -w -d_reentrant -fpic -dqt_no_mtdev -dqt_no_libudev -dqt_no_url_cast_from_string -dqt_no_integer_event_coordinates -dqt_build_qml_lib -dqt_building_qt -dqt_no_cast_to_ascii -dqt_ascii_cast_warnings -dqt_moc_compat -dqt_use_qstringbuilder -dqt_deprecated_warnings -dqt_disable_deprecated_before=0x050000 -dwtf_export_private= -djs_export_private= -dwtfreportassertionfailure=qmlwtfreportassertionfailure -dwtfreportbacktrace=qmlwtfreportbacktrace -dwtfinvokecrashhook=qmlwtfinvokecrashhook -denable_llint=0 -denable_dfg_jit=0 -denable_dfg_jit_utili

Grails - collection propery don't get rendered to JSON/XML -

i have domain class has collection type property. i'd render json, or xml won't show. don't know why that's so. here's example: class bag { list things } but renders (in json) as: {"class":"com.mystuff.bag","id":null} even if put objects in list. check problems? update 1 i tried doing same thing on project , can see list getting marshalled json no additional configuration. other project test 1 using more vanilla settings. don't remember changing config on actual project though. update 2 so testing code , found out json marshalling works fine collections, until place domain class inside @mock , @mock(bag) . i'm not sure why happening. assume whatever @mock domain classes, grails run-app well.

node.js - Set content type in restangular for put request globally -

i using nodejs server , restangular (angular framework) build restfull api. when make post request, form data sent in request payload(body). but when make put request, form data appended url query string. how can configure restangular send form data inside body similar post request? use customput() instead of put(). baseobj.customput(newobj).then(callbackfunction);

ios - Xcode Date Formatting - Format from RSS -

i have trouble this, , keep seem find resource learn exhaustively. trying use date formatter in xcode objective c, not setting date format correctly. here data: fri, 27 jun 2014 12:33:18 +0000 can assist me or point me in right direction? trying below code, not working. nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setlocale:[[nslocale alloc] initwithlocaleidentifier:@"en_us"]]; [dateformatter setdateformat:@"eee, d lll yyyy hh:mm:ss z"]; update: format below might help, shows 0 padding on day. wed, 02 jul 2014 11:47:35 +0000 according unicode technical standard #35 , "lll" date format "stand-alone month" "a month name without associated day number". should use "mmm" instead: [dateformatter setdateformat:@"eee, d mmm yyyy hh:mm:ss z"]; example: nsstring *str = @"fri, 27 jun 2014 12:33:18 +0000"; nsdateformatter *dateformatter = [[nsdateformat

java - Create an executable jar for Swing app -

i have created java application called app.java . uses gson. hence created jar gson.jar , created manifest file ( manifest.mf ) following content. manifest-version: 1.0 class-path: test.jar gson.jar main-class: app i created test.jar using following command: jar cfm test.jar manifest.mf * edit: jar cfm test.jar manifest.mf * is producing jar seen on disk. and run using java -jar test.jar the application throws classnotfoundexception exitlistener . when code uses exitlistner removed, runs normal run using java app. missing? either add jar has exitlistener class in in class-path class-path: test.jar gson.jar <exitlistenerjar> or write own exitlistener , use in app. edit on other thought can use code , add application import java.awt.event.windowadapter; import java.awt.event.windowevent; public class exitlistener extends windowadapter { public void windowclosing(windowevent event) { system.exit(0); } }

ember.js - Ember-CLI: Initializers and and Initializer subclass -

currently, in ember-cli initializer defined so: // app/initializers/observation.js export default { name: 'observation', initialize: function() { // code } }; in case, how define sub-class of initializer... following code correct? // app/initializers/close-observation.js export default ember.observation.extend{ newproperty: 1, otherproperties: 2 }; just import base initializer variable , extend that. import observation './observation'; export default observation.extend{ newproperty: 1, otherproperties: 2 };

junit - Eclipse (java) is there a way to run automatically unit tests when running my app -

i'm developing java under eclipse. i want automatic playing unit tests (junit tests) before running application. i.e when clicking on run -> java application unit tests run , , after finish run, application run. (i know can run unit test , app separately, want in 1 shot) is possible? there's infinitest eclipse plugin runs tests not before run app, after each change make codebase. it's smart enough detect tests affected given change runs relevant tests, isn't performance overhead.

Perl/awk/sed Program to convert rows to columns between identifiers -

my input file format: .set abc col2=123 col3=xyz col4=bcd col5=efg .set prs col3=456 col5=kda my output format: abc~123~xyz~bcd~efg prs~~456~~kda thanks using awk awk '{printf (/^\.set/?rs:"~")"%s",$0} end {print ""}' file .set abc~col2=123~col3=xyz .set prs~col2=456~col3=kda if blank line @ top of output problem, do: awk 'nr>1{printf "%s"(/^\.set/?rs:"~"),a} {a=$0} end {print a}' file .set abc~col2=123~col3=xyz .set prs~col2=456~col3=kda /^\.set/ line start .set ? ?rs yes, use rs new line :"~" no, use ~` field separator. so test in formatting see if should use newline or ~ updated correct result after op change requested output. awk -f= 'nr>1{printf "%s"(/^\.set/?rs:"~"),a} {a=/^\.set/?$0:$2} end {print a}' file .set abc~123~xyz .set prs~456~kda

vb.net - event handler in a resources dictionary xaml -

i have written little code in vb.net: first main window: <window x:class="mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <window.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="dictionary.xaml" /> </resourcedictionary.mergeddictionaries> </resourcedictionary> </window.resources> <grid> <button content="button1" height="23" horizontalalignment="left" margin="35,35,0,0" name="button1" verticalalignment="top" width="75" /> <button content="button2" height="23" horizontalalignment="left" margin="35,85,0,0" name="but

xmpp - roster.getEntities() always return null aSmack android -

i want make chat application using xmpp , asmack facing problem: unable users on server. first made connection logged , tried retrieve users empty collection. public void connect() { final progressdialog dialog = progressdialog.show(this, "connecting...", "please wait...", false); thread t = new thread(new runnable() { @override public void run() { // create connection connectionconfiguration connconfig = new connectionconfiguration( host, port, service); xmppconnection connection = new xmppconnection(connconfig); try { connection.connect(); log.i("xmppchatdemoactivity", "connected " + connection.gethost()); } catch (xmppexception ex) { log.e("xmppchatdemoactivity", "failed connect " + connection.gethost());

How to deserialize this json file in vb.net with json.net? -

i using json.net library , have json file want deserialize: { "jsonversion": 3, "levelmasteryscore3": 70000, "boosts": { "preboostsupergems": { "enabled": 1, "jsonversion": 1 }, "preboostthreemoves": { "enabled": 1, "jsonversion": 1 }, "preboostcolorsplash": { "enabled": 1, "jsonversion": 1, "excludedcolors": [ "g" ] }, "jsonversion": 1 }, "name": "0017", "movelimitobjective": { "movelimit": 19, "jsonversion": 1 }, "gemspawnchance": { "r": 20, "b": 20, "g": 0, "p": 20, "y": 20 }, "levelmasteryscore1": 20000, "board": { "tiles": [ [ "x", "x", "x", "x", "x", "x", "x" ], [

javascript - Ordinate Div by H1 name -

i sort in alphabetical order of box using h1 tag. this ​​the code: <div id="test"> <div class="box"> <div class="internalbox"> <h1><a href="http://www.example-t.it">third</a></h1> <p>sem lacinia quam venenatis vestibulum.</p> </div> </div> <div class="box"> <div class="internalbox"> <h1><a href="http://www.example-f.it">first</a></h1> <p>sem lacinia quam venenatis vestibulum.</p> </div> .... </div> <script> $( ".box h1", "#test" ).sort(function( a, b ) { return $( ).parents('.box').html() > $( b ).parents('.box').html(); }).appendto( "#test" ); </script> and here example http://jsfiddle.net/5fap4/ how can do? thanks t