Posts

Showing posts from September, 2015

scripting - Is there a way to create a bash script that will only run for X hours? -

is there way create bash script run x hours? i'm setting cron job initiate script every night. script runs until condition met, exporting it's status holding variable keep track of 'where is' after each iteration. intention start-up process every night, run few hours, , stop, holding status until process starts next night. short of somehow collecting start time, , checking against current time in each iteration of loop, there easier way this? bash scripting not forte (i know enough things done , dangerous) , have not done before. appreciated. thanks. use gnu coreutils gnu coreutils contains actual timeout binary, invoked this: # timeout after 5 seconds when sleeping 30 /usr/bin/timeout 5s /bin/sleep 30 in case, you'd want specify hours instead of seconds, timeout in 2 hours use 2h instead of 5s . see timeout(1) or info coreutils 'timeout invocation' additional options. hacks , workarounds native timeouts or gnu timeout command be

Git does not commit -

i try commit changes , keep getting this: # on branch master nothing commit (working directory clean) i do: git add . git commit -a -m "test" and error message before can git push like message says, doesn't there changes add cache, let alone commit anything. execute git status see if changes exist (it shouldn't).

machine learning - algorithmic complexity of classification algorithms/artificial neural networks -

the algorithmic complexity of binary trees o(n), n being height of tree. there resources listing complexity of methods selecting best tree? e.g. boosted regression trees, cart or c4.5 (even mars) also, not familiar artificial neural networks, references seem point specific ann implementations being np-complete: http://people.csail.mit.edu/rivest/pubs/br93.pdf , http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.7.8997 . does know extent general result?

c++ - How can I determine the actual type of an 'auto' variable -

in response: https://stackoverflow.com/a/14382318/1676605 this program given: std::vector<int> vi{ 0, 2, 4 }; std::vector<std::string> vs{ "1", "3", "5", "7" }; (auto : redi::zip(vi, vs)) std::cout << i.get<0>() << ' ' << i.get<1>() << ' '; i have no idea type of auto i is, making harder reuse expertise , learn examples. here changing auto i char i returns in function ‘int main()’:| /data/cbworkspace/testzip/testzip.cpp|14|error: cannot convert ‘boost::iterator_facade<boost::zip_iterator<boost::tuples::tuple<__gnu_cxx::__normal_iterator<int*, std::vector<int> >, __gnu_cxx::__normal_iterator<int*, std::vector<int> > > >, boost::tuples::cons<int&, boost::tuples::cons<int&, boost::tuples::null_type> >, boost::random_access_traversal_tag, boost::tuples::cons<int&, boost::tuples::cons<int&, boost

.net - Using .net3.5 assemblies and mixed-mode dlls on .net4 -

its in context of c++ application uses .net3.5 assemblies through mixed-mode (again targeted .net3.5) assemblies. native app explicitly loads .net assemblies. i want know repercussions of using .net3.5 assemblies on .net4. found few links suggest using uselegacyv2runtimeactivationpolicy. there similar question answer suggests fine, following links make me think better recompile targeting .net4: "...apps built versions 2.0, 3.0, , 3.5 can run on version 3.5, not work on version 4 or later." - on msdn "some framework types have moved across assemblies between versions..." - in answer "no idea. depends on application , apis uses. there breaking changes in .net 4 , application hitting one..." - in msdn forum answer i want know repercussions of using .net3.5 assemblies on .net4. in general, need set runtime activation policy force .net 4. means 3.5 assembly executed using clr 4 runtime, not clr 2 runtime. for scenarios, things &qu

crash - Java program crashing when it overwrites an existing .txt file? -

i'm making simple text based game have type commands preform actions. added feature game allows save progress. reason if try save game on existing save file crashes. here code saves game ( when fails save says "there error when trying save game data. game close." expected ): import java.util.formatter; import javax.swing.joptionpane; public class gamesave { private static formatter gamesave; private static formatter firsttimesave; private static formatter attackpoints; private static formatter defensepoints; private static formatter skillpoints; private static formatter wins; private static formatter loses; private static formatter money; // attackpoints, defensepoints, skillpoints, wins, loses, money public static void openfile(){ try{ attackpoints = new formatter("c:\\fightnight\\saves\\"+mainclass.newprofilename+"\\"+mainclass.newprofilename+"_attackpoints.txt");

sql - How to stop Access from thinking my table.field in VBA is a form component? -

so i'm writing sql query in vba in access 2010, , when code ran, thinks supplierconnect.mailboxid component on form, in fact database table (supplierconnect) , field (mailboxid). every time code ran pops box asking me input form component, isn't one. there way around or code differently? thanks! ' mailbox id if isnull(mailboxidcombobox.value) else if firstwhere = true mailboxid = "where supplierconnect.mailboxid = '" & [forms]![supplierquery]!mailboxidcombobox.value & "'" firstwhere = false else mailboxid = " , supplierconnect.mailboxid = '" & [forms]![supplierquery]!mailboxidcombobox.value & "'" end if end if this not popping asking value because thinks form control, because undefined query. cannot find field within query definition. happens because not have proper case sensitive table or field id or incorrect table linked. if provided more code sql statement using begin

sql - Updating a column using set criteria -

i want update kyc5.status scanned if same kyc5.wallet_number present in jewel_scan2.customer_wallet . so far have used following code: update kyc5 set [status_] = 'scanned' customer_wallet = jewel_scan2.customer_wallet but error message shows: the multi-part identifier "jewel_scan2.customer_wallet" not bound. any solution this? should use update inner join ? any highly appreciated. try add jewel_scan2 table from section below update kyc5 set [status_]='scanned' jewel_scan2 j kyc5.customer_wallet= j.customer_wallet

osmf - How to build strobe media player? -

i downloaded , installed strobe media player http://osmf.org/strobe_mediaplayback.html in mac. need debugging using console log statements. how build this? this doc might help: http://osmf.org/dev/osmf/specpdfs/building-osmf.pdf . otherwise should have debug build available sourceforge download: http://sourceforge.net/projects/smp.adobe/files/ hope helps

sql - Trying to compare two consecutive records -

i using sql server 2008 , need in writing query compares 2 consecutive records. select recorddate sitehistory siteid = 556145 , isrecent = 0 , isrunning = 1 order recorddate desc gives me around 2000 rows looks this: recorddate ----------------------- 2013-05-08 20:04:23.357 2013-05-08 19:45:26.417 2013-05-08 19:30:24.810 2013-05-08 19:17:22.843 2013-05-08 19:00:16.017 2013-05-08 18:44:14.230 ..... ..... now need compare date of each row next row , count how many times difference between 2 consecutive dates greater 15mins. come far: ;with temp as( select row_number()over(order recorddate desc)as 'row', recorddate sitehistory siteid = 556145 , isrecent =0 , isrunning=1 ) select count(*) count temp t1 inner join temp t2 on t2.row = t1.row+1 datediff(mm,t1.recorddate,t2.recorddate)>15 however, doesn't give me desired. please let me know how can correct suit requirements. logic of query correct, thing trying date difference in month

Matlab plot won't return correct results -

i have written function beginning of poisson process function n_t = poisproc2(t,tao,size) n_t=0; n=1:size if t>tao(1,n) n_t=n_t+1; end end end tao array of random doubles of length size. simplicity we'll [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,20] so functions purpose count how many elements of tao t greater given t. this code works fine when write poisproc2(3,tao,20); the answer 19 expected, if write x=1:.01:20; y=poisproc2(x,tao,20); plot(x,y,'-') y shows 0 in workspace (i expect array of length 1901) , plot reads 0. i'm pretty new matlab, seems pretty thing i'm trying , must missing obvious. please help! your code not work giving vector. if condition not working expect. first initialize n_t vector : n_t=zeros(1,length(t)) instead of if t>tao(1,n) n_t=n_t+1; end vectorize expression : n_t = n_t + (t>tao(1,n)) cheers

Combining multiple lines of telnet into 1 batch file -

to perform specific task had following commands telnet 10.0.0.192 *hit enter y (answer yes whatever question comes up) *hit enter domain\username (when prompted username) *hit enter password (when prompted password) *hit enter \\10.0.0.2\path\batchfile.bat (this batch file i'd run in end) *hit neter is there way can combine data 1 batch file (saving passwords fine) have double click batch file , ends executing batchfile.bat on remote server? it not possible automate entierly using batch file. can use vbs script manage session. here's example of such script (called dotelnet.vbs, sake of example): set myshell = createobject("wscript.shell") myshell.run "cmd" wscript.sleep 100 myshell.sendkeys"telnet 127.0.0.1" myshell.sendkeys("{enter}") wscript.sleep 100 etc... you call batch file with: cscript dotelnet.vbs

C# Ways to access containing class without passing reference -

is there way access containing/enclosing class during initialization (constructor logic) of nested owned class without needing reference passed constructor parameter? the reason don't want pass reference containing class constructor parameter nested owned class because virtually every single object in program need it, , feels sloppy passing in argument manually every time never change anyways. want simplify programming as possible other team members of mine using engine. i tried making method container class use when adding new objects take new instance parameter , set instance's "container" variable "this" (the container class), nested owned object's initialization code happens first defeats purpose (i want able access container during initialization, container variable needs set before, not after constructor code executed). any ways make happen? or doomed manually pass in reference container class every time make new nested owned object

python - How to connect to https site with Scrapy via Polipo over TOR? -

not entirely sure problem here. running python 2.7.3, , scrapy 0.16.5 i've created simple scrapy spider test connecting local polipo proxy can send requests out via tor. basic code of spider follows: from scrapy.spider import basespider class torspider(basespider): name = "tor" allowed_domains = ["check.torproject.org"] start_urls = [ "https://check.torproject.org" ] def parse(self, response): print response.body for proxy middleware, i've defined: class proxymiddleware(object): def process_request(self, request, spider): request.meta['proxy'] = settings.get('http_proxy') my http_proxy in settings file defined http_proxy = 'http://localhost:8123' . now, if change start url http://check.torproject.org , works fine, no problems. if attempt run against https://check.torproject.org , 400 bad request error every time (i've tried different https:// sites, ,

ruby on rails - User-generated SQL Query -

i'm developing data warehouse using ruby on rails , should allow user perform arbitrary select queries on application database. i know shouldn't do, it's interface client needs (i can't think of possible queries user might want , translate them activerecord queries). there complex joins , sub-queries , on. i'd rather (integrate app) let them access db via pgadmin (i'm using postgresql). my question is: safest way of doing this? should able escape insert, update, drop table, etc... i'm thinking of getting query string , sanitizing these "dangerous" words , using activerecord::base.connection.execute(sanitized_sql_string). reasonable approach? the safest way let postgres handle security you. create new user: create user reader; -- rails app should logon user then, explicitly grant select permissions on objects want them able query: grant insert on tablefoo reader; grant insert on tablebar reader; then, they'll able r

php - How can I reduce the number of queries Doctrine is performing? -

i'm building product management tool product can have arbitrary number of attributes , documents , features , images , videos single type , brand , , category . there few other related tables, enough demonstrate problem. there's model class called productmodel contains method (reduced clarity): public function loadvalues() { //product entity data $this->id = $this->entity->getid(); $this->slug = $this->entity->getslug(); // 1 of each of these $this->loadtype(); $this->loadbrand(); $this->loadcategory(); // arbitrary number of each of these $this->loadattributes(); $this->loaddocuments(); $this->loadfeatures(); $this->loadimages(); $this->loadvideos(); ... } each of load methods boiler plate executes method: public function loadentitiesbyproductid($productid=0) { // entities of type associated product. $entities = $this->entitymanager ->ge

android - Email or Something persistent for User signing in via Google+ (Google Game Services) -

is there way retrieve user's email address programmatically when authenticating during google game play services sign in process on android? or if there persistent user id returned token? we trying create scenario user can connect or merge many social accounts single account. gamesclient.getcurrentaccountname() returns logged in user's email address (assuming have get_accounts permission).

performance - Why does having an "include" of a file that doesn't exist slow my entire PHP page to a crawl (on IIS 7.5)? -

as example, let's have following in php code @ top of file: include ($collectiontype."s/collectors_config.php"); what i'm noticing if include file doesn't exists, let's @ path bogus/collectors_config.php , execution of php page slows crawl. if exist, page super fast. i running php 5.4 on iis 7.5 (windows server 2012). why that? there recursive lookup killing performance looking file isn't there? there setting in php.ini need change? looking insight here why happening.

lexical analysis - Conflict while parsing a set of expressions -

i parse set of expressions: r[3]c , r[2]c , r[3]c-r[2]c ... there conflict cannot solve... here part of lexer.mll : rule token = parse | 'r' { r } | 'c' { c } | "rc" { rc } | ['0'-'9']+ lxm { integer (int_of_string lxm) } | '+' { plus } | '-' { minus } | '[' { lbracket } | ']' { rbracket } | eof { eof } ... a part of parser.mly : main: e_expression eof { $1 }; e_expression: | ec = e_cell { ee_rc (rc.cell ec) } | e_expression minus e_expression { ee_string_eel ("minus", [$1; $3]) } e_cell: | r lbracket r = index rbracket c c = index { (rc.i_relative r, rc.i_absolute c) } | r lbracket r = index rbracket c { (rc.i_relative r, rc.i_relative 0) } index: | integer { $1 } | minus integer { printf.printf "%n\n" 8; 0 - $2 } this code curiously not work r[3]c-r[

android - NotificationCompat.Builder -

i send in constructor of class extends nothing context int icon = r.drawable.ic_launcher; long when = system.currenttimemillis(); mynotification = new notificationcompat.builder(context) .setsmallicon(icon) .setcontenttitle(context.getresources().getstring(r.string.app_name)) .setcontenttext(context.getresources().getstring(r.string.app_name)) .setwhen(when) .setticker(context.getresources().getstring(r.string.app_name)) .setdefaults(notification.flag_no_clear); and send datas through remoteviews , on end intent notificationintent = new intent(context, menu_activity.class); pendingintent contentintent = pendingintent.getactivity(context, 0, notificationintent, 0); contentview.setonclickpendingintent(r.id.layoutnotification, contentintent); mynotification.setcontent(remoteview); mynotification.setongoing(false); mynotification.setautocancel(false); mynotification.s

Parsing DICOM files in a directory with GDCM -

if have directory contains volumetric data variety of sources, pet , 4d ct. know how given dataset use say, vtkgdcmimagereader , load 3d image series of files. handle multiple modalities and/or 4d datasets manually peeking @ tags , dividing files lists , parsing them separately. is there particularly general way of going or better method within gdcm ? doing seems work feels bit of hack , there must proper way of doing it, can't seem find it. you can checkout following example

Views on Design By Contract or code contract -

i reading understand more design contract / code contract. as know, write contracts (invariants, pre , post conditions) ensure codes can maintain orderly. guarantees bugs prevented defined mechanism based on checks , balances but wouldnt implicated software performance? there additional checks between each method calls. i appreciate people share views , experience design contract me. disadvantages or advantages welcome. typically such frameworks support runtime checks , static ananlysis. latter performed @ compile time (or before); not slow down code @ all. former potentially affect performance. the microsoft research code contracts project nice example of this. can configure system such that: static analysis applies subset of possible contract enforcement @ compile time, or within deigner environment; runtime checks enabled code compiled in debug mode; and a subset of runtime checks enabled public api of code compiled in release mode (non-public code has

.htaccess - htaccess mod_rewrite issue. trailing / -

i using mod_rewrite remove .php in links. getting weird behavior when adding trailing / rewritten link; external resources don't load. wondering if can mitigate this. thank you. rewriteengine on rewritecond %{http_host} !^www.allprepaidplans.com$ [nc] rewriterule ^(.*)$ http://www.allprepaidplans.com/$1 [l,r=301] rewritecond %{the_request} ^get\s(.*/)index\.php [nc] rewriterule . %1 [ne,r=301,l] rewritecond %{the_request} ^get\s.+\.php [nc] rewriterule ^(.+)\.php$ /$1 [ne,r=301,l,nc] rewritecond %{request_filename} !-d rewritecond %{document_root}/$1.php -f rewriterule ^(.*?)/?$ $1.php [l] if "external resources" mean images, styles, scripts, etc. need make links absolute or add relative uri base: <base href="/">

c# - overwrite file in Zipping -

i try zip .pdf files in c#. code works fine when size of 1 of pdfs big, going overwrite pdf on rest of pdfs. not sure happening. tried increase size of buffer or zip file still same issue. have suggestion? this code: public void processziprequest(string strqueueid, string strbatchid, string strftppath) { int intreportcnt = 0; string strzipfilename = "order-" + strbatchid + "-" + strqueueid + "-" + datetime.now.tostring("mm-dd-yyyy-hh-mm") + ".zip"; strzipfilename = safefilename(strzipfilename); //memorystream ms = new memorystream(); filestream ms = new filestream(@"c:\surf\nikoo.zip", filemode.create); zipoutputstream ozipstream = new zipoutputstream(ms); // create zip stream ozipstream.setlevel(9); // maximum compression intreportcnt += 1; string strrptfilename=string.empty; memorystream outputstream = new memorystream();

How to use R package inside javascript? -

i m developing web application using d3.js , requires statistical techniques. know there excellent r packages out has implemented techniques need nicely. question is, how can use r package inside javascript code? mean call r functions directly javascript code. thanks in advance.

javascript - Creating thumbnail overlay in CSS -

i'm trying create layer on thumbnail shows information photo , i'm using jquery create hover effect , but faced hover problem , can check out code , preview here : my js code : $('img').hover(function(){ $(this).next('.mask').fadein(); },function(){ $(this).next('.mask').fadeout(); }); full css/html/js code : jsfiddle how can solve problem , make jquery hover normal? the effect you're getting because show .mask above img . since hover event on img , putting .mask on fire mouseleave event, fade .mask out again. when .mask has faded out, mouse hovering on img , .mask fade in , repeated. i suggest using 100% css this. there no need js.

c# - Passing a value, retrieved from a linq statement in a view, to its controller -

i have view has c# , linq in it(not ideal have work it!): protected void page_load(object sender, eventargs e) { . . var qry = (from p in db.entityobject == something_else select new { <fields> }).firstordefault(); . . } <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> . . i need pass value retrieved via linq statement in view controller. i've tried this: var qry = (from <entity objects> select new { id, // fields }).firstordefault(); routedata.values.add("id", qry.id); then tried pass hidden input type value: <input type="hidden" value="<%int32.parse(routedata.values["id"].tostring())"/> but,

multithreading - Java: Thread/task expiration after specified milliseconds -

in java there sane way have thread/task run continuously , end after specified run time (preferably without using several timers)? for instance, if have timertask , there doesn't seem way schedule task end after number of milliseconds or @ specific time timer class. sure, can schedule task repeat after number of milliseconds, if want end after 1 iteration? have run timer within scheduled task? i'm hoping more elegant answer that. the answer provided in this question work, not had in mind. essentially , i'm looking similar autoreset property on c#'s system.timers.timer class you can use executorservice , grab future , .cancel() after time want: final future<whatever> f = executor.submit(...); timeunit.seconds.sleep(xxx); f.cancel(true); or can have 2 services: 1 executes, uses scheduledexecutorservice cancellation. note: timertask depends on system time, use scheduledexecutorservice instead.

c++ - No matching constructor for initalization of 'ostream_iterator<int>' -

for code, why error, osteam_iterator template class ,why no matching constructor initalization of 'ostream_iterator', please give , thank you. define ostream_iterator template > class _libcpp_visible ostream_iterator int main(int argc, const char * argv[]) { vector<int> sentence1; sentence1.reserve(5);// 设置每次分配内存的大小 sentence1.push_back(1); sentence1.push_back(2); sentence1.push_back(3); sentence1.push_back(4); sentence1.push_back(5); int c = 5; copy(sentence1.begin(), sentence1.end(), ostream_iterator<int>(cout, 1)); cout << endl; the ostream_iterator class definition looks like: template< class t, class chart = char, class traits = std::char_traits<chart>> class ostream_iterator /*...*/ whereas respective constructor declared as: ostream_iterator(ostream_type& buffer, const chart* delim) since second template argument of ostream_iterator required of character type canno

iphone - Pasted code couldn't work in a new project ? -

today, copied function codes in old project paste in new project, following related codes - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { } when debug project, it's never been called.then related codes , storyboard checked, nothing wrong, deleted pasted functions codes, , wrote codes word word; debug, run , it's been called. the other pasted codes run , called. function had issue. after all, studied issue, , cannot find why happened. please, me solve "the paste codes cannot called". thanks lot. you have capitalization issue in method name. change tableview: tableview: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath should this - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath

android - Which report does the SendEvent data appear on in the Google Analytics dashboard? -

which report sendevent data appear on in google analytics dashboard? here android code : mytracker.sendevent("button", "share button", "articledisplay",lgoolgeanalytics); logcat: 07-23 20:35:53.509: i/gav2(8352): thread[gathread,5,main]: sending hit store where can see sendevent's on dashboard? steve the answer event report, wheren in per method signature mytracker.sendevent(string category, string action, string label, int value); mytracker.sendevent("button", "share button", "articledisplay",lgoolgeanalytics); in google-analytics if want see reprots, under behviour > events > overview

database - The reason that you might want two or more instances for same DB connection? -

i trying think of scenario need more 1 instances of db connection. normally, db connection 1 singleton object used everything. what's reason might want create instance of same class. (i read somewhere.) trying understand this, 2 instances of db connections seem risky cause conflict when writing db. faster when reading? (maybe 1 reason?) maybe db connection not example. can give me other scenario if know anywhere creating more 1 instance of singleton class make sense. you may need more specific on local app/embedded db vs servers. but, if have application server (iis, apache etc...) talks database server (sql server, oracle etc...), want concurrency , multiple connections active @ time. want concurrency since it's server handling many concurrent requests , sql servers should able handle that. serializing database activity on server catastrophic. concerning db connections, db access technologies, offer connection pooling . open connection, work , close.

javascript - i need code for hyperlink that is activated while clicking on nodes? -

i have view data visual network format used cytoscape web. have used example link http://lekshmideepu.blogspot.in/2012/03/cytoscape-web-examples.html drawing network different colored nodes , edges,it works color , size node/edge. need set 1 more event hyperlink each node. please need on-click event node hyperlink in network? <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <script type="text/javascript" src="js/ac_oetags.min.js"></script> <script type="text/javascript" src="js/json2.min.js"></script> <script type="text/javascript" src="js/cytoscapeweb.min.js"></script> </head> <script type="text/javascript"> window.onload=function() { // network data alternatively grabbed via ajax

Where should I be getting my release files from when using git? -

maybe weird question i'm still pretty inexperienced git. finished writing pretty simple chrome extension. i've been using git during development hang of using it, i'm little confused how generate release. in actual project folder there hidden .git folder gets included when pack chrome extension, , don't want that. know can copy files directory , rid of git stuff, there correct way within git able generate kind of release directory project files? or rather, how should doing it? you have makefile or equivalent dist target pack things , create crx file when make dist . packing things not git's responsibility, can't know details of project's structure. another helpful hint having things in src subdirectory can have other, non-source stuff around (like documentation, readmes, libraries, config skeletons, else not source - of these things not apply chrome extension). added benefit .git directory wouldn't in :p

To get Clients hostname without using DNS look up using asp.net -

i searching since 3 weeks not getting content.. can hostname using dns server.. accurate since our dns server takes long time update.. is there other way find hostname.. pls help.. other details: intranet application.. asp.net c# iis 7 you have change local machine dns address see here http://windows.microsoft.com/en-in/windows7/change-tcp-ip-settings

java - Why Thread.sleep is bad to use -

apologies repeated question haven't found satisfactory answers yet. of question had own specific use case: java - alternative thread.sleep is there better or alternative way skip/avoid using thread.sleep(1000) in java? my question generic use case. wait condition complete. operation. check condition. if condition not true, wait time , again same operation. for e.g. consider method creates dynamodb table calling createapi table. dynamodb table takes time become active method call describetable api poll status @ regular intervals until time(let's 5 mins - deviation due thread scheduling acceptable). returns true if table becomes active in 5 mins else throws exception. here pseudo code: public void createdynamodbtable(string name) { //call create table api initiate table creation //wait table become active long endtime = system.currenttimemillis() + max_wait_time_for_table_create; while(system.currenttimemillis() < endtime) { boolean status = //call

gitlab: git clone https with large repos fails -

when trying clone large repo (~700mb) on https, git fails with: c:\git-projects>git clone https://git.mycompany.de/fs.git cloning 'fs'... username 'https://git.mycompany.de': mwlo password 'https://mwlo@git.mycompany.de': efrror: rpc failed; result=22, http code = 500 atal: remote end hung unexpectedly clone on ssh works: c:\git-projects>git clone git@git.mycompany.de:fs.git cloning 'fs'... remote: counting objects: 144564, done. remote: compressing objects: 100% (30842/30842), done. remote: total 144564 (delta 95360), reused 143746 (delta 94542) receiving objects: 100% (144564/144564), 601.34 mib | 1.33 mib/s, done. resolving deltas: 100% (95360/95360), done. checking out files: 100% (4649/4649), done. cloning smaller repositories https works: c:\git-projects>git clone https://git.mycompany.de/git-test.git cloning 'git-test'... remote: counting objects: 135, done. remote: compressing objects: 100% (129/129), done. remote:

exception - JobTrackerNotYetInitializedException -

i'm using mac. when run below command, throws exception. tried jar hadoop examples, throws same exception. "jps" gives following output: 5103 namenode 5613 jps 5343 jobtracker 5277 secondarynamenode 5430 tasktracker so jobtracker should running. when execute: bin/hadoop jar hadoop-cookbook-chapter1.jar chapter1.wordcount input output i following exception: priviledgedactionexception as:shuuseiyi cause:org.apache.hadoop.ipc.remoteexception: org.apache.hadoop.mapred.**jobtrackernotyetinitializedexception: jobtracker not yet running** @ org.apache.hadoop.mapred.jobtracker.checkjobtrackerstate(jobtracker.java:5189) @ org.apache.hadoop.mapred.jobtracker.getnewjobid(jobtracker.java:3533) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ ja

AppFabric Cache Crashes -

the scenario: have written end service periodically checks new rows in database , inserts appfabric cache. have been using approach since 2 odd months. we using server machine store data cache in different regions. not using cluster of machines. single machine. "default" cache region has been divided 3 regions 3 different environments. each environment access machine cached data specified cache region. it working fine until following happening since few days. getting following exception. errorcode: errca0016 :substatus es0001 : connection terminated, possibly due server or network problems or serialized object size greater maxbuffersize on server. result of request unknown. the subsequent access cache throws following exception: errorcode errca0017 : substatus es0001: there temporary failure. please retry later. after 4 5 try, following exception. errorcode errca0018 : substatus es0001 : request timed out. after this, access cache throws following excepti

c# - how can i count duplicates in a list and change the item value -

i have program generates 3 lists based on contents of text file. want @ list , if there's item in more once, i'd change value "number in list x item" , remove duplicates list. here code use open , split file lists: private void open_click(object sender, eventargs e) { if (inputfile.showdialog() == dialogresult.ok) { var reader = new streamreader(file.openread(inputfile.filename)); while (!reader.endofstream) { string line = reader.readline(); if (string.isnullorempty(line)) continue; if (line.startswith("#main")) { deck = "main"; } if (deck == "main") { if (!line.startswith("#")) { int cardid = convert.toint32(line.substring(0)); maindeck.

c++ - GLX/X11 Changing the rendering resolution -

i have made simple application creates window opengl 4.2 context , takes user input. i have implemented making window go fullscreen xrandr , can change display resolution. i change don't have set displays resolution , window/contexts renders @ lower resolution display stays @ default. how implement this? extensions provide or can xrandr , manipulating window rather root window(dektop)? thanks.

data binding - WPF databinding after Save button click -

i have app , settings window tabcontrol containing couple of tabitems. each of them have fields (textboxes) databinded same singleton object. there elegant , wpf-like way the databinding after save button click? right it's databinded after changing content of textbox, , want singleton have old values , update them after clicking save button. for databinding object used in xaml textbox , use updatesourcetrigger property value explicit below: <textbox name="itemnametextbox" text="{binding path=itemname, updatesourcetrigger=explicit}" /> when set updatesourcetrigger value explicit, source value changes when application calls updatesource method below (you can put below code in save click event): bindingexpression = itemnametextbox.getbindingexpression(textbox.textproperty); be.updatesource();

wpf controls - WPF infragistics unbound column Filter not accessible -

Image
i have use xamgrid (version 12.2) unbound column. managed add unbound column display data not able apply filter. there needed done in xaml have filter accessible unbound column. using filter menu option have excel filter enabled. following xaml sample <ig:xamgrid name="xamgrid" autogeneratecolumns="false"> <ig:xamgrid.filteringsettings> <ig:filteringsettings allowfiltering="filtermenu" filteringscope="columnlayout"> </ig:filteringsettings> </ig:xamgrid.filteringsettings> <ig:xamgrid.columns> <ig:unboundcolumn key="myfield" headertext="my field" valueconverter="{staticresource fieldconverter}" valueconverterparameter="" isfilterable="true"> <ig:unboundcolumn.item

c# - Best way to find out distinct item in the big list -

i have following collection, has more 500000 items in it. list<item> mycollection = new list<item>(); and type: class item { public string name { get; set; } public string description { get; set; } } i want return list of items having distinct name. i.e. find out distinct item based on name. what possible ways & best in terms of time & memory. although both important less time has more priority on memory. you can sort list delete repeated items, seems storing data in dictionary<string, string> better task. or maybe put list in hashset .

Is there a way to insert javascript code to track and record clicks, requests and responses? -

i have website, links,external , internal iframes, javascript calls, etc. not simple site. supporting problems site, searching way insert "wrapping" javascript or other code, when "turned on" record activity on site specific user: record button clicks, requests , responses, , html shown on screen. then user , when facing issue, can turn on "tracking", make actions reach error, , send traces - while having requests, responses, html shown, click reproduce easy understand issue fast , solve it. anything can it? ofcourse, without changing existing code , links. thanks, tal

Custom Error Message for Event Receiver in SharePoint 2010 -

Image
i want users upload .doc files in document library. to so, have developed event receiver in visual studio 2010. my code follows: public override void itemadding(spitemeventproperties properties) { try { base.itemadding(properties); eventfiringenabled = false; if (!properties.afterurl.endswith("doc")) { properties.errormessage = "you allowed updload .doc files"; properties.status = speventreceiverstatus.cancelwitherror; properties.cancel = true; } } catch (exception ex) { properties.status = speventreceiverstatus.cancelwitherror; properties.errormessage = ex.message.tostring(); properties.cancel = true; } } the code referred this example. my problem while uploading non-doc files preventing system error message not user friendly defined in properties.errormessage . how solve

maven - glassfish not logging after deploy -

we turned our project maven project , since have problem logging. before in log files (system.in/err etc) , see them in netbeans glassfish tab. deploy "stucks" @ initializing part: undeploying ... distributing d:\extmontool\trunk\src\target\extmon-1.0-snapshot.war [glassfish server 3+] initializing... the app deployed , works there no log in server.log or netbeans any idea should change should problem? the problem arises after these lines in log: info: hhh000227: running hbm2ddl schema export info: hhh000230: schema export complete info: hhh000030: cleaning connection pool [jdbc:hsqldb:mem:richfaces_showcase] so, guess problem caused richfaces-showcase , when hibernate trying clean connection pool. if you're not using richfaces-showcase anyway (which you're not), exclude dependencies, cannot cause trouble. by running dependency:tree goal, can see, richfaces-distribution contains following: +- org.richfaces.ui:richfaces-components-api:ja

iphone - Is it possible to remember and force the last used keyboard in my app a la messages? -

is there way on ios remember if user used specific keyboard (let's hebrew) in textfield in app? , if so, possible me display same keyboard next time goes screen , uses same textfield? i know messages since ios 6 thanks

java - Java7 Type inference for generic instance creation? -

how can use java 7 type inference generic instance creation feature ? benefits use new style? this known diamond operator. saves having write generic type arguments on instantiation of generic type. type arguments of instantiated generic type inferred type arguments present on declaration. arraylist<string> list = new arraylist<>(); instead of: arraylist<string> list = new arraylist<string>();

save image to a folder under web-app in grails -

i need save image folder in application. far have learned save image database need save folder. how can this? can please me on please? here code below save database >>> def upload={ def user = user.findbyid(1) commonsmultipartfile file = params.list("photo")?.getat(0) user.avatar = file?.bytes user.save() } find below step wise implementation, have added gsp page uploadform(it have multipart form submission default), , controller function handle file save request, , service method save file in specified directory: step1: create form file upload: <g:uploadform name="picuploadform" class="well form-horizontal" controller="<your-controller-name>" action="savepicture"> select picture: <input type="file" name="productpic"/> <button type="submit" class="btn btn-success"><g:message code="shopitem.btn.saveproductimage"

linker - How do I link the library containing 'pyrUp' for opencv? -

i've been compiling , linking opencv code past few days following command: g++ motion.cpp -o motion `pkg-config --cflags --libs opencv` but have added call pyrup() function: pyrup( in, out, size( 640,480 ) ); now when compile following linker error: motion.cpp:(.text+0x1385): undefined reference `cv::pyrup(cv::_inputarray const&, cv::_outputarray const&, cv::size_<int> const&, int)' collect2: ld returned 1 exit status what missing? there alternative function should using? thought linking in of opencv libraries. as understand pkg-config( ref ) loads config file here /usr/local/lib/pkgconfig/opencv.pc contains number of settings. you may have add specific lib contains pyrup on end of line libs: -l${libdir} -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann the opencv.pc file may reside in different folder

python - converting list of numbers into list of strings appending some strings -

this question related converting list of numbers list of strings appending strings. how convert source below : source = list (range (1,4)) into result below: result = ('a1', 'a2', 'a3') you can either use list comprehension : # in python 2, range() returns `list`. so, don't need wrap in list() # in python 3, however, range() returns iterator. need wrap # in `list()`. can choose accordingly. infer python 3 code. >>> source = list(range(1, 4)) >>> result = ['a' + str(v) v in source] >>> result ['a1', 'a2', 'a3'] or map() lambda : >>> map(lambda x: 'a' + str(x), source) ['a1', 'a2', 'a3']

html - margin between to display table-cell -

i have following html <div> <div id="one">one</div> <div id="two">two</div> </div> and applied following css #one, #two{ display: table-cell; vertical-align: middle; height: 47px; background: red; border-collapse: separate; border-spacing: 10px; } demo but couldn't achieve desired. need space between 2 divs. if give padding value give space not remove background. you need put border-spacing , border-collapse rules on parent div, not table-cell divs.

if freemarker could add extends feature? -

some directive: #extends, #block, #override, #super for example, have layout template file, base.ftl <html> <head> <#block name="head">base_head_content</#block> </head> <body> <#block name="body">base_body_content</#block> </body> </html> now, write page, child.ftl <@override name="body"> <div class='content'> powered rapid-framework </div> <@super/> </@override> <@extends name="base.ftl"/> then, have following outputs, <html> <head> base_head_content </head> <body> <div class='content'> powered rapid-framework </div> base_body_content </body> </html> isn't idea? is this question, or request