Posts

Showing posts from June, 2015

boost - How to save strings in array after tokenizing it c++? -

my input.txt file looks this. "55.2""4""1""0""d""e""a" so wrote small cpp tokenize boost. #include <iostream> // cout, endl #include <fstream> // fstream #include <vector> #include <string> #include <algorithm> // copy #include <iterator> // ostream_operator #include <boost/tokenizer.hpp> int main() { using namespace std; using namespace boost; string data("input.txt"); ifstream in(data.c_str()); if (!in.is_open()) return 1; typedef tokenizer< escaped_list_separator<char> > tokenizer; vector< string > vec; string line; while (getline(in,line)) { tokenizer tok(line); vec.assign(tok.begin(),tok.end()); if (vec.size() < 1) continue; copy(vec.begin(), vec.end(), ostream_iterator<string>(cout, "-")); cout ...

python - Sklearn GridSearchCV, class_weight not working for unknown reason :( -

trying class_weight going . know rest of code works, class_weight gives me error: parameters_to_tune = ['min_samples_split':[2,4,6,10,15,25], 'min_samples_leaf':[1,2,4,10],'max_depth':[none,4,10,15], ^ syntaxerror: invalid syntax here code clf1 = tree.decisiontreeclassifier() parameters_to_tune = ['min_samples_split':[2,4,6,10,15,25], 'min_samples_leaf':[1,2,4,10],'max_depth':[none,4,10,15], 'splitter' : ('best','random'),'max_features':[none,2,4,6,8,10,12,14],'class_weight':{1:10}] clf=grid_search.gridsearchcv(clf1,parameters_to_tune) clf.fit(features,labels) print clf.best_params_ does spot mistake making ? i assume want grid search on different class_weight 'salary' class. the value of class_weight should list: 'class_weight':[{'salary':1}, {'salary':2}, {'salary':4}, {'sala...

xcode - library not found for -lAFNetworking -

i have project on bitbucket builds fine on 1 machine. cloned on machine, did pod install , installed fine. open .xcworkspace , won't build because of error in title of post. when project deleted original machine , cloned there (pods installed, etc.) builds fine. i don't don't know what's different other machine or information can provide here ask question. here's contents of podfile: # uncomment line define global platform project source 'https://github.com/cocoapods/specs.git' platform :ios, "7.0" link_with 'extender', 'definitiveextender' pod 'zipzap', '~> 7.0' pod 'sqkpieprogressview', '~> 1.0' pod 'afnetworking', '~> 2.3' pod 'mbprogresshud', '~> 0.9' pod 'reachability', '~> 3.1' pod 'hockeysdk', '~> 3.5.7' pod 'parse', '~> 1.4' i ran same issue. in case happening reason l...

Referencing dlls without copying them C# -

when create new c# project , reference dll, dll copied project's output directory when compiling project. is there way of referencing dll files , not copying them project's output directory, , have executable work them when being run (something assemblies if i'm not mistaken)? i tried accessing reference dll's properties, , changed copy local false didn't (probably because dll depending on other dlls located in dll's directory). is there way of doing that? actually can have assemblies copied gac not ideal solution. you have remember each assembly copied gac has strong named . if projects uses nuget packages problem install packages gac. believe not purpose of using nuget either. another option loading dlls different directory default bin folder using <codebase> tag in configuration: <configuration> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly>...

oracle11gr2 - Explicit table locking to disable DELETES? -

using oracle 11gr2: we have process cleans particular tables deleting records them past specified retention date (based on comparison between timestamp when record finished processing , retention date). writing code alert team if process fails. way can see process possibly failing if deletes disabled on particular table trying clean up. i want test alerts make sure work , correct having process fail. if temporarily exclusively lock table, disable deletes , cause procedure deletes records fail? or disable ddl operations? there better way this? assuming "fail" means "throw error" rather than, say, exceeding performance bound, locking table won't accomplish want. if locked every row via select update in 1 session, delete job block forever waiting first session release lock. wouldn't throw error , wouldn't cause process fail definitions. if monitoring includes alerts jobs running longer expected, however, work well. if monitoring proc...

How to find count of children of root nodes json data in angularjs -

i have following array of json data. there 2 root nodes , there subnodes of root nodes , sub-nodes of sub-nodes. need find how many subnodes root node has. have no idea how that. [ { "id": "0", "name": "subscriber" "suscribers": [ { "id": "0", "name": "suscriber 1" "events": [ { "id": "0", "name": "subscriber" "suscribers": [ { "id": "0", "name": "suscriber 1" }, { "id": "1", "name": "suscriber 1" } ...

javascript - Issue Updating one Html.TextBoxFor based on value of another -

i'm trying use simple jquery change text of 1 textbox half of numeric value of textbox's text. my script: <script> $(document).ready(function () { $('#inventoryvalue').keyup(function () { var stringvalue = $(this).text; var floatvalue = (parsefloat(stringvalue).tofixed(2)) / 2; $('#fiftypercentmultiplier').text(floatvalue); }); }); </script> my textboxes defined so: <tr> <td> <b>@html.labelfor(model => model.inventoryvalue, new { @class = "control-label col-md-2" })</b> </td> <td> @html.textboxfor(model => model.inventoryvalue, new { id = "inventoryvalue" }) @html.validationmessagefor(model => model.inventoryvalue) </td> </tr> <tr> <td> <b>@html.labelfor(model => model.fiftypercentmultiplier, new { @class = "control-label col-md-2" })</b...

java - Sharing objects with jersey json REST client -

i have written rest service using jersey maps object-structure json-result, like: @get @produces(mediatype.application_json) @path("/orders/{id}") public order getbyid(@pathparam("id") string orderid) { return orderservice.getbyid(id); // simplified } it works , returns order object structure json structure. now (jersey) client accesses rest service , gets json structure back. can parse json structure, nice map (the server's) object structure. but server's objects contain many jpa-annotations , other import s client not know about. how can share anyway server object structure (unannotated?) pojos client? tia! try java generator json https://javafromjson.dashingrocket.com/

jquery - Hide / customize cursor during HTML5 drag -

i'd customize mouse cursor during html5 drag operation because it's 1 thing setdragimage representing object being dragged (not in ie) looks pretty awful having standard mouse cursor superimposed. case when 'dragimage' small , there no way control opacity of 'dragimage'. i have various css cursors specified on drop target these disabled / ignored both chrome , firefox during drag. leaves standard unattractive arrow-and-dotted-box. here's fiddle: http://jsfiddle.net/mcau/wect6xuy/8/ here's html: <img draggable id="i" src="http://icons.iconarchive.com/icons/icons8/windows-8/64/diy-paint-bucket-icon.png"/> <table> <tr> <td class="a">copy</td> <td class="b">none</td> </tr> <tr> <td class="c">move</td> <td class="d">crosshair</td> </tr> </table> here...

genetics - Why are some SNPs assigned to the wrong position or even chromsome -

when lifting genome wide data came across issue, rs-numbers have merged. leads me point, snp must have been misassigned wrong position once (or wrong chromosome). after time, laboratories must have realized mistake , corrected it. in case old rs-number retracted , "old" rs number used snp. ok, far good. question concerns question, technical issues or problems can cause such misaligment: which can technical reasons, snp assigned wrong position (or chromosome)? how possible @ all? see: https://en.wikipedia.org/wiki/dbsnp#release see question, plus ones follow in same section: http://www.ncbi.nlm.nih.gov/books/nbk44417/#content.i_heard_that_rs_numbers_are_not and this: https://www.biostars.org/p/8040/

java - Arraylist is not returning the object -

i dunno missing concept, have coded small project maintains contacts using java arraylist , gui. there add, delete,seach,first,last,previous,next,exit,clear buttons in application. buttons except first , last working fine. problem getting in function displayfirst**() here code addressbookdemo.java public void actionperformed (actionevent e){ if (e.getsource () == jbbsave){ saveperson(); clear(); } else if (e.getsource() == jbndelete){ deleteperson(); clear(); } else if (e.getsource() == jbnfirst){ displayfirstrecord(); clear(); } else if (e.getsource() == jbnlast){ displaylastrecord(); clear(); } else if (e.getsource() == jbnsearch){ searchperson(); } else if (e.getsource() == jbnforward){ displaynextrecord(); } else if (e...

javascript - Delay in function calling -

the code is: settimeout(function () { $(id_lastchild).click(); $("#upload_download_doc").hide(); }, 150); settimeout(function () { $(id_lastchild).click(); $("#upload_download_doc").hide(); }, 100); but want above in function like function click_hide_scroll(){ $(id_lastchild).click(); $("#upload_download_doc").hide(); } implementation looking is delay(100).click_hide_scroll().delay(100).click_hide_scroll(); that means after 100ms delay call click_hide_scroll() function , after completion of , 100ms delay, call function again. is possible? or there other code this? try callback() function callagain(){ $(id_lastchild).click(); $("#upload_download_doc").hide(); } function click_hide_scroll(callback){ $(id_lastchild).click(); $("#upload_download_doc").hide(); settimeout(callback, 100); } settimeout(function() { click_hide_scroll(callagain)}, 100);

android - How to disable PreferenceFragment transparency? -

Image
i guess it's ok set background color in average fragment average layout, here i've got preferencefragment , layout ( preferencescreen ) doesn't support android:background field. what's neat way handle it? add following preferencefragment class declaration @override public view oncreateview(@nonnull layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = super.oncreateview(inflater, container, savedinstancestate); if (view != null) { view.setbackgroundcolor(getresources().getcolor(android.r.color.background_dark)); } return view; }

ios8 - UIWebView Recalculating the intrinsic content size when orientation changes -

uiwebview working whenever launched first in potrait mode. but after switching landscape mode, though specify - (void)viewwilltransitiontosize:(cgsize)size withtransitioncoordinator:(id<uiviewcontrollertransitioncoordinator>)coordinator { [super viewwilltransitiontosize:size withtransitioncoordinator:coordinator]; [self layoutsubviews]; } please advise how can make uiwebview recalculate intrinsic contentsize of not rendered in landscape mode just have use animatealongsidetransition:completion: method - (void)viewwilltransitiontosize:(cgsize)size withtransitioncoordinator:(id<uiviewcontrollertransitioncoordinator>)coordinator { [coordinator animatealongsidetransition:^(id<uiviewcontrollertransitioncoordinatorcontext> context) { uiinterfaceorientation orientation = [[uiapplication sharedapplication] statusbarorientation]; // whatever } completion:^(id<uiviewcontrollertransitioncoordinatorcontext> co...

How can I get input value to work in Javascript -

i learning javascript , trying create today. have text box, submit button , hidden p tag called "demo". want user enter either number or text. if user enter number 1 thing , if user text thing. please see code (any input help...): <%@ page language="c#" autoeventwireup="true" codebehind="practice.aspx.cs" inherits="javascript.javascript.practice" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script> function takeaction(){ var x = document.getelementbyid("textid").value; // var y = document.getelementbyid("demo").innerhtml=("you entered "+x + "."); if (x == number) { function num...

c# - reducing Excel access time -

i'm working in c# excel files, using microsoft.office.interop.excel. problem program runs slow. basically, iterate through cells of excel sheet, , read data in each 1 of cells. i use following command: value = (range.cells[row, col] excel.range).value2; where value variable, , range interop.excel object of range class. is there beter way in interop access access file , or library should use? if @ possible, use library epplus, more faster interop , lot easier program. if not possible due external constraints, try reduce number of interop calls as possible. doing looping in excel asking trouble - since each cell has acessed via interop , marshalling of data excel app eats lot of time. better use get_range() whole array in 1 go. single request take long time, looping in c# extremely fast afterwards. in general, beneficial can on c# side - if excel offer same functionality.

angularjs - Open button in new window/tab angular -

i enable "open in new window / tab" on button. frankly, tried many ways, , unluckily doesn't work. here button: <button class="button no-margin-bottom" data-ng-click="vm.navigatetoproject(project)" data-sd-secured data-sd-secured-contextual="project.permissions.canviewprojectdetails" data-translate>projects.view</button> any ideas? what want achieve new window / tab? run angular application in parallel, or have external link? if want run in parallel, there few issues you'll come across concerning shared data. can read more in post: angularjs: open new browser window, yet still retain scope , controller, , services but if want option open new tab, can done easily: simplest - html solution: <a href="#" target="_blank">link/button</a> or using javascript alone: window.open('https://stackoverflow.com/', '_blank'); here can see more approach how open url in ...

.net - integrating external application exe file in java -

i have 2 external application exe files(written in .net language) need integrate inside java application. understand can integrate , run exe's in local system through process java api. when deploy java app through weblogic how execute/call windows exe files? please suggest.

c# - Xamarin.Forms: Directory.GetFiles -

i developing xamarin forms application. trying getting lifes certian server directory. peace of code work on of .net applications. public static string[] getfiles { string[] filepaths = directory.getfiles("www.site.com/files"); } however directory class not exist in system.io in xamarin. there other way this? pcl's not support direct file i/o classes, because windows phone supports isolatedstoarge file i/o. you can either use dependencyservice inject platform specific file i/o forms app, or @ pcl-friendly file i/o packages pclstorage .

javascript - Slow change two SVG, -

why beginelement(); not work in firefox? demo https://jsfiddle.net/zpo2n8uf/8/ the initial decision http://jsfiddle.net/zpo2n8uf/3/ not come fact icon clicked rapid flashing var svganim = $('.fox_btn svg animate'); var playobj = { from: 'm11,10 l17,10 17,26 11,26 m20,10 l26,10 26,26 20,26', to: 'm11,10 l18,13.74 18,22.28 11,26 m18,13.74 l26,18 26,18 18,22.28', dur: '0.2s', keysplines: '.4 0 1 1', repeatcount: 1 }; var pausobj = { from: 'm11,10 l18,13.74 18,22.28 11,26 m18,13.74 l26,18 26,18 18,22.28', to: 'm11,10 l17,10 17,26 11,26 m20,10 l26,10 26,26 20,26', dur: '0.2s', keysplines: '.4 0 1 1', repeatcount: 1 }; $('.fox_btn').on('click', function() { if($(this).hasclass('play')) { svganim.attr(pausobj).get(0).beginelement(); } else { svganim.attr(playobj).get(0).beginelement(); }...

rest - KairosDB in Java - using the client to delete high volumes of data -

let me know if posted incorrectly, here. (note: kairosdb on top of cassandra. uses hector). i'm using kairosdb java client dump large amounts of sample data datastore. dumped 6 million in, , attempting delete of method follows: public static void purgedata(string metricstype, httpclient c, int num, timeunit units){ try { system.out.println("beginning method"); c = new httpclient("http://localhost:8080/api/v1/datapoints/delete"); querybuilder builder = querybuilder.getinstance(); system.out.println("preparing delete info"); builder.setstart(20, timeunit.months).setend(1, timeunit.seconds).addmetric(metricstype); system.out.println("attempted delete info"); queryresponse response = c.query(builder); //system.out.println("json: " + response.getjson()); } catch (exception e) { system.out.println("adding data points produced error"); ...

javascript - Target function and dynamic variable values in ImageSlider -

i'm asking question yet time... have thumbnails, upon clicking need more detailed version open, next/previous navigation buttons. speaking, works - when click thumbnail 5 (for example) - slide 5 opens. but! when click 'next' - image slider count kicks in , second slide opens, if displayed 1 had index of 1. now, since openning of expanded version triggered 'target', there way dynamically define image counter (currentindex) using target? and html is: <div id="rooms"> <ul id="check-rooms"> <li class="room_c"><div class="room_list" data-room="one"><img src="site-assets/photos/rooms1.jpg"><div class="room-description"><span class="label_bold">Эконом</span><br><span class="desc"> Две кровати</span></div><div class="room_box"><a href="/photos"><span class="came...

shell - VBScript Removing a network shortcut if it exist -

i trying check see if network location shortcut in network shortcut if exist delete , make 1 called homedrive. how ever makes homedrive doesnt delete old one. old 1 registered username hense why used %username%. need deleting thank in advance const nethood = &h13& set objwshshell = createobject("wscript.shell") set objshell = createobject("shell.application") set objfolder = objshell.namespace(nethood) set objfolderitem = objfolder.self strnethood = objfolderitem.path set shell = createobject("wscript.shell") set fso = createobject("scripting.filesystemobject") networkpath = shell.specialfolders("nethood") shortcut = networkpath & "\%username%.lnk" if fso.fileexists(shortcut) fso.deletefile shortcut end if strshortcutname = "homedrive" strshortcutpath = "\\homer-2\it$\%username%" set objshortcut = objwshshell.createshortcut _ (strnethood & "\" & strshor...

jquery - Rails ajax call returns 500 -

i have got ajax call deletes data database. data deleted properly, action returns failure ... code looks this: def remove_user_from_group @usergroup = usergroup.find params[:usergroup_id] @user = user.find params[:user_id] @usergroup.users.delete(@user) if @usergroup.save flash[:notice] = t("flash.deleted") render :add_user_to_group else flash[:notice] = t("flash.login_failed_nouser") render :add_user_to_group end end whats going wrong? same adding data , works fine.

c# - How to get the values from Html.ListBox in asp.net MVC -

i had before <div class="form-group"> @html.label("empresa", new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.dropdownlist("empresa", new selectlist(empresas, "id", "nombre"), new { @class = "form-control" }) </div> </div> and on controller values: (check request.form line) public async task<actionresult> create( [bind( include = "userprincipalname,accountenabled,passwordprofile,mailnickname,displayname,givenname,surname,jobtitle,department" )] microsoft.azure.activedirectory.graphclient.user user) { activedirectoryclient client = null; try { client = authenticationhelper.getactivedirectoryclient(); } catch (exception e) { if (request.querystring["reauth"] =...

javascript - why is droppable not accepting the item being dragged? -

why jquery droppable not accepting item being dropped? don't want use sortable anywhere. $(function() { $(".item").draggable({ helper: "clone", revert: "invalid" }); $("#drop").droppable({ accept:".item" }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script> <div class="items"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> </div> <div id="drop"> </div> it work: $(function() { $(".item,.letter ").draggable(...

eclipse - Where to find a similar to C grammar as inspiration in Xtext? -

i working on dsp toolchain named crosscore embedded studio sharc processors. ide implemented apart assembly language support poor. i not sure whether or not analog devices give better support in near future. i mean, there no code folding, no outlines , minimalistic code colouring support. quickly implement more efficient , looking @ way implement new language definition in eclipse luna. what found xtext . followed 5 , 15 minutes tutorials , read articles it. i ready implement language. because assembly language inherits similar aspects c ( i.e. preprocessor directives, c/c++ comments, arithmetic operations , semicolons endings), actively looking @ c grammar example xtext. unfortunately did not find yet. sadly, discovered c or c++ cannot described in xtext because of muliple language layers such c-preprocessor , c. not admit defeat yet , think can implement sufficent require approximate syntax colouring, code folding , outlines support. where can find helpful exa...

angularjs - How to get 100% of karma branch code coverage in typescript angular app? -

i write angular application karma , jasmin unit tests. got code in typescript: module app { ... } which generates javascript like: var app; (function (app) { ... })(app || (app = {})); now when run karma-coverage shows me 1 branch skipped , it's || (app = {})) ; one. happens when test more files got app module. how can test in jasmine, 100% branch coverage? if have build process using gulp or grunt, after typescript gets compiled javascript, can tell istanbul (what karma-coverage uses generate code coverage) ignore lines (like pesky typescript-generated lines). you can tell istanbul ignore line using /* istanbul ignore next */ comment (function (app) { ... })(/* istanbul ignore next */app || (app = {})); here's post explaining how using gulp. https://stackoverflow.com/a/33024388/1633757

Batch programming code explanation needed -

i'm trying understand batch script found online , code designed check last day of month , terminate script if condition true. heres copy of code. rem @echo off /f "tokens=1,2,3 delims=/ " %%a in ('echo %date%') set day=%%a & set month=%%b & set year=%%c set /a leap=%year% %% 3 if %leap%==0 (set eom=29) else (set eom=28) echo 01 03 05 07 08 10 12 | find "%month%" > nul && set eom=31 echo 04 06 09 11 | find "%month%" > nul && set eom=30 rem if %eom%==%day% exit however understand rest of code except following 2 lines. set /a leap=%year% %% 3 if %leap%==0 (set eom=29) else (set eom=28) when i've tried echo contents of leap variable keep getting 2, if i'm honest don't understand how ever 0 ? any advice on helpful. %% means modulus, since each leap year 4 years apart e.g. 2012(leap),2013,2014,2015,2016(2nd leap), if value of leap year 0, value of last year before leap year 4.( th...

yii - Required Rule on specific condition -

i need apply rule on form. have country , dependent drop down of state. i need apply required rule on state field. but if choose india drop down required rule should remove form. i have enabled clientsidevalidation true in cactiveform. view form: <?php $form = $this->beginwidget('cactiveform', array( 'id' => 'cart', 'enableajaxvalidation' => false, 'enableclientvalidation'=>true, 'clientoptions'=>array('validateonsubmit'=>true), // need next 1 transmission of files in form. 'htmloptions' => array('enctype' => 'multipart/form-data'), )); echo $form->dropdownlist($modeluser, 'country', countries::getcountrylistwithcode(), array('options' => array($currentcountry=>array('selected'...

php - get UserId when the button is clicked -

i want update find userid when button clicked. as example suppose user name "dell" have "userid" "111", when button clicked in should select user , further action. that's why use "$_post", when user clicks button return "userid". this how trying the "userid". $usrinfo = $this->getdoctrine() ->getrepository('mybundle:userstats') ->findbyuserid($_post); but think doing wrong, cause not working when user clicks button. and based on userid, update information like--- $usrst = new userstats(); $providerstats->seton(false); $em = $this->getdoctrine()->getmanager(); $em->persist($usrinfo); $em->flush(); so again main purpose find userid when button clicked . knows knows how solve problem. in advanced. you can try (i assume you're using form component, better if post form): ... public function ...

wpf - Performance issue - DataTemplate and DataBinding - 1st load -

Image
here drawing of ui: i have list of elements @ top (clickme1 , clickme2). each of element have several information contained inside mylist want display inside customelement of listbox. clickme1 clicked default. when click on clickme2, listbox taking 2-3 seconds before updating customelements information of clickme2. when switch again, it's updating right away problem visible first click. customelement has lot of different bindings clickme element (images , texts). here code: public observablecollection<customclass> mylist { get; set; } <listbox x:name="mylistbox" scrollviewer.horizontalscrollbarvisibility="visible" scrollviewer.verticalscrollbarvisibility="visible" itemssource="{binding mylist}"> <listbox.itemtemplate> <datatemplate> <local:customelement x:name="mycustomelement"/> </datatemplate> </lis...

gae userservice - How to automatically log out from Google App Engine application after logging out of other Google serivices -

i gae app logout, when user logout other google service. i have sso implemented in domain. have read this post.

Schema design for top ranked post query in cassandra -

i have requirement need find top ranked pictures in chronological order city. came below schema create table top_picture( picture_id uuid, city text, rank int, date timestamp, primary key (city,date,rank) ) clustering order (date desc,rank desc); it solve problem extent (apart duplicates) executing following query select * top_picture city='san diego'; . if same picture_id inserted in same day duplicate entries picture_id not part of partition key. can not add partitioning key because won't able make simple selection query above need provide picture_id selection query , won't give top pics city. did came accross type of schema before or other recommended ways it. it sounds want 2 views of data. in 1 view want top ranked pictures , in other view want picture_id unique. so have 2 tables, 1 has picture_id primary key , other have shown. when have picture insert, first try insert picture_id table using if not exists clause on...

node.js - How to run angularjs app on node server? -

i have make angularjs app , run on wamp server running fine want move on node express after reading made change in package.json file follow: { "name": "example", "namelower": "example", "version": "0.0.1", "description": "an example angularjs project", "readme": "readme.md", "repository": { "type": "git", "url": "git@git.example.com:example.git" }, "devdependencies": { "grunt": "0.4.2", "grunt-contrib-concat": "0.3.0", "grunt-contrib-copy": "0.5.0", "grunt-contrib-jshint": "0.8.0", "grunt-contrib-nodeunit": "0.3.0", "grunt-contrib-uglify": "0.2.2", ...

spring batch - Custom ItemReader to return more than one rows[based on some column value] to ItemProcessor -

i have file multiple rows. need read more 1 rows based on column value , pass processor list. sample input file is: 2|joe|24|ca 2|sam|32|ma 2|joe|44|ca 3|amy|21|ca the file sorted based on first field. i wanted pass first 3 rows processor list<item> last row separate list<item> is can customitemreader? regards, shankar

python - Select Numpy Array of Objects by Objects Attributes -

i have numpy array of objects equity , i.e.: array([ equity(24, symbol='aapl', asset_name='apple inc', exchange='nasdaq global select market'), equity(26578, symbol='goog_l', asset_name='google inc', exchange='nasdaq global select market'), equity(5061, symbol='msft', asset_name='microsoft corp', exchange='nasdaq global select market'), ..., equity(20513, symbol='look', asset_name='looksmart ltd', exchange='nasdaq capital market', ), equity(27133, symbol='wpcs', asset_name='wpcs international inc', exchange='nasdaq capital market'), equity(27917, symbol='free', asset_name='freeseas inc', exchange='nasdaq capital market')], dtype=object) the object equity has attribute exchange . which concise method subarray containing equity objects exchange == 'new york stock exchange' ? thanks! suppose numpy arr...

html - Why can't I change the size of my profile picture in my Sign In and Sign Up code? -

so have been coding sign in/ sign form. have no clue why profile-img not changing height or width! here css: .form-signin { max-width: 330px; padding: 15px; margin: 0 auto; } .form-signin .form-signin-heading, .form-signin .checkbox { margin-bottom: 10px; } .form-signin .checkbox { font-weight: normal; } .form-signin .form-control { position: relative; font-size: 16px; height: auto; padding: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .form-signin .form-control:focus { z-index: 2; } .form-signin input[type="text"] { margin-bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .form-signin input[type="password"] { margin-bottom: 10px; border-top-left-radius: 0; border-top-right-radius: 0; } .account-wall { margin-top: 20px; padding: 40px 0px 20px 0px; background-color: #f7f7f7; -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3); box-shadow:...

node.js - Raising a socket.io event from a Restify handler -

i have resitfy server , socketio server configured per example here . requirement raise socket.io event within handler. so, code looks this: var restify = require('restify'); var socketio = require('socket.io'); var server = restify.createserver(); server.get('/', function (req, res, next) { res.json(204, null); io.emit("sample", {"sample":"event"}); next(); }); server.listen(8080, function () { console.log('socket.io server listening @ %s', server.url); }); my client code pretty simple , looks this: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>socket.io chat example</title> </head> <body> <script src="socket.io.js"></script> <script type="text/javascript"> var socket = io.connect('http://localhost:8080'); socket.on('sample', function (data)...

I get error when use android:background and item_bg.xml -

i try create selectable listview. everthing right error when use android:background="@drawable/item_bg" drawable/item_bg.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" android:color="#999999"> </item> <item android:state_pressed="true" android:color="#ff00ff"> </item> <item android:state_selected="true" android:color="#b3bdff"> </item> <item android:state_pressed="false" android:color="#000000"> </item> </selector> error lines: android.view.inflateexception: binary xml file line #1: error inflating class caused by: android.content.res.resources$notfoundexception: file res/drawable-hdpi-v4/item_bg if delet...

ios - Create custom keyboard within app not external -

how able create keyboard enabled in app, or buttons put next each other make seem keyboard. image below http://i.imgur.com/qioxr0a.png you can use uibutton element or uiview touchbegan . don't keyboard extension because different controller.

Gradle error when creating a fat jar -

i'm trying create fat jar using gradle. i'm running error similar 1 raised against gradle . unfortunately don't understand gradle nor groovy enough come creative workaround i'm hoping here able help. i've searched online various workarounds no avail :( my particular conflict apache storm dependency: ... caused by: org.gradle.api.gradleexception: not copy zip entry /users/defaultuser/.gradle/caches/modules-2/files-2.1/org.apache.storm/storm-core/0.10.0-beta1/c3ba45e5ba616335c9f4be12317a8ebf2d2f17ba/storm-core-0.10.0-beta1.jar!meta-inf/license/license.base64.txt '/users/defaultuser/projects/streams/build/tmp/expandedarchives/storm-core-0.10.0-beta1.jar_6i3o5dzb4lwfvasqr1cg4giqy/meta-inf/license/license.base64.txt'. @ org.gradle.api.internal.file.abstractfiletreeelement.copyto(abstractfiletreeelement.java:79) @ org.gradle.api.internal.file.archive.zipfiletree$detailsimpl.getfile(zipfiletree.java:125) @ org.gradle.api.internal.file.abstractfi...