Just had to defend use of the below to someone in figuring out if a DateTime falls on a weekdaycode:
vvv oh gently caress me Polio Vax Scene fucked around with this message at 00:33 on Dec 31, 2013 |
|
# ? Dec 30, 2013 23:35 |
|
|
# ? May 30, 2024 03:10 |
|
Joke's on you. Saturday and Sunday aren't the weekend in every country.Sagacity posted:(btw, SVN is still worse, doing any kind of merging while trying to stay sane just sucks) We must be using different SVNs. I can barely remember last time I had a difficult merge, and the ones I have had would've been rough with any VCS, since they usually involved logical conflicts. Zhentar fucked around with this message at 23:56 on Dec 30, 2013 |
# ? Dec 30, 2013 23:53 |
|
Manslaughter posted:Just had to defend use of the below to someone in figuring out if a DateTime falls on a weekday Not too crazy. http://en.wikipedia.org/wiki/Workweek_and_weekend#Around_the_world (why the heck is Afghanistan Saturday->Thursday? Brunei takes Friday and Sunday off? craziness.) I bet you can get 99% there with CultureInfo, like take the 2 days before the FirstDayOfWeek as the weekend. ManoliIsFat fucked around with this message at 00:27 on Dec 31, 2013 |
# ? Dec 31, 2013 00:24 |
|
God, stupid people loving exhaust me. So I get in this morning I go talk to Guy and tell him "look, I think I really hosed up on Friday, this has been driving me nuts all weekend. I think you lost all your changes on Thing X that you were working on. That git command I told you to run reset your repository to the last commit, so if you had uncommitted changes, they're all gone." Guy is totally blithe and blasé about it. "No, no, I'm sure everything's fine, you've been stressing over nothing, I'm sure I didn't lose anything." I'd love for this to reassure me but he has Git Extensions open behind him and I can see he's on the same mainline that I am and there's no extra commits I don't have. Again Guy has no idea about branching or stashing so I'm 99% sure I was right, his work is gone, and he just doesn't realize it yet. But I don't argue (because there isn't any point in doing so), and hey, maybe what he means is that he has some kind of local backup and everything will be fine. I broach the subject of having an in-depth conversation about how to use git, what commits and branches are, and how we can safely collaborate and make sure nothing like this happens in the future. I get pushed off. Of course. Finally around two o'clock I hear: "Horatio...? ... I think you were right. My changes are gone." We find the WAR file from the staging server. It's on my desktop, where I copied it first thing in the morning. Guy had already overwritten the one on the staging server. We pull out the JSPs and JavaScript files. So that's something. It's the perfect time to create a branch so we can collaborate on fixing this mess. "Do you have some time right now? We can get this changes into a branch and..." "No, no, we can't put this code in a branch. It's broken right now." "...Right, yes, well, that's kind of the point of a branch, so you can work on code in a broken or incomplete state and it doesn't affect the mainline." "Oh. Well, no, let me just see what kind of progress I can make and maybe Thursday we can talk about putting it in a branch...." At this point I feel like I'm banging my head on a brick wall but I still feel responsible for loving his poo poo up so I say, "Well, I'm happy to help you try to recreate some of the Java files that were lost." "No, what I'm going to do is go online and try to find a decompiler to generate some Java from the class files in the WAR." Well, whatever. I give the gently caress up. You wanna be a stubborn idiot, go ahead and be a stubborn idiot. I can't stop you. I owned up to it, I tried to make amends, and Lord knows I've tried like hell to implement some revision control and build management processes that aren't total trash. It's a lost loving cause.
|
# ? Dec 31, 2013 00:36 |
|
I offer my own powershell horror from shortly before I learned about Get-Date -format:code:
|
# ? Dec 31, 2013 00:38 |
|
HORATIO HORNBLOWER posted:Well, whatever. I give the gently caress up. You wanna be a stubborn idiot, go ahead and be a stubborn idiot. I can't stop you. I owned up to it, I tried to make amends, and Lord knows I've tried like hell to implement some revision control and build management processes that aren't total trash. It's a lost loving cause. ManoliIsFat fucked around with this message at 01:15 on Dec 31, 2013 |
# ? Dec 31, 2013 00:57 |
|
HORATIO HORNBLOWER posted:
The burned hand teaches best
|
# ? Dec 31, 2013 02:11 |
|
Brain Candy posted:The burned hand teaches best I don't have any experience in Java except by proxy through Scala. Can you even do that (decompile I mean), meaningfully anyway?
|
# ? Dec 31, 2013 07:42 |
|
Maluco Marinero posted:I don't have any experience in Java except by proxy through Scala. Can you even do that (decompile I mean), meaningfully anyway?
|
# ? Dec 31, 2013 07:59 |
|
If "meaningfully" means producing anything like human-written code, the answer is "hell no."
|
# ? Dec 31, 2013 08:01 |
|
Suspicious Dish posted:You mean the part where it says git init? No, I was trying to describe creating a repository without a working directory: git --bare init and git --bare clone QuarkJets fucked around with this message at 10:00 on Dec 31, 2013 |
# ? Dec 31, 2013 09:57 |
|
Manslaughter posted:Just had to defend use of the below to someone in figuring out if a DateTime falls on a weekday https://www.youtube.com/watch?v=-5wpm-gesOY Also please don't use that horrible "edit with reply to the future" thing.
|
# ? Dec 31, 2013 10:35 |
|
ManoliIsFat posted:Not too crazy. http://en.wikipedia.org/wiki/Workweek_and_weekend#Around_the_world (why the heck is Afghanistan Saturday->Thursday? Brunei takes Friday and Sunday off? craziness.) I bet you can get 99% there with CultureInfo, like take the 2 days before the FirstDayOfWeek as the weekend. Won't FirstDayOfWeek return Sunday in the Americas? Calendars are always a horror.
|
# ? Dec 31, 2013 10:50 |
omeg posted:https://www.youtube.com/watch?v=-5wpm-gesOY Sadly I'm stuck with creating a library to manage appointments, schedules, and recurrences that are timezone compatible. And "oh gently caress me" doesn't warrant a new post. The true coding horror: the human race
|
|
# ? Dec 31, 2013 15:11 |
|
QuarkJets posted:No, I was trying to describe creating a repository without a working directory: git --bare init and git --bare clone Any specific reason?
|
# ? Dec 31, 2013 16:42 |
|
NFX posted:Won't FirstDayOfWeek return Sunday in the Americas? Calendars are always a horror.
|
# ? Dec 31, 2013 17:34 |
|
NFX posted:Won't FirstDayOfWeek return Sunday in the Americas? Calendars are always a horror. FirstDayOfWeek will vary between two retail stores sitting next to one another on the same street.
|
# ? Dec 31, 2013 17:48 |
|
Assuming we're still around in fifty thousand years, the interstellar humans of the future will look at this video and enjoy the laughable idea that there's a Time that applies across the whole of the human species at once, then send version-vector-stamped hypertweets to their friends about the dumbass third-millenium humans.
|
# ? Dec 31, 2013 17:56 |
|
Suspicious Dish posted:Any specific reason? Bare repositories are useful for all sorts of things, such as transporting changes between networks that can't touch each other except via optical media (government work)
|
# ? Jan 1, 2014 19:49 |
|
ninjeff posted:Assuming we're still around in fifty thousand years, the interstellar humans of the future will look at this video and enjoy the laughable idea that there's a Time that applies across the whole of the human species at once, then send version-vector-stamped hypertweets to their friends about the dumbass third-millenium humans. An atomic clock in a universally agreed-upon inertial reference frame QuarkJets fucked around with this message at 19:55 on Jan 1, 2014 |
# ? Jan 1, 2014 19:53 |
|
ManoliIsFat posted:(why the heck is Afghanistan Saturday->Thursday? Brunei takes Friday and Sunday off? craziness.) Friday is the Day of Assembly in Islam. Brunei additionally has a significant Christian minority and used to be a British protectorate.
|
# ? Jan 1, 2014 21:41 |
|
QuarkJets posted:An atomic clock in a universally agreed-upon inertial reference frame That's what we're using now, and it doesn't scale. Your terrestrial ideas have no place in Big Space.
|
# ? Jan 2, 2014 13:36 |
|
ninjeff posted:That's what we're using now, and it doesn't scale. Your terrestrial ideas have no place in Big Space. Why doesn't it scale? You travel with your own atomic clock that stays in your reference frame. From time to time your computer checks in with the space system's central atomic clock to see how far you're off by and making an adjustment accordingly. It's not going to be exact, but time-keeping between two non-inertial frames where you don't necessarily know your velocity relative to the central clock that well is going to be impossible. The atomic clock is basically like having a clock tower; each town (space system) gets its own and from time to time some people get together to make sure that all of the clocks are running about right. I don't see us being able to do much better than that with the technology that exists today, and it's a pretty good and realistic solution And I hardly see what's terrestrial about a system of atomic clocks orbiting stars so that spaceship pilots can have some reasonably accurate way of telling time, but okay
|
# ? Jan 2, 2014 13:53 |
|
Well, according to Poul Anderson,
|
# ? Jan 2, 2014 14:55 |
|
Maluco Marinero posted:I don't have any experience in Java except by proxy through Scala. Can you even do that (decompile I mean), meaningfully anyway? You end up with almost exactly the original source since its bytecode and not assembly, but everything's stripped. Hope you like reading hj a = new mb().a("98403").b(Color.Red); hj b = new df(); hj c = new el().k(); and so on. You never realize how important good variable/function names are until you don't have them at all. It is theoretically possible to walk the code and reverse engineer it and rename it enough to work with, but... you don't want to have to do that. Easier to just write the code again, unless you're specifically trying to hack some 3rd party closed source software.
|
# ? Jan 2, 2014 16:54 |
|
Timezones? I haven't had to deal with them in forever. Just use popen with a script that changes the timezone in Linux, and then use Epoc time with that. *edit* Jesus Christ, I just watched the end of that video. LEAP SECONDS?! Why isn't there a emoticon of a psyduck drinking scotch? FlapYoJacks fucked around with this message at 17:34 on Jan 2, 2014 |
# ? Jan 2, 2014 17:25 |
|
ratbert90 posted:Timezones? I haven't had to deal with them in forever. Just use popen with a script that changes the timezone in Linux, and then use Epoc time with that. Watch this video by Jon Skeet. He talks about time starting at about 17 minutes, but the entire thing is pretty interesting. http://vimeo.com/7516539
|
# ? Jan 2, 2014 17:40 |
|
Zaphod42 posted:You end up with almost exactly the original source since its bytecode and not assembly, but everything's stripped. Is it posible to back-translate (decompile) every posible chunk of bytecode? That is for sure not the case with old-school compiled code... the optimizations usually mangle the object code in ways that just make sense in assembly, but not in a high level language. (I had once to look at a dissassembled fragment of compiled PL/I code and it was an absolute mess...).
|
# ? Jan 2, 2014 17:42 |
|
I don't know about Java but it's not possible with .NET. The runtime has more features that for example C# doesn't support (like global variables).
|
# ? Jan 2, 2014 17:49 |
|
Amberskin posted:Is it posible to back-translate (decompile) every posible chunk of bytecode?
|
# ? Jan 2, 2014 17:50 |
|
I've dug around in .net bytecode a bit and it is more or less a direct transcription of the source; often even trivial constant-foldings didn't seem to be performed, presumably because the loader/JIT would take care of that. I would assume that JVM bytecode is similarly straightforward.
|
# ? Jan 2, 2014 18:00 |
|
Ithaqua posted:Watch this video by Jon Skeet. He talks about time starting at about 17 minutes, but the entire thing is pretty interesting. Yep, I agree with the first video guy. Find somebody elses code, thank them, and then never look at that code again.
|
# ? Jan 2, 2014 18:07 |
|
Zaphod42 posted:You end up with almost exactly the original source since its bytecode and not assembly, but everything's stripped.
|
# ? Jan 2, 2014 18:45 |
|
Java decompilers like Jad and JD actually work surprisingly well, and produce fairly readable code (big caveat: if it hasn't been run through an obfuscator). The biggest problem they usually have is with exception handler blocks -- those are tough to reverse engineer correctly a lot of times. I've used them on numerous occasions to figure out what a library was doing when the source wasn't available. Keep in mind that even private method names and fields are preserved by the compiler for reflection purposes, so the biggest place where you lose names is with local variables and parameters.
|
# ? Jan 2, 2014 19:46 |
|
Flobbster posted:Java decompilers like Jad and JD actually work surprisingly well, and produce fairly readable code (big caveat: if it hasn't been run through an obfuscator). The biggest problem they usually have is with exception handler blocks -- those are tough to reverse engineer correctly a lot of times. Java/C++ (probably others) make higher-level structure easier to decompile due to various language features such as overloading - that information has to make it into the binary, and now you have type-information of call arguments. Decompiling C code? Good luck with that, you can see it accessing a 32-bit register and try to guess what type it is based on what it does next. Java decompilation is how all minecraft mods are made. You run the .jar through an obfuscator with the purpose of renaming A, B into usable class names (Block, Player, etc) via a community-updated database. Then you decompile it, make your modifications/addon, recompile and re-obfuscate back to the original class names - which now mangles your references as well. Compare the stock .jar to the produced .jar, extract the files that changed and presto, a mod that you can distribute. There's a set of patches you can add that do some code cleanup for readability (where the decompiler went off the rails) but it's usable. It's amazing that it works at all, honestly. The nightmare mish-mash of competing and conflicting infrastructure in the modding community is a horror all on it's own though.
|
# ? Jan 2, 2014 23:48 |
|
Harik posted:Java/C++ (probably others) make higher-level structure easier to decompile due to various language features such as overloading - that information has to make it into the binary, and now you have type-information of call arguments. Decompiling C code? Good luck with that, you can see it accessing a 32-bit register and try to guess what type it is based on what it does next. Yeah, I spent a good bit of a year working on a fairly ambitious minecraft mod, and slowly lost my mind due to complete rewrites of what little and lovely common APIs existed (which were SUPPOSED to provide a static link target so you wouldn't have to break your mod and rewrite the drat thing every loving minecraft patch, except the stupid APIs changed as much as minecraft did!) I'm honestly pretty loving pissed at Notch for making a big deal out of an official API, talking about going so far as to charge money for API support, and then just dropping the whole thing on the community and walking away. That game could be SO much more, but gently caress, I can't be bothered to keep up with it. Its a real coding horror. They refactor EVERYTHING every loving week! And Documentation? What's that? Nope I've decided to just work on my own game from scratch in my free time, and I'm all the happier for it.
|
# ? Jan 3, 2014 00:10 |
|
Harik posted:Java/C++ (probably others) make higher-level structure easier to decompile due to various language features such as overloading - that information has to make it into the binary, and now you have type-information of call arguments. Decompiling C code? Good luck with that, you can see it accessing a 32-bit register and try to guess what type it is based on what it does next. As someone who used to do RE for a living, I can say with a certainty that it is easier to reverse C code than it is C++.
|
# ? Jan 3, 2014 02:21 |
|
Harik posted:Java decompilation is how all minecraft mods are made. You run the .jar through an obfuscator with the purpose of renaming A, B into usable class names (Block, Player, etc) via a community-updated database. Then you decompile it, make your modifications/addon, recompile and re-obfuscate back to the original class names - which now mangles your references as well. Compare the stock .jar to the produced .jar, extract the files that changed and presto, a mod that you can distribute.
|
# ? Jan 3, 2014 03:24 |
|
Scaevolus posted:I wrote my Minecraft mods (Optimine, MCRegion) directly using the obfuscated source. It's painful, but strangely doable once you accept that the names are arbitrary and meaningless, and look more at the structure of the code itself to guess at intent. That sounds like a very zen coding experience.
|
# ? Jan 3, 2014 03:54 |
|
|
# ? May 30, 2024 03:10 |
|
astr0man posted:it is easier to reverse C code than it is C++. That reminds me of something I wanted to post in here... I was trying to figure out how something worked in a game, so on a whim I decided to try reversing it... This was inferred from a single function: code:
|
# ? Jan 3, 2014 05:10 |