Click here to Skip to main content
15,909,898 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: MQOTD Pin
RUs1239-Apr-15 22:02
RUs1239-Apr-15 22:02 
GeneralRe: MQOTD Pin
Johnny J.9-Apr-15 22:13
professionalJohnny J.9-Apr-15 22:13 
GeneralRe: MQOTD Pin
RUs1239-Apr-15 23:00
RUs1239-Apr-15 23:00 
GeneralRe: MQOTD Pin
Corporal Agarn10-Apr-15 0:45
professionalCorporal Agarn10-Apr-15 0:45 
JokeRe: MQOTD Pin
Stefto10-Apr-15 2:02
professionalStefto10-Apr-15 2:02 
GeneralFriday Programming Challenge Pin
PIEBALDconsult9-Apr-15 19:28
mvePIEBALDconsult9-Apr-15 19:28 
JokeRe: Friday Programming Challenge Pin
V.9-Apr-15 20:14
professionalV.9-Apr-15 20:14 
GeneralRe: Friday Programming Challenge Pin
CDP18029-Apr-15 20:37
CDP18029-Apr-15 20:37 
Wow. That's hard. On my old computer I would have set up two 16 bit registers to hold the result and a counter, initialized with 32. As long as the counter is <= the length of the mask, I would (over both registers) bitwise shift in a 1, otherwise a 0. Loop ends when 32 shifts have been done.
Expanding this to IPv6 would require a third register (luckily the CPU has 16 of them) and the counter would have to be initialized to 48, otherwise everything remains the same.

The machine code for this would be about 20 - 30 bytes long, even if this is an ancient 8 bit CPU. Back then this problem would have been a basic (no pun intended) exercise.
The language is JavaScript. that of Mordor, which I will not utter here

This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.

"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."

If software development were a circus, we would all be the clowns.

GeneralRe: Friday Programming Challenge Pin
User 101325469-Apr-15 22:09
User 101325469-Apr-15 22:09 
GeneralRe: Friday Programming Challenge Pin
CDP18029-Apr-15 22:26
CDP18029-Apr-15 22:26 
JokeRe: Friday Programming Challenge Pin
Joan M9-Apr-15 20:38
professionalJoan M9-Apr-15 20:38 
GeneralRe: Friday Programming Challenge Pin
C3D19-Apr-15 21:44
professionalC3D19-Apr-15 21:44 
GeneralRe: Friday Programming Challenge Pin
Thomas Daniels9-Apr-15 21:44
mentorThomas Daniels9-Apr-15 21:44 
GeneralRe: Friday Programming Challenge Pin
Mark_Wallace9-Apr-15 21:54
Mark_Wallace9-Apr-15 21:54 
GeneralRe: Friday Programming Challenge Pin
Orjan Westin9-Apr-15 22:47
professionalOrjan Westin9-Apr-15 22:47 
GeneralRe: Friday Programming Challenge Pin
PIEBALDconsult10-Apr-15 11:30
mvePIEBALDconsult10-Apr-15 11:30 
GeneralRe: Friday Programming Challenge Pin
Freak3010-Apr-15 2:47
Freak3010-Apr-15 2:47 
GeneralRe: Friday Programming Challenge Pin
PIEBALDconsult10-Apr-15 11:31
mvePIEBALDconsult10-Apr-15 11:31 
GeneralHappy Friday Guys Pin
VijayPd9-Apr-15 18:24
VijayPd9-Apr-15 18:24 
GeneralRe: Happy Friday Guys Pin
King Fisher9-Apr-15 18:37
professionalKing Fisher9-Apr-15 18:37 
GeneralRe: Happy Friday Guys Pin
VijayPd9-Apr-15 19:04
VijayPd9-Apr-15 19:04 
JokeRe: Happy Friday Guys Pin
Agent__0079-Apr-15 18:38
professionalAgent__0079-Apr-15 18:38 
GeneralRe: Happy Friday Guys Pin
drummerboy05119-Apr-15 19:32
professionaldrummerboy05119-Apr-15 19:32 
GeneralRe: Happy Friday Guys Pin
HobbyProggy9-Apr-15 20:28
professionalHobbyProggy9-Apr-15 20:28 
GeneralRe: Happy Friday Guys Pin
Agent__0079-Apr-15 20:42
professionalAgent__0079-Apr-15 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.