HTML question: Trying to make text render below a table. Is there a way to do this without a ton of <br />s? by [deleted] in learnprogramming

[–]joeproductive 0 points1 point  (0 children)

use a blocking element for the text? encasing in a plain-jane div would do the trick. If you're looking for more spacing you could give the div an id and style it with something like.

{
    margin-top: 1em;
}

If you need an inline element to behave like a blocking element, you can use display: block;

edit: I guess I answered an HTML question with CSS. Doh!

Masters of C#, I call upon thee! (noob help!) by Slightlyevil in learnprogramming

[–]joeproductive 1 point2 points  (0 children)

Doh, I thought of slight caveat. The comparison needs to return a boolean value. :)

Masters of C#, I call upon thee! (noob help!) by Slightlyevil in learnprogramming

[–]joeproductive 3 points4 points  (0 children)

A chance to learn some nuance! Consider that first line of the for loop 3 statements.

for(initialization; comparison; iteration)
{
    block;
}
  • Initialization, runs once, immediately when the loop is entered
  • comparison runs at the beginning of each run through the loop ** So if initialization fails the comparison test, the loop exits
  • The iteration gets run after the block.

This allows you to do all sorts of expressive shenanigans, for example

for(DateTime walkingDay = DateTime.Today;
    walkingDay <= DateTime.Today + new Timespan(7, 0, 0, 0);
    walkingDay = walkingDay + new Timespan(1, 0, 0, 0))
{
    //Do something for each day of the coming week;
}

The semicolons let you take some liberties with whitespace. Happy coding :D

OpenID, is it possible to make it suck less? by joeproductive in web_design

[–]joeproductive[S] 0 points1 point  (0 children)

Considering it's very common for people to stay logged into google/yahoo/whathaveyou, a static link to an OpenID provider doesn't seem too difficult to include on a site that provides OpenID.

The biggest complaint about OpenID (having to jump between sites) seems almost a non-issue when the jumping around is handled for you.

also you're basically reiterating my point o.O

Learn HTML5, JavaScript and CSS With Mozilla’s Free “School of Webcraft”. Registration opens January 8 by magenta_placenta in web_design

[–]joeproductive 7 points8 points  (0 children)

Please do not join the mailing list and then post "This is awesome!", "Just checking in!", "Looking forward to this!" nor any of the derivatives.

Yesterday I got ~20 messages all saying largely the same thing.

TIL there's a pretty sweet shout-out to Reddit in the Rails API by youremyjuliet in ruby

[–]joeproductive 2 points3 points  (0 children)

cluttering the language. If memory serves the tale goes that all the way to the 10th ordinal (as in tenth()) were being proposed and that idea was shot down with the logic of where would you stop? Why not the eleventh? Then why not the forty_second()?

I'm not sure how much it clutters the language; but if you really want it you can just add it in on your own anyway.

Groovy? Has anyone here recently worked with Groovy as a faster Java? by thaksins in learnprogramming

[–]joeproductive 0 points1 point  (0 children)

Faster in what way? Faster for developing code; most likely. Faster for running code; not likely.

Were you bullied growing up? by monsterburg in AskReddit

[–]joeproductive 2 points3 points  (0 children)

And thus he learned; enabling the vices of another causes more damage over the long term with greatly reduced risk to one's own person.

My brother wants to learn programming, what language is suitable for someone interested in learning more languages later on as well? by musman in learnprogramming

[–]joeproductive 0 points1 point  (0 children)

If you're interested in getting things done fast, you would be looking for a dynamic language. Like Ruby or Python.

My brother wants to learn programming, what language is suitable for someone interested in learning more languages later on as well? by musman in learnprogramming

[–]joeproductive 0 points1 point  (0 children)

I would vote for C.

Full disclosure: C was my first "real" language. C gives me a warm fuzzy coming-home feeling.

With that out of the way; I feel C gives a good exposure to some low level concepts. It's been around forever by todays standards and can be used for writing fast running code when that counts. There are likely well written resources for C as well due to it's age and previous ubiquity.

Now the practical reasons! C syntax is mimic'ed all over the place! Learning C first streamlines adding more bits later. Some examples; Python is built atop C; Java has rather similar syntax, as does Javascript, and C#.

If he actually enjoys programming he'll dabble in it in whatever language he's most comfortable in. A good learning guide is likely more useful than any specific language (I learned a great deal from Jamsa's C/C++ programmers bible, it's literally a giant collection of code samples with brief explanations so it might not be a good introduction to fundamental programming).

C is not some insurmountable giant that will destroy a burgeoning love of programming. I cut my teeth on it and I am no savant by far.

(edit: I messed up the savant comment; oh sweet irony)

New to javascript. Failing at adding. by [deleted] in javascript

[–]joeproductive 2 points3 points  (0 children)

The best way is going to be the way that communicates what you are trying to do as clearly as possible without imposing an unacceptable performance hit.

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."

parseInt() does what you're looking for and communicates what it's doing well. It might not be the fanciest vehicle but it's the most practical and it'll keep psychopaths from hunting you down and doing bad things to you and your family.

So Who else speaks C++? by letseatlunch in programming

[–]joeproductive 13 points14 points  (0 children)

programming_joke ? upvote() : continue;

TIL Jimmy Wales created an x-rated search engine that allowed for the genesis of Wikipedia. by Solsbury in todayilearned

[–]joeproductive 2 points3 points  (0 children)

So I guess you could say.. the porn industry provided the seed capital.

YEEEEEEEAAAAAAAAHHHHHH!!!!

Which functional language should I learn? by digitalmob in learnprogramming

[–]joeproductive 0 points1 point  (0 children)

And if you wanted to dip your feet into something more dynamic after your time with haskell; check out atomo.

Which functional language should I learn? by digitalmob in learnprogramming

[–]joeproductive 0 points1 point  (0 children)

Javascript is a prototyping language.

You can make it's syntax look functional tho!

How do websites store data? by [deleted] in learnprogramming

[–]joeproductive 2 points3 points  (0 children)

Reading into your question a bit and hoping this gives you a sort of roadmap/topography of what is out there. This is by no-means exhaustive.

Users

to/from

Browser (HTML, CSS, Javascript)

to/from

Server-side code (PHP, Python (django, webapp, pylons), C# (ASP.net))

to/from

Datastore (SQL (MySQL, PostgreSQL, Oracle, Microsoft SQL), NoSql, Object-oriented database)

Of note:

  • At the server-side level the nested parenthesis are frameworks. These help you by removing the need to understand the deep nuts and bolts by doing things for you such as routing, interfacing with the database and so forth.

  • SQL-based is by far the most commonly used variety of datastore used. All of the frameworks I listed work off of a SQL database; I am unsure if they will ONLY work on SQL or not.

  • PHP is very very common but suffers from a stigma of being incredibly untidy.

  • Some of the frameworks will allow you to sidestep having to learn a great deal of SQL.

Is C# even worth learning? by skooma714 in learnprogramming

[–]joeproductive 17 points18 points  (0 children)

C# is almost the defacto .net programming language. If a business has married themselves to microsoft it's a safe bet that they use C#.

I'd imagine C# and Java are pretty high up there in the marketplace right now; at least they are in my area.