« first day (874 days earlier)      last day (4073 days later) » 

3:00 AM
No clue...
 
is this the obj-c room?
 
@TrevorRudolph Yes, like the title says
 
oh.. whoops
 
Like I said, to meet the 6 char requirement of editing I did what was suggested: Find something else to edit/add. So I added a short 1 line explaining that ~= operator (that us ES3 people don't know). I also added that as explenation to why I added that line: just to add the intended edit (that is important for that reference).
 
3:02 AM
ES3?
 
Do you guys get console errors from this example?
http://cdpn.io/hclEt
Made it so I can ask about a tile question. Not much use if people cant open it
 
@Benjamin, thanks for that link.
 
tile_swap is not defined
 
Uncaught ReferenceError: tile_swap is not defined
 
updH2 is not defined
 
3:03 AM
Uncaught ReferenceError: updH is not defined
lol
 
updH is not defined
 
It's weird.. because it all works in the edit mode -_-
Can you acess the edit mode?
If it works in edit mode, I might still be able to use is to explain my perils :)
 
anynone here knoe obj-c by chance, im in a pinch
 
I know the syntax is horrifying. And also have a pretty good idea how to concatenate strings since I looked that up recently to see if the iOS guys my company hired are competent (they aren't)
 
yea it is kinda horrifying, too many method repeats for getting and setting
ive been ediditng 1 page for 2 days
 
3:12 AM
Is it just me or is Knockout putting behavior back in the HTML where it doesn't belong?
 
@TrevorRudolph What's the problem?
@ErikReppen It's only putting in View behavior. One famous coder seems to agree with you though
 
i have a status bar utility so i put this code to eliminate the dock icon
 
[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
but if i do that windows dont focus and unfocus properly
and i need a preference window
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; makes focus normal
 
3:14 AM
i have that in my info.plist
same behavior as prohibited
nvm i had it set as a boolean instead of a 1 or 0 intiger
just fixed it
i feel dumb
 
Glad I could help :P
 
Might there be something I could do to add some extra characters in an edit so I could just fix what needs to be fixed and point the mods to that fact in the comment describing the reason for the edit?
 
Anybody feel like solving what is probably an easy question?
 
@BenjaminGruenbaum But you have the same issue right? If you're embedding dependencies for behavior in the HTML, you now have multiple places to modify that behavior. My instinct on the MVetc... so far has been that they're not quite seeing HTML's role in client-side web dev for what it is.
 
3:19 AM
Can I post 50 lines in chat or you guys want me to pastebin it
 
pastebin is a good bet
 
pastebin for sure. but not pastebin.com, it sucks. use e.g. gist
 
just for syntax purposes
gist is better
for highlighting
 
try in chrome: about:inducebrowsercrashforrealz
 
@ErikReppen I'm not embedding behavior of anything but the way I present my data in HTML, and I think it's perfectly fine to embed presentational data there
 
3:20 AM
Ok so, http://pastebin.com/P20L6Pd9

The problem is is that the php while loop is calling the setMarker which then calls addmarker so its adding the same markers to the map about 20 times, how can I do it so that it only executes setMarker once the arrMarker array is done being filled?
 
@ErikReppen But yeah, a lot of people don't like the idea of data-binding in HTML
 
Data changing dynamically is behavior. JS is the behavior layer.
 
@ŠimeVidas Lol, that's awesome
 
Ah, okay, I've just been feeling lonely on that one lately.
 
@ErikReppen The data doesn't change in HTML, just the way you present it
 
3:22 AM
im not gonna give you exact code but i say have the while function have an if function that checks the count of the array
@X
 
I'm not sure I agree with your opinion, I like Angular/Ember/Knockout, as long as you're only changing the way you display things it makes sense that changes are in the view reflect the data change. That's some of what MVC is all about
 
@XCritics do you understand?
 
@TrevorRudolph no :(
 
Alright I'm seeing the gray area there. I guess to me it's more the practical concern of having to go to two-places to adjust something when before there was one.
 
@XCritics is this a .js.php file or a <script> tag?
 
3:24 AM
@TrevorRudolph script
 
@TrevorRudolph what is .js.php?
@TrevorRudolph does that let me have my code in a .js file and include it?
@TrevorRudolph cause that would be nice
 
its a js file that you can import like regular but run php inside
like you're code
 
like <script src=".js.php"?
 
YES
it works great
 
3:24 AM
Awesome I'm going to do that right now
 
ok, see that it works the same and use it from now on
its very helful
but about your array problem... i need to look at the code a bit more
 
@TrevorRudolph want me to pastebin the whole thing?
 
no i just want to say...
php runs before the javascript
so the while function will be done before the js is allowed to run
understand?
 
@TrevorRudolph sounds like a riddle
 
no it isnt
the php is turned into html
then that html is put into your javascript
then the javascript runs
 
3:30 AM
@TrevorRudolph Yeah I understand but how am I supposed to run the function if the variables change everytime it loops
 
so javascript doesnt read <?php echo "hello" ?> it reads hello
post your whole code then ask the question again
 
and whats your question?
 
@TrevorRudolph So when createMarker is called, every single time in the loop, the addmarker function is eventually called, and adds the marker to the map, every time the createMarker is called, so I need a way that createMarker only executes if the array is full so it doesnt keep adding the same value to the map
 
only if maker has a position map and title?
 
3:35 AM
The over all set of functions is supposed to calculate the distance between the geolocation and the marker position, and only set the ones that are within 500 meters
 
but what array?
 
arrMarkers
 
@XCritics, dude, you need to go back and learn the basics, rather than jumping in with jquery and google maps
 
i kind of agree
 
3:36 AM
@phenomnomnominal So close to finish then I am lopl
 
and your function will pass stuff no matter what
so theres no way to test unless you test lati long and title for null or 0
with if
 
God, would you believe OP?
2
A: Getting first object from javascript litteral

Benjamin GruenbaumThis is usually accomplished using the map method, see the documentation here. var justNamesArray = items.map(function(elem) { return elem.name}); The documenation page also includes a useful shim, that is a way to include it in your code to support older browsers. Accompanying your reques...

 
abaahaahahhaha
 
He's using a for... in loop to get the 'first' property :/
I wonder if people ever read the docs
 
they dont :/
and why not google
just think, huh well i want a full array
so test with if
and tests array with 3 objects
 
3:38 AM
I found a english typo in the text (thank god). Let's hope the mod's let the edit pass this time. Else I'll must start thinking F it (and I don't want to). Thank you all for your kind help in helping me helping back haha!
 
this .js.php is the best thing ever
 
its great right?
works with css too but thats not important
but it is if you want to make background colors based on time of day
 
Yeah I was so sick of having this mile long <script> in my file nice to separate it
 
ive been down that road before
i tried to convert time of day in 24 hours to a single string and then to hex with math and stuff to get a color code that was darker for later hour
it sucked so i went with a tun of if functions with greater than and less than
 
haha
 
3:41 AM
@BenjaminGruenbaum because there is only one. I wonder if anyone reads the question
 
How long would I need to learn javascript before I can do what I need to do?
 
@dievardump I read the question
He doesn't make any sense :/
 
I did understand his question
 
@XCritics you shouldnt be focused on this porject
focus on javascript, not a javascript api like jquery or google maps
work on website fucntionality
 
@dievardump So he has a list of objects with a property but he doesn't know what the property is :/?
 
3:43 AM
think os a diffrent project that doesnt need maps
and for that matter php
learn js then php
then mysql and php togther
 
I'm good with php
 
Don't learn php
Learn JS because it's awesome
Skip PHP because it's bad
 
SERVERSIDE VS CLIENT
 
I've been writing php for quite a while, just trying to use JS for some extra stuff
PHP Isn't bad :(
 
I like the totally objective and absolute nature of that statement :)
 
3:44 AM
my order when like this: html css js php mysql python c objective-c
 
@Jack Thank you :)
 
@BenjaminGruenbaum too late D:
can I be fixed?
 
hahaha
 
@Shea Yes! There are plenty of languages without a billion function in the global namespace, 9 sort functions and weird case naming :P
 
3:47 AM
@TrevorRudolph my order was PHP > HTML/CSS (they came together) > MySQL > JS > ASM
 
@BenjaminGruenbaum yes. that make sense
 
@Shea Lol, PHP is very useful for plenty of stuff :P I'm just not particularly fond of it
 
@Shea i did a bit of asm with kernel but those 4 letter functions freaked my out and all the hex and memory got confusing
nasm
 
Well, since node.js, you don't really need to learn PHP anymore imo
PHP was just for the lack of node.js at the time
 
3:49 AM
I disagree, there are plenty of things I'd rather use PHP for than node :P
 
well, you're probably right to disagree, because I honestly haven't used node.js as much as I'd like to
 
reporting back, my second edit-attempt was accepted, again, thank you all!
 
but i dont use node.js i use php
 
@GitaarLAB You're welcome :)
 
3:51 AM
honestly, what can PHP do that node.js can't?
 
SO Review tests are so funny :P
@Shea It's not about the ability to do, it's about the ability to do easier
 
the more I think about it, the more I realize I can only think of things PHP can't do that node.js can
 
One example is that php hosting is cheaper, php developers are cheaper and making a web page dynamic is usually easier with php
 
well... I'm sure libraries help for that...
which I'm sure naturally come as you use a language more and more
 
I wouldn't build a web app with it, but if I just want a contact form here, or a simple action based on a GET parameter there, PHP is probably a better solution than node.js
 
3:53 AM
have oyu guys seen that apache python plugin it lets you run python like php but its like this <% print('hello') %>
 
I wouldn't dare build a web app with it, but it's extremely potent in making web pages dynamic
 
why, when node.js is so much lighter?
 
What do you mean by lighter?
 
well, you can't just install PHP
you need apache too
 
@Shea technically you can, but that's not the point
I love node and avoid php, but PHP is a very good tool for some stuff
If I'm making an AJAX intensive web app, node. If I just want to make my grandpa's page dynamic, probably php
 
3:56 AM
now tell me what's the difference from using php to make your grandpa's page dynamic, vs recycling code you've already used in node.js to do it?
it's the exact same thing
except, node.js is much lighter, and more efficient (afaik)
 
Last time we've had an argument I ended up doing a formal and pretty concise construction of our number system and basic math.
That was fun, but time consuming, so I'll tell you what, I'm willing to have this argument with you, the only condition is that we do it in the PHP room
Deal?
 
no, because then you automatically win. I'm advocating JS, and you're advocating PHP. You're trying to lure me into the lion's den. lol
 
You've already lost :)
 

« first day (874 days earlier)      last day (4073 days later) »