Search found 403 matches

by Dropzone
Thu Jan 31, 2013 3:07 am UTC
Forum: Coding
Topic: Convert 3-byte pixels into an image
Replies: 6
Views: 4946

Re: Convert 3-byte pixels into an image

Yeah, it's probably worth mentioning that the "JPEG" argument to ImageIO.write can also be "PNG" , "BMP" , or "GIF" , if you want it to write in one of those formats. Technically, it's possible to add support for more formats, but that involves implementing th...
by Dropzone
Tue Jan 29, 2013 8:17 pm UTC
Forum: Coding
Topic: Convert 3-byte pixels into an image
Replies: 6
Views: 4946

Re: Convert 3-byte pixels into an image

If you're using Java, you might as well just use the built-in image libraries. Assuming that width and height are int s containing the image's dimensions, and data is a byte[] containing the pixel data in red-green-blue, left-to-right, top-to-bottom order, the following code should work: BufferedIma...
by Dropzone
Mon Dec 31, 2012 8:09 pm UTC
Forum: Science
Topic: Pressure vs Temperature; need your help
Replies: 3
Views: 1624

Re: Pressure vs Temperature; need your help

Wouldn't it be a lot easier to just use something like this?
by Dropzone
Sun Dec 30, 2012 4:21 am UTC
Forum: Gaming
Topic: Different Experiences as a Female Character
Replies: 48
Views: 7825

Re: Different Experiences as a Female Character

In Baldur's Gate 2, male characters could end up with three potential (female) romantic partners fighting over them. Female characters had only one romantic choice, a smarmy knight fellow. There was supposed to be a second option, but they ran out of time or something. Neverwinter Nights' original ...
by Dropzone
Mon Dec 17, 2012 6:35 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1683694

Re: Coding: Fleeting Thoughts

Sorry, is that an output buffer of size 0, or a nullptr to the output buffer size? Often functions like that have a query-size interface where you ask it how much room is needed by passing in a null buffer, then calling it again with proper sized buffer. Having tested it some more, it seems that it...
by Dropzone
Mon Dec 17, 2012 3:18 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1683694

Re: Coding: Fleeting Thoughts

Things I have learned about RegQueryInfoKey today: ⋅ If the buffer that you provide for it to write the class name into (lpClass) has more than a certain amount of space available, the function will fail completely. ⋅ When that happens, the function returns an error code stating ...
by Dropzone
Wed Nov 28, 2012 9:18 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1683694

Re: Coding: Fleeting Thoughts

Funnily enough, there's an old Python library that implements something very similar to this: http://code.activestate.com/recipes/384 ... operators/
by Dropzone
Mon Nov 26, 2012 9:39 pm UTC
Forum: Coding
Topic: Java: Generic set method - syntax error
Replies: 5
Views: 3451

Re: Java: Generic set method - syntax error

Xeio and EvanED have the right answer, even if they might not be entirely sure why :P. A variable of type List<? extends DisplayBuffer> can contain a reference to a List<DisplayBuffer> , to a List<HardwareDisplayBuffer> , or to a List<SoftwareDisplayBuffer> (I don't know what subclasses DisplayBuffe...
by Dropzone
Fri Oct 26, 2012 12:07 am UTC
Forum: Coding
Topic: Transparent Forms
Replies: 4
Views: 1433

Re: Transparent Forms

Just for fun, I decided to see whether it was possible to implement something like this in Java. It turns out that the answer is "yes, but it'll use a ludicrous amount of RAM and completely ignore Windows' time format settings". The antialiasing works, though, and it does outline the text ...
by Dropzone
Fri Oct 19, 2012 3:11 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1683694

Re: Coding: Fleeting Thoughts

Yeah, the verboseness problem with Java is less the language itself (though it's still pretty verbose... mostly due to not having operator-overloading or first-class functions/lambdas) and more with the monstrosities that Enterprise tends to create... your ApplicationBusinessModel model = Applicati...
by Dropzone
Sun Sep 02, 2012 8:02 pm UTC
Forum: Gaming
Topic: Games you can't remember the title of.
Replies: 1892
Views: 451757

Re: Games you can't remember the title of.

Pretty sure that's "Gizmos & Gadgets!" - never played it myself, but I recognised it from this "LP" (warning, NSFW language).
by Dropzone
Fri Aug 10, 2012 12:18 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1683694

Re: Coding: Fleeting Thoughts

I googled some more, and found this - apparently, HTML5 deliberately avoids specifying what should happen to whitespace, because that's defined by the CSS specification instead. This seems... less than helpful when it comes to metadata elements like title, which CSS doesn't apply to. If Eclipse is s...
by Dropzone
Thu Aug 09, 2012 12:44 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 9848
Views: 1683694

Re: Coding: Fleeting Thoughts

Quick HTML question: does anyone know whether, if I indent my code like this, the leading and trailing whitespace inside the title element is likely to cause problems/considered bad style? All the browsers I've got installed do the sensible thing and ignore the whitespace, but I can't find anything ...
by Dropzone
Tue Jul 31, 2012 7:35 pm UTC
Forum: Coding
Topic: Playing tones in Python
Replies: 21
Views: 20352

Re: Playing tones in Python

That reminds me, I wrote some code for this thread, but never posted it for some reason. It's a Java utility class to allow easy creation of MIDI sequences, and an application that uses it to create MIDI from a text file of the format shown in the OP. I've attached the source code - bear in mind tha...
by Dropzone
Sun Jul 29, 2012 3:14 am UTC
Forum: Gaming
Topic: Mass Effect 2.
Replies: 1033
Views: 87709

Re: Mass Effect 2.

Bizarrely out-of-place ME2 appearance of the day: http://www.bbc.co.uk/i/b01llrgg/?t=1m06s (for non-UK people: it's a sequence from the BBC's Formula 1 coverage that was set to this ) . I'm now trying to imagine the chain of events that led to them buying a license for that particular piece of music...
by Dropzone
Tue Jul 24, 2012 2:49 am UTC
Forum: Gaming
Topic: Mass Effect 2.
Replies: 1033
Views: 87709

Re: Mass Effect 2.

Note that, unless something has changed in the last month or so, you can't get every ending variation in ME3 without playing multiplayer anyway (because Bioware is either incompetent or liars on that point), so it's not like the additional war assets you'll get in ME3 because you did the ME2 DLC wi...
by Dropzone
Mon Jul 23, 2012 11:02 pm UTC
Forum: Coding
Topic: Stupid Question
Replies: 15
Views: 3829

Re: Stupid Question

I'd go for int log2(int n) { return 31 - Integer.numberOfLeadingZeros(n) ; } . It's simple, and PrintAssembly shows that the JIT is smart enough to compile it into a bsr instruction, so it's probably the fastest implementation. ...actually, if I'm reading it correctly, the JIT compiles it to (pseudo...
by Dropzone
Wed Jun 13, 2012 2:45 am UTC
Forum: General
Topic: Thoughts for ships
Replies: 89854
Views: 7257074

Re: Screechings of the Great Unwashed (Meander to the Morgue

pizzazz wrote:Most races have a target distance, and everyone competes to run/walk/bike/swim/drive/whatever in the shortest period of time. Are there any major races where you are given some time, and have to go as far as possible?

The 24 Hours of Le Mans (and similar events) would count, I guess.
by Dropzone
Wed May 09, 2012 5:59 pm UTC
Forum: The Help Desk
Topic: Download YouTube Videos?
Replies: 18
Views: 5088

Re: Download YouTube Videos?

Speaking of "quality", I notice Video DownloadHelper often gives me a choice between a 720p .mp4 and a "Medium" .mp4. Which one is actually of better quality? Well, "Medium" seems to be 360p, so I think it's safe to say that "720p" is the higher quality one. ...
by Dropzone
Wed May 09, 2012 5:48 pm UTC
Forum: General
Topic: Blistering blue barnacles
Replies: 28352
Views: 2826678

Re: Pant Thread (because we need more panting)

As far as I can tell, sorting in the folder makes no difference in how they are cycled when I view them. I can sort by size, date created, name, etc. When I move through them in Windows Photo Viewer, Picture Manager, or Irfanviewer, it only sorts them alphabetically. I don't know about the others, ...
by Dropzone
Thu Apr 12, 2012 4:37 pm UTC
Forum: The Help Desk
Topic: Loss of Quality when setting an Image as a Background
Replies: 4
Views: 1589

Re: Loss of Quality when setting an Image as a Background

The easy solution is to manually convert the image to a JPG at 100% quality (presumably you can do this with whatever program you're using to make the images); Control Panel won't feel the need to convert something that's already a JPG, and a maximum quality JPG should have no visible artefacts. The...
by Dropzone
Mon Mar 26, 2012 2:40 am UTC
Forum: Gaming
Topic: Mass Effect 3 (Seriously, Use Spoilers People!)
Replies: 1908
Views: 247838

Re: Mass Effect 3 (To Avoid Spoilers -Don't Read)

Replaying ME2 was extremely annoying because every time I opened the main menu I'd have to wait for a minute while the game tried to connect to a server that was no longer there- almost made me give up replaying it. Is there an actual source confirming that the server has been taken down? I'm dubio...
by Dropzone
Sun Feb 05, 2012 8:01 pm UTC
Forum: Gaming
Topic: Games that support dual monitors
Replies: 3
Views: 1949

Re: Games that support dual monitors

Flight Simulator lets you expand the main 3D view onto additional monitors in the usual way, but you can also use them as a sort of workspace to hold various things: checklists, extra camera views, the radio conversation window, secondary instrument panels (if you're using the 2D cockpit), etc. I to...
by Dropzone
Sat Feb 04, 2012 1:03 am UTC
Forum: Coding
Topic: Creating a gif with python?
Replies: 13
Views: 8808

Re: Creating a gif with python?

Yeah, the easiest way to fix that would be to change the last line to os.system('"C:\\Program Files\\ImageMagick-6.7.5-Q16\\convert" ' + string + " animation.gif") Note that the default install path is different depending on which exact version you downloaded, but it'll be someth...
by Dropzone
Fri Feb 03, 2012 10:40 pm UTC
Forum: Coding
Topic: Creating a gif with python?
Replies: 13
Views: 8808

Re: Creating a gif with python?

Make sure your PATH environment variable is set correctly - you need to have the ImageMagick install directory before the Windows directories, otherwise you'll be running Windows' convert-FAT-to-NTFS tool instead of the ImageMagick program with the same name (alternatively, don't put ImageMagick in ...
by Dropzone
Sun Jan 22, 2012 1:31 am UTC
Forum: Coding
Topic: Designing a Python readdir/FindfirstFile library
Replies: 3
Views: 1597

Re: Designing a Python readdir/FindfirstFile library

Might be better to just go back to my original idea and "make" the user put it into a context manager... You could do that, and also provide a convenience function that looks something like: def readdirlist(*args, **keys): with readdir(*args, **keys) as files: return list(files) It loads ...
by Dropzone
Thu Dec 22, 2011 8:22 pm UTC
Forum: General
Topic: Thoughts for ships
Replies: 89854
Views: 7257074

Re: Screechings of the Great Unwashed (Meander to the Morgue

I've been playing minecraft too much lately. I just tried to use shift to not fall off a ledge in an entirely unrelated game with no such functionality. Easy to fix - just play one of the old Tomb Raider games instead, then it'll actually work! Incidentally, I do the exact opposite - ever since the...
by Dropzone
Wed Dec 14, 2011 6:59 pm UTC
Forum: Coding
Topic: GLOBOL: An esoteric language for the whole world
Replies: 42
Views: 21984

Re: GLOBOL: An esoteric language for the whole world

It'd be nice if Java could detect if STDIN is a terminal and... not terminate immediately on errors if so. Well, the second part is simple enough, but yeah, I don't see any way to detect if System.in is a terminal... Maybe you can hook into isatty with JNA? I mean, you'd lose some amount of platfor...
by Dropzone
Thu Nov 24, 2011 9:45 pm UTC
Forum: Coding
Topic: Bizarre IllegalArgumentException
Replies: 2
Views: 3117

Re: Bizarre IllegalArgumentException

It is a JDK bug, specifically this one . You should be able to work around it by setting the system property java.util.Arrays.useLegacyMergeSort to true , e.g. by calling System.setProperty("java.util.Arrays.useLegacyMergeSort", "true"); right at the start of the program.
by Dropzone
Tue Nov 22, 2011 8:21 pm UTC
Forum: The Help Desk
Topic: Romantic Partner Selection Algorithm
Replies: 3
Views: 1591

Re: Romantic Partner Selection Algorithm

I can't help with finding the post, but I do know of this Wikipedia article on the same subject. One of the links in that article goes to this paper, which sounds similar to the one you remember.
by Dropzone
Tue Nov 22, 2011 7:11 pm UTC
Forum: Mathematics
Topic: ITT: Motivate me to care about pursuing ever larger ordinals
Replies: 19
Views: 5674

Re: ITT: Motivate me to care about pursuing ever larger ordi

In a mathematical context, it's better to use U+2136 BET SYMBOL (ℶ) instead of U+05D1 HEBREW LETTER BET (ב) - it has the same glyph, but is a LTR character.
by Dropzone
Sat Nov 05, 2011 6:22 pm UTC
Forum: Site/Forum issues
Topic: Special Math Symbols in BBCode?
Replies: 3
Views: 4317

Re: Special Math Symbols in BBCode?

Either copy and paste from the "HTML" column of this page (or this one for Greek); or use the "Character Map" program included with Windows (or whatever the equivalent is on your OS).
by Dropzone
Wed Oct 26, 2011 10:22 pm UTC
Forum: The Help Desk
Topic: Downloading ImageJ Class files
Replies: 2
Views: 733

Re: Downloading ImageJ Class files

They seem to have downloaded fine for me (using Firefox); I've attached them to this post.
by Dropzone
Tue Oct 18, 2011 6:13 pm UTC
Forum: The Help Desk
Topic: Batch File Help? [SOLVED]
Replies: 6
Views: 2697

Re: Batch File Help?

There are two problems with your code: ⋅ When using SET, spaces around the equals sign are significant. Currently, you're creating a variable called "fileName " (without the quotes) - notice the space at the end. Therefore, the ECHO won't work because there's no variable called j...
by Dropzone
Mon Oct 17, 2011 6:38 pm UTC
Forum: General
Topic: Show the world your desktop! [Mommy, what's 56K?]
Replies: 2356
Views: 391260

Re: Show the world your desktop! [Mommy, what's 56K?]

I couldn't find the option in Windows 7 I'm pretty sure this will work: right click on an empty spot on the desktop, select "Personalize"*, at the bottom of that screen is a "Desktop Background" option, select that. Then, from there, look at the bottom again, and you'll see an o...
by Dropzone
Thu Oct 06, 2011 6:15 pm UTC
Forum: Coding
Topic: Getting framerate of paint() in Java?
Replies: 4
Views: 1997

Re: Getting framerate of paint() in Java?

Well, it's not really an interpreted language at all - it uses just-in-time compilation , which can (in theory) give even better performance than traditional compiled languages like C. Also, it's possible that the image-drawing code in the standard library isn't written in Java at all, but is part o...
by Dropzone
Wed Sep 14, 2011 2:40 am UTC
Forum: Coding
Topic: Is there an alternative to this try/catch block?
Replies: 20
Views: 4371

Re: Is there an alternative to this try/catch block?

Python explicitly added a syntax for this very situation. The "With" statement. So did Java: public void function() throws Exception { try (FileReader in = new FileReader("somefile")) { f(); try (FileWriter out = new FileWriter("otherFile")) { g(); } } }
by Dropzone
Sat Aug 20, 2011 11:53 pm UTC
Forum: Gaming
Topic: Games you can't remember the title of.
Replies: 1892
Views: 451757

Re: Games you can't remember the title of.

That immediately made me think of Medieval (IIRC, the demo mission is literally Robin Hood vs. knights in a forest with stone ruins), but the date doesn't really match up. I also noticed a game called Medieval Warriors when I was trying to find Medieval on MobyGames - it's closer to the right date a...
by Dropzone
Sun Aug 14, 2011 7:57 pm UTC
Forum: Coding
Topic: [C++] My tinyurl resolver
Replies: 5
Views: 2495

Re: [C++] My tinyurl resolver

import sys import urllib.error import urllib.request if len(sys.argv) != 2: sys.exit('URL Lengthener by Dropzone\nUsage: ' + sys.argv[0] + ' URL') try: with urllib.request.urlopen(sys.argv[1]) as f: if f.geturl() == sys.argv[1]: sys.exit('Host is not a url shortening service.') print(f.geturl()) ex...
by Dropzone
Sat Aug 06, 2011 5:33 pm UTC
Forum: Science
Topic: New Rule about jsMath
Replies: 12
Views: 13014

Re: New Rule about jsMath

How about formulas that contain greek letters? Should the greek letter actually be typed out, as in p=h/(lambda), or is use of math tags acceptable there? Personally I find typed out greek letters somewhat cluttery, especially if it's typed more then once, but the formulas themselves aren't necessa...

Go to advanced search