« first day (2476 days earlier)      last day (2475 days later) » 

2:07 AM
My goal is to get some data API from javascript and then have my html automatically refresh the results to a table. I only know how to use AngularJS to do this by binding it to some scope in the controller but want to try something other front end framework. What would you guys recommend?
 
I will just leave this here: apps.neallub.in/minesweeper/docs (then run away)
 
keep getting bombs when i shouldnt
 
2:25 AM
Neal2017
 
user6820627
@Neal react again, i hate react, why not canvas?
 
@Neal this is wrong
 
user6820627
@Neal here is typo in your file name: caculateBombsInRows.js
 
I winned
But yeah, that's not how minesweeper works
 
you also can lose on the first click. Minesweeper never let you lose on the first click.
I played a lot of minesweeper when I was younger. I don't mean to be overly critical of this minesweeper browser game.
 
2:36 AM
I wish there was a version of Minesweeper that would never make you lose if you're forced to guess.
 
my best score on easy was 6s
 
Oh, now I know how minesweeper works.
I thought you had to randomly click and just wish you didn't click a bomb. I was wrong.
 
@LearnHowToBeTransparent What makes you hate react ?
 
@AntoineGrandchamp Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
user6820627
@AntoineGrandchamp because it's easier to create this game using canvas
 
2:39 AM
Minesweeper with a smaller neighbourhood is damn hard. I wonder if a bigger neighbourhood would also be harder
 
what do you mean by neighbourhood?
 
In cellular automata, the Moore neighborhood is defined on a two-dimensional square lattice and is composed of a central cell and the eight cells which surround it. The neighborhood is named after Edward F. Moore, a pioneer of cellular automata theory. It is one of the two most commonly used neighborhood types, the other one being the von Neumann neighborhood. The well known Conway's Game of Life, for example, uses the Moore neighborhood. It is similar to the notion of 8-connected pixels in computer graphics. The Moore neighbourhood of a cell is the cell itself and the cells at a Chebyshev distance...
 
how would you make it bigger? 3d minesweeper?
 
@hsimah lol its not perfect. I only had three hours to do it.
 
that was the hardest game of minesweeper i've ever played
 
2:44 AM
@Neal it's better than I could come up with in double that time
 
You could probably get around the insta-lose by seeding the board on the first click
 
it destroyed all my preconceived ideas of how to play
 
@hsimah Thank you :-)
@monners Ive lost right away in minesweeper before.
just as an FYI
 
Playing official minesweeper? Must have been a super-old version
 
it's 100% not easier to make this in canvas
 
2:46 AM
@monners someone made a port online
 
@monners i think the newer versions allowed it. I know the original did not
 
@david lol true.
 
@hsimah Extended Moore neighbourhood, i.e anything within 2 pixels, or 3 pixels
 
@LearnHowToBeTransparent Why canvas? lol
 
Parents wouldn't allow it. Fills kids' heads with this notion that the world is unfair
 
meh. again. it was a code test. so only had 3 hours. I did not really look up all the "rules"
 
@KendallFrey That would be hard so hard ! I am curious to try it though
 
@AntoineGrandchamp How do you know it would be hard?
I should try to make it though...
 
@LearnHowToBeTransparent still works ;-P slepping doesn't matter ;-)
 
@KendallFrey I think that the number of possibilities would be way higher when you try to guess a bomb position.
 
2:50 AM
I'm not convinced that's the case
 
user6820627
@Neal you are nice enough to upload the source map :D
 
You'd have way more cross-referencing ability
 
@LearnHowToBeTransparent it is a github page.... github.com/maniator/minesweeper
have at it.
;-)
 
3:21 AM
@KendallFrey I just made a version with the bigger neighboor. It is clearly way harder !
 
3:31 AM
so you click a square and it tells you not only how many directly adjacent mines, but also ones that are next to the adjacent squares?
 
Exactly
instead of having a 3x3 square around the bomb, you now also have a 5x5 square
If anyone wants to try it here is the code : github.com/AntoineGrandchamp/minesweeper
 
no thanks
thats too hard
minesweeper was a method of distraction and relaxation for me
that sounds like hard work lol
 
That's what i am thinking too! But a was just curious too see
I*
 
4:02 AM
is it hosted somewhere?
 
4:14 AM
The issue was I forgot the rules also included corners in the count
@AntoineGrandchamp ^
 
 
1 hour later…
5:33 AM
is it possible to run NodeJS code synchronized?
such as fs.readDirSync
how did NodeJS realize the code~~
76
A: How to wrap async function calls into a sync function in Node.js or Javascript?

abbrdeasync turns async function into sync, implemented with a blocking mechanism by calling Node.js event loop at JavaScript layer. As a result, deasync only blocks subsequent code from running without blocking entire thread, nor incuring busy wait. With this module, here is the answer to the jsFidd...

 
Helloo..
I have to trigger a R-script from my nodejs. I;m using this npm package called R-Script : https://www.npmjs.com/package/r-script.

Looks like it is using a spawn internally. I'm getting ENOENT error. Can anyone guide me how to fix this issue?

Err - msg : events.js:182
throw er; // Unhandled 'error' event
^

Error: spawn Rscript ENOENT
at exports._errnoException (util.js:1016:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
at onErrorNT (internal/child_process.js:366:16)
 
maybe the anwser
 
that deasync ...
in threaded programming paradigm, it's considered as a waste if you let a thread sleep for a pretty (okay, deterministic...) long period.
 
How to send a mailchimp email template without using mandrill in c#?
 
Your best bet is to ask this question in the C# room
they have more experience with C# so maybe they can help you
 
5:46 AM
no one is active in that room
pls help me
 
lol
 
I can help you
but first you need to port your C# code over to nodejs
 
hahaha
 
Mohan, put a SO question then. It's early in the morning in West-europe and clearly night time in USA. There aren't much east (india / china / japan ) people contributing actively here on SO. Don't expect to have an answer immediately. " Patience " is a keyword here.
 
@david just give me an idea and links
 
5:50 AM
google?
 
^-- or let doctor googol help ya
 
is sitefinity any good?
 
I have a policy against using anything with finity in the name
 
this project has a really bad smell to it
the developers remote into the hosted environment and do development there
 
ugh
australia's largest software development company made me to that
 
5:53 AM
Ha! Sounds like how my previous place did their offshore dev
 
and because there can only be two concurrent users..
 
they took our PCs from us and made 20+ devs use a VM with 16 cores
it was so slow and retarded
 
@hsimah And who, pray tell, are Australia's largest software development company?
 
@monners at the time it was, called TechnologyOne
 
they're a consultancy aren't they?
 
5:54 AM
Never heard of em
 
con + insult
consult
 
no, they make enterprise business software
 
I woulda thought Atlassian or Thoughtworks would be the biggest, at least in terms of market share
 
tbh you raise a good point
 
Or MYOB
 
5:55 AM
what is 'biggest'
 
like people?
 
@KarelG good question
 
atlassian woudlnt' have THAT many people compared to something like IBM
 
i never really questioned it
 
We have the most outsourced developers!
 
5:56 AM
they didnt outsource, it was all in house
 
@derp IBM isn't Australian
 
hundreds of devs
 
how did NodeJS implement readdirSync?
 
ahh good point @monners
 
fs.readdirSync()
 
5:56 AM
@hsimah Then why were you huddled around a Pentium IV?
 
probably because some project manager didn't want to let reality get in the way of his/her gant chart
 
@monners because someone with a Cxx title liked the idea of 'cloud computing'
 
ZenDesk is pretty big
 
so everything had to go to the cloud
 
@hsimah My condolences
 
5:56 AM
including our development machine
I buggered off quite quickly at that point
 
Where you actually in Australia?
 
19 mins ago, by Strikers
Helloo..
I have to trigger a R-script from my nodejs. I;m using this npm package called R-Script : https://www.npmjs.com/package/r-script.

Looks like it is using a spawn internally. I'm getting ENOENT error. Can anyone guide me how to fix this issue?

Err - msg : events.js:182
throw er; // Unhandled 'error' event
^

Error: spawn Rscript ENOENT
at exports._errnoException (util.js:1016:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
at onErrorNT (internal/child_process.js:366:16)
 
yes, Brisbane
I can still see their building out my window
 
dont' think gasoline thoughts
 
Oh, you're still in Australia?
 
5:57 AM
yes
 
Wait, are you Australian?
 
yes
 
guys anyone with experience in nodejs please help.
 
> The actor who played Hot Pie on ‘Game of Thrones’ opened a pop-up bakery, called as "You Know Nothing, Jon Dough"
made my morning
 
YES
 
5:58 AM
Huh, my apologies, something about how you said an Australian company I worked for had me thinking you were somewhere else
 
you've made my day @karelG
im seriously considering moving from canberra to melbourne to avoid the terrible terrible IT here
 
@Strikers what's your question
 
21 mins ago, by Strikers
Helloo..
I have to trigger a R-script from my nodejs. I;m using this npm package called R-Script : https://www.npmjs.com/package/r-script.

Looks like it is using a spawn internally. I'm getting ENOENT error. Can anyone guide me how to fix this issue?

Err - msg : events.js:182
throw er; // Unhandled 'error' event
^

Error: spawn Rscript ENOENT
at exports._errnoException (util.js:1016:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
at onErrorNT (internal/child_process.js:366:16)
 
@derp join us
 
I could write clearer if I didnt type so quickly
lol
 
5:59 AM
@Jesse I'm getting ENOENT
 
anyway I'm going home
 
lol @monners who's us?
 
cya guys and gals
 
ride safe!
 
@derp Melbourne peeps
 
6:00 AM
im guessing melbJS has more than 8 people
 
wait, are you on the ViewSource slack group?
 
@derp are you sure that there aren't terrible IT people either ? :P
 
@monners nope
 
k
 
@karelG maybe but the market is bigger
so surely there will be a bunch of ppl i can build awesome things with
 
6:02 AM
if there are lots of people, then it's quite logical that the local square gets filled with more markets
 
There are a number of server-side scripting languages available, including:
ASP (*.asp)
ActiveVFP (*.avfp)
ASP.NET (*.aspx)
ASP.NET MVC (*.cshtml)
ColdFusion Markup Language (*.cfm)
Go (*.go)
Google Apps Script (*.gs)
Hack (*.php)
Haskell (*.hs) (example: Yesod)
Java (*.jsp) via JavaServer Pages
JavaScript using Server-side JavaScript (*.ssjs, *.js) (example: Node.js)
Lasso (*.lasso)
Lua (*.lp *.op *.lua)
Parser (*.p)
Perl via the CGI.pm module (*.cgi, *.ipl, *.pl)
PHP (*.php, *.php3, *.php4, *.phtml)
which one is most promissing?
 
node :p
 
pick a tech based on the requirements ... And some of those are only useful for experimenting
 
@Jesse Do you know how to fix ENOENT error.
 
never heard of those "webdna" or "bigwig" :|
 
6:04 AM
@Strikers No~ without code and full error stack
 
I'll give the code
var R = require("r-script");
var spawn = require('child_process').spawn;

R("trigger.r")
.call(function(err, d) {
if (err) throw err;
else {
console.log('Done with executin R Script')
//lets fetch the data and return the output
var fetchQuery = "SELECT * FROM Temp_AlertScore";
request.query(insertQuery, function (err, recordset) {
if(!err) {
res.status(200).send({recordset: recordset.recordset, configSave: 'Success'});
} else {
res.status(503).send({configSave: 'Success'});
}
});
}

});
 
:38342241
Err - msg : events.js:182
throw er; // Unhandled 'error' event ?
 
@Strikers Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
@CapricaSix sure caprica. I'll keep that in min :p
 
Cap's a bot
 
6:06 AM
I know
 
She protects that which is most dear
 
Here is my err stack
events.js:182
throw er; // Unhandled 'error' event
^

Error: spawn Rscript ENOENT
at exports._errnoException (util.js:1016:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
at onErrorNT (internal/child_process.js:366:16)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)
 
what is the meaning of parameter d, you never use it
you are using express?
 
yes I'm using express
 
@monners Ya know, when Battlestar galactica got aired for the first time, I really liked Tricia Helfer. I could have cloned hers character (Number six) to do nasty stuff
 
6:12 AM
@Jesse If you know any other way to trigger R script and have a callback when it is done. please help me
 
I am not familiar with R script. but it seem that you did not catch some error~
 
@KarelG Nah, Lee all the way
Just so long as he doesn't talk
 
I think triggering R script or any other external process should be same
now I tried

var spawn = require('child_process').spawn;
var env = process.env;
var async = require('async');

var opts = { cwd: './',
                                 env: process.env
                               }
                    // can modify child env with needed key-value pairs
                    opts.env['YEAR']=2013
                    opts.env['BASIN']='SC'
                    var RCall = ['--no-restore','--no-save','trigger.R']
                    var R  = spawn('Rscript', RCall, opts);
I'm getting the same EOENT error
 
6:32 AM
permissions?
 
morning
 
maybe try running echo instead of Rscript to see if its running an external script which is the problem?
i have no idea and am just throwing ideas into the wind
 
What environment are you running this on? Windows?
 
MS-DOS
inb4
 
Quiet you
 
6:37 AM
Morning
 
afternoon :P
 
Oh, I get it! Because time and location are relative!
 
your mum is your relative
 
I'm adopted o_o
 
@derp that logic statement yields true
 
6:39 AM
this pleases my circuits
my definitely human circuits
 
you don't have human circuits
 
anyone know Lua language?
 
you're a creature that pees at bushes or poles.
or humans
 
@KarelG Pretty sure humans fall within that set as well
 
it means that i love them
with my pee
 
6:40 AM
tbf, you're right :|
 
who has starred mohan's message?
 
idk, but It was just asked in C# too
 
* asks @ a RO owner * can you clean it up ?
 
7:11 AM
Somebody give the poor guy a 5 line algorithm using vanilla js
 
@Neil please don't put a tinyurl link (I clicked it because i trust ya but next time use the link of the page itself)
 
@KarelG using mobile phone
So it's tinyurl or nourl
I promise I won't tinyurl a rebecca black link
My promise to you @KarelG ;)
 
heh
 
7:39 AM
I have started learning JS (with a little prior knowledge of programming), are there any small projects I can start doing in pure JS?
 
Sure, what do you have in mind?
Karan has a list of small projects that you can make to practice; github.com/karan/Projects
 
Oh, cool! I'd be sure to check that out! I've made an almost working version of Pong using canvas, but I'd like to do more. I find JS very interesting haha
 
that sounds cool man
 
So I'd prefer learning some GUI/graphical applications
 
if you want to learn how to interact with the DOM I suggest making tic tac toe
 
7:43 AM
That sounds like a good idea. I've tried (and made it somewhat in CLI with Python), but have never managed to do it in JS
 
tic tac toe isn't that hard if you know the algorithm to check if a player wins
and it will teach you a lot about interacting with the DOm
 
that's kind of useful tho
I'd like to learn Vue/Angular, but I think a good understanding of pure JS is in order before taking on those projects
 
You're right
I've seen people that jump into jQuery without knowing basic javascript
That's very common, and oh boy, they write terrible code
 
haha, I've had some less than pleasant experience with jQuery, but it might be because I didn't know JS
 
Probably, but just keep practicing, keep programming and you'll learn from experience
And when you think you're super good at javascript, read the book "you don't know javascript"
 
7:49 AM
Oh, okay. I'll do that! Thanks. :D
 
There are good reads about javascript if you want to comprehend the language such as eloquent javascript
 
Yeah, I got a book called JavaScript: The Good Parts from my library for like $1 because they were having a cleanup sale
so I've got that going form e
 
from Crockford... a good book too
 
bob
8:12 AM
Hey peeps, How can you toggle animation something like this $('.ribbon_holder').toggle().animate({left: '315px'});
 
I know neither what you're talking about nor what that code is supposed to do
 
peeps means people, I think.
 
bob
ok, i'm trying to toggle a shift of 315px to the right on click
 
CV Tip #57214: If you're proud of your quality standers, make sure you spell 'standards' correctly.
3
 
@Nick :D
 
8:23 AM
https://stackoverflow.com/questions/45344779/how-to-fix-the-position-of-a-paragraph

check the picture he included, expired windows key, and then check the comments
 
@Nick a "peepshow" is a show where ♀ shows themselves in an erotic way. it's something from the Dutch language :P
 
I told you 10 times that I'm dutch man :(
 
make it 11 then
 
I'm dutch.
 
@MadaraUchiha out of curiosity, how many CVs aren't proof-checked and come in with lots of different mistakes?
 
8:33 AM
@KamilSolecki Far too many
 
Hm, would think people are wise enough to do at least that
 
Almost every CV I see has several capitalization mistakes in the technologies list (javaScript, Json, JQUERY, etc)
 
@MadaraUchiha Oh god, those drive me nuts
 
Some with bad English (if your English is bad, get someone who's better to proof you, or write in your native language)
 
sQl SeRvEr
 
8:35 AM
Wait, people include JSON in their cv?
 
Some with formatting problems (line breaks, fonts, underlines, etc)
@Nick Oh yes
JSON, XML, AJAX
We see those far too often.
 
'I am fluent in reading data interchange formats'
 
Isn't it common sense that a web developer knows how to work with network calls
 
Whenever someone writes down one of those technologies I'm tempted to invite them just to ask my tricky (and humiliating) questions about those technologies.
 
JSON isn't even a technology ...
 
8:36 AM
@Nick 8 years ago, knowing AJAX properly was a thing
Different browsers, different ways, jQuery/no jQuery, etc.
There's not much you need to know about AJAX today to do 95% of your daily work.
 
except in Android, god that was a hell
 
But I'm pretty sure I can one-up all those supposed AJAX experts with fairly simple questions
 
Eh, if you invite a candidate with "JSON" as tech, you should ask him which technology "JSON" is :D
 
@KarelG True or false? Any valid JSON document can map 1:1 to a valid JavaScript object.
 
As in: "Sir, please serialize this db into JSON by hand, on paper" :D
 
8:38 AM
Today yes but some people have old CV and have put that a long time ago when few people knew how to AJAX. I probably still have some "AJAX" in my online CV...
 
I'd say, true
 
(yes, I have ^^)
 
Valid JSON can only have some specific datatypes, like arrays, objects, strings, etc
 
@Nick You'd be wrong.
 
I had a feeling that it was a trick question
 
8:39 AM
some refs can be crossed in json <_<
 
Damn, my online CV is so crappy today...
 
!!> JSON.parse('{"n": 99999999999999999999999999999999999999999999999999999999999999999999999999999999‌​999999999999999999999999999999999999999999999999999999999999999999999999999999999‌​999999999999999999999999999999999999999999999999999999999999999999999999999999999‌​999999999999999999999999999999999999999999999999999999999999999999999999999999999‌​99999999}')
 
@MadaraUchiha {"n":"Infinity"}
 
9999999999999999999999999999999999999999999999999999999999999999999999999999999‌​9‌​999999999999999999999999999999999999999999999999999999999999999999999999999999‌​999‌​9999999999999999999999999999999999999999999999999999999999999999999999999999‌​99999‌​99999999999999999999999999999999999999999999999999999999999999999999999999‌​9999999‌​99999999 is not infinity.
 
@MadaraUchiha Verified
 
8:40 AM
Eh denys, I recall that my former manager (whom got retired now) once had a candidate for his position. Someone came up with an effin' 25 pages CV
 
We should have fixed JSON looong ago
@KarelG mine is 6 pages long, written very small
 
Comon, that was a nasty question :( @MadaraUchiha
 
he listed literally everything, even workshop certificates
 
who in here is dabbling around with React on a regular basis? Is there a good way to avoid a ridiculous pile of props being passed down from the parent component?
 
Any finite number can be represented in JSON because it's a string, but numbers in JS are 64 bit
 
8:41 AM
he could have filtered out non-relevant things instead of just dropping the cv. Big cv =/= good cv
 
@Nick Hey, You claimed to be a JSON expert
 
e.g. can I pass a "config" object that holds clickHandlers, state values and so on?
 
(You being the guy who wrote JSON in his CV)
 
I am also recruiting since I'm a manager. I dislike such cv's
 
I'm not a JSON expert and I know this.
 
8:42 AM
JSON was fast and lazily specified. It's a shame
 
"A CV should be like a skirt, long enough to cover it, short enough to keep it interesting."
 
@DenysSéguret The biggest fault is that there are no dates.
 
^-- i see that often
If the cv appears promising, I ask to fill it with dates
 
@MadaraUchiha and no infinity, no NaN, useless quotes, no comment, etc.
 
@Nick I like that
 
8:42 AM
otherwise, yes sorry
 
@MadaraUchiha no dates?
 
@GNi33 You can't serialize a date to JSON
 
I have to use my own pseudo-JSON (as Google does) just because you can't do science without infinity and NaN
 
why should you comment a json object?
 
!!> JSON.stringify({d: new Date})
 
8:43 AM
@MadaraUchiha "{\"d\":\"2017-07-27T08:43:35.342Z\"}"
 
err madara,it can, but you cannot de-serialize it ;)
 
@MadaraUchiha how would you like that to look like?
 
@KarelG There's no Date representation in JSON
 
Fuck JSON. I want method overloads >:(
 
I'm usually super fine with passing timestamps
 
8:44 AM
he meant putting that back to date object. JSON doesn't provide it itself
 
@GNi33 I dunno, d("ISO date string")?
`ISO date string`?
$"ISO date string"?
You could do whatever you want
But distinguish the fact that it's a date from strings
 
yeah, I see
 
@GNi33 Here's the thing about that though
If you want to transfer the same state store (redux, mobx, whatever) and your store has dates, you're screwed.
 
TJ Crowder just called out a high quality answer on being wrong, and the dude deleted his answer
That guy is so smart
 
You have to wrap anything that might be a date with new Date() or moment() to be sure
 
8:50 AM
@Nick ref ? :P
 
Anonymous
jsfiddle failing to run anything for anyone else?
 
"high quality" ???
 
^--
 
alright let me rephrase it
 
8:52 AM
it's not a correct answer though
 
A user who looks high quality because of his points, and his answer didn't look that bad
He keeps deleting/undeleting his answer
 
:|
 
Look at more QA. You'll learn that there are two types of high scoring answerers.
Especially in jQuery where you can score high by juste answering dupes ^^
 
jQuery and JS both have the best of the worst questions/answers
 
TJCrowder is a little special in that he is good AND also answers anything to get more rep
 
8:58 AM
he gets upvotes more easily because of his rep
 
I'm not convinced of that
 

« first day (2476 days earlier)      last day (2475 days later) »