Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Are you doing any optimization at any level, or is this going to compile to something like:

code:
void juicy(String arg0) {
    aload_0
    invokestatic print
    return
}

void main() {
    iconst_0
    istore_0
    iload_0
    iconst_0

    if_icmpeq .call_juicy
    return

  .call_juicy:
    ldc "Hello, World!"
    invokestatic juicy
}
(I don't know JVM bytecode at all, I just guessed a compilation based on my knowledge of other bytecode systems and this reference. I'm guessing that arguments to function calls are stored as a bunch of locals)

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Ferg posted:

No optimizations yet, that's pretty much what it compiles down to. I'm decompiling (via javap) similar Java code to get a feel for the JVM's behavior for different things and I'll tweak and optimize that as I go. Right now I've got the parser properly building the AST from what I want the language to look like (there's a lot more that is parsing than what that small bit shows) and now I'm getting the compiler built to support each bit.

And you're correct about function call arguments. The 0th indexed local is "this" in Java, and then the rest are the function parameters, and any that are declared in the method.

This inspired me to do my own take on it. I don't quite have if statements done, yet (to do it right, I'd have to start implement a basic graph algorithm, and I don't feel like doing that right now), but "Hello, world!" works!

I'd love to see how you tackled the problem.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Vanadium posted:

Now I just need to figure out how to make it click-throughable. :smith:

Use the X Shape extension and shape the input region away. In C:

code:
cairo_region_t *input_region;
input_region = cairo_region_create ();
gdk_window_input_shape_combine_region (gtk_widget_get_window (widget),
                                       input_region, 0, 0);
cairo_region_destroy (input_region);

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Yeah, I tend to use ZScreen, which is, admittedly, a little too fancy, but it takes high-quality screenshots (shadows and no "behind windows" thing) and automatically uploads them to imgur or saves them to a file or 20 other things.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Yeah, hand-rolled canvas 3D is fun stuff. (try to spot some broken z-sorting there, and laugh at how terrible my shading algorithm is)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

HardDisk posted:

:stare: How does this happen?

Compilers are addictive to write.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I know this is old news for most desktop environments, but here's something that's a bit hard to do under X/Linux: transparent window decorations.



It's also driven by CSS:

code:
MetaWindow {
    border-radius: 10px 10px 0 0;
    background-color: rgba(255, 0, 0, 0.6);
    background-clip: border-box;
    border: 4px solid black;
    padding-top: 20px;
    color: white;
    text-shadow: 1px 1px black;
}

MetaWindow:backdrop {
    background-color: green;
}
I can sperg all about why this is hard for all sorts of reasons if you want me to, and the code that I have isn't entirely right.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Van Kraken posted:

I put what I've got so far on github, if you want to try it out. Currently, it only works on fully loaded images, so it can't actually protect you from the goatman. I'm trying to figure out how to detect when a page loads new images so that I can hide them and replace them without the originals being seen. I'm also trying to figure out how to resize and crop images in-browser, rather than relying on placekitten. It's currently finals right now, so I'll probably have to put it off for a while.

You could replace all image requests with 1x1px images with the onBeforeRequest API by redirecting to a data URI:

code:
// transparent 1x1px png image
var blank = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";

chrome.webRequest.onBeforeRequest.addListener(function(details) {
    if (details.type == "image")
        return {redirectUrl: blank};
    else
        return {};
}, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]);

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Van Kraken posted:

Oh cool, this is just what I was looking for. I still need the display size of each image, though, and I can't seem to find a reliable way of finding it without actually loading each image, then acting on it once it loaded.

Find the computed width/height of the image tag? This also has the advantage that the image won't be stretched.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Van Kraken posted:

I think the browser still needs to load the image into memory to compute the size of the img tag, though, doesn't it? I was planning on reading height/width, manually setting them for the tag, setting the src to a 1x1 transparent image, and then using css sprites to resize and crop the cat pics.

Oh, I see what you mean (I was assuming that the width/height would be explicitly specified). Hide the thing using CSS visibility, once loaded, swap it out for a placekitten image. I don't see the benefit of the CSS sprites technique - placekitten will always give you a correctly sized image, won't it?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
hypermedia?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Wait, is this a mockup or the actual thing? You need some more whitespace, and to use less strange fonts, and to stop abusing different font sizes and colors for the same piece of information.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
First of all, pick a less annoying font. Look at the "i" in "information". It's crooked and slanted.

Why are you using two separate colors for "information maintenance"?

Why is there padding on the right side of your buttons for "Engineering" and "Auxiliaries"?

Why is the "500" in "500 operating hours" so huge?

Why is "Westrac CAT" in a box?

Why is there a random red "x", the only use of colored icons, next to "... add rigging info"?

Stop aligning the baseline of your text with some solid color. It always looks awful, especially when you have a letter with a descender. I cannot tell the "j" and "i" apart.

On the "Defer Iob" ("Defer Job"? "Defer log"?) tab, each line has a different alignment. Centered, and then indented left, and then flush left, and then aligned right.

"Defer PM" uses a unique button style, while the rest are links.

I highly suggest you increase your line-height and Google for "CSS grid framework". Use some color in your work, and use font weights, colors and sizes to show a hierarchy of information.

I remember some blog post or slides from a talk by either a GitHub or Twitter employee about the use of establishing an information hierarchy by nested boxes and font weights, but I cannot find it now.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I wouldn't go that far. Get a book on UX/interface design, look up the common elements of interface design, etc.

A big issue is that I cannot find an established hierarchy. You seem to be using size to establish hierarchy, but "Active" is bigger than the device itself. It's also not aligned to anything else. The "500" is also as big as the device itself, if not bigger.

Think about drawing a set of nested boxes: you don't have to actually have borders on the real page, this is just a skeleton to establish the layout. Something has to "own" each box, and the children of each box should be related to the owner in some way.

The most important information you want to show should be near the top of the hierarchy.

Have something I whipped up in three minutes in Photoshop:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Yep, it looks much better. I notice you still have a few inconsistent paddings around, and a bit more whitespace e.g. between labels. Make sure to keep things "centered" -- see the "active" label on the left-hand side in the components? That should all be centered. The easiest way to do that is to have a line-height that matches the tallest element in the row.

If you don't know if the padding is even, take a screenshot, and count pixels in something like Photoshop.

I would also put the most useful information near the top. What will people be viewing most when they come to this web page? The font you picked for the operating hours suggests that, so why is it on a right-hand column in the middle of nowhere? Put it near the top.

The only other thing I would suggest would be to use more color, sparingly, to mark important information and give contextual cues: gray out boilerplate text like "operating hours", and add a green/yellow/red meter for both status (Active) and potential maintenance information ("500 hours" is meaningless; is it good or bad? Should I get maintenance soon?).

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Yes.

It's a port of mpeg_play. MPEG-1 isn't actually that complicated. If you want to get started with multimedia, write a JPEG decoder. It's a very good use of your time, as you'll learn a lot.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Your Computer posted:

Perhaps I should just embrace the state and make it have a single state at a time with a tied-in animation and physics calculation. :shrug:

That's the usual thing to do.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

accthub posted:

Accthub currently does not use Redis for anything, we're just such huge fans of the software we're going to figure out a way to get it into our stack.

uh oh

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Why am I jumping diagonally off cliffs, to land on another cliff?

(Jump up to the left of the first head, and then try and go back down)

Also, you the teleporter warps me to a place. I don't see that place inside the editor.

Great work overall, this is really impressive. Is this on GitHub or something?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
You inspired me to write my own thing: http://jsfiddle.net/magcius/wW7Nd/

Karplus-Strong String Synthesis in JavaScript.

Unfortunately, sometimes the API stops sending me AudioProcessingEvents at random and I get this horrible "stuck" sound. I don't know why.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Sorry for the double post, but this is too much fun.

http://cloud.mecheye.net/Peggle/

Audio synthesis for (a very limited subset of) Impulse Tracker, playing the Peggle soundtrack.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Ferg posted:

Hasn't been long since I posted about progress on my emulator, but this made me want to gloat:


Unfortunately scrolling is horribly hosed (particularly in the horizontal direction) so it's not playable and Mario is a total mess:


Hey, if I wanted to do something like this, do you have any good documentation for where to start? I've written part of a 6502 core in JavaScript, which wasn't too hard , I'm just not sure how the NES-specific parts (graphics/tiling hardware, input, sound) works.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I can't stand all of that art. Complete miss for me.

Rook looks like that one boss from Zelda.

Knight is a horse with a huge eye, like a birth defect that he's really depressed about. Proportions are also super wrong, so he looks mopey. Sort of reminds me in Yoshi in a way.

Bishop is :v:.

Queen is so shocked, her jaw drops and her crown jumps up.

King looks like a mafia boss with a sombrero.

Pawn looks like a donut where the top part was extracted from the bottom part.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Grawl posted:

You're just bitching for the sake of bitching.

No, I'm not. It just doesn't work well at all, to me. I recognized the pieces solely based on their initial positions, and then worked backwards to see what the shape was supposed to be. If we were in the middle of a game, I'd recognize the knight, and maybe the pawn by how many there are, and only if there were that many left on the board.

If you release the chess app, I'd prefer a more traditional theme, maybe as a setting.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Also, you desperately need a different color scheme.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Knyteguy posted:

For anyone interested my (still a work in progress for content) new Bootstrap site is up: http://www.pluswebhost.com/portfolio/bootstrap/

Please Use A Bootstrap Theme.

People, especially people looking at your portfolio for design work, will recognize it immediately. I think a lot of people are somewhat sick of the Bootstrap theme.

Please Use A Bootstrap Theme.


Chopper posted:

My point is, once you learn to work with other peoples code you will never look back.

This probably belongs in the Coding Horrors thread, but at a previous job I was not allowed to use any external code. Not because of legal reasons, but because of support reasons.

"But what if Google goes out of business, and leaves GWT in the dust?"
"1) This is an internal tool. If they drop it, oh no, we're on a slightly outdated version, and 2) That's not going to happen."

"And what if jQuery goes out of business?"
"3) You're all morons."

This was at a company in the top 50 of the Fortune 500, by the way.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Sideways text is a bit hard to read. I don't think you need the "Black" / "White" labels for the clocks - users should be able to figure out the function very quickly after starting the game. Just put a clock on the side with the text facing us.

Other than that, I'd prefer a bit of visual consistency or at least a pattern with border thickness (the board's border doesn't look like it's twice the size of the white pieces borders).

I'd also make the checkerboard a lot more closer between the two colors. Minor variations on the brown could work well. Right now the difference is a bit strong.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Why don't the filaments render the glow in the mirror? Are you still doing the fake gaussian-blur at post for the glow and just forgot to process the filaments in the mirror?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
http://en.wikipedia.org/wiki/Grid_illusion

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
The grid illusion is one of those subtle enough that happens on your periphery; if you're looking for it or focusing on the grid itself, it won't happen.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Start by writing an emulator for the 6502. You can find plenty of data sheets and dumb test programs on the web.

Once you're done with that, try writing some emulators for the rest of the stuff.

http://emu-docs.org/
http://nesdev.com/

These should hook you up.

Because I'm crazy, I'm trying to write one of these but for the Game Boy Color, in JavaScript.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Ferg posted:

I have a Gameboy emulator in the works as well, but screw that Color garbage. I'm only supporting the original hardware and LCD palette and it will look like poo poo :smug:

While I was researching the GameBoy, I learned that the Color is literally just an extra palette, some more memory, and a few exrta graphics modes, so I was like "either I could have an emulator for Tetris and that's it, or for a tiny bit of extra effort have something that I can be proud of"

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Ferg posted:

The CPU is a superset of the original as well isn't it?

Surprisingly, data on the Gameboy Color is hard to find. I've been going on what I've found online, and in other emulators. I can't find any information on any new CPU instructions added for it.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Go is one of those games that I've always wanted to learn but always seemed too complicated.

So, good idea! I'll certainly check it out when I'm done.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I highly recommend everybody mentor a computer-oriented summer camp for a year or two. It's a really low-stress environment for the most part, it's a lot of fun, and it's a great learning experience for everybody. The camps are usually understaffed, so it's not too hard to get on the team.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Shalinor posted:

What's the time commitment on that like? Wouldn't it be, effectively, a full-time job for a few months?

Depends on the summer camp, and it also depends on how well you are around or love kids.

One year, I taught at a camp run by a place called "CyberCamps", which looks like it's now out of business. It provided a lot of content for kids to run through, built on top of an intranet, along with management systems for the counselors. All the kids were in their own little work, being introverts on the computer, except when they needed from a counselor (which was often, mind you). The counselors were encouraged to play around with technology in the background rather than just sit around idle, which would hopefully inspire the kids to do more or learn something extra. I installed Linux on a few of the extra computers, which some of the kids were fascinated by (installing applications for free, from a weird command line thingy, blew their minds), and played around with 3D modelling a bit.

Another, I taught at a completely different environment run by "iD Tech Camps", which had a set of goals for the students, and said "go". They provided some sample lesson plans and all the technology as before, but encouraged us to adapt them to the group of kids, and what they were interested in. The camp also required a group project at the end of the course. So it required a bit more effort to manage something like that, but I really enjoyed the collaborative environment that eventually came out of it, with the kids not seeing me as that guy they bug if they have issues, but their coworkers and peers along with it. We built a really simple Flash game by the end of it, with some people doing programming, some people doing animation and art, etc. Everyone was really proud of that.

I can't really answer "time commitment" exactly. It felt like a mix of playing around in a learning environment, and work. Hopefully this helped answer, at least a bit.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Git and Users.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Looks cool.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

The Gripper posted:

Isn't that dude the composer for Spongebob Squarepants? I didn't know he did any grungier-style stuff, which is pretty cool.

Spongebob Squarepants had a really low budget for the first few seasons and didn't have an in-house composer. They used stock production music for most everything.

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Horray for Backups

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply