@BenFortune If you don't like @THE just don't interact with him. If you feel he's doing something wrong like vamping to much ping a RO and they'll make sure everything is under control.
If you want to insult him, please do it in a funny way. These things are only good if they're funny.
@BenjaminGruenbaum He is insulting me since I met him here and not even in a funny way, I am happy to keep him on ignore from now on, nothing personal but don't like people who pick up every single word you say
@tereško I looked at an example, and to me, the advantage over the constructor is that just by checking for one property it supplies the instance with the rest of them
@AwalGarg while it decouples your code from new, it also has useful properties: it lets several instances to share the same dependencies (like DB connection abstraction) and lets you perform operations on the instance before releasing in int the general application.
mind you, it is considered a bad practice to put "logic" in the constructor
@BenFortune Oh yeah I've been reading about this, but it's not quite as straightforward to use as nwjs, is it? Mind you, I have no experience with electron. You can easily make binary bundles w/o having to compile and shit?
@tereško also I am not sure what you mean by the second point, I am a bit of a noob at design patterns. Somewhere I can read about this in a bit less technical language?
lololol... just had a quick look into main_out.js from agar.io. The guy who created that has some questionable skins in there :P "hitler;german empire;satanist;nazi;stalin;prussia;isis;
In computer programming, an indent style is a convention governing the indentation of blocks of code to convey the program's structure. This article largely addresses the free-form languages, such as C programming language and its descendants, but can be (and frequently is) applied to most other programming languages (especially those in the curly bracket family), where whitespace is otherwise insignificant. Indent style is just one aspect of programming style.
Indentation is not a requirement of most programming languages, where it is used as secondary notation. Rather, programmers indent to better...
let's say I have the following function
chrome.cookie.getAll({domain: 'google.com'}, callbackFn)
where callbackFn should return all the cookies available
now I have a big main() function(I must have this function) and this function must return the cookies of the given page(as a promise).
How...
@dystroy it's not a RTFM and it's not a wall of doc, it's just 4 cases of converting APIs to promises in short code samples. One of them fits OP's case perfectly.
If you think you can explain the issue better - please do post an answer on the canonical. We gain nothing by hand-tailoring answers to the OP and everything by having strong references to point people to.
@dystroy yeah that's what it felt too, but dunno how SO should handle that. It's technically a duplicate, but I know I'd hate to be redirected to this canonical if I had a simple issue as this one
@BenjaminGruenbaum I think closing like this should not be a "duplicate" because the question is not really a dupe. It should be more like - "closing so that the better content can be promoted, edit if you still feel those answers don't help"
A good answer should do many things in this context, it should point people to the canonical async Q&A in case they don't even know how async execution works, it should point to people in broad terms how promises work, it should point out there are different conventions and so on.
@darkyen00 A fan? Hmm, not exactly. But, admittedly, I have a preference for quite a few Microsoft products, including Office, Windows, Visual Studio, Azure, TypeScript and .NET. I don't categorize myself as a "Microsoft is the best thing ever!"-kind of guy though (as seemingly ever Apple product consumer is for Apple).
I also never understood that one. when do you guys not have access to the HTML on the page you're working on? and if this is a userscript you can inject the code anywhere.
[MySQL] someone? I have a table with title UNIQUE, and I did
START TRANSACTION;
INSERT INTO article (title,content,id_user) VALUES ('t1', 'c1',1);
INSERT INTO article (title,content,id_user) VALUES ('t1', 'c1',2);
COMMIT;
but it inserted the first line, crashed on the second, it shouldn't have inserted the 1st right?
$('#do_ok').on('click', function () { $('#status_ok').text('calculating....'); // This works on IE8. Works in Chrome // Does NOT work in FireFox 25 with timeout =0 or =1 // DOES work in FF if you change timeout from 0 to 500 window.setTimeout(function (){ long_running('#status_ok') }, 0); });
This works , the only difference is that , this has a setTimeout !
@RoelvanUden actually I'm still in the transation with this DB user, the transaction is not ended, I don't know how to end it... and if I select my table from another DB user the 1st line isn't here
@crl Of course not. A transaction is exclusive and isolated. Another query can't see changes that are isolated until they are committed. That's exactly the design; it's not a flaw.
my coding style tells me to put my application code in the end of the body. I never have to wrap anything unless I'm waiting for images to load. document.ready is completely useless to me