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

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.

Adbot
ADBOT LOVES YOU

Van Kraken
Feb 13, 2012

Suspicious Dish posted:

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

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.

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?

Van Kraken
Feb 13, 2012

Suspicious Dish posted:

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?

It's mostly a learning experience, anyways. The custom resizing will probably be the last thing to be added, but I was hoping to get the whole extension self-contained, without driving up placekitten's bandwidth. It would also give me some more flexibility about which images I can use.

Wheelchair Stunts
Dec 17, 2005
A CSS sprite map has the added benefit of only needing 1 request to retrieve which can be nice.

Deus Rex
Mar 5, 2005

a website I've been working on has had some serious issues with user-submitted text overflowing container elements when it's unexpectedly long or has extremely long 'words' (like URLs), so I wrote a little script to swap out non-empty text nodes with an excerpt from Finnegan's Wake.

before:


after running on <p> elements:


http://crystae.net/jquery.joyce.js

still a lot of room for improvement

mustermark
Apr 26, 2009

"Mind" is a tool invented by the universe to see itself; but it can never see all of itself, for much the same reason that you can't see your own back (without mirrors).

Deus Rex posted:

I wrote a little script to swap out non-empty text nodes with an excerpt from Finnegan's Wake.

A man after my own heart :swoon:.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!


I hate myself for starting this project.

Fortunately, with switch statements working, there's only one language feature I care about left (foreach) and then I'm done with this dumb compiler! And switch was the last one that required adding an opcode. :toot:

OneEightHundred fucked around with this message at 03:30 on May 16, 2012

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Picked up my old Gedcom project a while ago and have been rewriting parts of it. It's coming along nicely:



https://github.com/mikkelee/Gedcom-Framework

Not really useful at the moment unless you want to write Gedcom by hand (also I haven't implemented save yet, but that's literally just two lines of code that I've left out to avoid trashing my test files).

mortarr
Apr 28, 2005

frozen meat at high speed
Last month we managed to go over our data cap and got throttled back into the stone age for about ten days, which was a major pain. My ISP sends an email at 80% usage, and then again at 100%, but that's not much use and I wanted something that was easier to monitor.

I run a Rainmeter weather skin which parses html for a forecast on my desktop, so I thought I'd have a go writing my own skin to do the same.

I couldn't work out how to get Rainmeter to authenticate and navigate through several pages & redirects, so in the end I wrote a little C# console app to handle logging into my ISP's site and pulling just the data of interest out into an xml file. From there I wrote a Rainmeter script to refresh the xml and show its contents onscreen:

code:
Data usage @ 2012-05-17: 14.27 / 20GB


On the way I learned a bit more about the .Net WebRequest class, and also tried out log4net so I could get a decent fault trace on a 2nd PC without visual studio.


Not sure if I'll enhance it further, but features that I'd thought about were to keep a running history and use it to build up a graph, like a sparkline or something, that I could show onscreen next to the text. I could also do something so my password isn't sitting in a config file in plain text.

Jo
Jan 24, 2005

:allears:
Soiled Meat

mortarr posted:

code:
Data usage @ 2012-05-17: 14.27 / 20GB

As neat as this is, do you seriously have a 20GB bandwidth cap? :stare:

On a more related note, I've been working on a 4Chan/Reddit hybrid. Last night I got image search working. There are two algorithms in there right now, but it's a cakewalk to add more.

mortarr
Apr 28, 2005

frozen meat at high speed
Yep, 20GB limit then throttled to 64k/s or so. NZ ISP's suck balls if you're combining data/phone/tv, but to be fair I had a 40GB cap a while back and didn't use much more than half - I decided I'd rather have the money than the extra data, but it does mean watching my usage fairly closely.

Chopper
Feb 13, 2006

mortarr posted:

Yep, 20GB limit then throttled to 64k/s or so. NZ ISP's suck balls if you're combining data/phone/tv, but to be fair I had a 40GB cap a while back and didn't use much more than half - I decided I'd rather have the money than the extra data, but it does mean watching my usage fairly closely.

My parents have a 2Gb cap on their (free) connection and I max it out within 6 hours of being home, it's impressive you can cope with 20Gb for a whole month :gonk:

I have heard crazy things about NZ internet prices though so I can understand. UK I have 40mbit/2mbit with no caps or traffic shaping for £20/month!

</derail>

TerraGoetia
Feb 21, 2011

A cup of spiders.
I've been inspired by this thread to do a little practice programming between classes. My current idea is a program that searches a given URL for images, and extracts them. All of this is still somewhat new to me, so I'm building in steps. Right now it just text-dumps the <img /> tags it finds--I copy/paste them into an HTML editor and view the results. In the future, it will either create an HTML page on its own, or just start downloading all of the pictures to a directory on my computer. The screenshot shows some of the images it was able to find on this page.



Edit
I'm stopping with it tonight. I made an "HTMLWriter" class that can build a page out of all of the image tags I collect. That, combined with looping the image finder, has been very entertaining. For instance, I was able to collect all of the images in the one of the League of Legends threads in the gaming subforum. Instead of combing 170 pages to find entertaining/interesting pictures, I was able to do it in 20 seconds.

TerraGoetia fucked around with this message at 06:08 on May 20, 2012

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
This is the web app I'm working on, Spanner, it's a planned maintenance system. I'm trying to break into a market that sells Excel spreadsheets masquerading as systems for $80,000, so hopefully I can make a dent.

This is a checklist made from the items the system tracks, when printed the browser culls out everything except the 'page'.

Maluco Marinero fucked around with this message at 15:17 on May 22, 2012

etcetera08
Sep 11, 2008

Looks useful and nice but that font is not what I would've picked ;)

Doh004
Apr 22, 2007

Mmmmm Donuts...
Whatcha making in/with?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

etcetera08 posted:

Looks useful and nice but that font is not what I would've picked ;)
I've grown kind of partial to it but that's fair. There's a version of Calluna Sans (thats he font) that has a more standard numeral set, no dropping below the baseline or anything. I'll probably change to that before release. What don't you like about it specifically? I ask because I'm not Particularly good at any one thing, I'm just good at keeping working, so feedback is always good.

It's written in Python with Django.

\/ \/ duly noted: Thanks.

Maluco Marinero fucked around with this message at 01:32 on May 23, 2012

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Maluco Marinero posted:

I've grown kind of partial to it but that's fair. There's a version of Calluna Sans (thats he font) that has a more standard numeral set, no dropping below the baseline or anything. I'll probably change to that before release. What don't you like about it specifically? I ask because I'm not Particularly good at any one thing, I'm just good at keeping working, so feedback is always good.

It's written in Python with Django.

It's hard to read, as that typeface has a very ragged flow because of the numerals having a dropped baseline, the character shape / design not lending itself to body type, and it's kerning being really goofy on the web. You are inviting eye-strain, and that is not conducive to a great (or even good) user experience.

akadajet
Sep 14, 2003

It might work as a header only font? Use something a little less stylized (i.e. more readable) for the content.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

akadajet posted:

It might work as a header only font? Use something a little less stylized (i.e. more readable) for the content.
Yeah thats what I'm thinking. I really like how it works with my headers and brand idea, but yeah, the body really does need to change to something more standard.

G-Dub
Dec 28, 2004

The Gonz

Maluco Marinero posted:

It's written in Python with Django.

Are you concerned about companies preferring the overblown Excel solutions because it's MS Office and everyone without a clue prefers Office?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

G-Dub posted:

Are you concerned about companies preferring the overblown Excel solutions because it's MS Office and everyone without a clue prefers Office?
Yes and no. It is an issue, but from my experience working in the domain as a ships officer, and learning the experiences of others working with that sort of thing, it just isn't a reliable way to track literally thousands of items in a non information overload manner. The excel solutions have information overload, versioning issues, and there is the issue of collaboration between ship and shore.

The database solutions out there are in varying stages of maturity, and while they are set up on the ship, if anything breaks they are just poo poo out of luck until they fly support in, often.

Additionally, an excel solution on its own is not easily audited. Usually every 4-5 years you'll get your paperwork combed over by a national authority. It's not enough to say you use the system effectively, you have to be able to prove it.

A web app eases support problems, browser + Internet = go time as long as I'm doing my job, and also removes versioning issues. I'm going to do offline access if it picks up, but will work around that with a weekly email digest that sends them all their upcoming checklists and jobs so it's available offline.

Younger crew are starting to come in that see the value of this stuff; it saves mountains of time with our paperwork, believe me - and I've had some good contacts and promising feedback thus far from boat managers and crew.

I can also likely do much better on price, which will be suitable for a much less cashed up part of the market, eg. non profit sail training ships, small 1-5 ship operators, service ships that do contract work for the bigger companies.

It's not quite a long shot, and considering the amount of time I've already committed, I'll be damned if I'm not gonna give a launch a red hot go. I'll probably start posting progress regularly. I'm too invested to be a realistic critic of my work, so it's good to bounce ideas off people who have no reason to be anything less than honest.

Comrade Gritty
Sep 19, 2011

This Machine Kills Fascists
Got bored and started working on a Chrome extension that uses Twitter's bootstrap to style the forums. So far I have the index page mostly there. http://imgur.com/a/Bo8OI

Course since it's a chrome extension the responsiveness doesn't actually help anybody, but hey boredom.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Steampunk Hitler posted:

Got bored and started working on a Chrome extension that uses Twitter's bootstrap to style the forums. So far I have the index page mostly there. http://imgur.com/a/Bo8OI

Course since it's a chrome extension the responsiveness doesn't actually help anybody, but hey boredom.

Very nice. I'll be installing this when you release it.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Maluco Marinero posted:

Yes and no. It is an issue, but from my experience working in the domain as a ships officer, and learning the experiences of others working with that sort of thing, it just isn't a reliable way to track literally thousands of items in a non information overload manner. The excel solutions have information overload, versioning issues, and there is the issue of collaboration between ship and shore.

The database solutions out there are in varying stages of maturity, and while they are set up on the ship, if anything breaks they are just poo poo out of luck until they fly support in, often.

Additionally, an excel solution on its own is not easily audited. Usually every 4-5 years you'll get your paperwork combed over by a national authority. It's not enough to say you use the system effectively, you have to be able to prove it.

A web app eases support problems, browser + Internet = go time as long as I'm doing my job, and also removes versioning issues. I'm going to do offline access if it picks up, but will work around that with a weekly email digest that sends them all their upcoming checklists and jobs so it's available offline.

Younger crew are starting to come in that see the value of this stuff; it saves mountains of time with our paperwork, believe me - and I've had some good contacts and promising feedback thus far from boat managers and crew.

I can also likely do much better on price, which will be suitable for a much less cashed up part of the market, eg. non profit sail training ships, small 1-5 ship operators, service ships that do contract work for the bigger companies.

It's not quite a long shot, and considering the amount of time I've already committed, I'll be damned if I'm not gonna give a launch a red hot go. I'll probably start posting progress regularly. I'm too invested to be a realistic critic of my work, so it's good to bounce ideas off people who have no reason to be anything less than honest.

It would definitely help if you can find a way for companies to import their existing excel documents into your system. Aside from having to retrain employees, having to maintain two sources of documentation is a big no-no.

akadajet
Sep 14, 2003

Steampunk Hitler posted:

Got bored and started working on a Chrome extension that uses Twitter's bootstrap to style the forums. So far I have the index page mostly there. http://imgur.com/a/Bo8OI

Course since it's a chrome extension the responsiveness doesn't actually help anybody, but hey boredom.

I love bootstrap, despite the side-effect that every page it touches ends up looking exactly the same.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Doh004 posted:

It would definitely help if you can find a way for companies to import their existing excel documents into your system. Aside from having to retrain employees, having to maintain two sources of documentation is a big no-no.

Already have a very straightforward excel import system. It's much easier to handle mass data entry in Excel anyway. Most people on manual systems usually have their checklists on an excel spreadsheet or word document anyway, so they just need to arrange their information and it's good to go in. Getting data in easily is definitely a high priority as once I have a customer, once they've invested in the system as long as I do my job it's money in the bank.

TJChap2840
Sep 24, 2009

Lumpy posted:

Very nice. I'll be installing this when you release it.

In the mean time, you can check out the chrome extension that has already been released. I am currently using it but I will probably switch to this one for some change.

Comrade Gritty
Sep 19, 2011

This Machine Kills Fascists

akadajet posted:

I love bootstrap, despite the side-effect that every page it touches ends up looking exactly the same.

They do tend to look a lot a like :/ (Although they don't have to, i've seen some really nice bootstrap sites that don't look like bootstrap).

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

TJChap2840 posted:

In the mean time, you can check out the chrome extension that has already been released. I am currently using it but I will probably switch to this one for some change.

Sounds like you've got it all figured out. I used to do similar work in the past, but around warehouse shipping logistics/inventory automation and have faced the nightmare of 'b-b-b-ut the spreadsheet!!' too. It's criminal what some of those guys charge for what is basically a .xls with some VBA (if you're lucky, in cell formulas if you're not). It sounds like you've identified niche, have made a good, simple web-based solution for it, and now just need to convince people to get out of the 80s. Good luck!

TJChap2840
Sep 24, 2009

Scaramouche posted:

Sounds like you've got it all figured out. I used to do similar work in the past, but around warehouse shipping logistics/inventory automation and have faced the nightmare of 'b-b-b-ut the spreadsheet!!' too. It's criminal what some of those guys charge for what is basically a .xls with some VBA (if you're lucky, in cell formulas if you're not). It sounds like you've identified niche, have made a good, simple web-based solution for it, and now just need to convince people to get out of the 80s. Good luck!

That's a misquote right? :)

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

TJChap2840 posted:

That's a misquote right? :)

waaaagh new forum code causing weird things to happen. That was meant for Maluco Marinero.

Red Mike
Jul 11, 2011


Posted some pictures of my roguelike engine before. Well, today I finally got tired of the library I was using for the output (libtcod), and rolled my own with pygame, so I can have a combination of text and tile-based graphics, with no limit as to the number of tiles.

The tiles are every programmer's dev tiles, of course. It's also scaled up 2x, because otherwise it's tiny as hell.

Polio Vax Scene
Apr 5, 2009



Started messing around with the recursive lightning generator I made before, now it makes cracks.



source

The Wizard of Oz
Feb 7, 2004

I was about to use Dart for a project because I hate EcmaScript, then instantly banged into a language limitation (no reflection). I was then looking to add onto the project when it struck me that all it's doing is .NET, so why not just use .NET?

Well, you can't. Silverlight can interact a bit with the DOM but it's incredibly crippled, and I can't use Silverlight's components themselves because I need an HTML editor and the WebBrowser component in Silverlight cannot do it (WPF can, but there's no good editors), and the way I'd be using it I needed it lightweight and responsive, when I suspect WebBrowser is enormous. So I'd be spending most of my development time adding functions on the HTML side for the Silverlight side to process. Pretty dumb.

So instead of that - instead of actually doing the project I initially intended to do, that is - I'm writing a converter from .NET to EcmaScript. Here's it doing its first non-trivial task:



Here's the C# code generating it:

code:
using System;
using DotWeb.Html;

namespace Test {
	class Program {
		static void Main(string[] args) {
			HtmlDocument document = Window.Current.Document;

			document.Body.InnerXml += "<input id=dongs type=text/> and <input id=bongs type=text/> become <input id=roopas /> through <button id=brumper>brumption</button>";
			var dongs = (HtmlInputElement)document.GetElementById("dongs");
			var bongs = (HtmlInputElement)document.GetElementById("bongs");
			var roopas = (HtmlInputElement)document.GetElementById("roopas");
			var brumper = (HtmlButtonElement)document.GetElementById("brumper");

			brumper.Click += () => roopas.InputValue = (double.Parse(dongs.InputValue) + double.Parse(bongs.InputValue)) + "";
		}
	}
}
Here's some of the horrible EcmaScript it's currently making:

code:
_s0 = new a4Testn4Testn31Program_a_l_gc____DisplayClass1m6_pctor();
_l2 = _s0;
_s0 = window;
_s0 = _s0.document;
_l0 = _s0;
_s0 = _l0;
_s0 = _s0.body;
_s1 = _s0;
_s1 = _s1.innerHTML;
_s2 = "<input id=dongs type=text/> and <input id=bongs type=text/> become <input id=roopas /> through <button id=brumper>brumption</button>";
_s1 = (_s1) + (_s2);
And here's an example of the type of attributes I'm applying to provide conversion without wrapping, keeping things as fast and lean as possible:

code:
[WebRewrite("(({0}) + ({1}))")]
public static string Concat(string a, string b) { return string.Concat(a, b); }

...
[WebName(DomName)]
public abstract class HtmlInputElement : HtmlElement {
	const string DomName = "HTMLInputElement";
	...

steckles
Jan 14, 2006


Bashed out an old school voxel landscape engine last night. I remember being blown away by a couple voxel demos back when I was a teenager. Never did get around to trying to write one until now.

Exe and source are here, if you're interested. Good luck figuring it out though, even I don't know how it works any more.

Red Mike
Jul 11, 2011
I've been working on my map generation algorithm a bit, making better pre-made blocks for it to generate more interesting maps. This is the kind of thing it's coming up with now, but huge (it normally generates 200x200 tile maps, this is 800x800):

PresidentCamacho
Sep 9, 2009
I wrote a few Google Chrome extensions.

Kitten Rush

I think the idea for this came from somewhere in this thread.

Favicons!

Favicons next to external links.

Word Filter

You can censor words or swap them around.

Adbot
ADBOT LOVES YOU

wlievens
Nov 26, 2006

poemdexter posted:

Give a decent solution for the following:

I have a text file with:
code:
123123
456456
789789
123123
When I translate that to drawing, I get tiles in this form:
code:
1 2 3 1 2 3
 4 5 6 4 5 6
7 8 9 7 8 9
 1 2 3 1 2 3
So for the first 5, to move "up" would be to hit the 2 which when drawn looks like it's northwest. If I was at the 8 looking to move "up", I would hit the 5 which is northeast! So now when I'm trying to decide while sprite I need due to the black bold lines being necessary and having around 20 different sprites, I have to know which row I'm on so I know how to look in the 2d array to get the correct surrounding pieces.

Your coordinate transformation is completely wrong. Your world model remains a "square grid", you just render isometrically.

code:
         0,0
      1,0   0,1
   2,0   2,1   2,2
etc

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