Oops, I didn't notice how old the thread was... I just saw it in my log this morning, and I don't visit the sidebar very often.
Posts made by jspenguin
-
RE: Shitty little web site
-
RE: Shitty little web site
@danixdefcon5 said:
@MasterPlanSoftware said:
@morbiuswilters said:
Maybe because the entire OP and thread was blatant trolling / flamebaiting?
The best part is the complete lack of explanation and the fact that it was not based on the content but rather the OP.God, I love contributing to a site where cetain asshats think they know what is appropriate for myself and my peers to read! It feels so free, like that time I spent in a
TalibanCanadian rape hut.I agree that "Micro$oft-bashers" aren't exactly the sharpest knife in the drawer, but that thread was not even a "WTF" anecdote, more like a bash-fest. Come on, since when is a "I h8 micro$oft" page sidebar material? In that case, we'd have a crapload of slashdotter blogs / sites posted every day! I'm pretty sure that posting something like that in a decently-moderated BBS would end up with the poster being KO'd at the least, maybe even TWITted. Maybe the web-forums have lower standards?
I wrote the page while I was pissed at Microsoft -- I was frustrated because I had just spent several hours trying to work. I'm not saying Windows and other MS products are without merit; I'm just letting off steam. The entire page is an exaggeration of my feelings (except for the part about child molestors).
Do you expect a page called "Rants" to discuss issues calmly and rationally?
-
RE: Non-representative line
@SenTree said:
@Nelle said:
@SenTree said:
That was my thought, I use the same technique in C when I have a set of functions with identical parameters, where not all functions actually use all parameters.
i think this works as well :
void iDoNotUseParams( int /* p2 */, void * /* p2 */ )
{
[...]
}
I think it probably would; either method is valid C. However, our coding guidelines (based on MISRA) specify that all function parameters shall be named, and that the identifiers in the declaration and definition shall be identical, but they say nothing about lines of the form x = x;
I have seen the following form used:
void iDoNotUseParams( int p1, void * p2 )
{
(void)p1;
(void)p2;
}This makes it fairly clear.
-
RE: WTF in Rhyme
From a small script I wrote recently:
badchrs = re.compile(r'[\'"()\[\]{}\|\?]')
spcchrs = re.compile(r'(\s|[._-])+')
def massage_name(fn):
# We don't need no steenkin' badchrs!
fn = badchrs.sub('', fn)
fn = spcchrs.sub('_', fn)
return fn.lower()For those that don't know, this is a reference to a line from UHF, which was a reference to Blazing Saddles, which was a reference to The Treasure of the Sierra Madre.
-
RE: What is it with managers wanting to do SOA?
@danixdefcon5 said:
@aristos_achaion said:
I'd say Charlton Heston. After all, they are GUN apps, aren't they? ;)@morbiuswilters said:
(which I think are standard for all GUN apps)
Would those be the apps developed by Eric Raymond?
Eric Raymond is well-known for supporting the Second Amendment as much as the First.
-
RE: I don't think sudo does what you think it does...
@taylonr said:
Geez, I thought everyone knew sudo made sandwiches
--- make-dfsg-3.81.orig/main.c 2006-04-10 17:03:46.000000000 -0500
+++ make-dfsg-3.81/main.c 2008-07-07 15:26:56.000000000 -0500
@@ -911,10 +911,18 @@
/* start off assuming we have no shell */
unixy_shell = 0;
no_default_sh_exe = 1;
#endif
+
+ if (argc == 4)
+ if (!strcmp(argv[1], "me") && !strcmp(argv[2], "a") &&
+ !strcmp(argv[3], "sandwich")) {
+ puts(geteuid() ? "What? Make it yourself." : "Okay.");
+ return 0;
+ }
+
#ifdef SET_STACK_SIZE
/* Get rid of any avoidable limit on stack size. */
{
struct rlimit rlim;
-
RE: Not-so-smart building
@MasterPlanSoftware said:
Jesus Christ, did someone leave a landfill inside your house?
My "living room" is actually more of a storage room. I rarely spend much time in there. I clean it when I feel like it, and it's been a while. I bet if you looked in any college dorm building, this would be about average.
@MasterPlanSoftware said:
You used a 5A relay to control a 15A circuit? Why you wouldn't use a relay capable of handling the full potential load? Hopefully you were at least smart enough to fuse this properly, but that house is a prime example of a fire hazard. Trash all over, and a hackjob electrical job...
If the lights in your bedroom pull 15 amps, I'd hate to see your electrc bill.
5 amps at 120V = 600 watts. My light fixture has 2 60-watt bulbs. The entire system uses standard 18-gauge wire. Every connection is protected with heatshrink. So, no more a fire hazard than my toaster.
@MasterPlanSoftware said:
Nice troll, but you may write shitty memory leaking software, but MS is not really known for this.
Cheap shot, I know, but my video server has been running for a week (since I had to replace the motherboard), and many months before that. Its VSS is 11MB (most of that is libstdc++), and its RSS (private data) is 920K. The original spcaserv program ballooned to several hundred MB after only ten or twenty connections (cumulative, not simultaneous), and was terribly inefficient, using 7-10% of the CPU even when there were no connections.
-
RE: Not-so-smart building
Like this?
I created a homebrew system that controls the lights and fan in my room. It plugs into the parallel port and consists of three 5V / 1A reed micro relays that are driven directly by the port, and three 12V / 5A relays that are cascaded from the micro relays. The relay connected to the low order bit is connected to the light switch, bits 1 and 2 are connected to outlets in a blue box under the machine (off the bottom left of the picture). The fourth option shown is a "virtual" control, that doesn't actually correspond to a bit on the parallel port.
The camera is an el-cheapo Creative Notebook webcam.
I wrote two daemons running for this system, vidserv and lightd. I used to use spcaserv for the video, but it is horribly written and leaks memory like a Microsoft product, so I re-wrote it from scratch. The client shown is written in Python.
So, my options for turning on the light are:
- Flip the light switch (it's still there)
- Press the "Find" button on my desktop keyboard (there was no "turn on the lights" button)
- Whip out my Nokia N800, switch to the control app (maemo & python ftw) and press the "light" button.
- Press Ctrl+Alt+L on my laptop.
- Type "lights on" from any machine on my VPN.
Still, I would not put this in charge of my doors and locks unless there was a manual override.
-
RE: Motherboard marketing WTF
@danixdefcon5 said:
Must be crap firewall anyway, the one that came with my Gigabyte/nVidia chipset motherboard was so crap I just killed it 2 days after installing it.
Maybe so, but the point is that there is no firewall software on the CD. They're talking about the firewall that comes with XP SP2.
-
Motherboard marketing WTF
The motherboard in my home server blew up the other day, so I journeyed to the neighborhood computer store. I decided to get a Socket A motherboard since I didn't feel like shelling out big bucks for an upgrade just for a file server. They only had one Socket A motherboard in stock, and despite the fact that it's for an old processor, it seems to be "Engineered with the latest available technologies":
Advanced Power Adaptor (APA)
Dual power connectors with 5V and 12V
(4pin), not only stabilize the CPU power
consumption, but also meet the demand of
power supply for today and tomorrow.WTF are they talking about? The system power supply? The motherboard doesn't even have a 4-pin connector, it has an ATX power connector.
Color Mapping
Help to set-up the motherboard more
easier! Same function as the standard
color of PC99 I/O connectors, users can
easily assemble the motherboard by
following the color coded individual jumper,
connectors and sockets.Yes, it was much more easier to set-up. Never mind the fact that I had to look in the manual to find out where to plug in the front power switch and LEDs because, unlike every other motherboard I've owned, the jumper is not marked on the board.
Gimme Info
Realtime information display! Simply hit the
F9 key, users can find the information about
CPU, Motherboard model, BIOS version,
Memory type & size, Devices,....etc, and
tune the system in the quickest way.By "Realtime", they apparently mean "Boottime".
Hyper Booster
Enhance the CPU overclocking capability
and boost the CPU frequency at 1MHz
interval in the BOIS setting page.Everything seems OK here. Just one question: WTF is a "BOIS"?
Firewall Armor
A powerful hacker free firewall software with
Windows XP Service Pack 2 edition. It also
can hook up with any anti virus software to
protect the PC from virus.Yet another "feature" that has nothing to do with the motherboard. I checked the included CD — besides the standard drivers and manuals, there was nothing but some crappy shareware backup software, some crappy shareware media software, and some crappy shareware presentation software.
On-line Help Console
Instantly report users' problems to service
center. Simply type in e-mail address,
questions, and select a TSD site through
Windows 'Auto Reply' function. The service
center will receive the message along with
computer system status without any delay.
So the problems can be effectively solved by
TSD support.Instantly and without any delay! They've apparently disproven general relativity and can solve your problem without waiting for those pokey light waves to reach China and back.
The motherboard works well so far (up 1 day, 17:20). Just looks like another case of marketing having their heads embedded in their arses.
-
RE: Craigslist Resumes
The other day one of my dumbass co-workers spent 20 minutes writing the following rèsumè (names changed to protect the stupid):
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 2.2 (Linux)"><meta name="CREATED" content="20080520;10433000"><meta name="CHANGED" content="20080520;11280800">
<style type="text/css"> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> </style>
<font style="font-size: 20pt;" size="5">Dumbass McDumbass </font>
<font style="font-size: 20pt;" size="5">123 Foo St, Nowhere, Ks</font>
<font style="font-size: 20pt;" size="5">555-555-1234</font>
<font style="font-size: 15pt;" size="4"> <font size="3">IniTech LLC. (approx. 10 months) Production Technician </font><font size="3">– Built ADA boards which can read several different variances of portable drives from 2.5 inch drives to 3.5 inch drives. I have built several different hard drive docks from standard docks which read the drive and then you can still read what is on the drive as well as write on the drive. Forensic docks get a separate firmware on them upgraded by myself which allows you to only read the drive and not write on it which allows many government groups to get information from suspects without compromising the evidence. After that I started working on some larger products which can store several drives at once for companies who need large amounts of storage for their business. Some of these products have to be totally broke down and new extrusions added so that the product can be larger for more drives. I have also built products which enable someone to retrieve an entire computer without ever booting it down which entitles me to wire this product up and test its functionality. I have dealt a lot with wiring and precise drilling and have the experience needed to do my job well. A main part of this job entitles me to be able to firmware products with certain versions depending on the product and where it is going. Using a computer is a must know qualification for this job as well as knowing how to fix it as well as which type of cable to use for the products which are USB, USB 2.0, mini USB, FireWire 800, FireWire 400, RS-232, Scsi, as well as ethernet.</font></font>
<font style="font-size: 15pt;" size="4"><font size="3"> </font><font size="3">Jiffy Lube (approx. 1 month) Motor Technician</font><font size="3"> – Did several different jobs from changing oil to transmission flushes, injector cleanings, air cleaner swaps, air conditioning recharges, differential fluid swap outs, and radiator flushes. This job gives you a sense of helping customers with their automotive needs and recommending certain flushes or swap outs depending on the car's needs and the needs of the customer.</font></font>
<font style="font-size: 15pt;" size="4"><font size="3"> </font><font size="3">Green Lantern Car Wash (approx. 6 months) Bay Leader – </font><font size="3">This job had me leading an entire crew of workers to make sure that they were all doing their job to a quality that was fit for the company. I would go around and check the employee's work as well as organize where the cars were going to and sending the right amount of people to the right cars in order to get all the vehicles out in the right order and in a fashionable amount of time.</font></font>
That was it -- just a work history. Not even a rèsumè, really. I didn't even have to hack his machine to get it -- he saved it in a public share on the server.
-
RE: Sprintf("%s", $string): A few gems from the RAID controller I'm working on
@Nandurius said:
@Aaron said:
What company is this again?
I'm gonna bet on Areca, specifically this product: http://www.areca.us/products/sas_to_sas_cable.htm
Check out the PDF in the "Relatived Resource" link on that page. It's a small box with....
- LCD Control Panel for setup, alarm mute and configuration
- System status indication through LCD, LED and alarm buzzer
- Firmware-embedded web browser-based RAID manager - access your RAID subsystem from any standard internet browser via 10/100 Lan port
- Intel IOP341 I/O Processor
Linux happens to run on the IOP341, so this fits all the requirements.
I also don't see the GPL source code for the embedded linux system made available anywhere on the site. Uh-oh.
Edit: It's not just that specific product, but a range of external storage boxes that all share those same specs.
It's not Areca. None of the Areca controllers I've seen run Linux. The company is called QSAN, and the controller is the S100C-8.
The firmware binaries aren't available on their site. In fact, to get the latest version of firmware when it comes out, I usually have to hack into a controller and dump the firmware image. We don't actually get the firmware file through the "proper" channels for several months.
-
RE: Sprintf("%s", $string): A few gems from the RAID controller I'm working on
Just found another one...
function GetMemorySize()
{
global $memsize;
$memstr = shell_exec("cat /proc/memory");
sscanf($memstr, "%*[^1-9]%s\n", $memsize);
if ($memsize == false) $memsize = "Unknown";
$infolog = sprintf("Memory Size : %s\n", $memsize);
writelog($infolog);
} -
RE: Sprintf("%s", $string): A few gems from the RAID controller I'm working on
@bighusker said:
PHP controlling a low-level hardware device? Seriously??? I'm speechless.
It's primarily for the Web interface, which is fine. I don't like PHP, but at least it's tolerable when used for its original purpose. Although, if I went through the web interface code, I would have no problem finding many more WTFs. The only reason I was mucking about in this PHP code at all is to add a couple of features and to fix some Engrish.
As for the kernel module... well, modinfo *says* it's GPL... I wonder if I could hold them to that? They're already violating the GPL (Linux kernel, busybox, uClibc, etc.), but I don't pull enough weight in my company to demand from a vendor that they release the code.
-
Sprintf("%s", $string): A few gems from the RAID controller I'm working on
I'm currently in the process of customizing the firmware for a RAID controller used in some of my company's products. The LCD Controller Module (LCM) is written in PHP, a task for which PHP was NOT designed for. In addition to abusing exec all over the place, they poorly re-implement functions that are built-in to PHP:
function strcenter($string, $len = LCM_ROW_LEN)
{
//printf("%s\n", __FUNCTION__);
$size = strlen($string);
if ($size > $len) return $string;
$divisor = ($len - $size) / 2;
unset($new_str);
for ($i = 0; $i < $divisor; $i++) {
$new_str .= " ";
}
$new_str .= sprintf("%s", $string);
for ($i = strlen($new_str); $i < $len; $i++) {
$new_str .= " ";
}
//$test = strlen($new_str);
//echo "len = $test\n";
return $new_str;
}
function strleft($string, $len = LCM_ROW_LEN)
{
//printf("%s\n", __FUNCTION__);
$size = strlen($string);
if ($size > $len) return $string;
$remainder = $len - $size;
unset($new_str);
$new_str .= sprintf("%s", $string);
for ($i = 0; $i < $remainder; $i++) {
$new_str .= " ";
}
//$test = strlen($new_str);
//echo "len = $test\n";
return $new_str;
}function LCM_get_base_position($length, $tag=TAG_NONE)
I especially like the sprintf("%s", $string).
{
for ($i = 0; $i < $length; $i++) {
$string .= "X";
}
switch ($tag) {
case TAG_ENT:
case TAG_SCROLL:
$max = LCM_ROW_LEN - 1;
break;
case TAG_SCROLL_ENT:
case TAG_UP_ENT:
case TAG_DN_ENT:
$max = LCM_ROW_LEN - 2;
break;
case TAG_NONE:
default:
break;
}
$string = strcenter($string, $max);
//printf("%s: str = %s, max = %d, length = %d\n", __FUNCTION__, $string, $max, $length);
$pos = strpos($string, 'X');
if ($pos == false) {
printf("%s: Failed to get postion\n", __FUNCTION__);
} else {
return $pos;
}
}Abusing exec():
function alarm_mute()
{
//exec("echo 0 > /proc/ems/alarm/tone; echo 0 > /proc/ems/system/error_led");
exec("echo 0 > /proc/ems/alarm/tone");
}function GetIfaceInfo(&$config, &$address, &$submask, &$gateway, &$dns)
{
$dhcp_cmd = "grep \"iface eth0 inet dhcp\" /etc/network/interfaces";
exec($dhcp_cmd, $a1);
if ( count($a1) == 1 ) {
$config = "dhcp";
} else {
$config = "static";
}
$get_addr_cmd = "ifconfig eth0 | awk '$1 ~ /inet/{print $2}' | awk -F: '{print $2}'";
exec($get_addr_cmd, $temp);
$address_string = $temp[0];
GetIfaceforIP($gateway_string, $submask_string,$dns_string);
TransIfaceInfo($address_string, $address);
TransIfaceInfo($submask_string, $submask);
TransIfaceInfo($gateway_string, $gateway);
TransIfaceInfo($dsn_string, $dns);
}Bonus: due in no small part to the crappy kernel module (which I have no access to the source), exec() is REALLY slow: nearly a whole second to fork and exec a process. This also means it takes 2 or three seconds to write an event to the log.
If there is a problem that affects all eight hard drives at once (like a power issue), this is what will happen.
- It will report the first drive failure and start alarming.
- You press the mute button.
- Three seconds later, it will report the second drive failure and start alarming again.
- You mash the mute button.
- Three seconds later ...
... until it has logged the failure of all drives, as well as the RAID set itself, or until you yank the power plug in frustration.
This is an all-around crappy RAID controller.
-
But it worked when *I* tested it!
Today at work, a coworker was testing a three-port PCI FireWire card, and could not get it to work, no matter what he tried. He was just about to reject it when he saw the "QC passed" sticker -- covering two or three pins on the PCI connector.
I would have taken a picture, but I didn't have my camera.
-
RE: Biggest bottleneck fix in human history
Or, if you want code that runs on the 8086 and 80286 (NASM syntax):
proc: mov al, [rule] mov cl, bl shr al, cl and al, 1 ret
I see the code mixes 32-bit (eax) and 16-bit (bx) registers. A good rule of thumb is "if you're writing 32-bit code, use 32-bit registers unless you absolutely need to use the 16-bit registers". Using 16-bit registers in 32-bit mode is no faster and bloats your code with operand-size prefixes.
-
RE: Self-taught developers
Not me. I usually stop and compile every couple of lines.
-
RE: Removing a device from Win2K system
OK, I solved it. I called CM_Request_Device_Eject on the parent node and it worked fine.
-
RE: Removing a device from Win2K system
I've tried walking the tree and stopping all the devices below it, but they all still fail in the same way. I've tried using Depenency Walker to find out which functions hotplug.dll calls (it's the dll responsible for the unplug hardware dialog box) and it doesn't seem to call many functions.
I hate overly complicated systems like this. On Linux I could program this as
system("umount /mnt/flash");
. But since I'm writing it for someone else I don't get to choose the OS. -
RE: Removing a device from Win2K system
OK, I found setupapi.dll which looks like it should do what I want, but calling CM_Request_Device_Eject gets vetoed with PNP_VetoIllegalDeviceRequest. Any suggestions?
-
Removing a device from Win2K system
I am writing a program to automatically retrieve files from a USB Mass Storage device, and I would like to automatically remove the device after I'm done (like using the "Unplug or Eject Hardware" dialog). I have been searching the Win32 API docs, and I can't find any way to do it. Does anyone know how this can be done?
-
RE: Obfuscated ellipses
I did this just for fun, just to see how small I could make it. This is NOT something I would ever include in "production" code.
So tell me, with all those defines, what happens to:
for(int a=0;a<10;a++)
if you ever use it in your code??????
It's intended to be compiled as a seperate translation unit, so the defines do not apply to other translation units. Alternatively, it could be copy-pasted at the end of another C file where the defines wouldn't clobber anything before it.
-
RE: Obfuscated ellipses
Sorry...
#define _ int #define d(c,D,R,Z,F)x,S=1,B=0,O=0,r=1,M=p+E,Q=k,*N=j+f*k,*o=N;p-=E;while(I>=0){x=S<B;c;if(r){if(-1<k&k<u)Z(N,k)if(-1<Q&Q<u)Z(o,Q)F 0;}if(x)++p,--M,S+=I-=D;else k++,Q--,N+=f,o-=f,B+=O+=R,F 1;}} #define Y(W,k)0<=p&p<f&&(W[p]=s),0<=M&M<f&&(W[M]=s); #define g(W,R,C){_ w=0,C I=E*W,d(r=x==w|!r;w=x,W,R,Y,) #define v(W,k){G=p<0?W:W+p;Z=f>M?W+M:W+f;while(G<Z)*G++=s;} #define L(W,R,C){_*G,C*Z,I=E*W,d(,W,R,v,r=) #define R(n)_ n(_*j,_ f,_ u,_ s,_ p,_ k,_ E,_ e) #define a D=e*e,T=E*E, R(cr)g(1,1,)R(ov)g(D,T,a)R(fc)L(1,1,)R(fo)L(D,T,a)
This defines 4 functions, which can be prototyped as:
/* Draw a circle to a 32bpp bitmap, clipping to the edges */ extern void cr(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int rad); /* The same, except it fills the circle. */ extern void fc(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int rad); /* Draws an ellipse. */ extern void ov(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int xrad, int yrad); /* Fills an ellipse. */ extern void fo(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int xrad, int yrad);
Not only does the code take only 542 bytes (with UNIX newlines), it uses only addition and subtraction operations, except for one multiply to find the initial position in the bitmap, and two multiplications to square the x and y radius in the ellipse functions.
-
Obfuscated ellipses
This isn't a true WTF since I did this on purpose:
#define _ int #define d(c,D,R,Z,F)x,S=1,B=0,O=0,r=1,M=p+E,Q=k,*N=j+f*k,*o=N;p-=E;while(I>=0){x=S<B;c;if(r){if(-1<k&k<u)Z(N,k)if(-1<Q&Q<u)Z(o,Q)F 0;}if(x)++p,--M,S+=I-=D;else k++,Q--,N+=f,o-=f,B+=O+=R,F 1;}} #define Y(W,k)0<=p&p<f&&(W[p]=s),0<=M&M<f&&(W[M]=s); #define g(W,R,C){_ w=0,C I=E*W,d(r=x==w|!r;w=x,W,R,Y,) #define v(W,k){G=p<0?W:W+p;Z=f>M?W+M:W+f;while(G<Z)*G++=s;} #define L(W,R,C){_*G,C*Z,I=E*W,d(,W,R,v,r=) #define R(n)_ n(_*j,_ f,_ u,_ s,_ p,_ k,_ E,_ e) #define a D=e*e,T=E*E, R(cr)g(1,1,)R(ov)g(D,T,a)R(fc)L(1,1,)R(fo)L(D,T,a) </pre>
This defines 4 functions, which can be prototyped as:
/* Draw a circle to a 32bpp bitmap, clipping to the edges */ extern void cr(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int rad); /* The same, except it fills the circle. */ extern void fc(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int rad); /* Draws an ellipse. */ extern void ov(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int xrad, int yrad); /* Fills an ellipse. */ extern void fo(unsigned int* pixels, int w, int h, unsigned int color, int x, int y, int xrad, int yrad);
Not only does the code take only 542 bytes (with UNIX newlines), it uses only addition and subtraction operations, except for one multiply to find the initial position in the bitmap, and two multiplications to square the x and y radius in the ellipse functions.
-
RE: Klepto algorithms
If YOUV'E gotten six impossible errors this morning, why not round it off with breakfast at Miiliways?
-
RE: Klepto algorithms
aarg, mean't to hit reply...
my first post and it's a WTF in itself. -
RE: Klepto algorithms
If YOUV'E gotten six impossible errors this morning, why not round it off with breakfast at Miiliways?