« first day (1337 days earlier)      last day (3605 days later) » 

m59
9:00 PM
but how can I know the article id before the article exists (when they upload it via the wysiwig)
that's the exact mess I referred to.
 
You don't... why would you need it?
 
create the article in draft mode
 
Oh yes, you should do that anyway.
You don't need the ID (you actually need it the other way around) but you should create a draft anway
 
user3141603
I'm trying to find what causing the problem, but I am not succeeding.
Please try enter to http://www.dev.web-gen.net/index/ using the mobile phone and look at the wannabe-slider (with the background of a hand). At my phone, Galaxy S3 using Google Chrome, there is a problem with the background. What causing it and how do I fix it? Is it even a JS' poblem?

#BringBackOurBoys ;)
 
@SomeKittensUx2666 coool, my site is running
 
m59
9:01 PM
is there something I can read about the semantics of that? I'm clueless.
 
semantics of what? draft mode?
 
m59
yeah
 
it's just... draft mode
you know, the article exists, but it's not available on the website
only to contributors
 
@SomeKittensUx2666 I just found dragonquest.neocities.org
 
m59
sure, that's just a flag in the table, right?
 
9:04 PM
yeah
 
m59
what does that have to do with image urls?
 
Damnit
 
once you know your article id, can't you do what I told you earlier?
 
m59
^ the issue
 
9:05 PM
WHATS THE FUCKING ISSUE
 
m59
If I made them submit the article before adding images- problem solved.
They upload images before submitting the article, right?
 
THEY DONT NEED TO SUBMIT THE ARTICLE. CREATE THE ARTICLE IN DRAFT MODE BEFORE THEY SUBMIT IT
 
m59
but you just said it's the same submission to the database.
 
@FlorianMargaine Press caps lock
 
m59
My apologies if I'm that daft. I try not to be.
 
9:06 PM
@copy OH THANKS ITS A LOT EASIER NOW
 
fuck me
 
0
Q: Promise and Done not working

user3739426I have a simple .append loop iterating 100 times. At the end, I want to signal its completion, and it's not triggering. Could anyone please explain why .promise().done() is not working here: $(document).ready(function(){ var iterate = function(){ alert("Start!"); for(var i...

 
@copy thanks for getting the reference :3
 
m59
Freakin' catch 22s....
 
9:10 PM
evening all
 
@copy I'll pass that responsibility on to @BadgerGirl
 
9:24 PM
@SomeKittensUx2666 .... just in case
 
I'm aware of the quote as well
 
cool cool cool. Wasn't sure.
 
does anybody deal with angularJS?
 
m59
@vimes1984 yep
 
thank god
any idea on how to set header's for a jsonp request via $http
SOP is driving me mad
$http({
method: 'JSONP',
headers: {
'Accept':'application/vnd.cpc.postoffice+xml',
'Accept-Language':'en-CA',
},
url: 'https://ct.soa-gw.canadapost.ca/rs/postoffice?d2po=true&postalCode=K2B8J6&maximum=5',
refuses to work and GET just fails with cross domain blahh di blah
 
m59
9:30 PM
you can't set headers with a jsonp request
 
@vimes1984 try googling "Angular JSONP", also, you can't set headers with jsonp
It's just script tag injection
 
that was what i though
 
(The name JSONP is quite stupid)
 
yes it is very stupid
ok so this leads to my next question does cors have to be set up on the server I'm requesting data from?
 
m59
of course (if I understand your question)
are you trying to access an api that doesn't allow cross domain??
 
9:34 PM
I was playing around making a sleep function. Who decided that it is a good idea that nothing can happen while a "while loop" is running? jsfiddle.net/F3uVq/1
 
@Agent.Logic_ Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don'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.
 
@m59 yes I am
is what i'm tryign to request from
everything on my side seems ok
but i still get No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin
 
m59
If they don't allow it, then you can't.
Stop trying to steal their data, lol.
 
You could also do the request on the server
Then request that with javascript
 
@Schoening Because then you get stupid side effects
 
9:36 PM
yeah i could but the stupid host doesn't have curl
 
m59
What are you actually trying to accomplish?
 
I think php comes with file_get_contents
 
do a GET request to this REST service via angularJS
since i don't have CURL
 
user3141603
36 mins ago, by VladGincher
I'm trying to find what causing the problem, but I am not succeeding.
Please try enter to http://www.dev.web-gen.net/index/ using the mobile phone and look at the wannabe-slider (with the background of a hand). At my phone, Galaxy S3 using Google Chrome, there is a problem with the background. What causing it and how do I fix it? Is it even a JS' poblem?

#BringBackOurBoys ;)
 
m59
Oh, nm. I get it. Yeah, I don't see how you can't do that from the server...
 
user3141603
9:38 PM
PLZ halp
 
@copy Like what? I can't think of anything that would be more dangerous than anything else when programming.
 
@m59 php uses CURL for it
 
It's a get request
You don't need curl for that
 
m59
^
 
ahhhhhhhhhhh
 
9:39 PM
@Schoening The same things that you get when you do programming with multiple threads
 
right!
thank you
 
@Schoening Now, the fact that the browser can't do redraws is indeed stupid, but there are also reasons for that
 
Are there are techniques for preventing the "flash of unstyled content" thing you get when using angular
 
m59
ng-cloak
 
Can't think of something to call it but it's where you see the expressions and whatnot before it's all executed
Thanks
Looks like it flashes now instead of showing the raw html
 
9:49 PM
@copy Can't leave me hanging like that.. what are the reasons for that?
 
Thanks @m59
Got everything figured out. That was a pretty easy solution so I'm very happy with you
 
@Schoening Hang on, I got something to do
 
np
 
10:07 PM
@SomeKittensUx2666 Only downside of neocities is that I can't upload maps.
 
how so?
And you can use Google Maps
 
i mean directories, sorry used dutch words
 
any way to stop access to a php scritp from everything bar ajax?
 
or maybe the enlgish word is folder
 
@m59 file_get_contents works perfectly thank
 
10:11 PM
i can upload files, no folders to neocities
 
you
 
Still it works, but it's a little bit bothersome. doing everything in the main folder.
 
jsfiddle.net/bbLfC allowing loops to do things "outside" would make simpler code...
 
euclidthegame.neocities.org Anyone that wants to play a google html5 geometry game. Feel free to test it out. Only first level works tough.
why do I say google when I want to say cool :S ... :P
 
UI is confusing
 
10:20 PM
@90intuition I think it would be way better if double clicking creates new vectors. Rather than having to click back and forth between the buttons :)
 
@Schoening Not totall sure what you mean, did you finished the level ?
@SomeKittensUx2666 What is confusing about the UI ?
 
I wasn't sure what item was selected
 
@90intuition I never got any win message. So I guess not. I thought I did the right thing. What I mean is that the less things to do the better. Double click to create new point. Hold shift down to select two points.
 
also clicking opened the dropdown menu when I thought it selected a tool
 
Just my 2 cent
 
10:27 PM
@Schoening Did you use circles ?
So you mean keyboard controls instead of selecting buttons ?
 
@JonathanBredoChristensen Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don'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.
 
The circles work great :) @90intuition Yeah. Try to limit the amount of things people have to learn.
 
Maybe, first an intro, about how to select tools, how to make a vector etc. And then the serious geometry.
Did you finished the level completely (3 well done messages) ?
 
No
 
@Schoening I actually don't know for sure. However, Firefox for instance runs completely single threaded and cannot run more than one JavaScript interpreter at a time, but requires JavaScript itself. So it cannot run your while loop and a redraw in parallel
 
10:32 PM
Never rely on instructions to teach users how to do something
 
@Meredith Is this directed to me ?
 
It's also relatively easy for a competent programmer to work around this and it resembles the behaviour of native programs
 
@copy I can honestly not see why they did that design choice. If it is to avoid errors they just end up stacking up those errors until it is finished. Did you look at this link? jsfiddle.net/bbLfC I made an async for loop as a comparison.
 
@90intuition Sorta, but more like a general comment
 
I guess most games, have instructions, no ?
 
10:35 PM
They have them
 
You must hide them
 
But you'll notice that the good games don't require them to play
 
When did you last pick up a shooter or platformer and could not play instantly?
 
^ Exactly
 
JS can do multiple threads
 
10:36 PM
If your users can't just jump in and play, many of them won't play
 
Also, your async for is lolsome
 
@Gaelan Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don'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.
 
Okay, I get it.
 
@BenjaminGruenbaum Well I just wanted it to do what I had in mind with the simple while loop :p
 
SPOILER :P
 
10:38 PM
And that's level 1?
 
Oh Freud...
 
@Meredith this is the first construction in Euclid's Element, the most famous and one of the oldest mathematical books
 
Who is your target audience @90intuition ?
 
i'm developing it for a geometry highschool course
But I wouldn't mind if other people play it :P
But maybe I will make some levels like, draw a line between the two points.
Or select a point at the intersection of those 2 lines.
 
Cool. If you really want success with it make it more a game imo. I don't know the limits you have tho.
 
10:42 PM
How could I make it more a game ?
I was thinking about unlocking "thorems" in your toolbar is kind of game like.
 
Ok.. I got an idea here. But I dunno if it works for what you are doing.
 
Every level you complete, you get a new tool ("theorem") which you can use in new levels.
Well, I'm interested.
 
@90intuition I mean I'm not saying the geometry is hard
 
What if it was a game that lets the player cast spells? And the different geometries cast different spells? And then for some learning curve it says "use triangle whatever spell"
 
But I didn't even know how to draw a circle
 
10:44 PM
Just what came to my head first..
 
Yeah that's a good way to think about it
Give users a reason to complete the level
No one just does geometry for fun
 
Does not have to be action game or anything. But if you are drawing runes and pentagrams as a wizard.. that sounds awesome :p
 
Haha, there are, believe me, math geeks enough on this world :P
haha, I will think about that, but it is difficult to implement
 
Do you only want math geeks to play your game though?
Or do you want math geeks and other people to play it?
 
Well, it would be cool, if other people would play it as well, sure
 
10:47 PM
I got nothing to do tomorrow if you want a little help with that stuff. Up to you tho. Its your project.
 
Would be cool, sure, but the software I use, I;m quite sure, you have never used :P
But if you have some very clear ideas, maybe I can implement it.
 
What software are you using?
 
geogebra
 
@Schoening this decision is actually quite easy. In the browser, javascript has to be synchronized with the DOM. So a single thread is required. Web workers allow you to have multi-threads, but guess what: the DOM is not available to them.
 
@Carcigenicate Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don'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.
 
10:52 PM
I'm going to bed, are you tomorrow in this room ?
 
@90intuition what time?
 
is your time now 0:52 ?
 
yes
 
around 20:00 ?
 
Sure.
 
10:53 PM
ok cool, see you then
 
cya
@FlorianMargaine But what is so different about doing something in JS inside a loop and changing something in the DOM from JS inside the loop. I mean both tasks are going to block up JS because they have to compute something in that second. So why is one good and the other bad? :o
 
@Schoening In the case of your sleep function, the interpreter doesn't know that it is in an infinite loop for a specific amount of time
 
grep -lr 'regex' . | xargs subl
 
@copy Sorry. But why does this matter?
And what makes that different to C++ for example?
 
No difference to C++
32 mins ago, by copy
It's also relatively easy for a competent programmer to work around this and it resembles the behaviour of native programs
@Schoening If you look at the code of sleep, it's very obvious to a programmer that it makes sense for the browser to do redraws in the meantime
It's not so obvious for an interpreter
 
m59
11:07 PM
  return Promise.settle(promises);
}).finally(function() {
  //didn't run.....
}
 
Because the interpreter doesn't know if the loop ends in the next iteration and it doesn't know if you're currently making changes to the screen …
 
m59
is that because I didn't catch the errors?
 
And, as I mentioned earlier, it's not easy to run both in parallel, making your JavaScript code slower if you want to do redrawing in between loop iterations
 
@copy I thought C++ std::cout does print to the console from inside a while loop?
 
@Schoening Uff, you're asking really good questions
In short, the OS handles stdout (a stream from your program to somewhere outside) and can do things in parallel
 
11:11 PM
I feel like a lot of the people who post js questions are learning from sites like w3resource
 
Alright.
I am just looking at some introduction stuff on C++ and I saw that about their loops and thought "Hey why can't I do this in JS?" @copy
 
If you do user interfaces in C++, you will stumble upon the same problem
 
Hehe ok. One thing I know I will avoid is the "using namespace" ^^
 
using namespace is fine, just don't do it in header files
 
Actually it's fine, just not using namespace std
 
11:20 PM
tbh i dont really think using namespace std is a huge issue
 
(Math.random()).toString(36).slice(2)
^ sufficiently random?
 
People recommend against it for future proofing
But good designing pretty much solves that
 
using namespace only works in the current scope?
How are you doing code snippets in the same line as text? Witchcraft!
 
`
 
Nope.. that's not dirt on my screen
 
11:21 PM
/me should relearn C
 
@SomeKittensUx2666 I don't think floating pointer numbers generate all combinations in base 36
Just use something where you can verify that it's correct instead of guessing
 
I'd love to do something besides school projects in c++
 
Fair enough
 
I feel so stupid cuz I know so little about it
But there's not really anything you can do on a medium scale
It's either large projects or smaller exercises
 
I updated my async for-loop makes more sense now.. jsfiddle.net/7qSAC hehe.. its fun to make useless things :p
 
11:24 PM
0
A: Apply a Oil Paint/Sketch effect to a photo using Javascript

LoktarAlright so I found a great explanation of the algorithm used here and adapted it to JS and canvas. Live Demo How it works is you average all the pixels around your center pixel, then you multiply that average by the intensity level you want, you then divide it by 255, and save that value. You...

fun saturday answer
going to make some random filters and throw them on github
need to speed that one up though
 
+1 for cute cat (and a good answer too)
 
was surprised how well it turned out, but man its so slow.. I kind of want to use a settimeout or something instead of for loops :?
then I can have a progress bar
@Meredith thanks
 
Use my newly created for loop @Loktar lol
 
I don't think you could really speed up the algorithm
You could save operations though
I haven't looked at the code though so idk how much of that you already did
 
actually yeah thats the perfect idea
I calc the avg and intensity per pixel multiple times.. but its an unchanging value
holy shit thanks actually
I can do a full pass and do that for each pixel once
and then use a lookup
 
11:29 PM
Try using Int32Array for your arrays
 
yeah I always forget about those, that def would be faster as well
 
I think you have some out-of-bounds accesses, which could be bad
 
it shouldnt, it actually starts and ends within the radius parameter
thats one drawback actually, you lose that many pixels around the edge
so like if the radius check is 20, you lose 20px around the entire image pretty much
 
pixelIntensityCount[curIntensity] = ... those ones and they start as an empty array?
 
ooh yeah those start empty
I thought you meant going out of bounds on the image
dinners here gotta go eat then going to implement those fixes
 
11:35 PM
@Loktar Are you allowed to do it in WebGL ?
 
11:49 PM
@Karl Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don'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.
 
Hello there, help wanted from people which are experienced with coffee stackoverflow.com/questions/24223166/…
 
Do you want to know how to precompile CS scripts or how to compile them on request?
 
I would like to know what others are doing and how... It could be compliling on request or just having the right setup to compiling them automatically but through grunt.
I have to go to sleep, if you have any suggestions I will read it tomorrow. Thanks in advance!
 
I use this weird technique called "Writing JS in the first place"
 
Not that helpful ;) I already know this one.
 

« first day (1337 days earlier)      last day (3605 days later) »