Author Topic: Sixth Sense  (Read 12300 times)

0 Members and 2 Guests are viewing this topic.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Sixth Sense
« on: August 14, 2006, 02:31:14 am »
This is more of a project revival than a "new" project, persay, but I'm doing it from scratch. 

It's a service that dynamically generates images with data provided by an update client.  With this version, I plan to add things to allow display of one or more of randomly entered quotes or phrases as well.

I've been coding the update client in C#.  It's been the first practical .NET project I've worked on in a while.  It's definitely pretty sloppy, but it's working really well at the moment.  I need to add error handling (that comes in version 2.0 all the time anyway, right? ... >_>) and redo the plugin structure (I must consult master myndfyre :o), but, like I said, it works really well!

On the server side, I have the login verification and update handling taken care of.  Now I just need to code the rest of the interface and it's ready to go! >_>

Here are some screenshots of the update client:








Offline Explicit

  • Hero Member
  • *****
  • Posts: 717
  • Hail Bender!
    • View Profile
Re: Sixth Sense
« Reply #1 on: August 14, 2006, 02:35:57 am »
I need to add error handling (that comes in version 2.0 all the time anyway, right? ... >_>)

ROFL, hilarious.
Quote
Like all things in life, pumping is just a primitive, degenerate form of bending.

Quote
Hey, I don't tell you how to tell me what to do, so don't tell me how to do what you tell me to do! ... Bender knows when to use finesse.

[13:41:45]<@Fapiko> Why is TehUser asking for wang pictures?
[13:42:03]<@TehUser> I wasn't asking for wang pictures, I was looking at them.
[13:47:40]<@TehUser> Mine's fairly short.

Offline deadly7

  • 42
  • x86
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: Sixth Sense
« Reply #2 on: August 14, 2006, 08:52:00 am »
For a second when I read this I thought you were making a computer app to sniff out dead people with..
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
 [17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

Offline MyndFyre

  • Boticulator Extraordinaire
  • Moderator
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: Sixth Sense
« Reply #3 on: August 14, 2006, 03:50:27 pm »
For a second when I read this I thought you were making a computer app to sniff out dead people with..
WEAK
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline Quik

  • Webmaster Guy
  • x86
  • Hero Member
  • *****
  • Posts: 3262
  • \x51 \x75 \x69 \x6B \x5B \x78 \x38 \x36 \x5D
    • View Profile
Re: Sixth Sense
« Reply #4 on: August 14, 2006, 11:53:22 pm »
Where's the screenie of it actually dynamically updating an image?? :p
Quote
[20:21:13] xar: i was just thinking about the time iago came over here and we made this huge bomb and light up the sky for 6 min
[20:21:15] xar: that was funny

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Sixth Sense
« Reply #5 on: August 15, 2006, 12:30:43 am »
Where's the screenie of it actually dynamically updating an image?? :p

That's the easy part.  I'm much better at PHP than I am at C#.  I'll hopefully have it done in a month or so.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Sixth Sense
« Reply #6 on: August 15, 2006, 01:18:53 am »
I'm guessing it's Sixth Sense that made this, right? I always wondered how you did that.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Sixth Sense
« Reply #7 on: August 15, 2006, 01:51:29 am »
I'm guessing it's Sixth Sense that made this, right? I always wondered how you did that.

No, that's a quick project I threw together about a year ago for myself personally.  Sixth Sense was a service that allowed any person to register.  It was also a lot more robust, despite the lack of room for expansion in the way I coded both the server and the update client.  So far, this "version" is turning out a lot better.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Sixth Sense
« Reply #8 on: August 21, 2006, 10:59:05 am »
Alpha-ish version working pretty well.  Example product:





« Last Edit: August 21, 2006, 11:06:36 am by Sidoh »

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Sixth Sense
« Reply #9 on: August 21, 2006, 11:13:10 am »
So much superfluous space...

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Sixth Sense
« Reply #10 on: August 21, 2006, 11:32:14 am »
So much superfluous space...

How did I know it would be a negative, useless, obvious comment coming from you, rabbit? :P <3

I'm planning on adding a feature to read (or store) font widths, modify it by the size entered, and then dynamically resizing the image to fit that.

However, the only way to use the "older" generation of this product was to write ontop of a pre-made image.  I've been working pretty hard the last few days to get it to this point. :P
« Last Edit: August 21, 2006, 11:35:29 am by Sidoh »

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Sixth Sense
« Reply #11 on: August 21, 2006, 01:56:45 pm »
Calculate the width and then generate the background image to a temp file to write on top of, then write on top of it and delete the temp, and save the final product in the display folder-y place?

Offline MyndFyre

  • Boticulator Extraordinaire
  • Moderator
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: Sixth Sense
« Reply #12 on: August 21, 2006, 05:28:10 pm »
I love C#:

Code: [Select]
<% @Page Language="C#" AutoEventWireup="true" Debug="true" %>
<% @Import Namespace="System.Drawing" %>
<% @Import Namespace="System.Drawing.Imaging" %>
<% @Import Namespace="System.Drawing.Drawing2D" %>
<% @Import Namespace="System.IO" %>

<script runat="server">
void Page_Load(object sender, EventArgs e)
{
  Response.ContentType = "image/png";
  Response.Clear();

  Font font = new Font("Tahoma", 12.0f, GraphicsUnit.Point);
  string text = "Sidoh's old web service is gay.";
  SizeF textSize;
  using (Graphics g = Graphics.FromImage(new Bitmap(1, 1)))
  {
    textSize = g.MeasureString(text, font);
  }

  // make a rainbow gradient - need to start with junk values first
  LinearGradientBrush lgb = new LinearGradientBrush(new RectangleF(PointF.Empty, textSize), Color.Red, Color.Violet, 0.0f);
  ColorBlend blend = new ColorBlend();
  blend.Colors = new Color[] { Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Blue, Color.Indigo, Color.Violet };
  blend.Positions = new float[] { 0.0f, 0.16f, 0.33f, 0.5f, 0.66f, 0.83f, 1.0f };
  lgb.InterpolationColors = blend;

  Bitmap bmp = new Bitmap((int)textSize.Width, (int)textSize.Height, PixelFormat.Format32bppArgb);
  using (Graphics g = Graphics.FromImage(bmp))
  {
    g.FillRectangle(new SolidBrush(Color.LightGray), new RectangleF(PointF.Empty, textSize));
    g.DrawString(text, font, lgb, PointF.Empty);
  }
 
  using (MemoryStream ms = new MemoryStream())
  {
    bmp.Save(ms, ImageFormat.Png);
    ms.WriteTo(Response.OutputStream);
  }
  bmp.Dispose();
  lgb.Dispose();
}
</script>

See it in action:

http://www.jinxbot.net/test.aspx
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7503
  • One for a Dime two for a Quarter!
    • View Profile
Re: Sixth Sense
« Reply #13 on: August 21, 2006, 06:19:54 pm »
Myndy you're mean, and I love it.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Sixth Sense
« Reply #14 on: August 21, 2006, 07:13:40 pm »
Calculate the width and then generate the background image to a temp file to write on top of, then write on top of it and delete the temp, and save the final product in the display folder-y place?

The width is dynamic.  Constantly resizing the image on a request doesn't make any sense.  I'm fully aware how I would do that if it did, by the way. :P

If you're referring to the image with a blank background, then that's exactly what I was suggesting in the post you replied to...

MyndFyre: shut up.
« Last Edit: August 21, 2006, 07:26:49 pm by Sidoh »