Language:
switch to room list switch to menu My folders
Go to page: First ... 5 6 7 8 [9] 10 11 12 13 ... Last
[#] Tue Nov 04 2014 10:57:43 EST from dothebart

[Reply] [ReplyQuoted] [Headers] [Print]

hm, this sounds like a realy nice contest:

http://www.underhanded-c.org/



[#] Tue Nov 04 2014 12:10:22 EST from fleeb

[Reply] [ReplyQuoted] [Headers] [Print]


Has anyone ever had the need or experienced the use of the %n formatting code in a printf statement in C/C++?

I've read a lot of code, but I've never seen production code that uses this. And I'm kind of surprised such a beast exists.

Instead of printing the variable to which it refers, it writes to the variable a value representing the number of characters the statement has printed up to that point.

I suppose it was created to help deal with formatting concerns in elaborate lines of text, but... wow... that's obscure.

[#] Wed Nov 05 2014 11:25:22 EST from IGnatius T Foobar

[Reply] [ReplyQuoted] [Headers] [Print]

Working with managed code (whether Java or C#) puts me in mind of
Apple creating a programming language or something.

Yup. Today's programmers are isolated from the machine. It's too bad.

Probably the best applications today are the ones where the core logic is written in a Real Language and then has extensions written in "managed code"

[#] Wed Nov 05 2014 14:29:02 EST from fleeb

[Reply] [ReplyQuoted] [Headers] [Print]


The %n thing...

Turns out, at least in Windows, you have to call some other function to enable it, or it won't work.

But it's considered 'exploitable', since you can use it to write memory anywhere if you're sorta evil and know that someone ignorantly exposed printf by allowing a human to drop in whatever formatting field they want.

Nifty-weird.

[#] Wed Nov 05 2014 14:30:34 EST from fleeb

[Reply] [ReplyQuoted] [Headers] [Print]

Probably the best applications today are the ones where the core logic

is written in a Real Language and then has extensions written in
"managed code"

I agree.

You get the advantages of the managed code by letting it take care of the crap that's kinda difficult to handle, while getting the advantages of working closer to the wire by having that meticulous attention to how memory is being used, etc.

[#] Mon Nov 17 2014 11:21:57 EST from LoanShark

[Reply] [ReplyQuoted] [Headers] [Print]


Lovin' their treatment of PHP. Cruel, and entirely true.

[#] Tue Nov 18 2014 17:15:34 EST from dothebart

[Reply] [ReplyQuoted] [Headers] [Print]

[#] Mon Dec 01 2014 18:13:32 EST from dothebart

[Reply] [ReplyQuoted] [Headers] [Print]

hm, this sounds like something we may put into libcitadel too...

http://blog.kazuhooku.com/2014/12/improving-parser-performance-using-sse.html

(found on ycombinator ;-)



[#] Tue Dec 02 2014 01:43:14 EST from ax25

[Reply] [ReplyQuoted] [Headers] [Print]

dothebart,

You are evil smart :-)  Glad you are creative and not malicious!  Of course, that is just an assumption you don't have a side job - JK



[#] Wed Dec 03 2014 09:00:22 EST from IGnatius T Foobar

[Reply] [ReplyQuoted] [Headers] [Print]

Yikes. Let's not use Citadel as a test bed for technologies we want to play with.

[#] Wed Dec 03 2014 10:49:51 EST from fleeb

[Reply] [ReplyQuoted] [Headers] [Print]


But I like what I see here:

https://github.com/h2o/picohttpparser/blob/master/picohttpparser.c

Around like 139, DOIT(); DOIT(); DOIT(); and so on.

Even the 'if (unlikely(' bit kinda gives me a chuckle.

[#] Wed Dec 03 2014 11:15:21 EST from fleeb

[Reply] [ReplyQuoted] [Headers] [Print]


Oh, yeah, has anyone here heard of Duff's device?

You can use it to portably create coroutines in C, but... it's... not very nice:

http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

[#] Wed Dec 03 2014 14:30:28 EST from LoanShark

[Reply] [ReplyQuoted] [Headers] [Print]

Even the 'if (unlikely(' bit kinda gives me a chuckle.

I saw that. Must be an annotation for the branch-predictor. Didn't know you could do that, even in C. I am getting old.

[#] Wed Dec 03 2014 14:32:06 EST from LoanShark

[Reply] [ReplyQuoted] [Headers] [Print]


Either that, or you could say "Java has completely ruined LoanShark for any Real Programming"... take your pick.

[#] Wed Dec 03 2014 16:27:09 EST from fleeb

[Reply] [ReplyQuoted] [Headers] [Print]


I'm lucky (or unfortunate) that I can still work with C++. But I'm finding myself doing more Java and C# stuff as time passes.

[#] Wed Dec 03 2014 18:26:21 EST from dothebart

[Reply] [ReplyQuoted] [Headers] [Print]

I've been a c-guy for the recent years...

doing some python for the scripting the last year, now js replaces that due to the job...



[#] Thu Dec 04 2014 00:32:19 EST from ax25

[Reply] [ReplyQuoted] [Headers] [Print]

 

Wed Dec 03 2014 10:49:51 AM EST from fleeb @ Uncensored

But I like what I see here:

https://github.com/h2o/picohttpparser/blob/master/picohttpparser.c

Around like 139, DOIT(); DOIT(); DOIT(); and so on.

Even the 'if (unlikely(' bit kinda gives me a chuckle.

Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooo.



Go to page: First ... 5 6 7 8 [9] 10 11 12 13 ... Last