« first day (909 days earlier)      last day (4264 days later) » 

16:00
@BenjaminGruenbaum Try 3v4l.org/vsIjL
how can I do margin right on all but my last li in my navigation?
Heard of the last-child pseudo-selector?
:8824276
 li:last-child{
    margin:0;
}
@DaveRandom In C you can do a lot worse with the pre-processor :)
@Connor thanks
16:02
@benlevywebdesign No Problemo
@Alex 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.
#define true false
@DaveRandom old JS let you do undefined = true
user2157210
meh cant write app for playstation
@Connor maybe you can help me with another simple issue.
user2157210
16:03
they want $4k for the license
'use lax';
How do I connect a Website to a TCP Server run within the same network through Javascript?
@benlevywebdesign Maybe...
@Alex What does that even mean? Connecting a website to a TCP Server...
user2157210
^
16:05
@Alex First of all, whenever you're serving a website you're doing this over TCP anyway since HTTP is over TCP (almost always), second, connecting a website to something is overly broad
user2157210
ok webdesigners of the world
user2157210
is there some ide where i can drag and drop design?
Sorry, just woke up. But what I mean is that I want a Javascript to execute on a website and send a small string to an desktop application over TCP.
@BenjaminGruenbaum awesome sauce
@Nexxpresso Is there? Yes, should you use it? No
@Nexxpresso If you want to make designing easy just use something like twitter's bootstrap library
Or better yet, learn how HTML and CSS work
16:07
@benlevywebdesign ?
user2157210
i cant get myself up to html
@Connor not ready yet, don't wait around if you are
@Alex I don't think it's possible with just JS, use something that creates a small Java applet and passes messages. Or better yet, don't
I'd proxy it on the serverside using node.js proxying http to tcp is ~10 lines of node.js code
Thank you for the information, I had a feeling this would be the answer.
@Alex probably better off using something like WebSockets or long polling AJAX
16:09
I'll check it out.
WebSockets are TCP and not HTTP, it is a protocol though, with a handshake
user2157210
you can use some websockettotcpsocket proxy
user2157210
tho
TCP Listeners only works for apps and not sites though
user2157210
16:10
hm
In the documentation for the socket.io it says that I have to "npm install socket.io" I have no experience in how to do that since I've mostly used JS for functions and eventhandling. How do I install it?
@Alex That's the serverside, the documentation assumes node.js
so having node.js is enough?
Why do you need to send TCP traffic directly instead of HTTP? HTTP is much nicer to work with, message start and end are clear and it shows intent by using verbs
user2157210
@BenjaminGruenbaum You didnt understand
16:13
@BenjaminGruenbaum It is designed to be compatible with an HTTP server so that in theory you could seamlessly have the webserver service the websockets on port 80, but it reality there's just no way to do it at the moment.
@Alex npm install socket.io is for installing socket.io for use in a node.js project
(No practical, production ready way)
@Nexxpresso What part?
@DaveRandom Yeah, proxies are especially problematic
user2157210
I think his clients have some tcp listener running on their machines and he wants to send commands to this listener when they visit a certain page
user2157210
Did I get this right?
user2157210
16:14
thats how I understood him
@benjamin, I prefer TCP since it's more cleaner server side in the enviroment that I have my desktop application.
And yes, @Nexxpresso
@Alex Then your safest bet is to proxy TCP to HTTP with node.js, that's very easy since it comes bundled with TCP and HTTP servers (tcp is in the net module and http is in the http module)
user2157210
@Alex thought about url protocolls?
That would be the easiest, also, HTTP is fairly clean on the server-side once you get it working correctly, which, unless you're writing your own server is easy
16:16
@MarirajSankar 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.
user2157210
just register some url protocoll for your destkop application
@Nexxpresso how would that help?
i am very much confused
@BenjaminGruenbaum I've yet to make a proxy play nice at all, even running on :80 on the domain. They just don't understand, or are unwilling to, process persistent connections like that.
URL schemes are only on the local machine, not really for sending strings.
If I've got that right.
user2157210
16:17
maybe i am understanding it wrong
anyone know about Lawson
user2157210
You got a client
Most of them can't even cope with Connection: keep-alive
@DaveRandom Yeah, that's a real problem, I think socket.io falls back to AJAX at some point
user2157210
who got a desktop application and a browser
16:17
@MarirajSankar What?
@DaveRandom What? That's really basic... and very simple to handle
Lawson ERP
I've even written an implementation myself once or twice
user2157210
and when he clicks on example.com/test/fuckthis.html
@MarirajSankar Is that in JavaScript?
@BenjaminGruenbaum yes
user2157210
16:18
some command should be given over to the desktop application?
@BenjaminGruenbaum inorite. But most proxy servers that people actually use just won't do it. They just respond with Connection: close every time.
@BenjaminGruenbaum Portal development
From the website running within the network on another device. @Benjamin
@MarirajSankar No sorry, if you have a specific JS question you're struggling with feel free to ask though
user2157210
on another device
user2157210
16:19
So likely you visit some webpage and your media server should then play some video?
@Alex Proxy TCP through HTTP, I know it's stupid having TCP in HTTP over TCP, but it's really easy and works pretty well unless you have a lot of full duplex communication all the time, in which case you should use websockets or something similar
javscript has scope ?
@MarirajSankar Of course, it has very powerful sense of scoping
@DaveRandom Just like browsers. Why some people still use IE6-8 is beyond me
@BenjaminGruenbaum but im in beginning how do i improve
@Nexxpresso
I.e. When a button is clicked on a website displaying on a users mobile phone, a small string will be sent to the desktop application and display something like "Pressed!"

@Benjamin how do I do this practically, can you give me a link to documentation? :)
16:21
@MarirajSankar In JavaScript, scope is based on functions, it's hard to grasp at first, you don't have if or while scope, only function scope which is extremely powerful since it comes with lexical closures
@MarirajSankar A room reg wrote this: bonsaiden.github.io/JavaScript-Garden you should read it.
user2157210
@Alex okay now i got the whole problem
@BenjaminGruenbaum @ k thanks
user2157210
how does the website know the ip where it has to send the tcp packet to?
@Alex What back-end are you using? I'd just use WebSockets for the communication from the client to the server (socket.io being a good candidate for it)
@BenjaminGruenbaum Mmm, sounds... dirty. But then you look at websockets, ethernet-like framing over HTTP over TCP over IP over ethernet. Dafuq.
user2157210
16:23
well you could make it listen for broadcast
@Nexxpresso
It is provided by the user. Everything is within the same network so no need for port-forwarding and such.

@Benjamin, I'll dig in to it!
@DaveRandom The correct approach would be using WebSockets to begin with, or using HTTP instead of TCP - it's really fast enough for most practical stuff
Especially over ethernet
user2157210
@Alex ok then just do it like this you either change your application to use websockets
user2157210
or you use a websocket to tcp proxy on the desktop
in PHP, 1 min ago, by php NoOb
@DaveRandom Can I learn Ajax without learning Javascript ?
16:25
@Nexxpresso and Client-side?
user2157210
@Alex which client side do you mean right now
user2157210
the one on his mobile phone
Yes.
user2157210
well would just need to utilize html5 websockets connect with the specified details
I miss when @rlemon would summarize the chat because I keep coming back when 100 messages have gone by
16:26
@BenjaminGruenbaum The correct approach would do to just expose the raw sockets layer via browser JS APIs, but to restrict connections within the confines of SOP. IMO.
@Nexxpresso I guess I have some research to do, might come back later
Thanks, guys.
@DaveRandom Why would I need to expose raw sockets layer to a JS api? When is HTTP really not fast enough?
user2157210
@Alex easiet would be to make simple native apps for the mobiles
And in those cases, when are WebSockets a bad solution?
@BenjaminGruenbaum It's not about speed, it's about full duplex, or more to the point being able to have the server send data to the client without the client asking for it.
16:28
@Nexxpresso
I know, but I don't have the resources for that ;)
@DaveRandom Then what's wrong with WebSockets?
@BenjaminGruenbaum Complexity of the server-side implementation.
@DaveRandom In PHP you mean :P?
How can i use a class property inside a method, i have tried this but getting errors, the error is inside the loop, because it works outside the each
function element() {
	this.styles = {}

	this.test = function (something) {
		$.each(something, function(key, value){
			this.styles['john'] = 'boo';
		});
		console.log(this.styles); = "Uncaught TypeError: Cannot set property 'john' of undefined"
	}
}
user1125394
can I ask to ask a useless question
16:32
You just did.
2
@Connor JavaScript has no classes,
@Connor That's not a class.
Also, it's js OO 101.
user1125394
is it bad to save html files under .htm ?
Define "bad"
@c'c doesn't matter what you save them ass as long as you serve with the correct mime type
user1125394
16:32
good practice
user1125394
yeah <!DOCTYPE html> matters ven if you save it as foo.cs
@Connor Also, your code isn't working because you're also using this , do something like var that=this at the top of your code and do that.styles instead , in JavaScript this is dependent on context
@FlorianMargaine who is Fabian Hemmer ?
@BenjaminGruenbaum In any language. For one thing, the websocket spec is ridiculous (a frame can be 2 ^ 63 bytes payload? Really?) and for another applying that packet agnostic framing protocol gives you a whole bunch of craziness to implement with data buffering. There are bits of that spec that seem to be there just to increase the amount of I/O involved.
user1125394
@DaveRandom I have see websockets used for video steaming.. not sure it's a good idea though
16:34
@DaveRandom In node.js using websockets with socket.io is really easy. I agree that the spec is silly
The max payload length thing is completely ridiculous. I certainly can't see a use case for frames larger than an int32, longer than a short is pushing it really. You'd just break the message up into smaller peices.
@Esailija That's me
@BenjaminGruenbaum na, doesnt work
Yo mamma's so fat, your father no longer finds her attractive so now they're getting divorced
jsfiddle.net/rlemon/4vZD3 Another 'start' to a game... but I don't know what to build.
16:45
Make them disappear after they're completely off screen
Not when the edge touches :/
yea that is just a test :P
And all the circles flicker if one is removed
idk why that is :/
You must be removing the circle in a loop, so the drawing of the rest gets messed up
Hi guys
16:50
@rlemon make a kaboom clone
Does any of you know if there is a reliable profiler for javascript that allows line by line profiling ?
thats one I start on alot
@Sisyphe In Chrome you can do that with the dev tools
@BenjaminGruenbaum line by line ? I wonder if that would be possible with how the code might be compiled.
I found a pretty good profiler
hmm
are you sure ?
16:52
@Sisyphe That's a weird way to profile
but it does not do line by line profiling
@Zirak : why weird ?
@dystroy Source maps?
Generally (I mean also for other language) I don't think a line by line profiling is compatible with common optimizations
Why do you care about a line, and not the function it's in?
Also ^
Addy Osmani has a great series of articles about profiling with Chrome Dev tools,
16:53
because some functions are complex, and even if I know the issue is in the function, it's not obvious vhere the problem is in the function ^^
Profiling a language makes little sense though, since there are many implementations that differ in optimizations
Then reduce these functions into simpler ones.
@Sisyphe If you have a function that's complex, break it
You'll gain code enlightenment and clarity.
16:55
well even if that would be possible in an ideal world
on a real production project with more than 10 developpers and tens of thousands of lines of code, its not always possible
@Sisyphe Yes, it is
no it's not
if it's not my code, and if it's been already coded not well enough, I don't necessarily have tjhe time to refactor it
as I have deadlines and cant affort to rewrite everything that been badly coded
I never told you to rewrite everything. Just what you need.
@Darkyen you did it again ?! stop deleting your fb account, it makes my comments look retarded and useless !
Surely you have some suspicion as to where the problems lie
You can put console.time statements
Narrow it down, you may find it on your own
well in a function that's more than 500 lines long, and that i didnt code, no I generally don't have any clue
16:58
500 lines long o_O
and I'm looking for a tool that would help me pinpoint the issue
How the heck does a function get 500 lines long ?
well yeah
more than 500 lines long -> refactor.
16:58
More like, more than 20 lines -> refactor
Line by line isn't likely to help you.
!!s/5/1/
@SomeKittens more than 100 lines long -> refactor. (source)
@jAndy I have been into insane trouble and shit bro
does any of you work in a real production environment ? oO Man... sometimes you have to cope with code that is not your own, you don't have time to refactor and you are just looking for where a problem lies...
16:59
more than 2 lines -> refactor
No matter what. So you'll see a bunch of numbers flying, unless there's this really nasty O(2^n) going around, you need to think in broader terms.
more than 1 line -> perl
@jAndy The Game
anyway, if the answer is : no there is no tool like that in javascript, ok
more than one line -> minify -> profit
16:59
@Sisyphe Seeing a 500 line function is a great sign of needing to switch a workplace
I'll have to figure it by reading the entire code
@Sisyphe Seriously, 1) that's not really a tool problem but a theorical one. 2) you'll gain by refactoring it anyway.
Really, looking at it line by line is like inspecting a 1000 piece puzzle to find where you put your glasses
@Darkyen Ok Ok, I don't want to get involved in your dark back alley doings then
Ok guys... well good for you if you work in perfect workplaces, where your colelgues do perfect code, and where you don't have function that are more than 50 lines
that's not my case
17:00
@Sisyphe Doesn't your workplace have code review o_O? That's not about being perfect, that's basic
hah, no, I know what you're dealing with
@Zirak : a line by line profiler is able to give you the time taken by each line of code
I just deal with it differently
@Sisyphe Can you alter the code you're profiling?
@Sisyphe BWAHAHAHAH
Nothing is ever perfect ever
17:01
at least with other languages
I used to program in .NET
and line by line profiler are great tools
@jAndy no dude i am friken broken emotionally you got g-talk ?
i can really need somebody to talk to :-(
Did you really have that in C# ?
@Sisyphe And since a single line isn't a likely suspect for drastic code hickups, you have to think in broader terms (i.e. functions)
of course...
Of course you can, you can have that in JavaScript too
Like I said at the beginning of the conversation, Chrome comes integrated with a profiling that can do line by line profiling
17:02
@Darkyen you're serious about it ? well, I don't have g-talk (yet), but I'm in the office currently
@Zirak : well in .NET sometimes it is
I would say check out loops and nested loops when profiling, IO can also be extremely expensive
a single line can be a bottleneck
@BenjaminGruenbaum : how dos it perform line by line profiling ?
is there a sepcific option to activate ?
I only got function wise profiling to work
@Sisyphe There is an article about this by Addy Osmani, I don't remember, I never had to do this
a lot of code doesn't necessarily mean its running slow, and few code doesn't necessarily mean its running fast
isn't that true for all languages
17:04
I'll look into that, thanks
!!/undo
@jAndy no, in Assembler that's usually not true
:)
user1125394
@jAndy but long means no1 want to go inside
Let's make a language, with the only opcode being a 1 second sleep
Just to prove @jAndy wrong
.verySlow
inc ecx
dec ecx
cmp ecx, 5
jne .verySlow
@jAndy I thought you meant doing the same thing as in the same series of actions
17:12
i need somebody to talk me out of this :-/
@jAndy i am hell serious bro
@Darkyen don't do it
@BenjaminGruenbaum do what ?
@Darkyen Donnu, talking you out of it :)
@BenjaminGruenbaum :-/ what do u mean ?
3 mins ago, by Darkyen
i need somebody to talk me out of this :-/
17:16
u guys know what i came to this room only because you people here make me feel home make me feel happy everytime i am mellow
@BenjaminGruenbaum sorry cant understand ur joke
@Darkyen You said "Talk me out of this" out of context
@Darkyen So I replied with "don't do it"
ah..
i thought you meant the this pointer
@Darkyen Everything ok?
@BenjaminGruenbaum not at all , its more like .. urgh can u email me ?
[email protected] i'd rather talk on that
K sent
@Darkyen Well, in 20 seconds because of Gmail's undo got it?
17:20
Hello again :)
So I have bruises on my head from banging it against the wall. I'm looking for a well seasoned jquery/javascript person that can help me periodically with projects, preferably communicating through Skype. Hope I'm not breaking the rules by asking this, but if anyone is interested in making a few bucks shoot me a msg.
Hi Benjamin! You're here often I see. :)
@user1447679 You're not breaking any rules, it's perfectly OK to offer jobs to people here.
@user1447679 skype eyy
@user1447679 What is your goal?
I'm here often because I have it open when I work and stuff
Awesome.
@user1447679 You'd do better if you posted what you'd pay.
17:23
Also ^
@Connor My JS guru recently moved and is rarely available. I can handle most things but some times I spend too much time on certain things than is needed.
@user1447679 ok my skype is connor.miles6 if you want to discuss
I think you'll get better help by asking stack overflow questions that are not too localized and here questions that are
In SO, if you get bad advice, you'll know
I'd also check to see how much rep someone's got before "hiring" them.
Pay is good, but at the same time it's open for discussion. For example, if I take twice as long as I should have taken on a project, I only charge a client what they should have been charged, etc.
17:25
There's also a site, inspired by SO, on which you can offer money for small tasks. But they must be simple to describe.
@user1447679 i don't want money for it unless its a big project, then different kettle of fish
@user1447679 Bad form. Quote a starting price or no one will believe you.
Well I've found SO to be overwhelmingly helpful. It's a rare thing to find genuine people who actually don't mind helping others out.
SO is people who don't mind helping others out
@user1447679 Is it safe to assume at least 20$ per hour? That seems to be pretty much the amount that would get people from this room going
@Darkyen Did you get my mail?
@SomeKittens With all due respect I disagree. I negotiate on a one-to-one basis.
I pay more than $20/hour.
17:28
@BenjaminGruenbaum This looks very small for short tasks (disclaimer : I'm not interested myself).
@dystroy Not sure if so for Indians, I wouldn't be interested in short tasks because it's too much trouble with the taxes
Even for my n00bness, $20/hr is a bit low.
It might be interesting for our Indian friends here though like @AmaanCheval since they said the pay in India is less than in Europe or America
@SomeKittens Also, he said he pays more
@BenjaminGruenbaum I think $20/hr is less too
17:31
But that's probably only because I've heard people talk about charging way more
@BenjaminGruenbaum Well. That's a good idea. The advantage in here is that we have very reputable coders from countries where most aren't (yet).
Is there a way to send a private message directly through this chat room?
@user1447679 No, there is not, sorry, this chat is public and google indexed
I think that users open to jobs have a link in their profile.
@dystroy browsing users through SO careers costs > 1000$
17:35
@BenjaminGruenbaum would you be interested in chatting (typing) on Skype for a moment?
I mean that when you want jobs, you put a direct contact link in your profile. If some of you want a job and didn't, then, you should...
@user1447679 my gmail is [email protected] , you can send me a message at google talk
Connor I'll add you in just a second as well.
Thanks everyone.
@user1447679 Connor is pretty incompetent though, just saying :P
3
@dystroy I always want jobs, it makes 0 business sense to not willing to hear about job opportunities
Haven't used Google chat in ages. I sent you a request @BenjaminGruenbaum
17:38
Ok, I approved your request
@user1447679 I'm curious to see more of what you're offering. If you've got time, you can find me (again, Google Chat) at [email protected]
TypeScript will outdate javascript
What's going on here?
@user1447679 Feel free to email me as well if you want. [email protected]
Thank you all. I'll be back in just a second and will track down all these emails and will contact you.
!!/learn ln "ln `target` `linkName`"
Because I always forget which one comes first.
17:53
@Zirak Command ln learned
Me too
Won't be very useful, though
ln --help gives a giant scroll
man ln
btw @OctavianDamiean, if I remember correctly and you wanted a server to mock with Python, have you thought of app engine?
17:59
@SomeKittens we still buddies :)

« first day (909 days earlier)      last day (4264 days later) »