Posts

Showing posts from May, 2011
should be glad to see many women of that type in the Y.M.C.A. work. It is one of the great needs of our army that the boys should be amused and kept clean mentally and morally. I don't believe there is any organization better qualified to do this than the Y.M.C.A. Most of our chaps spent their time "on their own" either in the Y.M.C.A. hut or in the estaminets while we were in Petite-Saens. Our stop there was hardly typical of the rest in billets. Usually "rest" means that you are set to mending roads or some such fatigue duty. At Petite-Saens, however, we had it "cushy." The routine was about like this: Up at 6:30, we fell in for three-quarters of an hour physical drill or bayonet practice. Breakfast. Inspection of ammo and gas masks. One hour drill. After that, "on our own", with nothing to do but smoke, read, and gamble. Tommy is a great smoker. He gets a fag issue from the government, if he is lucky, of two packets or twenty a ...
Nov. XXIX. MDCCXXXI; Eblanae literis institutus; Obiit Londini, April IV, MDCCLXXIV.' Sir William Forbes writes to me thus:-- 'I enclose the Round Robin. This jeu d'esprit took its rise one day at dinner at our friend Sir Joshua Reynolds's. All the company present, except myself, were friends and acquaintance of Dr. Goldsmith. The Epitaph, written for him by Dr. Johnson, became the subject of conversation, and various emendations were suggested, which it was agreed should be submitted to the Doctor's consideration. But the question was, who should have the courage to propose them to him? At last it was hinted, that there could be no way so good as that of a Round Robin, as the sailors call it, which they make use of when they enter into a conspiracy, so as not to let it be known who puts his name first or last to the paper. This proposition was instantly assented to; and Dr. Barnard, Dean of Derry, now Bishop of Killaloe, drew up an address to Dr. Joh...
They were quite frank and easy. Johnson told the story of his asking Mrs. Macaulay to allow her footman to sit down with them, to prove the ridiculousness of the argument for the equality of mankind; and he said to me afterwards, with a nod of satisfaction, 'You saw Mr. Wilkes acquiesced.' Wilkes talked with all imaginable freedom of the ludicrous title given to the Attorney-General, Diabolus Regis; adding, 'I have reason to know something about that officer; for I was prosecuted for a libel.' Johnson, who many people would have supposed must have been furiously angry at hearing this talked of so lightly, said not a word. He was now, INDEED, 'a good-humoured fellow.' After dinner we had an accession of Mrs. Knowles, the Quaker lady, well known for her various talents, and of Mr. Alderman Lee. Amidst some patriotick groans, somebody (I think the Alderman) said, 'Poor old England is lost.' JOHNSON. 'Sir, it is not so much to be lamented tha...
customers amongst his numerous acquaintance. Fitzherbert was one who took his smallbeer; but it was so bad that the servants resolved not to drink it. They were at some loss how to notify their resolution, being afraid of offending their master, who they knew liked Foote much as a companion. At last they fixed upon a little black boy, who was rather a favourite, to be their deputy, and deliver their remonstrance; and having invested him with the whole authority of the kitchen, he was to inform Mr. Fitzherbert, in all their names, upon a certain day, that they would drink Foote's small-beer no longer. On that day Foote happened to dine at Fitzherbert's, and this boy served at table; he was so delighted with Foote's stories, and merriment, and grimace, that when he went down stairs, he told them, "This is the finest man I have ever seen. I will not deliver your message. I will drink his small-beer."' Somebody observed that Garrick could not have done...
mean, Sir? What do you take me for? Do you think I am so ignorant of the world as to imagine that I am to prescribe to a gentleman what company he is to have at his table?' BOSWELL. 'I beg your pardon, Sir, for wishing to prevent you from meeting people whom you might not like. Perhaps he may have some of what he calls his patriotick friends with him.' Johnson. 'Well, Sir, and what then? What care I for his PATRIOTICK FRIENDS? Poh!' BOSWELL. 'I should not be surprized to find Jack Wilkes there.' Johnson. 'And if Jack Wilkes SHOULD be there, what is that to ME, Sir? My dear friend, let us have no more of this. I am sorry to be angry with you; but really it is treating me strangely to talk to me as if I could not meet any company whatever, occasionally.' BOSWELL. 'Pray forgive me, Sir: I meant well. But you shall meet whoever comes, for me.' Thus I secured him, and told Dilly that he would find him very well pleased to be one of his...
'Lord Chesterfield's Letters to his Son, I think, might be made a very pretty book. Take out the immorality, and it should be put into the hands of every young gentleman. An elegant manner and easiness of behaviour are acquired gradually and imperceptibly. No man can say "I'll be genteel." There are ten genteel women for one genteel man, because they are more restrained. A man without some degree of restraint is insufferable; but we are all less restrained than women. Were a woman sitting in company to put out her legs before her as most men do, we should be tempted to kick them in.' No man was a more attentive and nice observer of behaviour in those in whose company he happened to be, than Johnson; or, however strange it may seem to many, had a higher estimation of its refinements. Lord Eliot informs me, that one day when Johnson and he were at dinner at a gentleman's house in London, upon Lord Chesterfield's Letters being mentioned, Johns...
The people have spoken! At the end of last year we asked you, our readers, to vote on the films and soundtracks you thought were the best of 2010. We sent our message far and wide across numerous platforms (Facebook, LinkedIn, Twitter, Orkut, etc) and got a great response. I have to say, the results threw quite a surprise at me, especially with the support for certain films I didn’t think would score so well, or those I didn’t consider. So, after collecting all the votes from the various discussion threads (including the comments at the bottom of the original post), here are the top 10 films and top 5 soundtracks of 2010, as determined by you: Top 10 Films: 10. Phas Gaye Re Obama and Tere Bin Laden – Interestingly, both films are small, low-budget situational comedies and commentaries on current political and economic affairs. The first film is by emerging director Subhash Kapoor while the second is the directorial debut of Abhishek Sharma. 9. Guzaarish – As is the norm, the fil...

ios - Alamofire: How to download files sequentially -

i have array of video files want download. using loop download each of them. when loop runs, files download in parallel, causes app hang, ui freeze, cpu use go through roof. for url in urlarray{ downloadfile(url) } i have function downloads file given url. func downloadfile(s3url:string)->void{ alamofire.download(.get, s3url, destination: destination) .progress { bytesread, totalbytesread, totalbytesexpectedtoread in println(totalbytesread) } .response { request, response, _, error in println(response) } } how can change files dont download @ sametime? also, how can check download finished can update ui? what call out function when file completes downloading (i.e. totalbytesread >= totalbytesexpectedtoread). in function, pop next item off list , call download function again new url. make array of urls , when need new item, remove array , pass download function. check if array empty , if is,...

Use of # in JavaScript (outside of jQuery and CSS)? -

i know of use of # in jquery , css, in vanilla javascript environment has no jquery or css intervention, # have use? yes, in javascript can use character # inside strings. for example, # begins id selector in css, can use in js: document.queryselector('#someid'); and in urls, # begins hash. in javascript can hash of object implements urlutils functionality using hash property: location.hash; // '#somehash' location.hash = '#anotherhash'; you can use delimiter strings: var arr = ['ab', 'c', 'de', 'fg', 'h', 'ij']; // longer var arr = 'ab#c#de#fg#h#ij'.split('#'); // shorter and of course may want string contain # character. in case, use # : var str = 'this string has number sign @ end: #'; apart strings, can use # in regular expressions: var rg = /#/; // matches character `#` literally

SQL join on two columns with different format -

i have column in table1 numbers id 4-157-802 354-332 33-989-083 5-525-688 i have column in table2 same numbers without dash (-) id 4157802 354332 33989083 5525688 i tried writing join statement join these tables based on these 2 columns follows, not working. select * table1 table1.id = table2.id , table2.id in ('5525688') need problem. appreciated. select table1.* table1 join table2 on replace(table1.id,'-','') = table2.id you can try using replace function.

opengl - Why does using glViewport for some GL_QUADS increase my window space area? -

Image
so i'm doing exercise involves graphing in opengl , coloring each quadrant. i've done it, when color quadrants before graphing function makes bigger defined size. below leave code clarification. in init declare necessary space of gluortho2d(-10,10, -10,10); this in main method called glutdisplayfunc(linegraph) if put @ top colors background increase space of window. //1 cuadrante glviewport(125, 375, 250, 250); glcolor3ub(255,255,0); dibujafondocuadrantes(); //2 cuadrante glviewport(0, 375, 250, 250); glcolor3ub(255,0,0); dibujafondocuadrantes(); //3 cuadrante glviewport(125, 250, 250, 250); glcolor3ub(0,255,0); dibujafondocuadrantes(); //4 cuadrante - realmente el 4 glviewport(0, 250, 250, 250); glcolor3ub(0,0,255); dibujafondocuadrantes(); which method dibujafondocuadrantes() has: glbegin(gl_quads); glvertex2f(-10, 0.0);//esquina izq arriba glvertex2f(-10, -10);//esquina izq abajo glvertex2f(0.0, -10);// esquina derecha abajo glvertex2f(0.0, 0.0);//esq...

javascript - How to create a download button out of an image? -

i have icon , want work download button pdf. i've tried several things nothing has worked far easy way this? fairly simple wrap icon in anchor, or use icon background one <a href="path/to/download"> <img src="icon.png"> </a>

PHP coding without "ids" in URL -

i don't know correct term in need of apologize in advance misleading title. when code in php use ?idname=value such as: http://domain.com/phpfilename.php?idname=value what instead of is: http://domain.com/mysites/ysub live example: http://www.probuilds.net/guide/euw/2263803659/52210396 stackoverflow uses same style don't understand how works? search pretty or semantic urls. first part handled webserver, converts pretty url "classic" style url pointing script , adding rest of url url parameter. called url rewrite . for example: http://example.com/this/is/pretty/url rewritten http://example.com/script.php?id=this/is/pretty/url then have variable $_get['id'] containing string "this/is/pretty/url" (usually called slug ) instead of integer id in php script. it's how you'll handle in php.

javascript - scroll bar in scaling svg image -

i have following d3 graph var width = 500, height = 300; d3.select("body").append("div") .attr("id", "containerdiv"); // remove old svg //d3.select("#wkfsvg").remove(); // add new svg var grapharea = d3.select("#containerdiv").append("svg") .attr({ width: width, height: height, "pointer-events": "all" }) .attr("id","wkfsvg"); var g = new dagred3.graphlib.graph().setgraph({}); grapharea.insert("g", "g"); var nodesjson = [ { "nodes": "initiate", "status": "startend", "creation_date": "", "performer_name": "", "execution_type": "automatic" }, { "nodes": "find next approver", "status"...

How to make Powershell ISE support colors and non-ASCII characters? -

here sample output windows powershell when run grunt task in project directory: done, without errors. execution time (2015-08-25 01:57:14 utc) loading tasks 9ms ██████ 17% loading grunt-contrib-copy 23ms ███████████████ 43% copy:styles 20ms █████████████ 38% total 53ms running "autoprefixer:server" (autoprefixer) task autoprefixer's process() method deprecated , removed in next major release. use postcss([autoprefixe r]).process() instead file .tmp/styles/main.css created. "done, without errors" in green , ".tmp/styles/main.css" in cyan. running same command in powershell ise, produces following: [32mdone, without errors.[39m execution time (2015-08-25 01:58:40 utc) loading tasks 9ms ███████ 20% loading grunt-contrib-copy 20ms ████████████████ 45% copy:styles 14ms ███████████ 32% total 44ms [4mrunni...

javascript - Regex for converting indented lines into code blocks -

i making regex parses code blocks, problem is, there problem! now, code blocks so's, 4+ spaces or 1+ tab. problem is, regex grabbing first , last lines of code blocks :( have no clue why. simply, regex: /^(?:( {4,}|\t+)(.+))$(?:(?:(?:\n?)( {4,}|\t+)(.+))*)$/ then using this: .replace(/^(?:( {4,}|\t+)(.+))$(?:(?:(?:\n?)( {4,}|\t+)(.+))*)$/gmi, function (m, g1, g2, g3, g4) { return "<code>" + (g1 + g2) + ("\n" + g3 + g4) + "</code>"; }) so question is, how can return of lines, , not first\last lines? bonus there way can remove 4 spaces/1 tab before displaying in code block? :d edit i show example of not work: works: line #1, 4 spaces line #2, 4 spaces does not work: line #1, 4 spaces line #2, 4 spaces line #3, 4 spaces what display lines #1 , #3. edit 2 just in-case want full context of code, here is: .replace(/^(?:( {4,}|\t+)(.+))$(?:(?:(?:\n?)( {4,}|\t+)(.+))...

Star Schema design -

i have question in regards star schema design, whether need use snowflake (which read should avoided). have following 3 dimension tables: main list dim. - contains list of people sub lists dim. - contains sorts of combinations main list program dim. - identify lists of programs, each program connected sub list each row in fact table contain keys following 3 tables (and metrics), issue - sub lists can exact list (in terms of list content) pointing different programs. should create in sub list dimension repetition of same content or should use snow flake connect between sub lists , programs? example - assuming main list contain 100k records, , have 3 programs a, b , c. program has 10k sub list have 10k entries in sub list dimension, program b , c have same sub list 30k records, should create 60k entries, 30k per each?? important note there other attributes in program dim differentiate between each program, , fact data @ program level. thanks!

java - Find the greatest odd number with a limited number of bits -

i trying solve question automated judge returning "time limit exceeded" (tle). on occasion of valentine day , adam , eve went on take part in competition.they cleared rounds , got finals. in final round, adam given number n , integer k , has find greatest odd number m less n such sum of digits in binary representation of m atmost k. input format: for each test case given number n , integer k output format: for each test case, output integer m if exists, else print -1 constraints: 1 &leq; t &leq; 10 4 2 &leq; n &leq; 10 9 0 &leq; k &leq; 30 sample input: 2 10 2 6 1 sample output: 9 1 this have done far. static long play(long n, int k){ if(k==0) return -1; if(k==1) return 1; long m=n-1; while(m>0){ long value=long.bitcount(m); //built in function count bits if(value<=k ){ return m;...

java - Pojo to json schema v4 and vice versa via maven -

i trying come set of documents 1 of our projects there requirement convert java pojos json schema 4 , json schema 4 pojos. couldn't find maven plug-in both of it. i able find https://github.com/wodzuu/jsonschema4-mapper json schema generation , https://github.com/joelittlejohn/jsonschema2pojo pojo generation. i sure common use case, writing check folks used past this? inputs

javascript - Why doesn't this two way data binding work? -

i have controller. whenever try bind $scope.things received json server, view wont update. in fact, if left push(newthing) , uncomment calls getallthings() , view display data and, in less second, remove it. the problem is: in server side (morgan running node , mongodb), i'm printing out json object before passed client , object correct, have latest created object. i'm willing use push instead of making request server fetch data, i'm upset topic. interesting thing second, third , consequent calls insertthing() update view. made feel kind of clueless. can provide more code if needed. controller: $scope.insertthing= function(newthing){ $scope.things.push(newthing); $http.post('http://localhost:8080/things', newthing) .then(function(res){ //$scope.getallthings(); delete $scope.newthing; }, function(res){ }); //$scope.getallthings(); }; $scope.getallthings = function(userdpt){ $http.post('http://localho...

c# - How can I use an IValueConverter to bind to different properties of an object in WPF? -

i have property in view model has property of class has multiple properties e.g. public class content { public int selector { get; set; } public int value1 { get; set; } public int value2 { get; set; } public int value3 { get; set; } public int value4 { get; set; } } public class viewmodel { public content contentinstance { get; set; } } and want bind in xaml converter such value of selector determines value bound element e.g. <textbox text="{binding contentinstance, converter="contentvalueconverter", targetnullvalue='', mode=twoway, updatesourcetrigger=propertychanged}"/> so far have: public class contentvalueconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, cultureinfo culture) { var contentpart = value content; if(contentpart == null) return; switch(contentpart.selector) { case 1: return c...

android - Finding which phone contacts are users in Parse -

in application, each user signs in phone number. in other words, each username corresponds different number. want detect phone contacts using application in way. however, not determine how should this. @ first, think querying each contact , users_in_contacts using or query @ end. method given in this answer : public void getfriends(list<string> numbers) { list<parsequery<parseuser>> queries = new arraylist<parsequery<parseuser>>(); (string number : numbers) { parsequery<parseuser> parsequery = parseuser.getquery(); parsequery.whereequalto("username", number); queries.add(parsequery); } parsequery<parseuser> userquery = parsequery.or(queries); userquery.findinbackground(new findcallback<parseuser>() { @override public void done(list<parseuser> numberlist, parseexception e) { if (e == null) { (int = 0; < numberlist.size(); i+...

jquery - Javascript - Rotating sphere pattern with flying objects around it -

how can achieve effect www.blackbox.cool ? so far managed sphere feel doing wrong demo for reason speeds after 10 seconds , slows down , can't think of how these flying objects around sphere $(function(){ var el = document.createelement('div'), transformprops = 'transform webkittransform moztransform otransform mstransform'.split(' '), transformprop = support(transformprops); function support(props) { for(var = 0, l = props.length; < l; i++) { if(typeof el.style[props[i]] !== "undefined") { return props[i]; } } } var $sphere = $('#sphere'), sphere = { rounds: 10, panels: 25, panelwidth: 200, el: $sphere.find('.container'), build: function(p, r) { var panels = p || this.panels, rounds = r || this.rounds, rot...

sockets - why the cookies continues working -

i have question reason web applications continues setting cookies, because persistent http conections use sockets, i.e.: websocket. http 1.1 , 2 uses persistent http conections, sockets in client , server. these sockets active necessary time loading complete web page (html, css, images, etc), sockets killed server. logic due server not know doing client. so, in scenario, use of cookies justified. but, websocket think scenary different, because uses 1 socket, means after conection done, server , client uses sockets sending data. so, question is... why cookies necessary if server know client? this question impossibly broad, since many different web applications work in many different ways. in general, cookies used store data needs persist beyond momentary connection between client , server. more specifically, connection between client , server can transient. server receives request, sends page, , moves on next request. doesn't maintain constant connection every...

numpy - How to np.roll() faster? -

i'm using np.roll() nearest-neighbor-like averaging, have feeling there faster ways. here simplified example , imagine 3 dimensions , more complex averaging "stencils". example see section 6 of paper . here few lines simplified example: for j in range(nper): phi2 = 0.25*(np.roll(phi, 1, axis=0) + np.roll(phi, -1, axis=0) + np.roll(phi, 1, axis=1) + np.roll(phi, -1, axis=1) ) phi[do_me] = phi2[do_me] so should looking returns views instead of arrays (as seems roll returns arrays)? in case roll initializing new array each time it's called? noticed overhead huge small arrays. in fact it's efficient arrays of [100,100] [300,300] in size on laptop. possibly caching issues above that. would scipy.ndimage.interpolation.shift() perform better, way implemented here , , if so, fixed? in linked example above, i'm throwing away wrapped parts anyway, might not always. note: in question i'm ...

java - Use properties file in Spring -

i newbie spring framework. in spring application there details below details needs maintain in properties file. transaction name transaction id txt_cco = 70001 txt_cci = 70002 txt_ssm = 20005 in controller, there action below. @requestmapping(value = {"/validatewalletamount**"}, method = requestmethod.get) public @responsebody string validatewalletamount(@requestparam("mobile") string mobile, @requestparam("pin") string merchant_pin, @requestparam("provider") string provider, @requestparam("currency_type") string currency_type, @requestparam("amount") string amount) { //to - txntypeid provider return "02 | 1000.00 | 0.00"; } according request parameter provider need relevant transacti...

c++ - Best way to analyze similarity of two datasets -

so i'm looking best way analyze 2 datasets , compare how similar are. each dataset consists of data each point in swipe gesture , need analyze how similar based on data. prefer in objective c c++ , swift work well. thanks guys! i think best approach solving problem use "artificial neural networks". @ comparing 2 sets of data , return amount of similarity. check out link below: https://en.wikipedia.org/wiki/artificial_neural_network i hope you.

android - IBM Worklight console preview commmon resources link error: Not Found -

im encountering issues when try preview apps using 'preview common resoursces' @ worklight console after deployment worklight server (a physical server installed worklight) im getting below error: not found the requested url / contextroot /apps/services/preview/ appname /common/0 not found in server does have encountered , resolved same issue? p/s: have deployed new worklight runtime environment in worklight server using worklight server configuration tool uploaded project .war files , deployed successfully. have restart service , when view in worklight console new runtime there. deployed .wlapp , .adapter cannot view application @ worklight console. thanks the preview server let no longer present in server deployments termed "remote servers" (non-development servers == not studio). in later fixes preview button removed. in short, preview hours not available in server deployment environment.

symfony1 - How to enable a new Tab in OrangeHRM? -

i want create new tab in orangehrm add facility customized reports. followed steps in website http://vizteck.com/blog/6-steps-how-write-new-module-orange-hrm/ , managed set , display new tab. when try write code in newly created tab. error tab not enabled. can me on how enable tab? what version of orangehrm use? if 3.1 versions , can read: orange hrm 3.1- adding new menu title tab i use 3.3 version, , name of tables others ( ohrm_data_group, ohrm_data_group_screen, , others.) actually try whit 3.3 versions. sorry bad english. cesar luis (dantrix2006[at]gmail.com

mongodb - Updating fields efficiently without losing data -

i'm getting feet wet pymongo, , seems easy task i'm not sure best way it. i have dictionary of member objects, each of has dictionary (key-value pairs of data). go through dictionary of member objects, , update database: writing every field present in member object db, and leaving unchanged other fields present in db member id not present in member object. here's best shot, running extremely slow, i'm guessing there's better way. (maybe one-liner?) in code, self.members dictionary of members i'm iterating through, , member.structure() returns dictionary of member object's data. for m in sorted(self.members.values(), key=lambda val:val.session) : ## each member if mcollection.find_one({'id':m.id}) none: ## if there no db entry matching member id print("\tmember {0} wasn't present in db. inserting.".format(m.id)) mcollection.insert(m.structure()) ## insert full dictionary else: ## i...