« first day (574 days earlier)      last day (4392 days later) » 

4:00 PM
ah, C# roundtrip format specifier is just R (or r)
 
mawning
woah it's quiet in there
 
4:16 PM
syscall read y u no read data
Oh wait it does. That's cool.
Yay! Finally got it to work.
 
@classdaknok_t There's also cpp-netlib
 
@JamesCuster is it alive? I thought is was abandoned right after that boostcon
 
I dunno, I stumbled across it the other night and thought it looked pretty nice. I didn't see how active it was...
Looking on github really quick, they have commits from a few weeks ago vOv.
 
oh I see... it looks alive
 
@JamesCuster the point is writing it myself so that I understand better how sockets work.
 
4:31 PM
Ahh
Nevermind then
 
How would read know when no more data is available from a socket? That's not possible, right?
 
@classdaknok_t it returns zero if EOS
(end of stream)
 
Oh yeah it has to wait till the other end closes the socket, right?
That's why my program hanged; I'm testing with HTTP.
 
@classdaknok_t yep
 
Well, I'm happy enough to have my Socket class working.
It probably has many bugs, but I'll fix them whenever I encounter them.
 
4:34 PM
@classdaknokt posix or windows?
 
@johnathon POSIX.
Mac OS X, to be exact.
 
@classdaknokt boost::asio
 
4 mins ago, by class daknok_t
@JamesCuster the point is writing it myself so that I understand better how sockets work.
 
@classdaknok_t and do you understand how they work now?
 
@classdaknokt understandable, as there is no real time messaging class for a simple client socket in windows i have to make one myself everytime i go to use a socket. but theres also the server side where i have to do asio at the os level
 
4:37 PM
@Abyx partially.
 
@classdaknokt what don't you understand about them?
 
@johnathon I don't understand the first argument to the socket system call, the socket family.
 
finally set up the fucking dial up internet connection again.
I hate this place
 
Dial-up? That's from the stone age. And expensive as hell.
 
I am living in the stone age currently.
in my grandpa's house.
 
4:39 PM
@classdaknokt ah, thats because theres different families of sockets, you have tcp, ipx, atm, ect , even a specialized socket type for communicating with databases
 
with no civilized tech geek around for miles
 
@johnathon Aren't those socket types?
 
in a town with only ye olde' people.
 
user406009
I thought databases just used tcp + custom protocol.
 
@EthanSteinberg probably, theres ton of different flags for the socket() calls
 
4:40 PM
> The domain argument specifies a communication domain; this selects the protocol family which will be used for communication. These families are defined in <sys/socket.h>.
 
@classdaknokt yea, for me it sin <winsock2.h> :P
 
I use pimpl with separate implementations for Windows and POSIX. The implementation gets selected at compile-time.
 
@classdaknokt can you make a udp socket, a raw socket, and a tcp socket
 
and for some reason I can only see new messages when i refresh the page.
 
@johnathon UDP, is that using SOCK_DGRAM?
 
4:42 PM
@classdaknokt yes sir it is :)
 
Hi,
can inner_product() be used with complex vectors?
 
I do have in my interface this:
enum class Type {
  Stream,
  Datagram,
};
But I haven't tested Datagram.
 
@classdaknokt theres also SOCK_RAW
 
@johnathon I don't need that for now. :)
 
@classdaknokt which tells the socket implimentation that your code is going to supply the ip header
 
4:44 PM
So the socket implementation will only provide the ethernet frame, right?
 
@classdaknokt and , at the same time enables a ton of use full stuff with sockets.
 
That's cool.
 
@classdaknokt pretty much, you have to supply the IP header it's self
 
> It's funny how finger puppets sounds okay as a noun.
 
@classdaknokt if you think about it it'll make sense, the network stack wont be constructing your packet for you at the IP level, (forgive me it's been a minute if i get the nomenclature wrong ) , and from that you can use that raw to look at other connections promiscuously (packet sniffing) , ect
 
4:48 PM
@johnathon are raw sockets also used for IPC?
 
@classdaknokt their used for a lot of stuff. and also to note, under the covers, XWindows uses a socket to communicate with your GUI apps
 
If X uses it for communication with other processes, yes, it's used for IPC. :)
 
@classdaknokt which is what lets Xwindows be scalable across a network natrually
 
Neat.
 
@classdaknokt and when i said Ipx, thats an old standard before tpc/ip became widely used
 
4:52 PM
@johnathon yeah, man socket(2) also mentions it.
 
@classdaknokt All n all though it's good your learning to use sockets. i do wish you the best of luck in it, but i have to ask, if your going to be doing any development for posix are you planning on useing something like Qt or KDevelop ?
@classdaknokt because if you are , i was just going to mention that Qt does offer some very nice classes in the networking department
 
@johnathon thanks. No I'll just use the standard library.
And the POSIX and BSD APIs.
Usually I start a project for learning purposes and I put it on GitHub (the code there is horrible, I guess) and after a while I delete it.
 
@classdaknokt rolling your own gui window in windows with the api is a pain, but it's doable.. i have very little deep knowledge of how xwindows does it except for the fact iv'e looked into it, and i can understand WHY such libraries such as Qt exists
@classdaknokt it's more to the fact that XWindows DOES use a socket or handling gui events, and the way it does it is (to me, mind you) more monstrous than how MS does it.
 
How does Microsoft do it? Through the kernel?
Wouldn't surprise me.
 
@classdaknokt nah, are you familiar with a call back routiene?
 
5:01 PM
I'm familiar with callbacks inside applications.
You pass a callback function to another function and your callback function gets called.
 
@classdaknokt ok, well ms does it with a static call back, and ya pass the address in of the callback you want windows to use to an api that registers the location of that callback with the system ( few other trinkets of info in that structure too such as a window class name ) and when you create window with that name the system will then issue windows messages to it via it's call back
@classdaknokt then your application calls an api that basicaly does a pop off of a message stack, to get the oldest message there is on the stack , and process it in a loop
@classdaknokt theres an api that will then take that message structure and crack it apart so that it fits the paramaters of your callback
 
Hmm, I understand.
But what calls that callback? The kernel, right?
Or does the window system have access to all memory?
 
no, it's in your code.
 
Doesn't my program need to communicate with a windowing system to create a window?
 
@classdaknokt no, your program asks the system to make the window for you, how you want it made
 
5:06 PM
Or to receive mouse or keyboard events.
There has to be inter-process communication to ask that the system, right?
 
@classdaknokt in xwindows yes,a socket, in windows not so much
@classdaknokt i have a diagram let me put it on flickar or sommin so you'll get a better understanding
 
And everything outside of that dotted rectangle is from the system, right?
 
@classdaknokt \yes
 
Hi all
 
How do those messages go from the system to the application?
 
5:12 PM
0
Q: Did i almost got hacked?

Vinit KumarThis might seem little weird but i almost got hacked. I luckily noticed some unauthorized activity n my gmail account. It did a whois query and found out the following results. I am posting the screenshot and whois report. Someone please provide me some insight into the nature and source of this ...

^ No, but your question has almost been closed :p
 
@classdaknokt but you have to understand, GetMessage() is a blocking call, that fills out a message structure to your application , then TranslateMessage() is called on it to unwravel the different keyboard mappings, then DispatchMessage() is called on it to tell the system to invoke your static window procedure
 
Say I hit a key on my keyboard. A signal goes from my keyboard to my computer. The kernel receives that signal.
If I want my application to respond to a key press, the signal has to go from the kernel to my application in some way, right?
How is that done in Windows? That's the part I don't understand.
 
@classdaknokt more to it than that, Which window has focus?
@classdaknokt thats just it, the message loop , in windows, to explain every widnow has it's on identifier, called a handle ..
@classdaknokt and if a window has focus and you hit a keyboard key, windows will put a message on the message que that has your windows handle in it, and the approperate keyboard message
@classdaknokt when your application calls GetMessage() it popp's the messages off that pertain to its handle
 
So the message queue is filled by the kernel?
 
@classdaknokt yes.. but an application can also send or post messages to that message que as well
@classdaknokt it's a very classic way of communicating between threads on windows
 
5:16 PM
it's all a big mess
 
@JohannesSchaublitb yes, but not as bad as Xwindows
 
I wonder how this is done on Mac OS X.
 
@classdaknokt the basic architecutre is the same, but insted of using a message que, it's done with a socket
 
There is a process WindowServer which runs as user _windowserver.
@johnathon Mac OS X doesn't use X.
 
@classdaknokt no, theres no user _windowserver
 
5:18 PM
@johnathon There is.
 
@classdaknokt there is the DWM
@classdaknokt thats responsible for painting the windows
 
soon canonical linux desks dont use X anymore either
wayland
 
@johnathon as I said, Mac OS X doesn't use the X window system.
And it doesn't use DWM.
It uses WindowServer.
 
@classdaknokt ah, confusion arose i thought you was talking about MS
@classdaknokt technically it DOES use Xwindows, or X11, the underlying concept is the same as Xwindows
@classdaknokt the different names pertain to forks of the projects
@classdaknokt and i forget what the particular BSD fork is (which is what mac osx uses)
 
Mac OS X uses Quartz Compositor.
> Quartz Compositor is the windowing system in Mac OS X. It is responsible for presenting and maintaining rasterized, rendered graphics from the rest of the Core Graphics framework and other renderers in the Quartz technologies family. Internally, it is also known as WindowServer.
 
5:22 PM
@classdaknokt right on, dig into where it came from, what source tree it spawn off of
 
Wayland will solve all these problems
 
@johnathon If Quartz Compositor uses X, why does Mac OS X ship with a separate X server?
 
@classdaknokt go look at how xwidnows talks to your window.. then go look at how quarts talks to the _windowserver ... the mechanisim is identical, the information theay use to "talk" with will be different.
 
Quartz Compositor is WindowServer
 
@classdaknokt you know what im saying. :|
 
5:25 PM
lol
 
Okay, I'll packet sniff on WindowServer.
 
don't do anything illegal or I will report you
 
@johnathon I recently read that there is no such thing as X-Windows. :-P
 
yea, tell me how sucessfull that is
@JamesCuster lol, techncially there isent, its X11 windows now
 
X-Windows is a protocol.
there are currently two major implementations
 
5:26 PM
The X window system (commonly X Window System or X11, based on its current major version being 11) is a computer software system and network protocol that provides a basis for graphical user interfaces (GUIs) and rich input device capability for networked computers. It creates a hardware abstraction layer where software is written to use a generalized set of commands, allowing for device independence and reuse of programs on any computer that implements X. X originated at the Massachusetts Institute of Technology (MIT) in 1984. The current protocol version, X11, appeared in September 1...
 
XFree86 and Xorg
 
"X can be called “X”, “X Window System”, “X11”, and a number of other terms. You may find that using the term “X Windows” to describe X11 can be offensive to some people;"
 
Quartz Compositor directly talks to the graphics card. It's the only process on Mac OS X that can directly access VRAM (and the kernel can do that too, of course).
 
Apparently some people go crazy when you call it X Windows.
 
5:29 PM
I just call it "X".
 
as do i
 
Three people like that.
 
lol
@classdaknokt i'll have to look into quartz, it may indeed be a different beast all togather
 
It seems that Quartz uses PDF internally and then renders it to whatever out put you want, be it the screen, an image file, a PDF, or a printer.
That's pretty neat. How is printing (to paper) done in Windows?
 
@classdaknokt print spooler, uses the same basic concept of drawing to a window's device context ( or direct 2d / 3d which renders directly to the video card or compatible rendering device)
 
5:36 PM
@classdaknok_t According to the image it seems that PDF is one of its output formats, not it's internal format.
 
> While traditional windowing systems (such as X) define every pixel on the screen as belonging to a single application at any given time, Core Graphics Services models each pixel on the screen as a composite of all applications that have drawn something to that pixel. Transparency effects are therefore possible by simply varying the relative "weight" of each pixel being composited into the final result.
@StackedCrooked Core Graphics Rendering uses PDF for its internal vector graphics representation. Apple describes its rationale for using PDF as follows:
> As a superset of Adobe PostScript, PDF brings several improvements, including better color management, internal compression, font independence, and interactivity. However, PDF is not a full-fledged language as is PostScript; it is declaratively, not programmatically, specified. Consequently a sophisticated and expensive language runtime is not necessary, as it is for PostScript.
 
@StackedCrooked @classdaknokt i bet in it's core, it's still using sockets
 
@johnathon probably.
 
@classdaknokt which just gets back to the point i was making, it's still X windows, just the information it's passing is different than whats in an X windows system
 
Then it's not X. It's similar to X, but not X.
 
5:38 PM
@classdaknokt lol, the architecture is X windows.
 
Quartz Compositor uses I/O Kit for doing I/O, so events are directly received from the kernel.
 
@classdaknokt big big fan of mac osx i take it?
 
@johnathon user and hacker.
 
@classdaknokt are you using clang or gcc?
 
Morning.
 
5:41 PM
@CatPlusPlus morning
 
@johnathon clang
That's the basic thing, same as in X I suppose.
(If you leave Core Services out.)
 
@classdaknokt yea, it is. Just out of curiosity what version of clang are you using?
 
@johnathon 3.2 SVN.
 
X is client-server.
 
@classdaknokt how did you get it set up with x code?
@CatPlusPlus so is mac os's quartz, background _windowserver
 
5:43 PM
> Before it dispatches an event to an application, the window server processes it in various ways; it time-stamps it, annotates it with the associated window and process port [(what kind of port?)], and possibly performs other tasks as well.
Apparently Mach ports. So it doesn't use sockets.
It goes through the kernel.
> a "port" is a protected message queue for communication between tasks; tasks own send and receive rights to each port
 
@classdaknokt then its simmilar to a message que
 
That is true, it uses event queues.
But not sockets.
Mach ports are generally used for IPC on Mac OS X. But they are abstracted away as much as possible in Cocoa.
 
@classdaknokt see now that's interesting, you'd have to be my age, but i can remember when research was being done on this stuff, and it was a major challenge to get X windows responsive enough for GUI work back int he day.
 
> You should implement interapplication communication using distributed objects whenever possible and use NSPort objects only when necessary.
 
Any good C++ programmer online who's looking for a job? :)
 
5:49 PM
If I want a job, I ask @jalf or I go to careers.stackoverflow.com.
 
What's $jalf?
 
@jalf is one of the users here on so
@Robinjoeh what kind of job?
 
jalf's a guy here who works for a company that needs more employees.
 
Ok... O.o
johnathon: A gaming project, a very tiny description, I know. :)
 
If I can play games all day and get paid for it, I'll take the job.
 
5:52 PM
@Robinjoeh which platform
 
johnathon: Linux and Windows, server is for Linux, and client will be Windows.
class_daknok_t: That will be a part of the employment later, but not from the beginning. :)
 
What kind of game? MMORPG?
 
class_daknok_t: It'll be different games under the Steam platform.
 
@Robinjoeh you have an email, i know someone who's big into game code, and it might interest him
 
johnathon: Really? tell him to add me on MSN then, bibko@live.com (you can add it too, if you want! :))
 
5:54 PM
A spam bot visits.
 
Oh no. :(
@johnathon: Do you have MSN? :)
 
@Robinjoeh no
 
@johnathon +1
MSN is a piece of shit.
 
@classdaknokt lol
 
(As you'd expect from Microsoft.)
 
5:58 PM
@johnathon: I know it suxs, but everyone uses it... ;) What are programmers like you using? Skype?
 
IRC, I imagine.
 
@Robinjoeh i despise skype man :)) for real.
 
std::string method_str = "GET";
socket.write(reinterpret_cast<const std::uint8_t*>(method_str.data()),
                       method_str.size());
Is that safe?
 
@johnathon: Haha, it feels like I'm out in the middle of nowhere here..... :D
 
socket::write(const std::uint8_t*, std::size_t) just calls ::write(const void*, size_t)
@Robinjoeh Email.
 
6:00 PM
Y u reinterpret_cast.
 
@classdaknokt depends on if the method_str() remains around for the duration of the call
 
I want to respond when I feel like it, and that's often not immediately.
 
@classdaknokt What?
 
@CatPlusPlus cuz socket::write takes a const std::uint8_t* but std::string::data returns a const char*.
@Robinjoeh I dislike instant messaging because people expect me to respond within like a minute.
 
What's socket::write?
 
6:02 PM
@CatPlusPlus his own socket class
 
@cl
 
@CatPlusPlus a function which calls ::write(const void*, size_t).
 
Ops!
 
Then why the hell does it take uint8_t.
 
@Robinjoeh you can edit messages.
 
6:02 PM
Just make it take const char*.
 
@CatPlusPlus because about 99% of all network protocols expect octets and not bytes.
 
And in 99.9999999999% cases byte is an octet.
 
@classdaknokt Oh... :) Nice.. I like emails too! :)
 
xD
@CatPlusPlus well, I guess I'll just put a static_assert(CHAR_BIT == 8, …) somewhere then.
What about the signedness of char?
 
@classdaknokt you can use unsigned char
@classdaknokt but it really dosen't matter
 
6:04 PM
@johnathon then I still need the cast.
 
Implementation defined. Shouldn't matter.
 
@johnathon: Did you tell your friend to email me, if he's interested?
 
@Robinjoeh i left him a message bout it
 
@johnathon: Thank you very much. :)
 
@CatPlusPlus kthx!
Also, instant messaging isn't well-suited for large amounts of text.
And emails are easier to organize.
 
6:07 PM
Sometimes you need IM.
 
For what? Smileys?
 
No, instant messaging.
It's kinda obvious.
 
I know.
In that case I have a cellphone or Skype.
 
Skype is IM.
 
I don't use the IM feature.
 
6:08 PM
Well, mobiles, too.
 
I only call people.
 
Voice chat is IM.
This chat is IM, too.
Congrats, you're using IM!
 
But I don't know you guys in real life, so if I don't feel like responding here, I don't and you don't go ask me next day why I didn't respond.
 
Annoying people will be annoying regardless of the medium.
 
So it's a bad idea for me to visit you in real-life, right?
:P
I'm going to visit Poland in July, btw. Last time I've been there was more than two years ago.
 
6:20 PM
:(
 
My pizza is delayed. Not like.
 
Order a new one and see which one arrives first.
Then only pay for the first one that arrives.
 
Ell
oh I really want a pizza
 
I'm making meat dumplings now ;)
 
6:25 PM
I'm eating satay crisps.
 
Here in Russian student campuses is the main food.. On breakfast, dinner and supper ;) 5 minutes and they are ready
 
But I want krupuk with satay sauce.
 
what is satay? ;)
I've looked up on wiki... 've seen the pictures ;) looks tasty
 
It's the diarrhea-colored sauce in this picture:
It's tasty as hell.
Very popular in the Netherlands. Esp. in combination with chips, frikadellen, kroketten and satay.
Diarrhea is nasty, and it makes your ass burn as hell.
> @tweetsbi thanks I forgot about that one I still think it's bad design, though.
Dear twitter, I put a fucking comma after "thanks" and you deleted it.
 
Fucking commas are inappropriate for public timeline.
 
6:32 PM
Twitter if u delete punctuation y u no delete all punctuation and y u delete any punctuation at all twitter y u mess with my status updates y u encourage bad grammar.
Also, there was a period after "one".
 
Maybe you imagined it.
 
@tweetsbi thanks, I forgot about that one. I still think it's bad design, though.
I didn't, and it only happens when JavaScript is enabled.
 
Also opening in new tab = middle mouse button.
 
I only have two mouse buttons. xD
 
Stop living in 20 years ago.
 
6:38 PM
I don't need a middle mouse button or a scroll wheel if I never use them.
No, it scrolls if I move my finger over the surface of the mouse.
 
Moving fingers on the mouse? Crazy.
 
I'm used to it and I like it.
 
Also after clicking MMB you can scroll with variable speed.
Win.
 
I can scroll quickly by swiping and I can stop the scrolling by touching my mouse again.
Or I can scroll slowly by slowly moving my finger.
 
But then again you're a Mac user, you must be happy you even got two mouse buttons. xD
 
6:47 PM
:P
Mac OS X still defaults to one mouse button. So fucking stupid.
A multibutton mouse isn't required to do most things, but it sure increases productivity by 9999e999999%.
You can right-click using the control key if you use a one-button mouse.
 
@classdaknok_t I'm trying to get used to it and I'm not sure if I like it. On some days my fingers aren't as slippery as normal, and then scrolling is burdensome.
 
:P
Use it for a while and it'll get so fat you can fry chicken on it.
 
Also I had to disable the scrolling with inertia.
 
If I scroll to the top with inertia enabled then the inertia is still active for a short while even if the page already has reached the top. If you during the time for some reason need to press the command button, e.g. saving the file, then the zoom kicks in and suddenly the font rapidly increases or decreases depending on the scroll direction that is still active by inertia.
 
6:58 PM
Lol.
 
It's really maddening.
 
What kind of crappy application are you using?
IE?
 
QtCreator.
 
OSX, king of retarded UI functionality.
 
It zooms with Cmd+scroll?
That's shitty.
 

« first day (574 days earlier)      last day (4392 days later) »