Posts

Showing posts from August, 2014

loops - How to plot several datafiles in consecutive graphs using gnuplot -

i have large number of ascii files named in order of form data.xxxx.tab, "xxxx" number between 0000 , 9999. each file contains 5 columns, first x-coordinate, second y-coordinate , remaining 3 variables wish plot against x-coordinate. need know how write loop in gnuplot 4.6, plot consecutive graphs of 1 of variables against x-coordinate. i tried instructions given in following posts: plotting gnuplot several files and gnuplot : plotting data multiple input files in single graph but these created single graph containing curves data files together, whereas need consecutive graphs plotted 1 after another, showing evolution in time of variable graph. the following should work: # fix axes proper comparison between graphs set xrange [0:10] set yrange [0:10] # if want animated gif set term gif animate set output 'output.gif' # plot data [n=0:9999]{ plot sprintf("data.%04d.tab", n) using 1:2 title 'case '.n } the %04d string...

Mysql: Change Timezone Per Query -

i want change timezone while query executing. like calculating attendance , store timestamp in attendance table. expected check-in time of employee stored in employee table , office timezone stored in office table, timezone can differ office office. office 1 can have different timezone office 2. so functions date_format( from_unixtime()) should work each office's timezone. you should take @ mysql function: convert_tz

dictionary - Python: dictionaries and word counting -

this question has answer here: item frequency count in python 10 answers i need make function reads string , returns dictionary keys words in string , values how many times occur. this tried: def countwords(arg): dic = {} in agr: if in dic: dic[i] += 1 else: dic[i] = 1 return dic which counts how many times letter appears. i thought of separating each word different position of list first, i'm not sure how or if that's right way go here.. what should do? this perfect case default dict: https://docs.python.org/2/library/collections.html#collections.defaultdict import collections co def countwords(arg): dd = co.defaultdict(int) # since want counts use int in arg.split(): # split on whitespace dd[i] += 1 # when new key encountere...

iphone - iOS App Error: I screwed up somewhere in date calculation -

my app crashing randomly, can't generate same case occurs in user's devices, here more details crash report: crash class: nsinternalinconsistencyexception function: -[calendarviewcontroller deleteevent:] the method implementation this: -(void) deleteevent: (ekspan ) span :(ekevent *) eventtodelete{ nserror* error = nil; [sharedeventstore removeevent:eventtodelete span:span error:&error]; // refresh ui } stacktrace: 0 corefoundation 0x33acf2a3 <redacted> + 162 1 libobjc.a.dylib 0x3b7ec97f objc_exception_throw + 30 2 corefoundation 0x33acf15d <redacted> + 0 3 foundation 0x343a4ab7 <redacted> + 90 4 eventkit 0x34208b33 <redacted> + 1642 5 eventkit 0x342084c1 <redacted> + 408 6 eventkit 0x342091f7 <redacted> + 306 7 eventkit 0x341fa199 <redacted> + 144 8 eventkit 0x341fa0ff <redacted> + 30 9 calendar 0x0010acaf -[calendarviewcontroller deleteevent:] + 126 10 calendar 0x0016f585 -[blockalertv...

Stata: If all observations unique, skip code -

i have dataset tells me how many referrals each general practitioner (gp) makes each hospital. if @ least 1 gp in data refers patients 2 (or more) different hospitals, want run additional code, otherwise don't. i using code: set more off gsort gp -referrals code: gen nvals = _n ==1 generate obs = _n if nvals != obs { display "different number of unique observations total observations-therefore run additional code here" continue } display "same number of unique observations total observations-therefore loop don't wish run additional code" at moment doesn't seem working. could me develop code please? i.e. if total number of observations equal total number of unique observations, know can skip next section of code- go have: display "different number of unique observations total observations-therefore run additional code here" a simple solution isid , combined capture . example, auto dataset uniquely identified make vari...

I am getting a 401 error when I am sending a soap request to a nav web service -

i trying send xml soap request dynamics nav web service. xml wsdl. have created web access key , 1 in key parameter of xml. <s11:envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'> <s11:body> <ns1:create xmlns:ns1='urn:microsoft-dynamics-schemas/page/customerws'> <ns1:customerws> <ns1:key>+gn8nu4i7iw7d/g9vcai8hze5iei1nbktbqdp5qfxe4=</ns1:key> <ns1:shipping_advice></ns1:shipping_advice> <ns1:shipment_method_code></ns1:shipment_method_code> <ns1:shipping_agent_code></ns1:shipping_agent_code> <ns1:shipping_agent_service_code></ns1:shipping_agent_service_code> <ns1:shipping_time></ns1:shipping_time> <ns1:base_calendar_code></ns1:base_calendar_code> <ns1:customized_calendar></ns1:customized_calendar> <ns1:currency_code></ns1:currency_code> ...

sql server - SQL - Search table for last day of each month in date range and output data? -

i have 2 tables: ticket_report ticket_report_snapshot the ticket_report_snapshot table exact copy of ticket_report table, has 1 column: snapshot_date a snap shot of ticket report table taken everyday, snapshot_date being date snapshot taken. the columns both tables have working are: project_group, ticket_status i need create stored procedure takes 2 date parameters. these 2 dates, need print count of open tickets each project on last day of each month in between 2 dates passed (the last day of each month searched in snapshot_date column of ticket_report_snapshot table). this have far: --this query gives me last day of particular month declare @dtdate datetime set @dtdate = '1/6/2016' select dateadd(s,-1,dateadd(mm, datediff(m,0,@dtdate)+1,0)) -- ouput: 2016-01-31 23:59:59.000 select project_group project_name, count(ticket_status) open_tickets ticket_report_snapshot ticket_status != 'closed' , ticket_status != 'cancelled' , snapshot_dat...

list - How can i display a 3x3 grid in Python tkinter? -

for program intend develop, essential me develop 3x3 grid display words set has been converted list. achieve i'm aware of method supposedly create 3x3 grid using list linebreaks within developed list. however, program functions @ more diverse level , instead of having pre-defined text file / list, set/list defined users input , utalises file dialog allows user select own 9 words 3x3 grid. reason dont think possible apply line breaks. there way display 3x3 grid displays each of these 9 words. extremely grateful of advice given. code... if feels particular section of code them solve problem, not hesitate leave comment. thank much! creating 3x3 grid no more difficult looping on items , creating widgets. this creates 3x3 grid of labels, storing references widgets in dictionary: table = tk.frame(root) row in range(3): col in range(3): label = tk.label(table, text="") label.grid(row=row, column=col, sticky="nsew", padx=1, pady=1) ...

java - Issue using Terminal -

i using android terminal emulator allow me move 'non-movable' apps onto sd card(external storage). when enter pm get-install-location message: here exception java.lang.securityexception: neither user 10010 nor current process has android.permission.write_secure_settings. how can permission this? , next steps allowing non-movable apps onto external sd card. many thanks write_secure_settings not available normal applications, it's available fo system app.

iphone - Multithreading and Grand Central Dispatch on iOS -

now trying understand concept of gcd. using grand central dispatch how implement multithreading in application.i have idea gcd concept cant implement concept application.i need simple example blocks understand multithreading using gcd.please me... ok.. simple example ) you can write code in method. example -(void) viewdidload { [super viewdidload]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ //here non-main thread. nslog (@"hi, i'm new thread"); dispatch_async(dispatch_get_main_queue(), ^{ //here returns main thread. nslog (@"hi, i'm main thread"); }); }); }

meteor - Data from db undefined at first, then changes to actual data -

i doing find on collection of nodes , storing info in variable. i console.logging data see contents of it. thing is, data stays empty array split second , new console.log done array of data. see code below: template.temperature.helpers({ node() { let node = nodes.find({_id:session.get('selectednode')}); console.log(node); return ''; } }); my console output: 1: [] 2: [object] what reason this? in router, subscribe within waiton: router.route('/home', { waiton: function() { return [ meteor.subscribe('nodes'), ]; }, action: function() { if (this.ready()) { this.render(); } }, }); this ensure route wait until subscription completed before executing route. uses meteor loading hook, wait utilize whatever loading screen or animation ahve setup.

javascript - Add new form row before table and have "enter" go between rows -

i trying figure out how script add row before first table row, allow "enter" key cycle between cells. here have far, adds row after each row var i=$('table tr').length+1; $(".addmore").on('click',function(){ addnewrow(); }); $(document).on('keypress', ".addnewrow", function(e){ var keycode = e.which ? e.which : e.keycode; if(keycode == 9 ) addnewrow(); }); var addnewrow = function(id){ html = '<tr id="tr_'+i+'">'; html += '<td><input class="case" id="caseno_'+i+'" type="checkbox"/></td>'; html += '<td class="prod_c"><input type="text" data-type="product" name="data[product]['+i+'][product_id]" id="product_'+i+'" class="form-control autocomplete_txt" autocomplete="off">'; html +='</td>'...

Return blank data if the column is empty in SQL -

i have run following query returns 36 rows of data select a.objective, sum(a.t_value) db2adm2.tfintr10 (a."year" =10) , (a.objective between 'waaaa' , 'wzzzz') group a.objective when merge table , add narration field (ob_narr5) rows of data reduced ob_narr5 not exist every objective, see sql. select a.objective, sum ( a.t_value ), b.ob_narr5 db2adm2.tfintr10 inner join db2adm2.tfinobjp b on b.ob_12345 = a. objective (a."year" =10) , a.objective between 'waaaa' , 'wzzzz' group a.objective, b.ob_narr5 rows returned 4. how can return rows including blank fields , / or return rows blank fields? thanks replies, left , full outer join both work. how replace <null> blank instead please? waaaa -173597.12 <null> wabaa 222717.76 general you can use full outer join preserving values both tables or left outer join particular...

android - Attachment not working with intent -

i have tried 2 ways attachment sms 1 hardcoded (the file 100% exists) have checked many times.: intent sms = new intent(intent.action_sendto, uri.parse("smsto:" + number)); sms.putextra("sms_body", smsbody); sms.putextra(intent.extra_stream, "file:///storage/sdcard/pictures/imageapp/img_20160107_133123.jpg"); startactivity(sms); the other: uri picture = uri.fromfile(picturefile); string smsbody = "this sms!"; intent sms = new intent(intent.action_sendto, uri.parse("smsto:" + number)); sms.putextra("sms_body", smsbody); sms.putextra(intent.extra_stream, picturefile); startactivity(sms); the picture variable in debug returns like: file:///storage/sdcard/pictures/imageapp/img_20160107_144801.jpg this exists, i've checked adm. what problem? why picture not being transferred attachment? thanks. ...

css - Down Arrow On Lists Within Lists -

i'm trying place down-arrow in navigation menu, if there li within li . hover on shop link see i'm having difficulty - http://codepen.io/anon/pen/abucf the arrow (or v demonstration purposes) should after shop tab, check out , my account , not inside it. how able achieve in css? thank you. you're trying @ element check specific condition , style parent based on that. css can't yet used style parent elements unfortunately. your best bet add class onto each element want styled , way or physically place icon/img in each anchor tag requires it. alternatively use javascript make happen.

Keep Getting a Syntax Error when Creating MySQL Trigger -

i trying create trigger fire after insert of record see if there other records similar inserted record (same date) , if update column in inserted record. once complete 1 update after update well. appreciated. create trigger `insert_postdateindex` after insert on `zoomloca_listings-dev`.`listings_posts` each row begin declare vnewpostdateindex int; declare vlastpostdateindex int default '0'; set vnewpostdateindex = '0'; set vlastpostdateindex = (select postdateindex listings_posts date(post_date) = date(new.post_date) order postdateindex desc limit 1); if vlastpostdateindex = '0' set vnewpostdateindex = '0'; else set vnewpostdateindex = vlastpostdateindex + 1; end if; update `listings_posts` set postdateindex = vnewpostdateindex id = new.id; end error: #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 6 the problem there no top in mysq...

gtk - configure error for --- gobject ---- python header not found -

python header files not found when configuring gobject-introspection. i have downloaded tar :----- gobject-introspection-1.34.2 command :----- gobject-introspection-1.34.2$ ld_library_path=/usr/local/lib:/usr/lib:$ld_library_path ./configure --disable-static error :---- checking python script directory... ${prefix}/lib/python2.7/dist-packages checking python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages checking headers required compile python extensions... not found configure: error: python headers not found how can resolve error, please suggest ? the compiler looking python header files. on linux distro solved via installing python-dev or similar package. under hood, should able specify include directory via gcc's -i option.

php - How to debug ERR_CONNECTION_TIMED_OUT -

i trying build site saves (checkbox) value using php txtfile. , worked fine. however, i'm rearranging files on server in order make easier later create more. i think rewrote path's files right (including fopen(_ dir _ . 'pathname')), when im changing checkbox (wich form submits on-click) "err_connection_timed_out" error , site links error page of host. my question is, how can debug error? via console cant find error's , it's not giving me information missing links or files on server. thanks in advance help.

javascript - How to return multiple values from an ajax success event -

i have 2 js files i.e. myjs1.js , myjs2.js . myjs1.js method of myjs2.js called. i want return r1 , r2 results(in myjs1.js) i have tried this: declared r1 , r2 variables before ajax call , after ajax call added: return [r1,r2]; but return r1 , r2 undefined . when researched issue came across adding async: false work has many issues (like browser freezing). tried , still not able values of r1 , r2. note: uing ajax first time bear in mind. edit: there ajax call in js1 in on success event method called. want access result call method in js1 edit:look here code myjs1: function method() { $.ajax({ type: "get", datatype: "json", url: "http://127.0.0.1:8000/***/***", success: function(response){ result=methodofmyjs2(response); load1(r1); //r1 result load2(r2); //r2 result } }) } myjs2 : function methodofmyjs2(data) { $.ajax({ type: "get", data:somedata, ...

r - Converting character vector to list of data frames of same names -

i have set of data frames - let called report_001, report_002, report_003 , on - have names of them in character vector such as: n <- c('report_001', 'report_002', 'report_003') i need turn list of data frames follows: dflist <- list(report_001 = report_001, report_002 = report_002, report_003 = report_003) so can index this: dflist[['report_002']] however, since have large number of data frames, don't want manually. trying this, has not worked: dflist <- sapply(n, function(x) assign(x, as.name(x))) for question, data frames not important. keep things simple, can have: report_001 <- mtcars report_002 <- mtcars report_003 <- mtcars how can achieve auto conversion of names of data frames list of data frames of same name indices? report_001 <- mtcars report_002 <- mtcars report_003 <- mtcars n <- c('report_001', 'report_002', 'report_003') dflist <- mget(n) head(df...

ios - Converting NSDictionary to JSON in Objective C -

this question has answer here: generate json string nsdictionary in ios 12 answers i want generate json in objective c , below example, 1 dictionary has fields, , within dictionary want add dictionary. i.e. student dictionary can have subjects dictionary(which can have multiple items. { "student": { "name": "b", "std": "d", "subjects": [{"id":"1","id":"2","id":"3"}] }} i trying using nsjsonserialization , tried first creating json string of subjects dictionary but, after converting final json of main dictionary showing (slash) breaking json. added subjects inside main dictionary after converting showing subjects json starting ( any suggestion m missing? thanks use nsjsonserialization : nsdata *jsondata ...

readline - Changing tab-completion for read builtin in bash -

the current tab-completion while "read -e" active in bash seems matching filenames: read -e [[tabtab]] abc.txt bcd.txt cde.txt i want completion set of strings defined me, while file/dir/hostname-completion etc. should deactivated duration of "read -e". outside of script complete -w 'string1 string2 string3' -e works well, cant kind of completion work inside script while using "read -e". although seems reasonable request, don't believe possible. the existing implementation of read builtin sets readline completion environment basic configuration before calling readline handle -e input. you can see code in builtins/read.def , in edit_line function : sets rl_attempted_completion_function null duration of call readline . readline has several completion overrides, it's not 100% obvious resets entire completion environment, far know function used implement programmable completion per complete command. with ...

jquery - Whats wrong with my if statement -

i have simple script basic calculations. have price dynamically populated sake of simplicity set constant price. input box takes down payment has min , max attributes set. min 10% of 3000 300 , max 3000. if statement keeps telling me down payment either less or more min max values unless use min or max values. in fiddle if statement works min , max not on actual site. here fiddle check. html <table> <tr id="payment"> <td>payment</td> <td>$3000</td> </tr> <tr id="down_payment"> <td>down payment</td> <td>$300</td> </tr> <tr id="financed_amount"> <td>amount financed</td> <td>$2700</td> </tr> <tr id="term"> <td>term</td> <td>22 months</td> </tr> <tr id="interest_rate"> <td>interest rate</td> <td>0%</...

java - Why I can't return nothing in a static method this way -

i wrote piece of code train litte bit , wanted understand why cannot use notation. public static double retanglearea (double c, double d) { double area = c * d; if ( c < 0 || d < 0) { system.out.println("error."); return; } return area; } if call method in main() shout "error." , still calculate (c * d) negative number wanted print show in. well, know how rid of problem want understand why can't way , what's problem that. three ways round this: throw exception rather writing error console. write console in catch block arguably in better position deal error. change function return type double (note capital), , return null if don't want calculate value. use java.lang.optional<t> return type. of these, prefer , therefore recommend 1.

angularjs - Restangular ui.router resolve asynchronous or synchronous -

i using restangular , ui.router. below code. app.config(["$urlrouterprovider", "$stateprovider", "$locationprovider","restangularprovider", function ($urlrouterprovider, $stateprovider, $locationprovider, restangularprovider ) { $urlrouterprovider.otherwise("/"); $stateprovider // .state("home", { url: "/", templateurl: 'app/class/html/classlist.html', controller: 'classsectionlistctrl vm', resolve: { acyear: function (restangular, $stateparams) { return restangular.all('currentyear').getlist(); }, classsectionsubjectmatrix: function (restangular, $stateparams) { return restangular.all(...

sql server - How can I pass a value through to an SSRS report even when it returns no records? -

i have procedure calculates date range based on inputs, , selects group of records based on date range. ssrs report based on procedure works great, unless there no records return...and no longer displays calculated date range. looks report failed. can tell user there no records available, if don't understand parameters enough, may not know why is. example, 1 option select records shipped during last week of month, not including spilled on next month. in december of 2015, meant starting sunday, december 27th , ending thursday, december 31st. may expecting record january 1st included in week, , not understand why didn't show up. if can display date range, might make more sense.

c++ - Default function that just returns the passed value? -

as lazy developer, use trick specify default function: template <class type, unsigned int size, class function = std::less<type> > void arrange(std::array<type, size> &x, function&& f = function()) { std::sort(std::begin(x), std::end(x), f); } but have problem in particular case, following: template <class type, unsigned int size, class function = /*something 1*/> void index(std::array<type, size> &x, function&& f = /*something 2*/) { (unsigned int = 0; < size; ++i) { x[i] = f(i); } } in case, default function equivalent of: [](const unsigned int i){return i;} (a function returns passed value). in order that, have write instead of /*something 1*/ , /*something 2*/ ? there no standard functor this, easy enough write (though exact form dispute): struct identity { template<typename u> constexpr auto operator()(u&& v) const noexcept -> decltype(std::forwa...

c# - Domain driven design methods in aggregate -

this question has answer here: dependencies between domain object, factory , repository 1 answer my question in regards following: if have class manages users, lets call usermanager . should responsible updating users in database (something registeruser , updateuser methods uses repository interface) in scenarios new user registers or updates profile? i think task can delegated class. usersubscription class handles calls(events) related userrepository . imagine usersubscription class of having methods (lets call them updateuser , subscribeuser ) recieves valueobject usermanager class , uses them update or register users. think usersubscription , usermanager classes in same aggregate in application layer . i think might looking repository pattern : mediates between domain , data mapping layers using collection-like interface accessing d...

powerbi - DAX Running Difference -

Image
in power bi have table column decimal numbers. how create new column running difference of aforementioned column values? see personal example in picture below: in example want column difference between current value of runningextratime , previous one. rather dax, edit query resolve this, using technique based on adding index column. i assume use "add index column" , leave default column name: "index" , step name: "added index". can use "add custom column" , refer prior row's value column: "runningextratime" using like: = if [index] > 0 [runningextratime] - #"added index"{[index]-1}[runningextratime] else 0

ios - Using NSUserDefaults on arrays -

i trying use nsuserdefaults save array in app's core data. thought use nsuserdefaults problem wherever put code creates default throws sigabrt error. here code creates default: let levelarraydefault = nsuserdefaults.standarduserdefaults() levelarraydefault.setvalue(levelsarray, forkey: "levelsarray") levelarraydefault.synchronize() levelsarray array of list objects: class list: nsobject, nscoding { // mark: properties var name: string var answersarray = [answer]() init?(name: string) { // initialize stored properties. self.name = name if name.isempty { return nil } } required init(coder decoder: nscoder){ self.answersarray = (decoder.decodeobjectforkey("aa") as? [answer])! self.name = (decoder.decodeobjectforkey("name") as? string)! } func encodewithcoder(coder: nscoder) { if let answersarray = answersarray { coder.encodeobje...

php - mysql_real_escape_string() expects parameter 1 to be string, -

i have used mysql_real_escape_string give following error: warning: mysql_real_escape_string() expects parameter 1 string, array given in /applications/xampp/xamppfiles/htdocs/example/infostud.php on line 16 line 16 $department=mysql_real_escape_string(['department']); hi if have on page html or form send values page.html <html> <head><title>title</title> </head> <body> <hr> <form action="page_to_process.php" method="post"> name:<br> <input name="name" id="name" type="text" size=50> <br>addres:<br> <input name="addres" id="addres" type="text"size=50> <br>phone:<br> <input name="phone" id="phone" type="text" size=50> <br> <p> <input type="submit" value="send" id="send" name="send"> </p...

Javascript function executes twice, Meteor js -

this simple script horizontal fortune roulette, created using slick slider. problem: function rollout() executed twice (and helpers too) because template rendered twice. i'm using iron:router routing, code: router.configure({ loadingtemplate: "loading", layouttemplate: "layout" }); router.map(function() { this.route("hello", { path: "/", waiton: function() { return meteor.subscribe("games"); } }); }); hello.js: session.setdefault('currentslide', 0); template.hello.events({ 'click .create': function(e) { e.preventdefault(); var ins = { gamestarttime: new date(), finished: false } games.insert({ gamestarttime: new date(), finished: "false" }); session.set("gamestatus", "waiting"); } }) template.hello.helpers({ currentslide: function() { ...

How do I use sendmail instead of mail to send via PHP? -

i have code sends email this, i'd rather use sendmail instead of default php mailer because want skip php.ini settings: $to = $_post['email']; $subject = "subject."; $header = "from: me <me@me.com>\r\n"; $header.= "mime-version: 1.0\r\n"; $header.= "content-transfer-encoding: 7bit\r\n"; $header.= sprintf("content-type: %s; charset=\"%s\"","text/html","utf-8")."\n\n"; mail($to, $subject, $html_msg, $header); what need change use /usr/sbin/sendmail ? could use popen ? if on unix-like system, php's "default mailer" is sendmail, don't have change if that's need. for more details, can see relevant php.ini configuration options in documentation ( http://us3.php.net/manual/en/mail.configuration.php ). if don't want use mail() , yes, talk sendmail popen , though may instead want use third-party mailer packa...

c# - NTLM authentication not working when using Windows.Web.HttpClient having AllowUI set false -

i porting windows 8.1 app windows 10 uwp app. problem have encountered old code (it still compiling though) uses system.net.httpclient throws stupid exception when trying authenticate on server using ntlm. "known windows 10 sdk error - fixing it." - microsoft since months. (described else here: https://social.msdn.microsoft.com/forums/en-us/9e137127-e0e5-4aec-a7a9-d66f5b84c70b/rtm-known-issue-systemnethttphttpclient-or-httpwebrequest-class-usage-in-a-uwp-app-throws-a?forum=win10sdktoolsissues ) the workaround? - "use windows.web.httpclient instead" so trying. var request = new httprequestmessage(); request.requesturi = myuri; request.method = httpmethod.post; request.content = new httpstringcontent(mycontent); request.headers.add("user-agent", "myapp"); request.headers.add("soapaction", "mysoapaction"); request.content.headers.contenttype = new httpmediatypeheadervalue("text/xml; charset=utf-8"); var f...

java - What is the advantage of using ctrl-shift-t instead of ctrl-shift-r in Eclipse? -

when first got java programming mentor of mine introduced me ctrl-shift-t shortcut in eclipse, long before discovered ctrl-shift-r. reason had bias towards ctrl-shift-t , tended use whenever possible. what noticed eventually, though, if eclipse had non class files in context ctrl-shift-t didn't anything, , had put class file in context use shortcut. then hit me ctrl-shift-r catch-all shortcut can open every file, no matter context in ide. in respects seems more useful shortcut because can used @ time. so makes me wonder i'm missing ctrl-shift-t. outside of shortcut pulling smaller subset of files when searching, there other advantage using i'm missing? ctrl - shift - r opening resources in workspace (i.e. files) ctrl - shift - t opening classes (types), may not in files in jars.

jquery - Complex grid with smooth performance -

my website built in asp.net 4.5 , in 1 of pages have display data in tabular format(grid). allow user perform complex operations. data populated in grid coming different sources. because of fetching , binding of data becoming time consuming. can please suggest best option in case? have tried using gridview heavy control used in such scenario. thanks in advance.

javascript - AngularJS - Dynamic Directives using ng-repeat -

i've spent while trying find elegant solution this, whilst have solution 'works' doesn't feel easiest or correct way of doing things. so, question is...how can dynamically load directives! context, below how hoping i'd able away it! i've not included routing or template loads , assign below controller ng-controller. app.js angular.module('myapp', []) .controller('somecontroller', ['$scope', function($scope) { $scope.directives = ['mydirectivea', 'mydirectiveb']; }]) .directive('mydirectivea', function() { return { template: '<p>directive a, exciting.</p>' }; }) .directive('mydirectiveb', function() { return { template: '<p>directive b, equally exciting.</p>' }; }); template.html <div ng-controller="somecontroller"> <div ng-repeat="directive in directives"> <x-directive></x-directive>...

php - Silex FormServiceProvider could not load type "form" when using Symfony3 Components -

when trying build form receive error: invalidargumentexception in formregistry.php line 87: not load type "form" i've registered formserviceprovider, translationservicerprovider, , validatorserviceprovider. here relevant part of code: $this->_form = $this->_app['form.factory']->createbuilder('form', $this->_map()) ->add('firstname', 'text', [ 'constraints' => [new assert\notblank()] ]) ->add('lastname', 'text', [ 'constraints' => [new assert\notblank()] ]) ->add('email', 'text', [ 'constraints' => [new assert\email()] ]) ->getform(); here version numbers of related components i'm using: silex/silex v1.3.4 php micro-framework based on symfony components symfony/security-core v3.0.1 symfony se...

java - Why mongodb oplog is always empty? -

i'm trying write synchronizer between mongodb , lucene. idea implement application tail oplog , reproduce in lucene. basis i'm using this post the problem oplog empty: rs0:primary> db.oplog.rs.find({},{"ts":1}).sort({$natural: -1}).hasnext() false rs0:primary> db.message.find({}).count() 729 rs0:primary> db.oplog.rs.find({}).hasnext() false rs0:primary> db.oplog.rs.find() rs0:primary> can explain me i'm doing wrong? all replica set members contain copy of oplog, in local.oplog.rs collection. in order query oplog have use local database . use local; db.oplog.rs.find();

mysql - <timestamp>_add_devise_to_users.rb created instead of <timestamp>_devise_create_users.rb -

i absolute new ruby on rails , running following command $rails generate devise user i expected file _devise_create_users.rb generated . generating file _add_devise_to_users.rb. when run command rake db:migrate after this, gives me error , sqlite3::sqlexception: no such table: users: alter table "users" add "email" varchar default '' not null. since there no user table created. any headways suggested ? i believe need capitalize user rails generate devise user make sure rollback mistakes made db in prior attempts.

android - imageView.setImageResource(int resId) vs. imageView.setImageBitmap(Bitmap bitmap); -

Image
the image file identical. once comes drawable , 1 file system . here code. <imageview android:scaletype="fitend" android:id="@+id/partner_logo" android:layout_width="51dp" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:contentdescription="@string/parter_logo" /> i set partner logo dynamically, load id webserver , then set imageview.setimagebitmap(bitmap bitmap); with imageresource looks , expect in bitmap case small. here picture compare the logo (black arrow points) set via setbitmap . seem not up-scaled -- the logo (read arrow points) set via setimageresource . looks like. so question why there difference here? works scaletype in case of bitmap? because setimageresource() automatically scale image. if want use setim...

geospatial - rtree/btree data structure go upper from child to parent -

i new rtree/btree data structures. creation of tree bottom-to-up process searching node/range search/knn search top-to-bottom process. using knn search wanting improvement: data trajectory of points, spatially close each other. in order search knns every point on entire trajectory, want search 1 point first, other points, don't want start root again, instead want start results of first point, , go upper parents. enable me avoid searching lot of unnecessary pages. problem here how can go upper child parent in rtree/btree structure? should change tree creation process , whenever split happens, fill parent[] property of child? there other simpler ways problem? you could: store pointer parent node in children node know how move upwards in nodes structure. between queries store pointer last leaf node , there using pointer parent move upwards, check parent node, again move upwards etc. until node different subtree should picked. store pointers children nodes in every...

angularjs - How to spyOn chained method call to Restangular in Jasmine? -

i using jasmine write unit tests angularjs factory returns call restangular. take example, function functobetested(params) { return restangular.all('/foo').getlist(params); } it straightforward test whether or not all() being called on restangular. how can test whether getlist() gets called on returned restangular object after all() has returned? at moment, have beforeeach(function() { module('ui.router'); module('myservice'); module('restangular'); }); describe('functobetested', function() { beforeeach(function() { httpbackend.expectget('/foo').respond([]); }); it('should call on restangular', function() { spyon(restangular, 'all').and.callthrough(); functobetested({}); httpbackend.flush(); expect(restangular.all).tohavebeencalled(); }); }); if try follow same pattern , along lines of expect(restangular.all.getlist).tohavebeencalled(); things stop working. not able f...

java - Abstract class generic-through-constructor inheritance -

i'd model following, generic abstract class gets type constructor (ala arraylist()) public abstract class abstractparent<t> { protected abstractparent(t... params){ //(...) } } public child<u,v> extends abstractparent<????>{ public child(u param, v param2){ super(param, param2); } } but canot use '?' or parent's t '????' type. want child<string,string> abstractparent<string> while child<string,integer> abstractparent<? extends object> , ...similarly how arrays.aslist() method works: aslist("a","b") returns list<string> whereas aslist("a",1) returns list<? extends object> . why disallowed or how can workaround it? if want parent type of supertype of both u , v, you'll still have explicitly specify in child 's generic parameters. closest thing can class child<x, u extends x, v extends x...

record, and replay rabbitmq data -

is there rabbit mq plugin or application can subscribe rabbit mq messages, save them disk, , publish messages @ same rate came in? i starting rabbitmq , trying figure out best way set integration tests. do want fanout messages 2 separate queues ? if so, create 2 queues , bind them fanout exchange. messages published exchange replicated. can configure 1 of 2 queues save messages disk !

ruby on rails - How to create a form using simple_form to control scopes (via has_scope) in a view -

basically, cannot figure out how prevent form generator encapsulating in hash (filter{...}), making easy form set params used in view's scoping. has_scope code in controller: has_scope :degree_id has_scope :discipline_id has_scope :competency_id has_scope :type_id has_scope :year simple_form code in view: <%= simple_form_for :filter, url: analyze_school_path, method: :get |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :y, label: 'year', collection: @years, include_blank: '- year -' %> <%= f.input :discpline_id, label: 'discipline', collection: discipline.all, include_blank: '- discipline -' %> <%= f.input :competency_id, label: 'competency', collection: competency.all, include_blank: '- competency -' %> <%= f.input :type_id, label: 'type', collection: jobtype.all, include_blank: '- type -' %> </div> ...

chef include recipes override attributes -

when include recipe in recipe how override attributes. it looks include recipe used default attributes not attributes of recipe when run in run_list. when creating wrapper cookbook, common override attributes. suppose, have my_web_server cookbook my_web_server/recipes/default.rb this: include_recipe "apache2" and override attribute default_site_enabled apache2 cookbook. file my_web_server/attributes/default.rb should like: override['apache']['default_site_enabled'] = true and don't forget specify dependencies in my_web_server/metadata.rb like: depends "apache2"

asynchronous - C# Tuple not returning value -

it's first time using tuple's might doing wrong or missed small. used have repetitive code : if (!b1fturn) { if (b1turn) { fixcall(b1status, ref b1call, ref b1raise, 1); fixcall(b1status, ref b1call, ref b1raise, 2); rules(2, 3, "bot 1", ref b1type, ref b1power, b1fturn, b1status); autoclosemsb.show("bot 1 turn", "turns", thinktime); ai(2, 3, ref bot1chips, ref b1turn, ref b1fturn, b1status, b1power, b1type); turncount++; b1turn = false; b2turn = true; } } if (b1fturn && !b1folded) { bools.removeat(1); bools.insert(1, null); maxleft--; b1folded = true; } if (b1fturn || !b1turn) ...

How do I support c++11 in Opencv 3 Android NDK -

can me, please? i doing next changes support c++11 opencv 3 in android ndk: i change app_stl := gnustl_static app_stl := c++_static application.mk app_stl := c++_static app_cppflags := -std=c++11 -frtti -fexceptions app_abi := armeabi armeabi-v7a mips x86 arm64-v8a x86_64 mips64 app_platform := android-14 # use select gcc instead of clang ndk_toolchain_version := 4.9 android.mk local_path := $(call my-dir) local_path_lib_dir:=library/lib/classifier include $(clear_vars) opencv_camera_modules:=off opencv_install_modules:=on opencv_lib_type:=shared include ../../../opencv-android-sdk/sdk/native/jni/opencv.mk local_module:= detection_based_tracker local_src_files := detectionbasedtracker_jni.cpp \ library/jniutils.cpp \ ${ local_path_lib_dir}/logic.cpp \ ${ local_path_lib_dir}/logic2.cpp \ local_c_includes += $(local_path) local_ldlibs += -llog -ldl -lm -latomic -l$(loc...