[QUOTE=SiPlus;39130615]Scancode.ToString reminds me of things like if (somebool.ToString.Length == 4) {true} else {false}.
You can't use switch with numbers? O_o[/QUOTE]
It's an ugly workaround because Scancode is actually a byte and there's no way to convert it to normal number other than using ToString or to writing a plug in Assembly, and replacing everything with bytes instead of strings or numbers doesn't work - because there's no plug for it and that makes the OS hang when i press any key.
I usually do BLAH_HEADERNAME_HPP where BLAH is a short project name.
[QUOTE=Sartek;39126721]What's with the influx of people using C# for everything?[/QUOTE]
I like C#, because it's sort of similar to Java except it's actual programming and not baby stuff.
[QUOTE=cartman300;39131219]It's an ugly workaround because Scancode is actually a byte and there's no way to convert it to normal number other than using ToString[/QUOTE]
Isn't byte just unsigned 8-bit number?
[QUOTE=DarkCybo7;39131508]I like C# ... it's actual programming and not baby stuff.[/QUOTE]
*stretching my neck*
[QUOTE=ECrownofFire;39131279]I usually do BLAH_HEADERNAME_HPP where BLAH is a short project name.[/QUOTE]
I prefer #define Inc_HeaderName in apps and #define LIBNAME_INCLUDED_HEADERNAME in libraries.
Generally when you #define a constant it's in upper-case because variables usually aren't and thus nothing will overlap in strange ways that fuck things up because you accidentally made a statement equivalent to =;
This is like the single convention that every decent C programmer uses
[QUOTE=esalaka;39131589]Generally when you #define a constant it's in upper-case because variables usually aren't and thus nothing will overlap in strange ways that fuck things up because you accidentally made a statement equivalent to =;[/QUOTE]
But uppercase looks like I'M YELLING MY CODE instead of writing it.
And you can change `#define` to a `const` at some point, I haven't seen any code with `const`s being uppercase.
I don't think I've seen any code where consts weren't uppercase.
[QUOTE=SiPlus;39131608]But uppercase looks like I'M YELLING MY CODE instead of writing it.
And you can change `#define` to a `const` at some point, I haven't seen any code with `const`s being uppercase.[/QUOTE]
Because pre-processor definitions and constants are different things.
[QUOTE=SiPlus;39131608]But uppercase looks like I'M YELLING MY CODE instead of writing it.
And you can change `#define` to a `const` at some point, I haven't seen any code with `const`s being uppercase.[/QUOTE]
Didn't I just pretty much make it clear that as far as I'm considered #define warrants upper-case because it's preprocessor fuckery? If you use const it doesn't matter since the compiler will handle that for you. But as long as none of your non-#define'd are in upper-case and all the stuff you #define is, the preprocessor will never accidentally break your code.
[editline]7th January 2013[/editline]
Well, it won't with these constants, anyway.
Uppercase define looks like Hungarian notation. Type information in identifier names. If you use an IDE, it's useless, because you can see the type info when you write an identifier.
[QUOTE=SiPlus;39131661]Uppercase define looks like Hungarian notation. Type information in identifier. If you use an IDE, it's useless, because you can see the type info when you write an identifier.[/QUOTE]
But the preprocessor defines aren't normal code
They're pre-processor definitions
They [B]have no intrinsic information about being a preprocessor definition[/B] which is exactly why you have to provide the semantics in the textual representation. Incidentally, this is also what [url=http://www.joelonsoftware.com/articles/Wrong.html]Hungarian notation originally does[/url].
[img]http://cl.ly/Lygv/Screen%20Shot%202013-01-07%20at%2015.42.04.png[/img]
[img]http://cl.ly/LzJ5/Screen%20Shot%202013-01-07%20at%2017.50.17.png[/img]
Figured out a cool hack to make SpotifyFS usably quick last night. Stuff like ls -l and OSX Finder will getattr every file, which means we need to know their size. But since it's a file on a remote server, we'd need to make a HTTP HEAD request to find that out at the least. The problem then, is that CloudFront marks the URL as "used".
So I devised a clever hack where we predict the size of a track given it's length in milliseconds and the fact that it's bitrate is known. It's not perfect, but it gets it to within a few bytes. I've made it so it over-calculates by a few bytes. The result is you get a few bytes of zeroes on the end of your track, which gets ignored. The upshot is you can browse like a local folder without it chugging away downloading everything in the background.
I could add a playlist to iTunes pretty easily now, for example.
Apologies for that first image being huge, screenshots are weird on a retina Macbook Pro apparently...
Also if you haven't read that thing yet please do so now, it makes understanding the existence of Hungarian notation much easier
[editline]7th January 2013[/editline]
mergeeee
aaaa retina display sized screenshots
- snip, nevermind -
holy shit the resolution is insane
[QUOTE=SiPlus;39131608]But uppercase looks like I'M YELLING MY CODE instead of writing it.
[/QUOTE]
Sometimes you have to.
[QUOTE=SiPlus;39131661]Uppercase define looks like Hungarian notation. Type information in identifier names. If you use an IDE, it's useless, because you can see the type info when you write an identifier.[/QUOTE]
dude i don't even use a C variant and I can tell you're just making shit up
quit it
[QUOTE=cody8295;39128745]Millions? Everybody knows the only way to make that much is by hacking the Gibson.[/QUOTE]
don't worry, the password is god
Okay, this is offtopic, but WHAT the fuck??
[IMG]http://puu.sh/1KUlA[/IMG] this [IMG]http://puu.sh/1KUmw[/IMG]
[QUOTE=cartman300;39133291]Okay, this is offtopic, but WHAT the fuck??
[IMG]http://puu.sh/1KUlA[/IMG] this [IMG]http://puu.sh/1KUmw[/IMG][/QUOTE]
i've been doing that for at least a year now
he's the project lead for "internet explorer for linux" - and yes, he's serious.
[QUOTE=cartman300;39130130]
Woo! At least! I figured out how to write the keyboard driver!
I'm mapping the keyboard scan codes to characters right now, ESC key and numbers 0,1-9 are done.
[IMG]http://puu.sh/1KNZJ[/IMG]
Also i'm doing it this way because i can press ~8 buttons at once and it scans them correctly.[/QUOTE]
It kind of looks like there's an offset between keys turning on and off.
What I'm saying is you can make an array the size of the amount of possible keys, and when the scancode is less than 129, you do array[ Scancode ] = true, and when the scancode is greater or equal to 129, you do array[ Scancode - 128 ] = false.
[QUOTE=lavacano;39133317]i've been doing that for at least a year now[/QUOTE]
Get help; Self deprecation is bad behaviour.
I thought he'd just changed his user agent.
Having testers for the Dwarfpunch Mapper project is actually pretty helpful. They find things that average users would complain about, but don't bother me at all.
[IMG]http://i.imgur.com/4pxk7.png[/IMG]
I had to recreate the settings window to use sliders instead of spinners (the up-down counter things) because you can type directly into spinners and the testers were annoyed when invalid values they typed in manually didn't work in it.
[QUOTE=Neo Kabuto;39134500]Having testers for the Dwarfpunch Mapper project is actually pretty helpful. They find things that average users would complain about, but don't bother me at all.
[IMG]http://i.imgur.com/4pxk7.png[/IMG]
I had to recreate the settings window to use sliders instead of spinners (the up-down counter things) because you can type directly into spinners and the testers were annoyed when invalid values they typed in manually didn't work in it.[/QUOTE]
How high does the scale go? The slider works well for most users but what if some crazy person wants a 200% scale image?
Though since it's dwarf fortress, that's probably just a case of exporting at 100% and resizing upwards with the filtering of choice.
[QUOTE=danharibo;39134535]How high does the scale go? The slider works well for most users but what if some crazy person wants a 200% scale image?
Though since it's dwarf fortress, that's probably just a case of exporting at 100% and resizing upwards with the filtering of choice.[/QUOTE]
It only goes up to 100%. It's out of the full region export size which is pretty huge already (medium worlds are about 2000px square), and we can't yet do anything to make it higher resolution.
[QUOTE=cartman300;39131219]It's an ugly workaround because Scancode is actually a byte and there's no way to convert it to normal number other than using ToString or to writing a plug in Assembly, and replacing everything with bytes instead of strings or numbers doesn't work - because there's no plug for it and that makes the OS hang when i press any key.[/QUOTE]
Hm? I'm pretty sure .NET does these conversions automatically.
[code]
byte x = 4;
switch (x) {
case 4:
MessageBox.Show("it worked");
break;
}
[/code]
[QUOTE=cody8295;39134907]Hm? I'm pretty sure .NET does these conversions automatically.
[code]
byte x = 4;
switch (x) {
case 4:
MessageBox.Show("it worked");
break;
}
[/code][/QUOTE]
Yeah, but this is not .NET anymore, it's being translated to Assembly and then compiled and packed into .iso, no Windows API calls, that means every .NET function needs to be pluged with Assembly and not all of them are pluged that's why some stuff doesn't work.
It's the same reason as when i write it in Visual Basic and it throws errors when i do something like
[code]If ("A"="B) then
Console.WriteLine("It Works!")
End If[/code]
It doesn't work because there's no plug for Object.Equals()
Sorry, you need to Log In to post a reply to this thread.