Search Amazon.com:
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 $3,400 per month for bandwidth bills alone, and since we don't believe in shoving popup ads to our registered users, we try to make the money back through forum registrations.
«10 »
  • Post
  • Reply
tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


rjmccall posted:

I love this. Yes, the problem people have with this code must be that they dislike concise and expressive notations.

Have you considered learning GolfScript, or APL (and derivatives)?

quote:

tl;dr: In a better-designed language, this would be:

a better designed language wouldn't have the use case of 'all project euler problems should be one-liners'

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Zombywuf posted:

1) Block ads, problem solved
2) I'm saying you shouldn't use CGI in that very specific (evil) case.

Hey this is the coding horrors thread not the judgemental programmers thread.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


yaoi prophet posted:

Look, I just want to know why we've been writing text using the same 26 letters for hundreds of years. Isn't it time we started using something more English 2.0?

there are more than 26 letters (in english) if you are pedantic and see carolingian minuscule and latin as different scripts

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Golbez posted:

** Most people simply go for /[^A-Za-z ]/, without realizing the single space part of the instructions.

unicode


Otto Skorzeny posted:

and to tef


tef fucked around with this message at May 10, 2012 around 21:50

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


ToxicFrog posted:

What happened to your old avatar? I liked that one.

So did I

Some ie9 user got butthurt that my avatar crashes/slows down their browser

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Zamujasa posted:

Ugh, I know. I've tried linking this (as well as things like evidence-based estimating/scheduling) but it does not help at all. They have no idea how programming works.

Try linking it twice so he can read it twice as fast

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


If only there were ascii characters for this very purpose

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


BP posted:

The application I develop for uses a non-SQL hierarchical DB, upon which we've added the abstraction of records with fields.

Aaaaaaaaaaaaaaa.


aaaaaa.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF




I can't wait for 'how secure is my credit card number'

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF



Good luck when VISA find them. They're less tolerant of parody than the olympics.

(mycreditcarddetails.co.uk got shafted)

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF



give it time, someone will make json with schemas and namespaces

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF



(I know of these being added )

json is pretty much the "gently caress it, we'll do it live" of serialisation formats

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Hammerite posted:

I disagree. There is no reason why a table should not use strings as its primary key.



Performance.


edit: Although I guess that doesn't matter with MySQL

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Hammerite posted:

I don't think the presumption should be that using a string as a primary key is a bad idea,

Frankly, beyond percussive maintenance, I am unsure how to transmit this information to you.

Hammerite posted:

so I don't think the onus is on me to show that it actually isn't.

'I don't understand why it is bad so it isn't my job to try'

Unfortunately, the onus isn't on us to explain why this is a BadIdea™.

Hammerite posted:

What requirements are there of a primary key? By definition, it is meant to uniquely identify rows in the table. To that, you and Zombywuf would both add (unless I misunderstand you) that the primary key should be meaningless. (And I would agree that in the great majority of cases it should be meaningless, I just don't join you is saying that it must 100% of the time be meaningless.)

Artisan primary keys.

Hammerite posted:

Handy if you want to use UTF-8 to support internationalisation, but also want to use ASCII text for some key columns used internally

I know you brought this up earlier, but UTF-8 is an extension of ASCII You don't need to use two different encodings here, just use UTF-8 everywhere.

tef fucked around with this message at Jun 13, 2012 around 09:34

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


KaneTW posted:

This thread is becoming a horror in itself, again.

This will never stop happening.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Hammerite posted:

I asked for a comparison that was (among other things) unbiased. I didn't ask for a scattering of snide comments about how this or that totally sucks in MySQL, hurr hurr. Notice how McGlockenshire was critical of MySQL but I didn't jump on anything he said.

But in the end you're right, I shouldn't have bothered responding to the barbs since it wasn't really relevant to the topic I was trying to discuss.

if you want to have sql explained to you, you could perhaps start somewhere other than the coding horrors thread.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


ymgve posted:

I wasn't thinking about code snippets, but more larger projects which are cleanly organized and relatively easy to understand.

I tend to find code beautiful in theory and rarely in practice. Code can only be as beautiful as the problem it solves, and most of the problems we face are ugly.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Plorkyeran posted:

That could be pretty interesting, actually.

Isn't that the screenshot thread

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


DaTroof posted:

That's why I was tempted to cite jQuery as an example of good code, even though the code itself isn't beautiful. It provides an elegant interface that solves difficult problems, which is often way more important than the underlying implementation.

I think my favourite piece of code is this polyglot quine

code:

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Find a new job, it will be quicker than teaching your boss how to do his.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Groke posted:

Ahaha.

For a living, I maintain (after a fashion) a pretty large suite of in-house developed legacy database applications written in an obscure and rare language.

Is it MUMPS?

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Suspicious Dish posted:

I'm curious how people feel about the goto statement as an approach to this.

C++ code:
  request = asprintf ("HTTP 1.1\nGET %s", url->path);
Yes, I know, it's an "HTTP client".

HTTP/1.1 sends \r\n as line separators, and has a Host: header

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF



https://bugs.php.net/bug.php?id=60758

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Zombywuf posted:

Memcached is a HTML template cache node.

Actually memcache was written because mysql couldn't cache queries well.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Look Around You posted:

You pretty much can't go wrong with Ruby or Python. They both have large frameworks that they're known for (Rails for Ruby, Django for Python) and lighter frameworks for more flexible development (Sinatra for Ruby, Flask and Pyramid for Python).

I'd wager that ruby is easier to pick up for php developers than python, or perhaps, ruby is easier to write php in than python is - python has immutable strings, explicit self, an explicit unicode type, and semantic whitespace.

quote:

As for the differences between the languages... Ruby is very good at writing DSLs and gives you a lot of opportunity for "natural" looking language extensions. It's big on giving you a lot of ways to do things (which is a key part of its philosophy, taken from Perl).

To be obsequious, ruby reminds me of a lisp-2 with a smalltalk semantics and perl syntax

quote:

One more thing about Python: there's two main versions, Python 2 and Python 3. Python 2 is still the most commonly used version as python 3 introduced some backwards incompatible changes and not all libraries have updated to py3 yet.

Ruby similarly has some issues between 1.8 and 1.9 with the introduction of unicode handling.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


GrumpyDoctor posted:

You think semantic whitespace makes python harder to write?

It doesn't make it harder to learn, it's more of an obstacle to whiny programmers.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Zombywuf posted:

I'm also really itching for an excuse to use Riak.

Me too

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Thermopyle posted:

There's a huge problem in science right now where it's extremely difficult to replicate others work because code isn't available or the exact environment the code was used in isn't documented well.

This sort of thinking doesn't help that problem.

“In the good old days physicists repeated each other's experiments, just to be sure. Today they stick to FORTRAN, so that they can share each other's programs, bugs included.”

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Sometimes the return value changes between versions for those error cases https://bugs.php.net/bug.php?id=50696

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF



code:
php > var_dump(str_replace("b", "a",False));
string(0) ""
php > var_dump(str_replace("b", "a",0));
string(1) "0"

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Aleksei Vasiliev posted:

what the gently caress, this is a feature? Isn't this 100% normal for any OO language? Why wasn't it available as soon as objects were?

Same reason foo(1,2,3)[0] was a syntax error until recently. the grammar is a mess.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


str.encode([encoding[, errors]])
Return an encoded version of the string. Default encoding is the current default string encoding. errors may be given to set a different error handling scheme. The default for errors is 'strict', meaning that encoding errors raise a UnicodeError. Other possible values are 'ignore', 'replace', 'xmlcharrefreplace', 'backslashreplace' and any other name registered via codecs.register_error(), see section Codec Base Classes. For a list of possible encodings, see section Standard Encodings.

New in version 2.0.

Changed in version 2.3: Support for 'xmlcharrefreplace' and 'backslashreplace' and other error handling schemes added.

Changed in version 2.7: Support for keyword arguments added.


is this coding horrors or zombywuf is too lazy to read the docs horrors

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Zamujasa posted:

Reminds me of my last job where I'd see code that was literally just "1;", as if it did something.

It does something in perl:
http://stackoverflow.com/questions/...ch-perl-package

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Frozen-Solid posted:

PHP6 got dropped, and they decided instead of making a full version update, to roll the "featured" changes PHP6 was going to have into smaller portions. PHP6 basically became PHP 5.3 and 5.4. There are still a few features that have been discussed and planned for 6 that we haven't seen yet though.

PHP6 tried to add unicode, and strayed from the true path of UTF-8, and suffered as a result. Unicode support is still missing from PHP.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


it's a bad thing

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


http://blog.serverdensity.com/remov...e-its-too-slow/

quote:

Throttling: the performance impact of the global lock in MongoDB 1.8 was such that we couldn’t insert our monitoring postback data directly into MongoDB – it had to be inserted into Memcached first then throttled into MongoDB via a few processor daemons (as opposed to larger numbers of web clients).

Using memcache (a cache of all things) as a write queue for mongo db.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Zombywuf posted:

*writes sql query*

*watches db engine turn query into a series of data streams, cached partial operations, spools, bloom filters, etc....*

*laughs at nosql people doing it by hand*

If we're honest, it's more like:

Writes Sql Query, Watches it turn into series of streams, cached operations etc,

Rewrites Sql Query after inspecting the query plan, tries again.

Laughs at nosql people writing what they want directly rather than second guessing a non deterministic query planner.

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Postgres 9.2 introduces index only scans http://wiki.postgresql.org/wiki/Wha...ndex-only_scans

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


Doctor w-rw-rw- posted:

You redirect logging to a file? Not syslog?

/dev/log

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

X -> YF + XF + Y
Y -> XF - YF - X
XF


code:
#
/*
 *	UNIX shell
 *
 *	S. R. Bourne
 *	Bell Telephone Laboratories
 *
 */

#define LOCAL	static
#define PROC	extern
#define TYPE	typedef
#define STRUCT	TYPE struct
#define UNION	TYPE union
#define REG	register

#define IF	if(
#define THEN	){
#define ELSE	} else {
#define ELIF	} else if (
#define FI	;}

#define BEGIN	{
#define END	}
#define SWITCH	switch(
#define IN	){
#define ENDSW	}
#define FOR	for(
#define WHILE	while(
#define DO	){
#define OD	;}
#define REP	do{
#define PER	}while(
#define DONE	);
#define LOOP	for(;;){
#define POOL	}


#define SKIP	;
#define DIV	/
#define REM	%
#define NEQ	^
#define ANDF	&&
#define ORF	||

#define TRUE	(-1)
#define FALSE	0
#define LOBYTE	0377
#define STRIP	0177
#define QUOTE	0200

#define EOF	0
#define NL	'\n'
#define SP	' '
#define LQ	'`'
#define RQ	'\''
#define MINUS	'-'
#define COLON	':'

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply
«10 »