Allegro.cc - Online Community

Allegro.cc Forums » Allegro.cc Comments » Thread locks too soon

This thread is locked; no one can reply to it. rss feed Print
Thread locks too soon
Eric Johnson
Member #14,841
January 2013
avatar

Purchasing a repeater would be more costly than just purchasing an adapter. Besides, I only need it for one device, so a repeater would be a bit overkill. As far as moving the router is concerned, unless I mount it sideways on a wall, I can't move it any higher than it is already. If I don't buy another adapter, I could just rearrange my desk to be closer to the router. If I move the desktop just half a foot over, the signal is greatly improved... so I'm quite literally at the fringe of the signal. :P

bamccaig
Member #7,536
July 2006
avatar

How will a different adapter improve the signal strength of the network though? ??? Unless you're sure the problem is your current adapter and not the network itself..

Eric Johnson
Member #14,841
January 2013
avatar

I'm sure it's the adapter.

Edit

I used Speedtest to test two adapters I have. Same network, same configurations, both are advertised as offering the same speeds, yet one performs much better than the other.

Test #1
Test #2

If you clicked on the above links, you would see that test #2 did significantly better than test #1. I'm supposed to get "up to" ~30 megabits down, but get in the high teens at the most. If the second adapter will remain consistent in its performance, I'll just stick with it and not get a new one.

Chris Katko
Member #1,881
January 2002
avatar

Some adapters suck. Getting better ones with real antennas definitely will help.

If you have Linux you can easily do measurement with terminal program wavemon. (Great tool!)

{"name":"wavemon_main.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/a\/ca5276739b726a038b180cb7a64b1b98.png","w":512,"h":369,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/a\/ca5276739b726a038b180cb7a64b1b98"}wavemon_main.png

https://d2.alternativeto.net/dist/s/13dd1314-c011-e211-a334-0025902c7e73_3_full.png

You can also use iperf to measure between boxes. (Super easy setup on Linux because of apt-get, slightly more annoying on Windows boxes.) If you have a Linux flashed router like my DD-WRT flashed one, you can run iperf on it and get detailed speed statistics.

{"name":"1","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/a\/ea8f04d4470996af54a42d1595efcfbb.png","w":1051,"h":681,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/a\/ea8f04d4470996af54a42d1595efcfbb"}1

And the great thing about iperf is... it's REAL throughput and latency measurement. It's not theoretical. There's no unit conversion, or "arbitrary signal strength units." It's telling you what a real TCP/UDP connection would get where ever you are located.

I just realized there are GUI's for it too:

{"name":"iperf-fig1.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/6\/560128314fcfa8223b0cad2a1ac4cf2e.jpg","w":971,"h":701,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/6\/560128314fcfa8223b0cad2a1ac4cf2e"}iperf-fig1.jpg

ALSO,

-> make sure your router IS NOT NEAR METAL. Not on a metal desk/table/cabinet. Metal couples with electromagnetic radiation (wireless radio) and can even damage/overheat the wifi chipset.

-> ANTENNAS ARE DIRECTIONAL. If you rotate an antenna 90 degrees, it's going to lose HALF the power. (IIRC)

-> Microwaves (and other 2.4/5G networks) compete for time. Switching the channel can pay huge dividends.

-> An iOS/Android app for network monitoring can also be helpful and show you nearby channel interference.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Eric Johnson
Member #14,841
January 2013
avatar

Thanks for the info, Chris! My desktop is running Windows, but I'll have to remember wavemon for use with my laptop. The router is not near metal and the antennas are fine. My room is between two walls, a refrigerator, and a microwave, so it's definitely not the best place for WiFi. :P I'll look into a network monitoring app for Android.

type568
Member #8,381
March 2007
avatar

Bump this. Make it to a month at least. It's quite common to be unable to reply to something which would actually be relevant.

Eric Johnson
Member #14,841
January 2013
avatar

type568 said:

Bump this. Make it to a month at least. It's quite common to be unable to reply to something which would actually be relevant.

Hey man, you can't just make an on-topic reply without first reading and responding to the 1854 other replies! ;D

Merry Christmas, everyone! :D

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Neil Roy
Member #2,229
April 2002
avatar

Quote:

Merry Christmas!

{"name":"611165","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/1\/81af2a8a041b88bb56e4745bbe53943e.jpg","w":488,"h":330,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/1\/81af2a8a041b88bb56e4745bbe53943e"}611165

---
“I love you too.” - last words of Wanda Roy

Chris Katko
Member #1,881
January 2002
avatar

Merry Christmas!

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Eric Johnson
Member #14,841
January 2013
avatar

It's too bad we didn't have a Krampus Hack (or equivalent) this year. :'( Would any of you be up for a "bootleg bash" sometime in the future? :P I need a good excuse to clone some older games.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I'm working on some HTML5 pages for a friend, using JS and MoMo, Eric's JS lib.

Tell me Eric, (I'm on IRC now), what would you suggest for a multiply blender? Can I get at image data and mix it directly?

Also, I want to do some scrolling text, should I just set a fixed height and then control the scroll value via a timer? How do I use a timer with JS and MoMo?

EDIT
I want to draw the text using MoMo, because it has nice outlines, but then I need to draw multiline text, filtering <br> tags and such

Eric Johnson
Member #14,841
January 2013
avatar

Tell me Eric, (I'm on IRC now), what would you suggest for a multiply blender? Can I get at image data and mix it directly?

I don't have much experience with blending, but you can pass a bitmap to Momo.getBitmapCanvasContext() to get its 2D context and then use the getImageData() method to get an array of pixel data that you can manipulate.

Here's an example using getImageData() to invert a bitmap's colors:

#SelectExpand
1// Assume that bitmap, bitmap_w, and bitmap_h are defined elsewhere. 2 3// Get the 2D context of the bitmap. 4let context = Momo.getBitmapCanvasContext(bitmap); 5 6// Get the image/pixel data of the entire bitmap. 7let image_data = context.getImageData(0, 0, bitmap_w, bitmap_h); 8 9for (let i = 0; i < image_data.data.length; i += 4) { 10 11 // Invert all of the bitmap's colors. 12 image_data.data[i] = 255 - image_data.data[i]; // red 13 image_data.data[i + 1] = 255 - image_data.data[i + 1]; // green 14 image_data.data[i + 2] = 255 - image_data.data[i + 2]; // blue 15 image_data.data[i + 3] = 255; // alpha 16} 17 18// Put the inverted data back into the bitmap. 19context.putImageData(image_data, 0, 0); 20 21// Draw the bitmap. 22Momo.drawBitmap(bitmap, 0, 0);

(I haven't tested the above, but I'm pretty sure it'd work.)

Edit
Here's a working demo of using image data to invert a bitmap. Press space to invert. I know it's not multiplying, but I just wanted to see if what I wrote above would work (it does; see below).

example.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Example</title>
    <script src="momo.js"></script>
    <script src="example.js"></script>
  </head>
  <body>
    <canvas id="canvas_id"></canvas>
  </body>
</html>

example.js:

#SelectExpand
1// Quick example. No error checking. 2 3let bitmap = undefined; 4 5function main() { 6 7 Momo.initialize(); 8 9 Momo.setCanvas("canvas_id", 768, 448); 10 11 Momo.installKeyboard(); 12 13 bitmap = Momo.loadBitmap("bitmap.png"); 14 15 Momo.resourcesLoaded( 16 17 () => { 18 19 Momo.createLoop( 20 21 () => { 22 23 if (Momo.isKeyPressed("space")) { 24 25 invertColors(); 26 } 27 28 Momo.clearCanvas(Momo.makeColor(255, 255, 255)); 29 30 Momo.drawBitmap(bitmap, 0, 0); 31 } 32 ); 33 } 34 ); 35} 36 37function invertColors() { 38 39 let context = Momo.getBitmapCanvasContext(bitmap); 40 41 let image_data = context.getImageData(0, 0, Momo.getBitmapWidth(bitmap), Momo.getBitmapHeight(bitmap)); 42 43 for (let i = 0; i < image_data.data.length; i += 4) { 44 45 // Invert the colors. 46 image_data.data[i] = 255 - image_data.data[i]; // Red. 47 image_data.data[i + 1] = 255 - image_data.data[i + 1]; // Green. 48 image_data.data[i + 2] = 255 - image_data.data[i + 2]; // Blue 49 } 50 51 // Puts the inverted image data into the bitmap. 52 context.putImageData(image_data, 0, 0); 53} 54 55Momo.setEntryPoint(main);

See attached for bitmap.png and a screenshot of the result.

By the way, it's just "Momo". It comes from the Romanization of "桃" ("もも"), which means "peach" in Japanese (I like peaches).

Quote:

I want to draw the text using MoMo, because it has nice outlines, but then I need to draw multiline text, filtering <br> tags and such

Multiline text drawing isn't supported by Momo (yet).

Another Edit
You can roll your own multiline text function in the meantime. I threw this together in just a few minutes, for example:

function drawMultilineText(font, fill_color, size, x, y, alignment, text, outline_color = undefined, outline_width = 0) {

  let lines = text.split("<br>");

  let i = 0;
  let number_of_lines = lines.length;

  for (i; i < number_of_lines; ++i) {

    Momo.drawText(font, fill_color, size, x, y + (size * i), alignment, lines[i], outline_color, outline_width);
  }
}

It'll split lines wherever "<br>" appears. Hopefully it does well as a starting point.

Yet Another Edit

Quote:

Also, I want to do some scrolling text, should I just set a fixed height and then control the scroll value via a timer? How do I use a timer with JS and MoMo?

Sorry, I didn't see that question until now. A timer would work (or just calculate it in the main game loop in an update phase/function). You could use setTimeout() or setInterval()--whichever suits your needs best. Google is your friend in this regard. I can write an example if you need me to.

Neil Roy
Member #2,229
April 2002
avatar

Neil, what is that supposed to be / mean? If you don't celebrate, fine, but don't tell me not to. ;) :P :{

I posted a picture, and from that you somehow got me telling you what to do? You have serious mental issues my friend!

---
“I love you too.” - last words of Wanda Roy

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

@Neil

You were obviously trolling for some kind of response. It doesn't suit you? Sorry, but when you put "Merry Christmas" in quotes and then post an image of some kind of candy or some shjit, you are obviously making light of it. Why don't you go back to your gay black husband in the other thread. He probably misses you. Something else I didn't find very entertaining. You don't celebrate, fine, but leave me to mine. 8-)

Christmas is supposed to be about the birth / conception of Jesus. Christ Mass? Duh? It may not be in the Bible, but Easter sure as hell isn't either. Rolling Easter eggs for fertility rituals to Ishtar anyone? Lulz if that ain't idol worship I don't know what is.

Easter.
Ishtar.

Same word over time. It's supposed to be Passover, pesuach, which IS in the Bible.

@Eric
Sweet, thanks for the info, I'll put it to use.

Chris Katko
Member #1,881
January 2002
avatar

I just saw the new Star Wars.

It's hilariously bad. You will laugh more at it, than with it.

It's also so drawn out (2.5 hours) that people were looking at their phones to see how much time was left.

No spoilers but for fun: Count how many times Luke Skywalker angrily walks away from the camera. ;D

The first 45 minutes of pan shots are just a parody of Lord of the Rings.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

type568
Member #8,381
March 2007
avatar

Merry Christmas.. Guess I'll be gone to read all posts til next X-mass then ;D

& oh. Well, I guess we have a massive & regular new off topic thing.

But yeah, maybe really listen to the OP?:D

Neil Roy
Member #2,229
April 2002
avatar

Edgar... I posted a picture. That's it. It's more of a joke if you know what that candy is. As usual you're looking for an argument. You seem to enjoy stirring up shit. My name is not Monty Python and this isn't argument clinic, so piss off! Don't blame me because your conscious is bothering you.

{"name":"611168","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/5\/f5661e2801c2fd6fc75b79ac68197e44.jpg","w":474,"h":342,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/5\/f5661e2801c2fd6fc75b79ac68197e44"}611168

---
“I love you too.” - last words of Wanda Roy

Bruce Perry
Member #270
April 2000

It's a humbug, isn't it? As in, clearly a reference to Scrooge's 'Bah! Humbug!' from 'A Christmas Carol'?

The correct response is "I guess Christmas doesn't go well for everyone - sorry to hear that", not "OMG TR0LL I DONT GET IT BUT I REPOART YU ANYWEY" ;D

(I should know better than to deflect a fight on to myself though :-X)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Chris Katko
Member #1,881
January 2002
avatar

No idea why Christmas makes so many people butthurt. It's been around before any of us were alive, and it'll still be around long after we're gone. And commercialism aside, there's nothing but good intentions behind it.

Meh.

I had a good Xmas and I hope everyone else did.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Eric Johnson
Member #14,841
January 2013
avatar

I got a new tire pressure gauge for Christmas. 8-)

jmasterx
Member #11,410
October 2009

A simple Google Search By Image reveals that it is indeed a Humbug.
{"name":"611171","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/f\/3f1b7cc83ffae543e87e75c0ab85ba94.jpg","w":1314,"h":554,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/f\/3f1b7cc83ffae543e87e75c0ab85ba94"}611171

It is a reference to:

{"name":"611172","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/7\/87f4964be1685ec86d8b2d4a75ea8e85.jpg","w":1882,"h":608,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/7\/87f4964be1685ec86d8b2d4a75ea8e85"}611172

Let's try to use our GoogleFoo next time :)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

It's a humbug, isn't it? As in, clearly a reference to Scrooge's 'Bah! Humbug!' from 'A Christmas Carol'?

The correct response is "I guess Christmas doesn't go well for everyone - sorry to hear that", not "OMG TR0LL I DONT GET IT BUT I REPOART YU ANYWEY" ;D

(I should know better than to deflect a fight on to myself though :-X)

He reduced Christmas to a confection. :P It's insulting. He also ignored my request for identification of said confection and then accused me of having mental issues.

And no, I'm not gonna google every piece of crap you guys post just to see if there is a hidden message or dubious meaning. Say what you mean and mean what you say. :P :P ;P

Bruce Perry
Member #270
April 2000

For me, Christmas is all about the excuse to confection oneself into a blobby pile of over-indulged jelly. If you're insulted by that, I still feel fine because the sugar rush is telling me everything's right with the world. 8-) At least for a few minutes, until the big crash comes. But by then I probably wouldn't be able to reach the mouse and keyboard, so I would never know.

More seriously, I suspect you two just know how to push each other's buttons by now. Nothing here really looks so bad to the rest of us. :-/

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.



Go to: