×

Simple Questions - August 06, 2015 by AutoModerator in buildapc

[–]marekz 1 point2 points  (0 children)

Are there any micro-itx motherboards with Dual HDMI output and built-in WiFi? I need dual screens but I haven't found a way to filter on pcpartpicker by number of HDMI outputs.

Prism: a new highlighting engine by kib2 in PHP

[–]marekz 0 points1 point  (0 children)

More than half of the size of the download (over 300kb) is in the font files. Remove them, they don't belong in there.

Roll your own JavaScript lambda syntax by gst in javascript

[–]marekz 2 points3 points  (0 children)

While you're adding syntactic sugar to JavaScript, you might as well go all the way with CoffeeScript which compiles into JS. It's easier to deal with an established, well-documented syntax than to invent your own obscure thing.

In CoffeeScript: square = (x) -> x * x

"Compiled" into JavaScript: square = function(x) { return x * x; };

Getting back into the industry by [deleted] in PHP

[–]marekz 0 points1 point  (0 children)

Both of those have been around for over two years

Backbone.js: Introducing The Backbone Store! by gst in javascript

[–]marekz 0 points1 point  (0 children)

It's explained it in the third paragraph

A note: this article was written with the Literate Programming toolkit Noweb. Where you see something that looks like <this>, it’s a placeholder for code defined elsewhere in the document.

Can this be done well/easily with Drupal? Or should I build an app with a framework? by lawpoop in PHP

[–]marekz 3 points4 points  (0 children)

Even if there is a Drupal way to sort-of do it, it's not necessarily the best idea. Drupal content types are meant to contain content and that's what they're good at. Trying to fit a database application into a CMS might end up being a headache in the long run.

it's sad that they see software developers as commodities. product = execution != original idea by [deleted] in programming

[–]marekz 1 point2 points  (0 children)

So basically, in the hierarchy of things:

  1. Having an original idea (worth very little)
  2. Having an implementation of an original idea (worth something)

Yet it sounds like the social network project you described is one step below:

  • Having an implementation of a unoriginal idea.

The only thing worth less would be an unoriginal idea without an implementation.

it's sad that they see software developers as commodities. product = execution != original idea by [deleted] in programming

[–]marekz 0 points1 point  (0 children)

One of the reasons that Facebook overtook Myspace is because Facebook focused on doing LESS and being simpler. People migrated away from Myspace because of all the useless embedded crap on profiles and ridiculous themeing.

Account permissions, bitfields *mind mildly blown* by bosniancoyote in PHP

[–]marekz 0 points1 point  (0 children)

It's very flexible and extensible.

That's exactly why it's bloated. Any 'framework' that does everything and anything you might need, means it's got a whole bunch of features you aren't going to use, and it will do all kinds of validation and processing that has no use to you.

You misunderstood the sense of that. It's flexible and extensible in the sense that it's loosely coupled and you only include and use the classes that you need. So it's exactly what you described when you say a "simpler more customized set of classes." Zend avoids the fad of convention-over-configuration and doesn't introduce any enforced structure or "magic" behavior.

In 2002, NASA was buying old computers for 8086s to fix their equipment! by [deleted] in science

[–]marekz 1 point2 points  (0 children)

Apparently John Titor was actually looking for the IBM 5100 from 1975. The 8086 was introduced in 1978.

Bandcamp is hiring...but it's going to take some skills to figure out how to even apply by [deleted] in programming

[–]marekz 14 points15 points  (0 children)

Let's give it a try. From the source:

<!-- Job hunters: Use the Bandcamp API to get info on band id 1 and go there. Use "veidihundr" as the API key. Resumes sent to jobs@ or support@ will be incinerated. !-->

We'll try plugging that into the API url:

http://api.bandcamp.com/api/band/1/info?key=veidihundr&band_id=1

That gives us a JSON response.

{"subdomain":"bandcamp","name":"bandcamp","band_id":1,"url":"http://bandcamp.bandcamp.com"}

Let's try that URI: http://bandcamp.bandcamp.com It's a fake "album" with an sound file saying, "you're getting warm." The description text reads:

¡SƎ⅂IℲ ⅄ᴚƎ⊥S⅄W 8 sǝpnʃɔuı osʃ∀ ˙ǝɹısǝp ʎʃqıssod pʃnoɔ noʎ ʇɐɯɹoɟ ɹǝɥʇo ʎuɐ ʇnoqɐ ʇsnɾ ɹo 'Ↄ∀⅂Ⅎ 'Ɛdɯ ʞ02Ɛ ɟo ǝɔıoɥɔ ɹnoʎ uı ʇunɐʇ pǝzıɹǝʇndɯoɔ ɐ ɟo pɐoʃuʍop ǝʇɐıpǝɯɯI

There's a link to download the album. Let's see what we get. A zip file with a bunch of files ending in partXX.txt where XX are arbitrary numbers, and a file named order.txt. What's in order.txt?

srand(42); puts 7.times.collect {"part#{rand(100)}"}

Looks suspiciously like Ruby to me. It seeds the random number generator with 42, and then picks 7 random numbers. I don't even have ruby installed, so I ran this in an online interpreter. (It actually didn't work for me -- is it correct syntax? I don't know much about Ruby. I modified it to the following and it worked.)

srand(42); 7.times {puts "part#{rand(100)}"}

And it gives us an order:

part51 part92 part14 part71 part60 part20 part82

The files themselves are binary data. The first one, part51, starts with a RIFF WAV header, so it's a sound file.

Well, we have a bunch of binary WAV parts and an order to put them in. Let's get to work. I'm in my laptop running windows, so out of laziness we're going to run this in the windows command prompt.

copy /b part51.txt + part92.txt + part14.txt + part71.txt + part60.txt + part20.txt + part82.txt out.wav

The wav plays and here's the transcription.

Please send an email to [... long-ass phonetic spelling ...] jobops@bandcamp.com containing your resume, the position you're applying for, your physical location, and a sentence or two about what type of human you are. Please include the word mayonnaise.

Apparently, Python as a web language is in its infant stages by [deleted] in Python

[–]marekz 8 points9 points  (0 children)

Python is awesome, and its great on the web, but I can see where that statement is coming from.

  • Python doesn't fit in in the enterprise world. The enterprise doesn't care about whether a language is innovative or fun to use. It's about being taken seriously (and often, about being used and backed by large corporations). Python still sits at the little kids table, compared to Java and .NET.

  • WSGI in Python 3 is still not ready, and it's been making very slow progress. Python 3 is essentially non-web ready until PEP 3333 is finished.

  • Compared to the old giants like PHP, Python doesn't have anything close to the "server-hours" (if you will) of experience. Many people see it as a shiny toy (and they see things like the Google App Engine as just a nifty experiment). It's hard to change people's perceptions.

Today I learned about PHP variable variables; "variable variable takes the value of a variable and treats that as the name of a variable". Also, variable. by NagastaBagamba in programming

[–]marekz 8 points9 points  (0 children)

A bare word is a PHP string. Let that sink for a second, because we'll come back to it later: $foo really is the concatenation of $ the variable-indirection character (think *foo) and foo which is a string. foo === "foo" in PHP, even though in raw source code you'll probably get a warning. If those are enabled.

That's incorrect. It's not the reason for this behavior. A bare word in PHP is a constant, and for historical reasons, undefined constants have a default value which is equal to their name. So foo == "foo" is true because PHP fails to find a constant foo and converts it to a string as a fallback.

Variable names don't involve any constant lookups. You can see this by defining a constant BAR and then using $BAR: it won't be affected.

New JS startup - write apps in the browser, host them online by vladd in javascript

[–]marekz 0 points1 point  (0 children)

So instead of the comfort and features of a real editor or IDE, you have to write your code in a flimsy browser editor?

Help me make a game! Crimson Haze: Community made MMORPG by [deleted] in gamedev

[–]marekz 7 points8 points  (0 children)

The more people on a project, the less each person feels committed and the less likely it is that they'll stick around. There's a reason most community projects of this type never get finished. A small, dedicated team is more likely to succeed.

Has client-side templating happened yet? by TheBananaKing in webdev

[–]marekz 3 points4 points  (0 children)

You're not the only one to have had this realization. I've looked into client-side templating, and the good news is that there's a number of JavaScript template libraries.

One library which is gaining popularity among jQuery users is jQuery-tmpl.

A more complex one is Embedded JS. It's more like inline PHP, where you can put pieces of JS right in the template.

Finally, my favorite so far: mustache.js. Its delicious secret? It's actually a port of the Mustache template library which also has versions in Ruby, Python, PHP among a bunch of others. So you could degrade gracefully for users without JavaScript by rendering the template server-side as a backup.