« first day (1963 days earlier)      last day (2863 days later) » 

7:00 PM
If you get the digit sum without stringifying it, you get 80 bytes:
int a(char[]a){int s=1,t;for(int b:a){for(t=0;b>0;b/=10)t+=b%10;s*=t;}return s;}
But you lose the smiley :/
 
just change one of the other vars
 
Yea, b to c would work
 
i was about to say that assumes a 2 digit ascii code but... yeah ascii
 
I think it only assumes a non-zero code, but either way, yea.
 
oh yeah my bad
 
7:03 PM
Let's just hope the input string doesn't have nulls o_O
 
and there are 3 digit ascii codes for letters anyway
so i'm a dumb
@TimmyD can the input contain null
 
@Bigtoes That's a safe assumption.
 
noice
 
We'll limit to printable ASCII
 
man if only toCharArray() wasn't a million characters
though i think yours still might be better...
 
7:06 PM
@Bigtoes Does Java not care that the function name and the input variable name are the same?
 
Nope
 
java has good type safety which is a pro for java i guess
that left shift mask that i mentioned earlier applies to java as well so java has netted 0 today
 
@Poke its going to apply to nearly every language, unless they wrote their own bit shifter
 
Go and python don't do it iirc
 
its 0xFFFFFFFF<<32, right??
 
7:10 PM
ye
 
PowerShell apparently wraps
PS C:\Tools\Scripts\golfing> [int]$a=0xFFFFFFFF;$a;$a-shl31;$a-shl32;$a-shl33
-1
-2147483648
-1
-2
 
func main() {

	fmt.Println(0xFFFFFFFF<<32)
}
prog.go:8: constant 281470681743360 overflows int
it tried to compiletime generate XP
 
haha
 
looks like PS allows the hardware to decide the behavior
 
In binary:
PS C:\Tools\Scripts\golfing> [int]$a=0xFFFFFFFF;[convert]::ToString($a,2);[convert]::ToString($a-shl31,2);[convert]::ToString($a-shl32,2);[convert]::ToString($a-shl33,2)
11111111111111111111111111111111
10000000000000000000000000000000
11111111111111111111111111111111
11111111111111111111111111111110
 
7:13 PM
in x86 x << y is equivalent to x << (y & 31) in 32-bit ints
 
Maybe it takes modulo, lol
 
hmmm
func main() {
	for i := uint32(0); i < 32; i++ {
		fmt.Println(0xFFFFFFFF<<i)
	}
}
this is still throwing an overflow error
so, it appears that its bitshift to make a bunch of zeros doesn't even work
 
What if you make 0xFFFFFFFF unsigned? or is it already?
 
oooh, got it
func main() {
	for i := uint32(0); i < 33; i++ {
		fmt.Println(uint32(0xFFFFFFFF<<i))
	}
}
4294967295
4294967294
4294967292
4294967288
4294967280
4294967264
4294967232
4294967168
4294967040
4294966784
4294966272
4294965248
4294963200
4294959104
4294950912
4294934528
4294901760
4294836224
4294705152
4294443008
4293918720
4292870144
4290772992
4286578688
4278190080
4261412864
4227858432
4160749568
4026531840
3758096384
3221225472
2147483648
0
 
That doesn't make sense
You shifted it before making it unsigned
 
7:16 PM
nah, I was casting it so it doesn't throw an overflow error
everything is unsigned
 
How can Print(x) be an overflow but Print(uint32t(x)) not?
 
er, not sure about 0xFFFFFFFF, but I don't think it matters
@feersum because its an explicit cast
 
I don't know this language; how could that matter?
 
well, the bitshift is trying to produce a number outside the range of int
so, by default, it throws an error
but since I cast it to an int, I say that its ok, and to simply trim off the upper bits
 
"unsigned" is how it's interpreted. 0xFFFFFFFF is 32 1-bits. You can interpret it as an unsigned int (2^32 - 1) or as a signed int (-2^31) through (2^31 - 1)
well that was two different thoughts mashed together
but you get the point, i hope?
 
7:20 PM
@Poke Do you know this language, or are you making stuff up?
 
this is how computers work
o.O
it's language independent
 
You're making stuff up. I see.
 
?
0xFFFFFFFF is a 32 bit integer
you can interpret it however you want
 
I think I found a bug with filtering on the site. If I try to exclude a tag, that tag's text is included in the search, further narrowing the scope of my search past my intended scope.
http://codegolf.stackexchange.com/search?q=-%5Bcode-golf%5D

Searching for simply `[code-golf]` returns only questions tagged with that tag, but searching for `-[code-golf]` does not return all questions NOT tagged with it, and it also returns answers containing either `code` or `golf`.

I have to specify "is:question" to get what I want.
 
@NathanMerrill What is the type of 0xFFFFFFFF in Go?
 
7:21 PM
no idea
 
@Poke Big endian or little endian? :p
 
/cringe
 
@feersum looked it up, its an "Integer literal", which says to me signed, but I don't know for sure
8
Q: Searching for posts without a tag borks the search parameters

animusonCurrently, search seems to be doing odd things when you search for posts without certain tag(s) using the not operator. For example: -[css] -[html] should return a list of posts that do not have the CSS or HTML tags, and it correctly looks for that criteria. However, it also seems to change my s...

 
In PowerShell, the 0x is actually an operator that returns a signed int
 
@NathanMerrill Thanks.
 
7:25 PM
so, something like [uint32]$a=0xFFFFFFFF would throw a cast error
 
I found this in Go spec:
> Except for shift operations, if one operand is an untyped constant and the other operand is not, the constant is converted to the type of the other operand.
I don't see what happens for shift operations.
But an untyped constant seems to be what you have.
 
I suppose, technically, it's throwing an ArgumentTransformationMetadataException error. Because PowerShell.
 
ArgumentTransformationMetadataExceptionThrowerBuilderClassFactoryTemplate
 
errr, I'm pretty confused now
 
@flawr you forgot the throws ArgumentTransformationMetadataException
 
7:29 PM
var i = 1<<s           // 1 has type int
var j int32 = 1<<s     // 1 has type int32; j == 0
 
func main() {
	fmt.Println(0xFFFFFFFF)
}
^ that throws an error
constant 4294967295 overflows int
 
It's probably because Println is overloaded
 
I don't think so.
It's because the default type for untyped integer literals to covert to is int
Which is equivalent to int32 at least in this implementation
 
7
Q: Tag search NOT operator is broken

Jon SeigelSearching for "-[feature-request] [comments]" should return a list of questions that have the tag [comments] but not the tag [feature-request]. The right hand sidebar says that, but the search results are identical to "[feature-request] [comments]". As random points out, the operator works, bu...

 
Ah, that makes sense
 
7:31 PM
Woo 0 to language lawyer in 60 seconds
 
Searching with only a NOT operator is apparently not allowed/supported.
 
@TimmyD oh right=)
 
good to know
 
Makes sense for other sites with millions of results.
But when 4/5 questions on PPCG is code-golf, I wanted to see the others. Fixed by using is:question
 
7:33 PM
I wonder what sort of magical parsing causes - to break it.
Nice find, though. That's a useful tidbit.
 
so, it looks like 0x...is always unsigned
and then it casts it to a signed integer
aka, fmt.Println(0x7FFFFFFF) works, but fmt.Println(0x80000000) doesn't
its also not related to the Println
var a = 0x80000000 throws an error as well
 
Is there a collapsible spoiler tag I can use in a post?
 
@Poke just tested in in python: it uses its own integer datatype, so bitmasking won't really work
@RenderSettings there isn't anything collapsible in a post, IIRC
the best you can do is a stack snippet I think
 
Hm. :/ The finite field challenge wants me to post a multiplication table, which is long...
 
pastebin?
 
7:43 PM
If it isn't totally necessary to show your answer is valid, you could link to pastebin or something
 
"If you use a built-in function, please also describe in words which result it produces (e.g. provide a multiplication table)."
Also pastebin is evil
 
You could describe one illustrative case, then show the rest?
 
@RenderSettings the other answers don't seem to be providing a table, so I'd just follow suit
 
They aren't using a built-in
 
ah, you're right
 
7:45 PM
Whatever, I can just show (m 0x53 0xca) == 1
 
@EᴀsᴛᴇʀʟʏIʀᴋ hi mister irk
 
@EᴀsᴛᴇʀʟʏIʀᴋ haha, that took a few moments=)
 
Easter was a couple months ago
 
7:53 PM
@TimmyD and it will be again in a couple months
 
I need help
I have a very good internet, but becuase of reasons, I need to be at least 30 meters from the router
Thus my current download speed doesn't hit 1MB/s
 
"wires"
 
Is there anything I could do about this?
@FryAmTheEggman Oh, also, I have a wall between me and my router
 
Drill a hole?
 
@Bálint Wrap some auminium foild around antenna?
 
8:02 PM
@Bálint if your location is fixed, is the router's location fixed?
 
@FryAmTheEggman I don't think they sell 40 meter long cables
 
You can attach wires to other wires ;)
 
@flawr I use a small USB based device to have internet
 
32
Q: How can I boost my wifi range?

Adam MillerI want to be able to connect to my wifi network from downstairs in the garage. My apartment is three floors up, and, while the signal is detectable there, it's very weak. I have tried lifting the laptop up higher. The reason is depicted here: How can I extend the range of my wifi router?

 
Wich is also not very good because I have a PC
 
8:04 PM
@NathanMerrill I once made some experiments, was able to reach about 1.5 miles=)
 
@flawr the real question is what your bit loss rate was
 
@NathanMerrill How can you find out?
 
I can listen to a signal across the world with a 50% accuracy rate
@flawr no idea
 
The router is fix, in fact, some idiot took the net cable (wich goes in the router) and nailed it to the floor
 
Well I still had pretty much full speed as if i was just 30 feet away.
 
8:06 PM
It can be moved around in a 2 m area
 
@NathanMerrill Nope, certainly not 2.4GHz 100mW
 
@flawr no, I can. I simply need to guess on each bit, and I'll get it right 50% of the time
 
I try to place some aluminium around the antennas tomorrow, to see if it works or not
 
Haha, still nope, you do not find out whether there is a signal at all or not
 
I might buy a signal extender if everything fails
Or a 40 m long internet cable, depends on the price
 
8:09 PM
@Bálint Sure they do. The maximum single-segment length is 100m for 1000BASE-T connectivity.
Or heck, buy a spool, some ends, a crimper, and roll your own.
 
@TimmyD I would stay away from this method
 
@TimmyD People seem to be very averse to using wires nowadays... Spoiled by too effective wireless :P
 
@Bálint You, personally? Or a general recommendation?
@FryAmTheEggman This is true.
 
@TimmyD I personally
 
Any particular reason? Crimping your own Ethernet cables is really simple.
 
8:15 PM
It would help, if...I don't know...The router wasn't on the exact opposite side of the house
 
@Bálint you're talking ethernet cable? do you have access to the modem?
not router*
 
@NathanMerrill No, I'm not a talking ethernet cable
And technically yes, but practically don't
 
so, the coax cable is nailed to the floor?
 
@NathanMerrill Yes
 
and I'm guessing there aren't any other coax ports in the house?
 
8:20 PM
I don't know the technical terms, and that bothers me
 
look for one of these:
to see if you can hook up your modem somewhere else
(simply having a port doesn't guarantee that it'll work, but it often does)
 
@NathanMerrill Sorry, you misunderstood me, I don't know the technical terms, but I know what cable does what
 
Depending upon pricing, you could run a 40m coax cable with a gender changer on one end. That may or may not be cheaper than a 40m Ethernet cable.
 
I can't change the positioning of the router
 
why not? is the router nailed as well?
 
8:25 PM
I counted, and I need 20 m of ethernet cable at least to connect the computer and the router
@NathanMerrill No, but my parents use the internet for their job, so they need it
 
Ah, I had thought the coax cable was the limiting factor in the movement.
 
I try to put some alu around it
@TimmyD It is one of the limiting factors
Because the coax cable is nailed down
 
if you can't move the router, then the fact that the coax is immovable is irrelevant :)
 
Precisely.
With the coax being nailed down, you could pop in a female/female RG6 coupler, plunk down another 20m coax cable (or whatever length) and move the router wherever you want.
 
8:29 PM
actually, how do coax splitters work with two modems?
 
If the router itself can't move, though, then your options are a) swap the router for a higher-power model, b) add some aluminium/aluminum foil, c) buy a lengthy Ethernet cable.
@NathanMerrill They don't.
 
d) wifi repeater
 
You'd need to negotiate specially with your provider to use a different set of frequencies, else at least one modem wouldn't be able to communicate.
A wifi repeater is an option, but given that we're only talking 20m, it seems egregiously overkill.
 
> egregiously
 
yeah. And while I haven't used them, it seems like it would increase ping more than the other options
 
8:31 PM
@flawr It's a perfectly cromulent word.
 
> cromulent
@TimmyD I just looked it up, didn't know it was an actual english word.
 
@NathanMerrill It also depends upon how busy the spectrum is in the area, too -- might not have a free channel available to setup a repeater.
 
But remdinded me of this
 
I just made 3 siggnal strengthener (aka aluminium folia pieces), let's try it
 
@TimmyD am I correct that it would increase latency more than the other options though?
 
8:32 PM
I'm curious what my mom will say, when she notices them
 
@Upgoat are you sure you aren't @Bálint?? :P
/s
 
@EᴀsᴛᴇʀʟʏIʀᴋ ??
 
@NathanMerrill Yes, but probably on the order of a few ms, likely not noticeable.
 
He has bad speleling for the most part.
 
> speleling
 
8:34 PM
@EᴀsᴛᴇʀʟʏIʀᴋ But I have a reason for it
 
wifi is one of my least favorite thing about apartments
 
@Upgoat types on his iPad.
 
we have our own router, but we have to compete for channels with other routers
 
5Ghz for the win
 
8:35 PM
my computer doesn't support :/
 
@EᴀsᴛᴇʀʟʏIʀᴋ shit, the cat found out my sock is Ba— idk what you're talking about :P
 
10/10 nice coverup
TIL @Bálint is goat.
 
@NathanMerrill You can buy a nano USB 5GHz wifi adapter for like $15
 
@Bálint what is? You don't have hooves to blame
 
@TimmyD router + 2 computers comes to around $80
we're moving soon anyways, so hopefully we won't have as many problems
(aka hoping that people are dumb and are all on the same channel)
 
8:40 PM
@Upgoat Non-native-english speaker.
 
Ah
I run almost exclusively wired
 
actually, maybe we'll be able to do that with our main computer at home at the new place
I have no idea
 
mainly because I'm paying for a 150Mbps connection, and that's tough to actually maintain on Wifi at any distance
 
My download speed is half of the one before the aluminium
 
@Bálint aluminium reflects signal, so it definitely requires tweaking to make sure it points to your computer
 
8:42 PM
Also, you should be using one sheet, not three little pieces
The idea is to reflect all the Omni-directional signals into a mono-directional signal
From the link Nathan posted earlier:
 
I have three separate antennas
Now, it doubled, awesome
Still less than 3 MB, but at least I can send messages
 
Depending upon your home electrical wiring, and availability in your area, you could also look at doing a powerline connection
 
morning
 
I'm still waiting for fiber, 1 GB sounds awesome
 
Power-line communication (PLC) is a communication protocol that uses electrical wiring to simultaneously carry both data, and Alternating Current (AC) electric power transmission or electric power distribution. It is also known as power-line carrier, power-line digital subscriber line (PDSL), mains communication, power-line telecommunications, or power-line networking (PLN). A wide range of power-line communication technologies are needed for different applications, ranging from home automation to Internet access which is often called broadband over power lines (BPL). Most PLC technologies limit...
 
8:46 PM
Anyone knows, how much that cost
@TimmyD I think I just buy a cable
 
It's totally dependent upon what companies are selling in your area, since it has to account for the style of mains plug and the frequency of the mains electricity.
 
@Quill hey!
You are blue now!
 
yeah... I woke up to a diamond
10
 
7
Programming resources

Proposed Q&A site for programmers looking after viable resources on different algorithms and techniques.

Currently in definition.

Anyone joining?
 
@Quill \o/
 
8:52 PM
@Bálint I don't think they're gonna make another computer/cs/programming/etc SE
 
@Quill congrats :)
 
@flawr It depends on how much followers it gets
 
Thanks @El'endiaStarman, @MartinEnder, @flawr (I think)
 
@flawr cannot find that word, can you explain?
 
"Lisa the Iconoclast" is the sixteenth episode of The Simpsons' seventh season. It originally aired on Fox in the United States on February 18, 1996. In the episode, Springfield's bicentennial approaches, and Lisa writes an essay on town founder Jebediah Springfield. While doing research, she finds a confession revealing that Springfield was a murderous pirate named Hans Sprungfeld who never cared about the people of Springfield. Lisa and Homer decide to get the message out but instead anger the town council. The episode was written by Jonathan Collier and directed by Mike B. Anderson. It w...
 
@TimmyD Too bad I watch simpsons only in german.
Thanks for the reference anyway=)
 
Huh. I wonder how the translation works.
 
I do have to admit that I like the german versions even better than the original.
 
8:58 PM
Well, I was meaning specifically of those two words.
 
Is it possible to solve my challenge in O(log(n)) time?
Finding the denominator of 1/1 + 1/2 + ... + 1/n
 
@TimmyD gonna research that
 
@Dennis maybe you can help me
 
@LeakyNun
 
@LeakyNun look for the cumulative lcm in oeis
 
9:11 PM
and then?
 
denominator = lcm (1,2,3,4,5,6,...,n)
were just adding fractions
do we?
 
I specifically mentioned in my challenge that it is not the cumulative LCM.
 
@flawr I think it's not quite that simple since the numerator might share factors with the denominator.
 
@LeakyNun you wrote a challenge about this?
@El'endiaStarman oh right
 
9
Q: Denominator of harmonic series

Leaky NunEarlier, we did the pseudofactorial of a number, which is the LCM of the numbers from 1 to n. It would be useful in adding fractions together. However, we find that the denominator of 1/1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 is 20 instead of the pseudofactorial of 6, which is 60. Your task is to find...

 
9:21 PM
@LeakyNun perhpas if the abc conjecture holds=)
 
and then?
 
@TimmyD embiggen-> "vergranden" cromulent->"allumpassend".
in this case the german ones are probably not that good, but still they'd fit I think
 
I suppose the limit is O(n) [although I still do not have an algorithm for it] because it involves finding the primes below n.
Unless there is a way to form the unreduced fraction in O(log(n))
The numerator would be n!/1 + n!/2 + ... + n!/n
 
in The Bridge, 1 min ago, by Eᴀsᴛᴇʀʟʏ Iʀᴋ
user image
 
I suppose forming this one from the last one in O(log(n)) is already good enough.
 
9:33 PM
@Quill Are you getting married too??
 
cmc: find and generate the n-th term: 1, 3, 11, 50, 274, 1764, ...
 
@LeakyNun Two possibilities, from what I can see.
 
int f(int n){return n<6?new int[]{1,3,11,50,274,1764}[n]:1;}
 
@Quill :D congrats on Magic shiny quadrilateral
 
9:48 PM
@Bigtoes only if Doorknob gets married first
 
@Quill Geez, has your luck with women been that bad? o.O
 
lol, and meh
 
if you were in charge of ordering the alphabet, what would you do?
 
@NathanMerrill Put U and I next to each other.
 
9:54 PM
lol
 
Please tell me you knew about that joke beforehand. :P
 
I did
 
Okay, good. :P
 
AEIOUYMBPNDT
 
I would leave the alphabet in its current ordering.
 
9:55 PM
C is tough. do you pair it with S or K?
 
Both.
HSCK
 
AEIOUYMBPNDTKCSX
I'm not sure why you included H there
 
@NathanMerrill You get rid of C altogether, or possibly make it the CH sound alone. S and K work to make it redundant.
 
@Bigtoes nope, we can only reorder
 
9:57 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ I haven't played TF2 for a couple/few years.
 
@NathanMerrill Meh. That's a half-ass job I want no part of :P
 
@mbomb007 you should play it it's really good
 
@Bigtoes it's the job of conforming an unstandardized system into a more regular one
 
@NathanMerrill S and H goes together often. Maybe go TSHCK...
 
@Quill can you make the pro term post featured with your newfangled blueness
 
9:58 PM
JavaScript regex mini challenge: match one optional comma with any number of spaces afterwards, but not nothing. (Hint hint @CᴏɴᴏʀO'Bʀɪᴇɴ. :P)
 
@CᴏɴᴏʀO'Bʀɪᴇɴ It's the same as it has always been. 2Fort everywhere.
 
@NathanMerrill Which is half-assed imo, because you should eliminate redundancies in the system at the same time.
 
well, I like S and X together because they are so similar sounding
 
Yea, you don't need X either. It's either ks or z sound.
 
but that's the thing about standards. You can't just drop what you don't like
 
9:59 PM
Yeah, we have standards.
 

« first day (1963 days earlier)      last day (2863 days later) »