Have We Got A Tracking Number For The Cases?


OT, But heres to the community :p
Code:
#include <stdio.h>
#include <stdlib.h>


char* take_binchar(char* in, char*out) {
	int i=0;
	char c=0;
	if (!in) return NULL;
	if (!out) return NULL;
	for (; ;) {
		char w;
		w = *in;
		if (w == 0) return NULL;
		if ((w != '0')&&(w != '1')) {
			in++; continue;
		}
		if (w == '1') {
			c |= (1<<(7 - i));
		}
		i++;
		in++;
		if (i==8) {
			*out = c;
			return in;
		}
	}
}

int main(int argc, char** argv) {
	int i;
	char *ptr;
	for(i=1;i<argc;i++) {
		ptr = argv[i];
		for(; ;) {
			char c;
			ptr = take_binchar(ptr,&c);
			if (ptr) {
				printf("%c",c);
			} else {
				break;
			}
		}
	}
	printf("\n");
	return 0;
}
It is now proven that to read the forums, one needs programming skills....
(I know that this utility propably already existed. It was more fun to write than to search for.)
EDIT:spoiler, because of offtopic post
 
cosurgi said:
matzesu said:
What dos "STFU" mean???? :huh:
Oh, that's simple. First you need to install bsdgames package. On debian/ubuntu you just type in the terminal:
Code:
sudo aptitude install bsdgames
Then you type in the terminal:
Code:
wtf stfu
And that's it! HTH.
Hehe, fantastic command.
 
Last edited by a moderator:
C sucks. You have to learn C++:

Code:
#include<iostream>
#include<string>
int main(int argc, char* argv[])
{
        for(int i=1 ; i<argc ; i++)
        {
                std::string s(argv[i]);
                int shift=8;
                char ch=0;
                for(int j=0 ; j<s.size() ; j++ )
                        ch += (s[j]=='1') << --shift;
                std::cout << ch;
        }       
        std::cout << "\n";
        return 0;
}
That's just a plain C++. Sombody wants to boast a one-liner in perl? Well, here's a ten liner, 10 times more readable than perl ;)
Code:
#include<iostream>
#include<string>
#include<bitset>
int main(int argc, char* argv[]) {
        for(int i=1 ; i<argc ; i++) {
                std::string s(argv[i]);
                std::cout << (char)(std::bitset<8>(s).to_ulong());
        }
        std::cout << "\n"; return 0;
}
 
cosurgi said:
#include<iostream>
#include<string>
#include<bitset>
int main(int argc, char* argv[]) {
for(int i=1 ; i<argc ; i++) {
std::string s(argv);
std::cout << (char)(std::bitset<8>(s).to_ulong());
}
std::count=7 << "\n"; return 0;
}

Fixed and confirmed.

Q29zIGhhcyA3IFNURHMu
 
Last edited by a moderator:
cosurgi said:
That's just a plain C++. Sombody wants to boast a one-liner in perl? Well, here's a ten liner, 10 times more readable than perl ;)
Code:
#include<iostream>
#include<string>
#include<bitset>
int main(int argc, char* argv[]) {
        for(int i=1 ; i<argc ; i++) {
                std::string s(argv[i]);
                std::cout << (char)(std::bitset<8>(s).to_ulong());
        }
        std::cout << "\n"; return 0;
}
Code:
print "".join([bin(ord(c)) for c in raw_input("Input text:")])
(Not tested)

I think that's a relatively legible one liner in python. ;)
(Swap bin() for hex() for hexidecimal)
 
Last edited by a moderator:
Code:
import sys
print '.join(chr(int(x, base=2)) for x in sys.argv[1:])
Code:
import sys
print ' '.join("{0:08b}".format(ord(c)) for c in ' '.join(sys.argv[1:]))
 
Last edited by a moderator:
cosurgi said:
Sombody wants to boast a one-liner in perl? Well, here's a ten liner, 10 times more readable than perl ;)
Here you go. That's stdin -> stdout filter, accepts inputs with or without spaces between octets:
Code:
perl -pe'$_=pack"(B8)*",/\d{8}/g'
Edit:
One liners can be done in C too:
Code:
char *b,p;int main(int c,char **a){for(;--c;putchar(p))for(b=*++a;*b;)p+=p+*b++%2;return puts("");}
 
Last edited by a moderator:
This is absolutely disgusting....
How can a "major" company still not have any news or status or even f#cking ship the cases!?

It has been said they work with/for Toyota? Seems like a load of shit, now, doesn't it?!

This is terrible, absolutely disgusting! (Nothing is aimed toward OP/Members!!)
 
No. I don't linger around here as much anymore.. I might pop in every few days and it's the same story (once again, not toward OP)!!

It's a load of crap. I think I would be willing to take a complete Pandora MINUS the case with a part refund... I'll buy a case later, or mock up a shell and use the Pandora in my Bike Computer project.



I'm just venting.. Will stop now.. UNHAPPY CHAPPY!
 
kingoddball said:
This is absolutely disgusting....
How can a "major" company still not have any news or status or even f#cking ship the cases!?

It has been said they work with/for Toyota? Seems like a load of shit, now, doesn't it?!

This is terrible, absolutely disgusting! (Nothing is aimed toward OP/Members!!)
You do realise that we've been told they have shipped? Over 16 hours ago..?

Do yourself a favour and follow Pandorapress, or one of the scrapers put together by Alec and Kloplop. You'll find that when you're a little better informed, you'll have less need to vent. ;)
 
Last edited by a moderator:
craigix said:
Supposed to be in Newcastle tomorrow.

static.gif
spinsmile.gif
heart.gif
worshippy.gif
 
Last edited by a moderator:
hmmmm.... feel like a dick, now.... but i do enjoy a good vent. i still have doubts....
 
Back
Top