attn: BigWallop - yer binary woes hopefully solved!

Have a look at this; I've done 2 versions since I don't know which end of the DIP switches in question is the MSB and which is the LSB, ie is the number '1' the rightmost or leftmost switch.

Assuming right-to-left numbering, here's 0 to 1023 in dip switch format:

formatting link
left-to-right numbering:

formatting link
a way of printing that for yer spod and you should be ok!

If you want to find a particular sequence quickly just use:

formatting link
the 10 zeros are the number you want to show as a DIP switch, right to left, ie 0000000001 is '1'

Left to right is:

formatting link
that'll help :)

If yer DIP switches don't look like that just send me a pic of the block and I'll fit it in; the script is v.flexible.

cheers

witchy/binarydinosaurs

Reply to
Witchy
Loading thread data ...

should be interesting!

Reply to
Dave Gibson

Reply to
James Hart

That's exactly how I did it - 3 pngs, the GD graphics library and some PHP glue to do the maths......took me half an hour and I'm by no means a competent PHP programmer :)

cheers

witchy/binarydinosaurs

Reply to
Witchy

In article , Witchy writes

Looks like each image gets built & d/l one at a time, I got bored when the d/l reached 500kB, nice tho' ;-)

Reply to
fred

Not a criticism - very neat tool, and nice of you to do it - but rather than generating the images on the fly using GD, which takes a long time and generates many images for download, a more efficient solution would be to use 2 images in total - one for the switch, which you set as the background of an element, and another one representing the on state, which you overlay in the correct position, once for every switch position.

Reply to
Grunff

formatting link
> where the 10 zeros are the number you want to show as a DIP switch,

formatting link
> Hopefully that'll help :)

You are the bestest user in the group !!!!!! I owe you the biggest juiciest thing you can think of. Absolutely Fricking Wonderful !!!! That will definitely do the job to get him started on his own with these. If it means he memorises the basic ones to get the jobs done.

Fricking Marvellous Piece of work them !!!!!

Now edited and printing in three columns on A4 sheets. Don't know how many sheets yet, but don't really care, because you're Wonderful !!!

Thank you Very Very Very Much Witchy.

Reply to
BigWallop

Yup - the last one is wrong - its actually 512. 2^10 is 1024, but you've got to remember that 0 is one of those possible combinations, so you can only do 0-1023, not 0 - 1024! ;)

Very impressive otherwise though... :)

D
Reply to
David Hearn

This is true, but I was going for coding speed, not efficiency :) If this wasn't a one-off it would be a simple task to remove the gd stuff and just build up a load of IMG tags per switch block. - local cacheing should make sure the images were only downloaded once.

In fact I've just done it because I could -

formatting link
- much easier to code than using GD too :o)

cheers

witchy/binarydinosaurs

Reply to
Witchy

:-)

Reply to
Grunff

No problem - I like little challenges like that, and because of Grunff's suggestion in the other thread I came up with an even simpler version that's half the size :o)

Let us know if it helps!

cheers

witchy/binarydinosaurs

Reply to
Witchy

In article , Witchy writes

An interesting lesson for me, looking at the source, Ta (hope you don't mind).

While we're in optimising mode, short paths & single char filenames get you down to just over 200k, because we can ;-) - not exactly maintainable tho'

Reply to
fred

I've drawn the layout on to the back of his hand this morning to see if it helps him with a 10 head installation today. Everyone has been told to call me if he phones them for help, and they all know I mean it, so we'll see what happens.

Fantastic bit of coding that. I get lost when it comes to this type thing. In fact, it takes me all my time to compose a letter in the word processor. Many Thanks for that Sir.

Reply to
BigWallop

Did you view the PHP code or did you view the source of the page in a browser? The code itself is 907 bytes unoptimised:

Binary gubbins

Reply to
Witchy

*grin* - I know....blame my dodgy loop constructs!

Ta; I'm trying to get back into programming after a 10 year self-induced abstinence to maybe make meself more employable....

cheers

witchy/binarydinosaurs

Reply to
Witchy

Oooh no, nice to see that, didn't think I had permissions to read that & so didn't try. I just waited until the whole page appeared on my screen, then did a 'file'

'save as'. The resulting just looks like html, sample:

0000 :

(1024x~10lines)

The above was a save from Opera, below is a save from IE, with local paths:

0000 :

My feeble attempt at saving b/w was just by trimming the LOCAL path and filenames in the html bit:

0000 :

Feeble of course cos to trim your path would require a different shorter named website :-/

Am I right in thinking the php script runs on your provider's server & then the html to display the results is what we download? The download counter on my Opera window reaches about 650k at completion.

Academic now (as you've done it), but is the way for other such things to write an app in javascript to run on the user's m/c, so you just download the script?

Btw, please bear with me at this difficult time, as after being in 'the business' for years and not _needing_ a website I am having my arm twisted to write one for the other half's fledgeling business :-/ ; the tips in the 'usenet names' thread may well save me integrating a contact forms script.

Thanks for the look at your script; off to do some reading . . . .

Reply to
fred

A quiet word to set expectations may be called for here......

Having been employed in the IT industry for over 25 years, the last 7 of which were as a freelance IT consultant (software developer) on bleeding edge technologies - followed by a forced 12 month abstinence from not being able to get any sort of IT development job paying a reasonable rate - I can say with my best French accent that the UK IT marketplace is well and truly buggered. So I started up my own handyman business, earning a whole lot less than I did two years ago, and thoroughly enjoying every minute. Plus I'm a lot fitter, having lost over 2 stone in weight these last 6 months.

I am on friendly terms with several IT recruitment consultants. All of them, to a man (or woman), have advised me that for every IT job posted there have been 350 instant CVs landing on their desk (or arriving in their email inbox, which is the standard way of IT recruitment these days). Only about half a dozen of the cream get looked at - the rest are filed under "better luck next time".

Why this downturn? A couple of reasons. First, Labour introduced IR35 in 1999 which made the contractor treat his limited company income as personal salary, as a supposed "disguised employee" of his client. One or two contractors were then stupid enough to pursue their client through the courts so as to claim holiday, sickness and other employee benefits. Result? In many cases clients are wary of offering jobs to freelancers for fear of the freelancer taking them to the cleaners.

Another big reason is the offshoring of IT projects to India and other far off places. People in Bangalore get paid about 10% of what a UK IT consultant does (or did), and are considered very well off in India even at those low rates. The numbers game played by the big corporates dictates that this offshoring is rather a good game.

Plus Labour have opened the floodgates to IT migrants coming into the country via fast-track visas. You know that deal that deal old Blunkett did with the French to close the Sangatte holiday camp on the French side of the chunnel? Well the rumour is that the French were very pleased to close it, providing that the UK took the inmates from the holiday camp. They weren't treated as immigrants because that would have made the immigration figures look ballistic, but they came in as workers, on visas.

Then we have the end of the Y2K crisis, and the general slowdown in industry not helping matters.

The latest information I have is that there are about 250,000 IT freelancers in the UK today. About 80,000 (or 30%) of those are currently without work.

Things are picking up a bit presently, but not to the levels that existed 2-3 years ago. I'm in no rush to go back to IT (I really, really don't want to).

Good luck with your aspirations, but I wouldn't hang your hat on IT getting you employed - there's an awful lot of very good IT people who can't get a job today, so someone with newly acquired skills is likely to find it quite difficult.

PoP

Reply to
PoP

We recently had a long thread about this, and I said a lot of stuff which I don't intend to repeat here, but I'd like to briefly counter your point for the benefit of Witchy.

I know that many people share PoP's thoughts re. the current state of the IT industry, but this has not been my experience at all.

I've been on the recruiting end, and have had major problems finding *skilled* people to fit the jobs. Whenever we've advertised, we've received hundreds of applications, but finding candidates who can deliver what they say they can is a totally different matter.

Many of the candidates looked superb on paper, and presented themselves very well at interview, but when it came to testing their technical knowledge/skills they were a real letdown.

So IME there are plenty of IT jobs around for people who have good skill sets.

Reply to
Grunff

Believe it or not I completely agree with what you are saying!

The disturbing thought that occupied my mind during my time as a freelance consultant was that I was often working alongside someone who I knew was lying through their teeth about their previous achievements and track record. I could see it in their code. And I have heard several such freelancers telling those around them that they lie on their CVs in order to get a job.

But this is not entirely the fault of the individual. Recruitment consultants, paid on percentage, are well known to present a candidate with embelished skills. I've had a couple of interviews in the past where the client comes out with "it says here that you are expert in XYZ....", and they register instant disappointment when I have said "no I'm not".

The building industry has gained a bit of a reputation for having cowboys within it. I fear the IT industry can be similarly inclined.

Absolutely. About 3 years ago I had a telephone interview and was set a tough technical test by the IT department. 20 questions. I believe I answered 16 off the top of my head, the other 4 I said I didn't know the answer to. I got the job - apparently they'd been interviewing for some 2 months and I scored higher than anyone else and was perceived as honest when it came to something that I didn't know. Many of the so-called "experts" they had interviewed and given this test to were scoring 4 or 5.

A major problem is that if you have the skills then it is a problem of getting noticed enough to get the assignment. If you are completely honest about your track record then most likely you won't get a look in, because the candidates who do lie about their true background will get to sit on the interview.

Whilst I am writing this I shouldn't leave out the employer. So many IT adverts these days want 5 years experience in each of Java, ASP, SQL Server, C++, Visual Basic, XML, HTML and a bunch of other things. You dare reveal that you might not be competent in any of these things and you won't get to the interview. And yet in reality there is no way anyone is going to be expert in all those areas together. In essence these employers are lining themselves up for the applications which are so far from the truth.

PoP

Reply to
PoP

Yup, the PHP side of the Apache webserver intercepts the code and comes up with the required HTML to render properly on yer browser. Normally the only hint that there's PHP involved is because of the .php file extension but even that can be hidden.

or a URL generated by tinyurl.com of course.....

Yep, see above. In my case it's running on a linux box 3 feet away from where I'm sitting now so I can do what I like to it, but a few providers support the rapidly-becoming-accepted PHP/MySQL backend.

You could do it with Java I think; javascript itself doesn't download to the user's machine in the same way a java applet does - it relies on the browser supporting it instead. The beauty with PHP (and server side includes) is they run on the server so there's less to download for the client.

What I used to do before I got my own webserver was have the contact address as a jpeg or animated gif, but people complained about that because they had to manually fire up their email client and type the address in! Now that I know about encoding the address I could go back to that I suppose, but so many varied people visit my site they're not all running microsloth products and don't all have integrated systems where if they click on a mailto: link in a browser their email client automatically fires up with the correct address in a new message!

Also these days I've got a copyright notice at the bottom of each page, so working out the email address doesn't take rocket science :)

cheers

witchy/binarydinosaurs

Reply to
Witchy

HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.