Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Loezi
Dec 18, 2012

Never buy the cheap stuff
https://twitter.com/kennwhite/status/1067133581435305984

Adbot
ADBOT LOVES YOU

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

A Reg article on same that explains a bit more:
https://www.theregister.co.uk/2018/11/26/npm_repo_bitcoin_stealer/

bigmandan
Sep 11, 2001

lol internet
College Slice
Ever wanted a PHP implementation written in Go? Neither did I.

https://github.com/MagicalTux/goro

Soricidus
Oct 21, 2010
freedom-hating statist shill

bigmandan posted:

Ever wanted a PHP implementation written in Go? Neither did I.

https://github.com/MagicalTux/goro

mark continues to do nothing wrong :colbert:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
looks like he's using his japanese prison time well

iospace
Jan 19, 2038


bigmandan posted:

Ever wanted a PHP implementation written in Go? Neither did I.

https://github.com/MagicalTux/goro

https://www.youtube.com/watch?v=kY-pUxKQMUE

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

bigmandan posted:

Ever wanted a PHP implementation written in Go? Neither did I.

https://github.com/MagicalTux/goro

now all we need is a go implementation written in php

Jazerus
May 24, 2011



php...finds a way

canis minor
May 4, 2011

https://twitter.com/felixfbecker/status/1067117685375422464

choice quote:

quote:

Felix,thank you for comments.The software includes the legal notice of use of MIT license which fully capacitates extendors to make use of it.Please keep in mind the extension code is currently about 100K lines.Friendly reminder,reverse engineering is a violation of license terms

MononcQc
May 29, 2007

if you don't want people to re-wrap a thing and sell it wholesale, don't use MIT as a license.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
I think the complaint is they didn't include the copyright notice, the only thing the license requires them to do

NtotheTC
Dec 31, 2007


https://twitter.com/DevsenseCorp/status/1067410510289747968

Lol. Their stable release is going to suck then and a loooot of people are going to ask for their money back

Guess someone snatched the twitter account away from the intern who'd read too many Wendy's tweets

NtotheTC fucked around with this message at 19:56 on Nov 27, 2018

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Huh I'm surprised even that happened. Around ten years ago I found a half dozen for-profit "security" products that were using WireShark unattributed and reported it to the Wireshark team. I lost track of them after a few years but nothing changed despite a strongly worded "Thanks we're going after these guys hard" email from WireShark. And that's GPL not MIT.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

nielsm posted:

You are developing a Windows application for syncing user photos between a PC and your cloud service. Where would you store a local cache of files?

A) In the user profile folder, Local AppData or similar
B) In the shared user profile, C:\ProgramData or similar
C) A folder under C:\Windows\System32

If your choice was C, then congratulations, you made the same choice as Apple did for iCloud. What the gently caress, Apple? :psypop:

I was pretty sure iCloud syncs your photo library to %USERPROFILE%\Pictures\iCloud Photos. Are you sure about this?

nielsm
Jun 1, 2009



Simulated posted:

I was pretty sure iCloud syncs your photo library to %USERPROFILE%\Pictures\iCloud Photos. Are you sure about this?

I found this on a user's machine that had disk full. After telling the iCloud client to log out (where it warned this would remove all local copies of things) it removed all data in that C:\Windows\System32\iCloud Photos\ folder.

megalodong
Mar 11, 2008

RE the strncpy stuff from last page, I'm still amazed how often I come across people, supposedly with lots of C experience, using it as a "safe" copy for null-terminated strings...

Soricidus
Oct 21, 2010
freedom-hating statist shill
null terminated strings were a mistake and any use of any c stdlib str* functions is a code smell. please use one of the many libraries that provide sane strings implemented using structs that store the length and capacity alongside the buffer.

Remulak
Jun 8, 2001
I can't count to four.
Yams Fan

megalodong posted:

RE the strncpy stuff from last page, I'm still amazed how often I come across people, supposedly with lots of C experience, using it as a "safe" copy for null-terminated strings...
Ehh, like anything else it is safe if you know what you’re doing and are in a controlled context.

But I guess from that perspective so are while loops looking for null terminators...

Nude
Nov 16, 2014

I have no idea what I'm doing.

bigmandan posted:

Ever wanted a PHP implementation written in Go? Neither did I.

https://github.com/MagicalTux/goro

I like this part of the readme:

quote:

Why?

That's a good question. [...]

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Soricidus posted:

null terminated strings were a mistake and any use of any c stdlib str* functions is a code smell. please use one of the many libraries that provide sane strings implemented using structs that store the length and capacity alongside the buffer.
B-b-but my precious memory!

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
They're probably cool if it's 1850 and you have 3 whole bits of RAM to rub together
or embedded systems i guess, but why the hell are embedded systems working with strings

Ola
Jul 19, 2004

RPATDO_LAMD posted:

They're probably cool if it's 1850 and you have 3 whole bits of RAM to rub together
or embedded systems i guess, but why the hell are embedded systems working with strings

How else is the thermostat supposed to scroll go pro now at just $7.99/mo to unlock temps above 68F

Volguus
Mar 3, 2009

Ola posted:

How else is the thermostat supposed to scroll go pro now at just $7.99/mo to unlock temps above 68F

You cannot beat the executive explanation: marketing data has shown a 10% subscribers increase since we have added that text.
Done and over.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



68° ought to be enough for anybody

boo_radley
Dec 30, 2005

Politeness costs nothing

Munkeymon posted:

68° ought to be enough for anybody

68° ought to be enough for any body.

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
69 would be nice

Carbon dioxide
Oct 9, 2012

Munkeymon posted:

68° ought to be enough for anybody

I looked at this post on a bad screen and I thought you said 68" and I was wondering what you were talking about.

Toady
Jan 12, 2009

nielsm posted:

I found this on a user's machine that had disk full. After telling the iCloud client to log out (where it warned this would remove all local copies of things) it removed all data in that C:\Windows\System32\iCloud Photos\ folder.

Are you sure the user didn't set that directory themselves? I've never, ever seen iCloud store photos in anything other than in the user's Pictures\iCloud Photos directory.

senrath
Nov 4, 2009

Look Professor, a destruct switch!


Searching it all I can find reference to is the %USERPROFILE%\Pictures\iCloud Photos\ directory, which appears to be the default. I assume it being in System32 was entirely user error.

Foxfire_
Nov 8, 2010

"ASCII text over serial" is a fairly common protocol for talking to equipment from embedded stuff that adds string handling to things.

I like to do strings as unterminated fixed size arrays in structs i.e.
code:
struct ThingCmd
{
    char Text[THING_CMD_SIZE];
};
You can copy them with =, sizeof() them, static analyzers are better about noticing if you overrun them, and they tend to explode dramatically if someone isn't paying enough attention and tries to use str* functions on them.

ChickenWing
Jul 22, 2010

:v:

DELETE CASCADE posted:

69 would be nice

:golfclap:

JawnV6
Jul 4, 2004

So hot ...

RPATDO_LAMD posted:

They're probably cool if it's 1850 and you have 3 whole bits of RAM to rub together
or embedded systems i guess, but why the hell are embedded systems working with strings

What do you think "embedded" covers these days?

ChickenWing
Jul 22, 2010

:v:

I dunno if this is a "horror", per se, but it's a completely ridiculous thing I learned at a recent talk at work.


Apparently, CPython doesn't have any concept of primitive types - everything is spun up into a struct with a bunch of ancillary type information. Naturally, creating and maintaining structs is more expensive than just putting a value in a memory location. At some point, someone said "I bet we could improve performance if only there was some way to reduce the amount of cycles we spend creating and garbage-collecting all these structs for frequently used values." I believe this person then proceeded to drink heavily while thinking about the problem, because at some point on the far side of the ballmer peak they decided that the best course of action in this instance would be to preconstruct a set of "small number" objects and return references to those any time an object with that value was needed rather than creating a new object. Our talk didn't cover the exact range (it may vary depending on system?), but the tl;dr is:

code:
> val hundred = 100
> val thousand = 1000
> hundred is 100
true
> thousand is 1000
false
This apparently applies to "small strings" as well, e.g. aaaa, bbbb, ...

Whatever makes python faster, I guess?

e: thousand != 100

ChickenWing fucked around with this message at 21:21 on Nov 29, 2018

Soricidus
Oct 21, 2010
freedom-hating statist shill

ChickenWing posted:

I dunno if this is a "horror", per se, but it's a completely ridiculous thing I learned at a recent talk at work.


Apparently, CPython doesn't have any concept of primitive types - everything is spun up into a struct with a bunch of ancillary type information. Naturally, creating and maintaining structs is more expensive than just putting a value in a memory location. At some point, someone said "I bet we could improve performance if only there was some way to reduce the amount of cycles we spend creating and garbage-collecting all these structs for frequently used values." I believe this person then proceeded to drink heavily while thinking about the problem, because at some point on the far side of the ballmer peak they decided that the best course of action in this instance would be to preconstruct a set of "small number" objects and return references to those any time an object with that value was needed rather than creating a new object. Our talk didn't cover the exact range (it may vary depending on system?), but the tl;dr is:

code:
> val hundred = 100
> val thousand = 100
> hundred is 100
true
> thousand is 1000
false
This apparently applies to "small strings" as well, e.g. aaaa, bbbb, ...

Whatever makes python faster, I guess?

this kind of thing is commoner than you might think. e.g. java does the same thing for instances of the Integer class with small values. and the optimisations some languages do to reduce memory usage of short strings are quite impressive.

i'm surprised python bothers though given how little thought they normally give to performance

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
CPython refuses to do big structural changes for the sake of perf, but that's a pretty easy localized optimization that doesn't really impact the rest of the code base and has big benefits.

EssOEss
Oct 23, 2006
128-bit approved
I assume that is supposed to say "thousand = 1000" but yeah, this is very common and just a thing you do if you want performance. For example, the .NET async/await system works by wrapping all sorts of results in a Task structure, which is a real waste if the task is short-lived or, even worse, executed synchronously so it just goes to waste right from the start. So it keeps a cache of things like "task that returned with true". Things have improved in the next version, though, where you can skip some of these allocations altogether.

UraniumAnchor
May 21, 2006

Not a walrus.

EssOEss posted:

I assume that is supposed to say "thousand = 1000"

It's the difference between "same value" and "same object" so it was intentional.

Dylan16807
May 12, 2010

UraniumAnchor posted:

It's the difference between "same value" and "same object" so it was intentional.

Not the last line, the one that initializes "thousand" needs to be fixed for the demonstration to work.

code:
>>> hundred = 100; thousand = 1000
>>> hundred is 100, thousand is 1000
(True, False)

Dylan16807
May 12, 2010
Oh and for bonus points if you put that in a file (or compress it to one line) you get a different result, because all instances of "1000" compiled at the same time will share the same object.

Adbot
ADBOT LOVES YOU

Xarn
Jun 26, 2015

ChickenWing posted:

I dunno if this is a "horror", per se, but it's a completely ridiculous thing I learned at a recent talk at work.


Apparently, CPython doesn't have any concept of primitive types - everything is spun up into a struct with a bunch of ancillary type information. Naturally, creating and maintaining structs is more expensive than just putting a value in a memory location. At some point, someone said "I bet we could improve performance if only there was some way to reduce the amount of cycles we spend creating and garbage-collecting all these structs for frequently used values." I believe this person then proceeded to drink heavily while thinking about the problem, because at some point on the far side of the ballmer peak they decided that the best course of action in this instance would be to preconstruct a set of "small number" objects and return references to those any time an object with that value was needed rather than creating a new object. Our talk didn't cover the exact range (it may vary depending on system?), but the tl;dr is:

code:
> val hundred = 100
> val thousand = 100
> hundred is 100
true
> thousand is 1000
false
This apparently applies to "small strings" as well, e.g. aaaa, bbbb, ...

Whatever makes python faster, I guess?

As someone already said, Java does this too. What is extremely fun is that IIRC you can use reflection to gently caress around with the conversion slots, so that int with value 2 converts to Integer that has value 4... :v: I mean if you do it, it is your own drat fault, but it is still pretty drat funny.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply