« first day (706 days earlier)      last day (4233 days later) » 

12:00 AM
@MohamedAhmedNabil detecting things on screen is tricky, and harder still due to the massive amount of data involved.
 
Ok, it's time for me to sleep.
Bye.
 
Detecting shapes/patterns/... in images sure isn't easy. Doing it in real time is even worse
 
@MohamedAhmedNabil your average computer screen shows about 1GB of data every 3.5 seconds.
 
@MooingDuck Do you have a some sort of starting point I cant start at to make something like this?
 
@MohamedAhmedNabil No, I tried that and gave up. Too hard :(
 
12:03 AM
@MooingDuck I never give up, Im Young :D
 
2
Q: How to read the screen pixels?

NewbieI want to read a rectangular area, or whole screen pixels. As if screenshot button was pressed. How i do this? Edit: Working code: void CaptureScreen(char *filename) { int nScreenWidth = GetSystemMetrics(SM_CXSCREEN); int nScreenHeight = GetSystemMetrics(SM_CYSCREEN); HWND hDesktop...

 
@MooingDuck What about something like making the program do something specific when the mouse is pointing to a certain color (color range)
 
@MohamedAhmedNabil yeah, that one is much easier. You could probably do that
 
@MooingDuck Whats something like that called/ (How can i do that?)
 
@MohamedAhmedNabil I dunno, check stackoverflow/google/msdn
 
12:05 AM
@MooingDuck I should know what to search for first ^.^ Ill give it a try
 
@R.MartinhoFernandes More accurately, you can't be 100% certain of equality based on hashes -- but if (for example) you're comparing SHA-256 hashes, and they're equal, the chances of you're having found an actual collision are so remote that it's often quite reasonable to just assume they're equal. Just for example, Sun's (I can't quite bring myself to say "Oracle's") ZFS de-duplicates blocks based on SHA-256 hashes without comparing the actual data (and never lost data from it, TTBOMK).
@R.MartinhoFernandes Later.
 
@R.MartinhoFernandes your reddit submission is #1 post of /r/cpp in the top posts of this week.
Actually it's the highest rated of this month as well.
 
@JerryCoffin Ah, but you can't really say the same of std::hash.
 
@MooingDuck I serached for "C++ Color picker" Its all in MFC and Qt noting for console application
 
@MohamedAhmedNabil you're going to want to get the mouse coordinates, and read the pixel color at that coordinate. A "color picker" is usually a dialog box that lets a user pick a color :D
 
12:09 AM
@MooingDuck Ill check that out, and thanks for the info :D
 
@StackedCrooked Hmm, yeah. I got over 1k views today, against the ~8 views/day I used to have.
@StackedCrooked How do you see those stats?
 
@R.MartinhoFernandes Nothing fancy. Just click the "top" tab and then links from "this week" or "this month".
 
@MohamedAhmedNabil This is easy to do in C#/C++/CLI
 
@MooingDuck But there's the problem that I might want to have a color range, I hope I can use Relational and equality operators with Colors too
 
12:17 AM
I tried to make a bot for a game once... I'll I got it to do was my attack rotation xD (I didn't have much coding experience then)
 
@MooingDuck I can use the same thing to scan the entire screen for a certain collection of pixels, Right? Then i can do something certain when a certain picture shoes (example: click on it)
 
12:30 AM
@MooingDuck What do you think of my learning progress so far? :)
 
I don't.. see the difficulty in getting the colour of a pixel with X,Y position
 
@Rapptz This is just the basic thing, im taking it a step further
 
Which is? Chances are it's been done a million times over.
 
@Rapptz So what if it's done a million times before, Its an accomplishment and im proud of it :)
 
Depends on how you implement whatever you're doing.
 
12:35 AM
@Rapptz If you think about it there is nothing out there that someone hasnt already done/ tried
 
Of course there is.
 
@Rapptz Given that im nothing more than an amateur, Im pretty damn proud of what i did
 
I was proud of the things I did when I was younger too.
 
@Rapptz :) I never thought i could do an aimbot. Programming is awesome :D
 
aimbot being..?
 
12:38 AM
@Rapptz Really dont know what an aimbot is? Look on youtube
 
Do you mean auto-aim?
 
@Rapptz its called aimbot, but yea something like that
 
How did you implement it? As a DLL? Injection?
 
@Rapptz program running in the background
 
.. What is it auto-aiming at?
 
12:40 AM
I selected a certain clump of pixels that is on the player's texture
 
Using.. Windows API? I actually don't think the <windows.h> header helps with pixels.
 
Is there any good documentation on win32 UI programming anywhere?
MSDN can't even tell me how to receive a click event from a button
 
@Rapptz nop ^.^
 
@MohamedAhmedNabil Then?
 
That's their UI programming section
Doesn't say anything about a single button
 
12:45 AM
@Rapptz just a Win32 console application
nothing too advanced from that side of things
it did take alot of files and code thou
 
I'm very confused because the standard doesn't have a graphic library.
 
Mapping out the idea itself took me 2~3 hours
 
@IDWMaster What kind of UI framework do you want to work with? WinForms, MFC, WPF?
 
I need to sleep now
See you al soon
 
Bye.
 
12:46 AM
@Rapptz Native Windows UI -- I'm giving a C++ speech at a university and would prefer to have some kind of decent GUI application in my samples.
I also don't want to force .NET down everybody's native throats.
 
@IDWMaster, Use CreateWindow with the "Button" class and look in WM_COMMAND messages for the click.
WM_COMMAND of the parent.
 
How do you identify which button was pressed?
 
Oh man. Windows API :(
 
@IDWMaster, WM_COMMAND arguments.
One is an identifier you assign in the HMENU position when you create the button.
I think that's the value of wParam.
and then lParam is a handle to the button or something.
 
wParam = 0
lParam = 4129268
 
12:49 AM
Maybe w is split between the ID and the notification code. That would make more sense.
How are you creating the button?
 
ptr = CreateWindow(L"BUTTON",L"Button",WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,0,0,100,100,parent,NULL,NULL,NULL);
 
Right after parent, put an arbitrary number as your ID.
Typically you make a symbolic constant like ID_BUTTON1 or something.
Then you can use (I looked now) LOWORD(wParam) to extract the ID.
 
So I could use an int for a unique ID
 
and HIWORD(wParam) will be the notification code like BN_CLICKED.
 
And whenever I create a button, add it to a vector and associate it with a button class
 
12:52 AM
That's probably a good idea, and the ID should definitely be unique among other controls.
 
Ahh! Figured it out
lparm is actually the source HWND
So lparm = the value returned from CreateWindow which was associated with the creation of that button.
That's handy
Don't have to manually create IDs then
 
Yeah, Handle to the control window is what MSDN's WM_COMMAND says.
The IDs are probably something so that you can not have to worry about storing the handles or something.
 
You still have to store some dictionary
If you're dynamically creating buttons
I'm working on a library like this:
 
It feels weird having the system store things for you.
 
std::shared_ptr<IApplicationWindow> window = inst->CreateForm();
std::shared_ptr<IButton> btn = window->CreateButton();
Why is it double posting my messages?
Anyways; I'm trying to make a more "C++ style interface".
 
12:57 AM
Yeah, I was working on one until I started learning C#.
 
I personally don't think UI development should be limited to C#
 
Then I realized that .NET was what I was doing, except mostly complete.
 
You get a HUGE framework dependency, and numerous administrative hassles.
 
True, C++ is still my preferred language, but I think that'll change when I get more experience with C#. I mean, .NET is something you install anyway because so many programs need it.
 
Yeah, but there's downsides to .NET as well
.NET has a slow garbage collector
Easy to reverse engineer .NET progams
Difficult to optimize .NET applications
Huge performance penalties when calling native code in a tight loop
I started with .NET and then learned C++ when C# became too slow for me
 
1:01 AM
Yup, it has its pitfalls, but it is very productive for Windows development.
I figured it'd be a good one to learn when someone wants me to be productive.
 
Hmmm
Maybe it wouldn't be a bad idea to add a .NET dependency on Windows.
It's cross-platform, so I could just add the .NET in the Windows version, use other frameworks on systems like Linux that have better C++ support
Essentially wrap the .NET functions in a C++ library
which can be loaded with LoadLibrary
 
It'd be better included in automated Windows updates than with the OS itself, but I don't think it's an overly bad idea to merge it. There are so many .NET people making applications.
 
I'm just debating if it's appropriate to use a library dependent on .NET at a C++ convention
It would still be standard C++ (the code that uses the library)
But for some reason it just doesn't feel quite right.
 
Yeah, it'd probably be best not to mix them there.
I wish it was easier to export functions from C# DLLs, though.
 
Still; if that's the way MS wants it programmed (they seem to be forcing win32 users towards .NET)
Perhaps that's the way the library should be written
 
1:06 AM
At least it's OO, unlike 90% of the Windows API.
And the 10% that is is just COM.
 
True
And some of the 10% COM actually calls into .NET code
 
^ Madonna "I'm so stupid"
 
I guess the people at the convention wouldn't have to know it's using .NET
 
@chris well there's a bit of script language support too, including a filewriter, a dictionary and an enumerator thingy. of course implemented in COM, but you don't see that when you use it in javascript (say)
 
There isn't exactly a restriction on using only native code at the convention
And if you have
shared_ptr<someclass> myinstance = .....
and you call
myinstance.somefunction();
By looking at that; you have no idea if it's .NET or not
 
1:09 AM
posted on September 21, 2012 by Jorge Pereira - MSFT

My name is Jorge Pereira and I am a developer at Microsoft.  For the past few months I've been working on a Windows 8 app along with a small team of developers from the Visual C++ team, we call it Project Code Name Austin. Austin is a digital note-taking app for Windows 8. You can add pages to your notebook, delete them, or move them around. You can use digital ink to write or draw t

 
->
 
@IDWMaster that is actually an interesting question. with complex answer. see my "lessons in windows programming" blog
still i didn't cover everything, it's even more complex... due to crazy api evolution
 
omg my dog is being like a cat again
started on the other end of the bed and keeps moving closer until he's on top of me
 
^ Repost just because it seemed right
 
@Cheersandhth.-Alf Yeah; I read somewhere on MSDN (can't remember where) that WM_COMMAND on buttons is deprecated and there's some replacement for that now
@Cheersandhth.-Alf How many times has this picture been posted here?
 
1:15 AM
dunno, 20?
 
Anyways; would you recommend calling into .NET for UI development, or doing it natively?
 
Only seen it twice
 
UI development on Windows specifically
 
do the ui in .net and call down to api instead?
 
.NET
 
1:16 AM
OK. I'll do the UI code in .NET and write a C++ wrapper around it
(and sneakily put it in the same DLL file)
(using C++/CLI)
 
i think .net is just about right for run-of-the-mill user interface work
 
@Cheersandhth.-Alf On Windows
 
On Linux it would actually be more practical to use C++ (regular)
All depends on the platform
 
@IDWMaster, How do you export it with C++/CLI if you write it in C#?
 
1:17 AM
@chris I never said I was going to write it in C#
If I DID write it in C# though
I could also do it
 
I was looking into that for something, but I stumbled upon changing the IL first, which worked.
 
I could embed the DLL at the end of the EXE bytecode
after compilation
and load the IL using Assembly.Load (some load function on Assembly) in C++/CLI
to load the data at the end of the bytestream
and then use reflection to dynamically call into the C# code
I've embedded hundreds of .NET dlls in a C++ project once
 
I know you guys don't especially appreciate C code but this code, is the mother of all UB:
 
and resources
 
0
Q: issues with fscanf and seg. faults

Tyler Sebastianchar temp[100]; char event[1000]; int i = 0; do { while (true) { **fscanf(fin, "%s", &temp);** if (temp != "BEGIN:VEVENT" || temp != "BEGIN:VCALENDAR") { strcat(event, temp); } if (temp == "END:VEVENT") { Events[i][0] = *event; ...

 
1:19 AM
Wrote a cool little IDE that embeds the stuff nicely
Basically puts a small read-only file system at the end of the EXE file
 
Seems legit.
 
Mounts the file system and redirects all calls to File.Open, Directory.Enum...... etc.
 
What the hell is this **fscanf(fin, "%s", &temp);**
 
@Rapptz He was highlighing it
Not valid code
 
@Rapptz: he was highlighting it
@chris: it's far from legit
 
1:21 AM
But I think he wanted to put emphasis on it
 
Oh, I was so confused.
 
Anyways; off to C++/CLI!
And messy GCHandles!
Bye!
 
2:04 AM
Hey guys, check this out zewailcity.edu.eg
A university where nobel award winners teach
What do you think?
 
2:16 AM
@MohamedAhmedNabil surely a good place
 
@Cheersandhth.-Alf Yea, It does look nice :D
@Cheersandhth.-Alf I wonder how will they get somone for computer science that took a nobel :P
 
@MohamedAhmedNabil i don't think anyone's ever got a nobel in computer science? some folks like rear admiral grace hopper got a lot of awards. some folks like nygaard and dahl and for that matter p.j.plauger (iirc) got the turing award. but i don't know any nobel.
 
@Cheersandhth.-Alf There isnt even a nobel for computer science
 
you checked
he he
the turing award is perhaps the closest
 
I was just being sarcastic, I already know. :D
 
2:20 AM
except pure math awards like fields award
 
Turing Award is the Nobel of computer science
 
@Cheersandhth.-Alf Plauger didn't get a Turing Award. FWIW, the full list.
 
oh, thanks
i need more and better memory, and more and simpler wound dressings
and more coffee
:-)
 
@Cheersandhth.-Alf or gummy bears
 
well if they're sugar-free. i have diabetes
 
2:24 AM
@Cheersandhth.-Alf Oh, That just makes me sad :(
I cant ensure you sugar free, but 1 pack equals 1 redbull
 
Now thats a gummy bear
Check it out :D
 
^ Repost, just because I liked it: "Self defense against fruit"
 
2:27 AM
@Cheersandhth.-Alf This is hilarious
Sometimes i like to go to the python room and ask them if they know parselmouth language XD works everytime
 
3:04 AM
@Rapptz I dont care Mitt Romney is awesome
 
lol'd
 
This is prooooof
Try to tell me how this isnt awsome
 
I watched that a month ago.
 
Still awesome
 
I liked the first one better.
 
3:11 AM
Both are great
 
@MohamedAhmedNabil ...and what ad does YT show me when I watch it? Yup, a Romney ad!
 
I dont know why but I have never seen a YouTube ad ever
 
So are these all pro-Romney videos? Or are they all Romney bashing videos?
I haven't bothered to watch any of them.
 
^ Repost, just because I liked it. :-)
 
@Mysticial More bashing- than pro-Romney, but definitely not intended to be serious at all -- basically just fitting other words to his lip movements. Some really funny, mostly just kind of silly.
 
3:16 AM
^^ That sounds like something out of the onion...
 
3:35 AM
ugh so bored >.>
 
4:07 AM
 
^ What should I call this monstrosity of a curve? It reminds of the British islands, for some reason
 
4:28 AM
bonk
 
It's a dragon isn't it?
 
a silly variation, yes
for n in range( 1, 3**7 + 1 ):
    ell_shape( direction_left if n % 2 != 0 else direction_right )
    while n % 3 != 0:
        n = n // 3
    n = (n + 1) // 3
    turn( direction_left if n % 3 != 0 else direction_right )
 
I think that's what Martin Gardner called them. You get the design by folding over a strip of paper over itself and then unfolding it so that every bend is at right angles.
 
well, and roger penrose has one in wrought iron on his property's gate
 
4:38 AM
but those are simple dragon curves
the above is a monstrosity
thanks, but i'm not sure i can relate it to that
here's my code for "ordinary" dragon curve
for n in range( 1, 2**9 + 1 ):
    ell_shape( direction_left if is_even( n ) else direction_right )
    while is_even( n ):
        n = n // 2
    n = (n + 1) // 2
    turn( direction_left if is_even( n ) else direction_right )
for the monstrosity i just changed 2 to 3 in a few places :-)
 
Oh ... looked awfully similar :)
 
i think it's amazing how the human visual system can relate such things
 
Few things do it better.
 
I just love it when the internet randomly dies for like 20 minutes at around 12:30 AM all the time.
 
@chris I just love it when people refer to their shoddy connection to their shoddy ISP as "the internet".
 
4:53 AM
@Insilico, Good point, but I'm simply too lazy.
 
@chris :-)
 
^ I installed 7zip and tried it in GhostView and it sucketh. Can someone convert to PDF please
 
@Cheersandhth.-Alf crooked clover
 
Just received an email that I should watch this:
 
5:11 AM
it doesn't seem to be music
is it?
 
It is. Unless you hold a very old-fashioned definition of what music ought to be.
 
well i couldn't hear anything but then i didn't go farther than before the first frame
slow connection u now
 
How come?
Norway has good infrastructure :)
 
it helps to have a sloooow connection and not installed relevant version of adobe flesh player
now playing Porcupine Tree "Stupid Dream" album
 
5:44 AM
 
^ Very silly. Why didn't I know that?
 
What didn't you know?
 
That they fit like so.
It boggles the mind.
 
What's PHP got to do with it?
 
Dunno.
If your classes do not have virtual methods but they use virtual inheritance, will they get a vtable?
 
no
i don't think so
 
I think so too.
The article says yes.
 
why on earth
 
6:01 AM
> You should note two things in this diagram. First, the order of the fields is completely different (in fact, it is approximately the reverse). Second, there are these new vptr pointers. These attributes are automatically inserted by the compiler when necessary (when using virtual inheritance, or when using virtual functions). The compiler also inserts code into the constructor to initialise these pointers.
 
well a vtable is table of pointers to methods
 
Maybe vptr is not a vtable.
 
while with virtual inheritance you need to know offsets of base class subobjects
 
The article seems to be quite good at first sight.
 
hm
there's an old book about memory layouts in c++
i think still holds good
 
6:05 AM
@Cheersandhth.-Alf Which one? I think it's an interesting topic.
 
like "inside the c++ memory model" or something
oh yes, lippman
 
6:36 AM
I don't know if this has been posted, but wow...
 
I went to the Dark Side. Just bought an Apple product. New iPad baby. God the retina display is beautiful!
 
@chris about 6 times. different sources though :)
@Chimera "iPad baby"?
 
@sehe, I'm always late with every cool new thing :/
 
@sehe no just the new iPad. Baby was added so say like, "Yes, I got the last ticket baby!"
 
Who isn't? La condition humaine
Also, "every cool new thing" is vastly overrated
Me: Your shoes are on the wrong feet. 4yo: .. Me: .. 4yo: .. Me: .. 4yo: I don't have any other feet.. Me: Fair enough.
 
6:46 AM
@sehe I'm sure the iPad is overrated, I was going to buy an Android based tablet instead. But my wife really wanted the iPad, so now I have an iOS and Android device, which will be good for developing for the two dominant mobile platforms
 
@chris so far i got the title, "nonsense"?
 
Chatting from iPad now in bed! Woot
 
sbi
@Chimera "Yes, I got the last ticket, baby!" Note the comma, native speaker.
@chris By definition, when you're late, then they aren't "new cool things" anymore.
Oh, and good morning, fellow nitpickers. Can you tell I haven't slept enough?
 
Oh stop it @sbi
 
sbi
@Chimera "Oh stop it, @sbi!"
 
6:56 AM
Hmm, good point there, although this will be new and cool for the next however many years it takes to get it working or find problems with it.
 
You could pretend to share my joy with me.
,,,,,,,,,,,,,,,,,,,,,,,,,,
 
sbi
@Chimera You expect the Grumpy Old Man™, to share your joke with you, on a day when the third thing he says here is that he hadn't slept enough? Did your sense of honor and survival just go on vacation?
 

« first day (706 days earlier)      last day (4233 days later) »