Tech Coding Q&A

Shu

Spiral out, Keep going..
Veteran
Joined
Nov 21, 2006
Messages
2,926
Age
40
Location
Nashville, TN
Gil
25
Bomb
Black Mage
Terra
Cloud Strife
FFXIV
Shu
FFXIV Server
Lamia
Hey folks,

I know a few folks have come and asked me some intro stuff to coding, but I thought I would let everyone share there questions, advice, suggestions and everything else. If I get enough interest I might even think about doing a sub forum for folks to do Q&A's.

So let's see who's interested.

1) What I want to know is what Languages do you know? (and don't fib, because it's important for those that need a subject matter expert)
2) What do you want to learn going forward?

Shu -

1) VB.net, C#, Java, SQL, Jquery, HTML (CSS as well), XML/XSLT. I also am getting a little more proficient at doing powershell scripts and ruby.

I am exceptional at ASP.net systems, and can't stand looking at classic asp unless I have too. I am quite experienced with asp.net coding architecture and my source code usually resides on a Team foundation server, where people have open source here at work.

I am now looking into Entity Framework. I love 4.0, and I like to build custom ajax over the ajax toolkit options. The only thing I would consider myself highly skilled at is maintaining Microsoft SQL Databases. From Stored Procs, Triggers, Job, to writing SSIS packages for data import/exports on Link servers.

2) I want to learn more XML page storage. I have seem some nice stuff with XML temp storage, that enables you to do multithreading without bogging down the overall performance. I want to make sure I don't enable java hacking though in the process, since data transfer is usually highly sensitive over here.

In the distant future when mobile apps are the all and everything, I want to look into HTML 5 (or whatever it is at the time) also if they are still using Object oriented C for apple, I'll probably look into that.. if I ever want to spend a pretty penny.

----

Misc info:

Recent projects:

C# Web app

I have creating a xml post interface in which simulates live data from one site to another, via HTTP Post protocols. Using an XSD I validate to make sure all data is stored correctly on our DB and the clients DB, when posting back.

VB.net Windows App

I have created a multi xml post tool to allow automation of interface posts to simulate live data in bulk as a stress test tool on our current CMS.
 
In terms of learning, stuff like this may be good:

http://www.codecademy.com/#!/exercises/0

There are other games I've seen that teach programming that look fun.

I've even seen ones that teach assembly language: http://0x10c.com/

For myself, I knew algorithms, it security, ia-32 assembly language, c, c++, javascript, and other things. I wouldn't say I was a master or an expert in any single area. But, its not necssarily difficult to figure out or anticipate how things work if you have a fundamental understanding of it.

Example, XML temp storage is something I know absolutely nothing about. But, I can guess that it probably is a web application abstraction similar to caching on a processor and that it probably adheres to spatial locality and temporal locality as a cpu does and is subject to the same precedents of branch prediction, out of order execution and other fundamentals which govern how effective or ineffective multi-threading can be if indeed web applications are capable of multi-threading which may possibly be an incorrect assertion considering how much overhead there is in the interpretive / virtual machine stages & how lacking it is in terms of being a rich multi-media experience.

With multimedia it may be easier to have one thread process audio data and another process graphical data, thus having two separate streams. Web applications being so lacking in terms of multimedia experiences with the demise of flash interfaces and such, it may be that the beneficial potential for such multithreaded capacity is somewhat low.

Blah, blah. /Dumb post. I somewhat hate computer stuff, anywayz.
 
I dinnae wish to fib, so I will state now that rather than "knowing" I am "learning" a few languages.

vB
Ruby


I am by no means advanced, nor am I knowledgeable in the topics but I am learning at a rate I'm very pleased with. I would really like to delve deeper into these languages before trying to learn anything else, but I believe here soon I will be needing to pick up some Java know-how from a professor of mine.

Until recently, I had only been creating very sequential scrips and not utilizing object based programming as I didn't understand it. However, I have been taking a stab at it, and have made a circle "object." I'll post it later, though, and if anyone could look it over and give me tips I'd appreciate it. :grin:
 
Last edited:

This site is decent for picking up coding practices in a way that is fun. :grin:

http://thedailywtf.com/

I used to follow Bram Cohen(designer/creator of bit torrent)'s blog, Theo De Raadt(OpenBSD), Richard Stallman(Free Software Foundation) and other assorted industry veterans. Some of it makes for excellent reading & n00bs like me can learn a lot, sometimes.

BramCohen's blog: http://bramcohen.livejournal.com/
rsnake's page(used to be good for web app security, but its somewhat abandoned these days): http://ha.ckers.org/

Etc, etc. There's plenty of quality reading material out there.

I guess the most important thing to learn is to actually create or build things you use & have some type of project you can work on to hone your skills. A lot of people try to read a book about C++ or read tutorials and never use the skills in a hands on environment. Those people never go anywhere.

OOP is ridiculously overhyped and played out. Its nothing really special or a big deal, mostly just a bunch of fanboys getting excited over nothing.
 
Okay, so I had a bit of a question regarding a few "languages" (I don't know iv javascript and CSS are considered languages? I read that HTML isn't a language either, but rather a "mark up" so I'm just going by that).

Kirababes was playing on Tumblr and messing with themes on said site, but couldn't find one just right, so I figured I'd try to help and learn a little HTML to help tweak a few things to her likings. I wouldn't say I "know" the language, but I've created a shitty little theme of my own I aim to continue improving on as I continue learning in addition to completing the tutorial and hands on examples of it. I aim on learning CSS soon, and then Javascript afterwards. My question is this, I know that those three (HTML, CSS and Javascript) can all feed into each other well, but how, exactly, do they? Is it a Basics>Formatting>Animation relationship?

Perhaps my own studies will answer these questions soon, but I figured it wouldn't hurt to ask.


In addition, if any of you care to browse over this, I'm having an issue in my layout where as I'm trying to reduce the...er..."glare" of my links on the page. I want to make them look less ugly, essentially, and can't be assed to Google as I am already typing this out. (Yes, I know I shouldn't use the <center> </center> method, I'll remove that once I get a bit of CSS as many have recommended instead)

<html>
<head>
<title>{Title}</title>
<link rel="shortcut icon" href="{Favicon}">
<link rel="alternate" type="application/rss+xml" href="{RSS}">
{block:Description}
<meta name="description" content="Pockets' Tumblr Layout" />
{/block:Description}
</head>



<!--Set Background Color-->
<body style="background-color:eek:range;"> <center>


<!--Create Layout Container-->
<div id="container" style="width:700px">


<!--Create Layout Header-->


<!--Name Banner-->
<div id="header" style="background-color:white;">
<h1 style="margin-bottom:0;background-color:white; text-align:center;">{Title}</h1></div>

<!--Pockets logo-->
<p style="text-align:center;"><a href="http://www.finalfantasyforums.net/forum.php/"><img src="http://i49.tinypic.com/kcjiq0.png" width="32" height="32" alt="Pockets"/></a>

</p>
<hr />

<!--Create Left Floater-->
<div id="menu" style="background-color:white;width:110px;height:400px;float:left;">
<b>{Name}</b><br />
<a href=http://vertigostatus.tumblr.com/>Kira Tumbl Test <br/>
<3</div>


<!--Post Container-->
<div id="content" text-align:center;float:left;">


{block:Description}
<p id="description">{Description}</p>
{/block:Description}

<id="posts" style=align:center;>
{block:Posts}
{block:Text}
<li class="post text">


{Body}

{/block:Text}

{block:Photo}
<class="post photo">
<img src="{PhotoURL-500}" alt="{PhotoAlt}"/>

{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
{/block:Photo}

{block:Photoset}
<class="post photoset">
{Photoset-500}

{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
{/block:Photoset}

{block:Quote}
<class="post quote">
"{Quote}"

{block:Source}
<div class="source">{Source}</div>
{/block:Source}
{/block:Quote}

{block:Link}
<class="post link">
<a href="{URL}" class="link" {Target}>{Name}</a>

{block:Description}
<div class="description">{Description}</div>
{/block:Description}
{/block:Link}

{block:Chat}
<class="post chat">

<ul class="chat">
{block:Lines}
<li class="{Alt} user_{UserNumber}">
{block:Label}
<span class="label">{Label}</span>
{/block:Label}

{Line}
</li>
{/block:Lines}
</ul>
{/block:Chat}

{block:Video}
<class="post video">
{Video-500}

{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
{/block:Video}

{block:Audio}
<class="post audio">
{AudioPlayerBlack}

{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
{/block:Audio}
{/block:Posts}

<p id="footer">
{block:PreviousPage}
<a href="{PreviousPage}">« Previous</a>
{/block:PreviousPage}

{block:NextPage}
<a href="{NextPage}">Next »</a>
{/block:NextPage}

<a href="/archive">Archive</a>
</p>
</div>


<div id="footer" style="background-color:White;clear:both;text-align:center;">
Pockets has no idea what he is doing</div>

</div>
</center>
</body>
</html>

34s55av.jpg
 
A pro like DBT, Shu, etc could probably answer this better than I. :grin: I'll take a crack at it, though. :ohshit:

1. HTML, XHTML & XML are generally considered mark up languages. They lack loops, variables, functions and other assorted characteristics of programming languages. Mark up languages are used to format data & the typical format is data formatted <tag>data</tag>.

2. If you're learning javascript and css, it may help to know a little about their background. :ohshit:

The 3 key things to know about javascript are... A) its a client side language B) its the most common means of developing asynchronous web applications and C) its useless as far as security is concerned.

A) Client side languages like javascript were developed to reduce strain on servers and bandwidth. The idea is to have some functions performed on an end users browser(client side) rather than a server(server side). Like say a server hosted 1,000 forums. And, each forum had a chat or shoutbox. Rather than 1,000 chat windows / shoutboxes run serverside consuming CPU cycles, bandwidth, and RAM, it would be more economical to delegate those applications to running on an end users browser & having data processed on an end users machine. Its delegation in terms of moving processes from a server to an end users machine are one of the reasons client side languages like javascript were developed. Not a big deal, now. Everyone has broadband internet and can stream video, etc. But, back in the days of dial up, etc it was more of an issue. :grin:

B) 'Asynchronous' implies a language can operate 'out-of-sync' with browser pages loading or reloaded. Clocks that count in real time without re-loading a page are 'asynchronous'. Shoutboxes, chats, etc operate asynchronously also. Here's an example of an asynchronous game written in javascript(you can play without registering, etc): http://deathraygames.com/play-online/drg/greenhydra/index.html Javascript(ajax, etc) is good for building interfaces, applications, etc which function independently or 'asynchronously' of page load/reload.

C) Javascript isn't good for mandatory features as some browse with it turned off. Being that its client side and integrated into an end users browser implies it can be tampered with & data executing can be manipulated & edited.. It should never be used for user authentication and other things involving security or privacy, etc. :elmo:

CSS is basically a design abstraction. In an ideal sense, the key thing developers strive for is modularity in terms of separating content from appearance and code. This makes it relatively easy to plug and play different skins, themes, etc. CSS is like OOP where a 'class' is defined once in a centralized location & used multiple times where necessary to avoid having to define everything everytime you need it.

Rather than have a document where <font color=black> is utilized everytime black text is needed, there is an effort made to separate styling and appearance cues from data to achieve modularity and cleanliness.

My question is this, I know that those three (HTML, CSS and Javascript) can all feed into each other well, but how, exactly, do they? Is it a Basics>Formatting>Animation relationship?

Basically, there's a header declaration that tells the browser how to interpret the data. If its XML there'll be a declaration that says something like:

If its javascript, there'll be a declaration that says: <script type="text/javascript"> -javascript goes here- </script>

With CSS the declaration will be: <style type="text/css"> -css goes here- </style>

And, there are ways to link to remote .js or .css files via <link rel>.

Tumblr layout --

1. If you're referring to the big link that says "Skyrim" you'll want to view source and see which tags encapsulate it. If its encapsulated in the footer area, you'll want to edit the style there.

This will tell you how to style links: http://www.w3schools.com/css/css_link.asp
And, this will say how to style text in terms of size, etc: http://www.w3schools.com/css/css_font.asp

poop
 
HTML is the wall of your house, css is the wallpaper/paint

HTML is used to structure a webpage, whereas CS is used decorate it. It's that simple

As for how they feed into each other, that's simple too. There are three methods, inline, embedded, and external. Inline is where you declare what the element looks like in the tag, embedded is where you have all your css at the start of the file, and external is where a link references an external CSS file. External is by far the best, so I will explain it.

In your html file, in the head i.e. <head> </head>

you would post this <link rel="stylesheet" type="text/css" href="mystyle.css" />

where mystyle is the name of a document called mystyle and saved as .css

so

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>

So an example would be as follows

In your CSS file

h1
{
font-family:Trebuchet MS;
}


Then in your html files any text in the tags <h1>alalalala</h1>

Would be in the font Trebuchet MS. Though just to clarify h1 is a pre-designated tag for a type of header in html, I was just showing you the format of a css element

That is a pretty basic example, but these things are best learned by doing. So here are the best tutorials to get you motoring, and good luck

HTML Tutorial
CSS Tutorial
JS Tutorial
 
Last edited:
I see, so I was fairly close with how they relate. :hmmm: So essentially, CSS is to create basic templates to call on reference for a page (I assume you can also use it for objects?), while javascript creates individual applications or objects to operate independently of the pages?

@Licky Those are actually the tutorials I've been using, they were by far the best I saw. :lew: and aye, because of the HTML tutorial there I am indeed familiar with the headings. Good explanation of CSS, thanks.

@Riddick Little more than I needed there, :wacky: but I suppose detailed responses are always favorable to barebones ones, and you did indeed answer my question as well. I did not actually open your links, as I noticed the path led me down the CSS tutorial. I'll get around to working on that from square one today as I read up on CSS, but thank you for the link. ;) No wonder I was uncertain as to how one would style them, it's in the next part!


Thank you both for your answers.
 
Last edited:
Do you mean this part?

CSS is to create basic templates to call on reference for a page (I assume you can also use it for objects?)

If so, what I meant by this is that if you could create templates for a page to use, could you not also use it for objects? Or rather, can you call an template so as that an object would inherit the attributes of the template.

A decent example may be, say you have a shoutbox, would you be able to call a template for this shoutbox? Meaning changing the location/name within the coding would refer to another .css, making a quick swap between styles of an item on a page, instead of the entire page, should one so choose.
 
I see, so I was fairly close with how they relate. :hmmm: So essentially, CSS is to create basic templates to call on reference for a page (I assume you can also use it for objects?), while javascript creates individual applications or objects to operate independently of the pages?

CSS separates presentation from data.

Say presentation and data were intermingled. It would look something like this:

[Presentation/Data] <------- Everything dumped into one huge file. Difficult to read, unorganized, inefficient, etc.

What CSS does is to provide modularity and to separate the abstracts, so it looks more like this:

[Presentation(CSS)] ----- [Data(Content: images, text, etc)] <-------- Separate files.

With both abstracts separate, it makes it easier to plug and play things like skins & templates. Content is easier to edit, process and utilize also. Its similar to OOP and classes in terms of there being one(or a small number of) file(s) that needs to be changed and multiple instances of the single file distributed throughout.

Like say if you had a website with 200 pages & you wanted to change the appearance. You would only need to edit one .css file to make all 200 pages look different. You wouldn't have to edit all 200 pages.

Its the same with classes and OOP where there's one file containing the classes and multiple instances. To change things you only need to edit the single file containing the class, you wouldn't have to edit all 200,000 lines of code containing class instances.

The more strongly bound the abstracts(in programming theory terms) the less clean, more difficult to read, and less elegant things generally are.

CSS also contains inheritance as classes & OOP do. Its a different type of inheritance, though. :elmo:

The only reason I'm mentioning it is because its a basic fundamental of good design & something that can be applied in different areas. It is worth knowing.

edit -- I'm not doing my pov justice, but wateverz
 
Last edited:
You could have explained that in two sentences

Also

I am assuming you mean object oriented, in which case. What?

Either way I did a shit job of saying what I wanted to say & a polymorphism / oop purist might crap themselves just thinking of it. :grin:

Uh, OOP -- object oriented programming(?).

I think the more a person deals with so-called "purists" the more they might realize how heavily some areas of programming are inundated with zealots and fanatics who support design abstracts in favor of common sense. In a lot of cases, its not really education its moreso indoctrination. Its think this or believe this in blind faith without really understanding it. There may be a lot of so-called "academic purists" sacrificing functionality in favor of some abstract design paradigm with all the fanaticism and blind faith of a programming jihadist. That's my view of it, anywayz, I'm sure some might disagree. :ohshit:

...

Long explanations are better than short, concise, ones.

There are a ridiculous number of people in the world who believe everything in life should be as convenient and quick as a mcdonald's drive thru. Its like if something takes longer than 2 minutes, its: "not worth doing".

-If they can't read something in 2 minutes, its "not worth reading".
-If they can't make a girl orgasm in 2 minutes, its "too much work".
-If they can't understand everything about a political issue in 2 minutes, its "too much effort".
-If they can't recall which policies and programs a candidate supports, its "not important". Yet, they vote anyway and screw things up for everyone else but not understanding things well enough to make a good choice.

Its not a healthy mentality to have as it may imply someone'll never progress beyond scratching the surface on anything.

Don't think I'm singling anyone out, btw. I have the same problem also sometimes, I just try to be aware of it and avoid it. :ohshit:
 
...

Long explanations are better than short, concise, ones.

There are a ridiculous number of people in the world who believe everything in life should be as convenient and quick as a mcdonald's drive thru. Its like if something takes longer than 2 minutes, its: "not worth doing".

-If they can't read something in 2 minutes, its "not worth reading".
-If they can't make a girl orgasm in 2 minutes, its "too much work".
-If they can't understand everything about a political issue in 2 minutes, its "too much effort".
-If they can't recall which policies and programs a candidate supports, its "not important". Yet, they vote anyway and screw things up for everyone else but not understanding things well enough to make a good choice.

Its not a healthy mentality to have as it may imply someone'll never progress beyond scratching the surface on anything.

Don't think I'm singling anyone out, btw. I have the same problem also sometimes, I just try to be aware of it and avoid it. :ohshit:

Length has no bearing on whether an explanation is good or not, thinking 'oh this is long it must be good' is silly. You can pad an explanation out with lots of redundancy by saying things over and over again which is redundant and just pads things out. Anyways none of this remotely approaches being on topic. Now please tell me why,

"OOP is ridiculously overhyped and played out. Its nothing really special or a big deal, mostly just a bunch of fanboys getting excited over nothing."
 
There is nothing to get, almost every language is OOP or supports OOP concepts, it's been around for years now and is practically a standard. You were touting the modular nature of CSS which is not very far from OOP itself. Please support your thus far baseless claim that

"OOP is ridiculously overhyped and played out. Its nothing really special or a big deal, mostly just a bunch of fanboys getting excited over nothing."

You can either wave me off again because you do not know what you are talking about, or you can explain what makes you say the above
 
Edit: Should have cleared the formatting from the code before applying new colors. My standard font color is still applying. Lawl.

I do have to agree that OOP makes more sense than any sequential coding of considerable length. :hmmm: I find it very easy to follow.

Anyhow, I have a question now. I didn't manage to get around to the CSS tut yesterday, and doubt I will finish it today, so if the explanation is further on feel free to tell me so. :neomon: It goes back to styling my links, so here goes.

This code is placed under head, and recognizes the a:link{text-color:black;} on line 8. I'll color the lines to further clarify, even though I could simply take a screen.

body {
background :#FFFFF0
url ('http://i49.tinypic.com/23hogog.png')
repeat-x
fixed
top ;
}
a: link {text-color: black ;}
a: visited {text-color: black ;}
a: hove r {text-color: black ; text-decoration:underline;}
a:active {text-color:black; text-decoration:underline;}


My question, however, is this, why does placing the link styling within the body portion not recognize the a:link{text-color:black;} as any kind of command, yet every other type of link style? Here is the code for placing it within the body.


body {
background:#FFFFF0
url('http://i49.tinypic.com/23hogog.png')
repeat-x
fixed
top;
a:link {text-color:black;}
a:visited {text-color:black;}
a:hover {text-color:black; text-decoration:underline;}
a:active {text-color:black; text-decoration:underline;}
}


Let me know if I wasn't clear, I'm really not trying to be confusing. :hmmm:
 
Ah, wtf, I'll try to answer. :ohshit:

Its a local vs global variable issue.

If you have something like...
Code:
<style type="text/css">

a:visited {text-color:black;}
a:hover {text-color:black; text-decoration:underline;}
a:active {text-color:black; text-decoration:underline;}


.footer a:visited {text-color:white;}
.footer a:hover {text-color:white; text-decoration:underline;}
.footer a:active {text-color:white; text-decoration:underline;}
}
</style>

<body>

blah, blah, blah.
link, link, link

(these links will be black being encapsulated within <body> tag)

<div style="footer">

blah, blah, blah
link, link, link

(links here will be white as the variables/values relating to the "footer" property are [B]local[/B] and don't coincide with values related to the <body> property/tag/whatever)

</div>
</body>

Values/variables can't be global across the board. It wouldn't allow the parititioning / separation necessary to have different color fonts or different styles within the same document.

Hence, they're local. :elmo: Targeting a specific area depends upon which tag or style encapsulates a certain area as variables / values are localized.

I guess that's pretty much it. :hmm:

edit -

Oh! Also, unless tumblr uses their own unique css format this is incorrect:

body {
background:#FFFFF0
url('http://i49.tinypic.com/23hogog.png')
repeat-x
fixed
top;
a:link {text-color:black;}
a:visited {text-color:black;}
a:hover {text-color:black; text-decoration:underline;}
a:active {text-color:black; text-decoration:underline;}
}

It should be:

body {
background:#FFFFF0
url('http://i49.tinypic.com/23hogog.png')
repeat-x
fixed
top;}

a:link {text-color:black;}
a:visited {text-color:black;}
a:hover {text-color:black; text-decoration:underline;}
a:active {text-color:black; text-decoration:underline;}

1. Brackets {} in CSS don't nest as far as I know. The BODY bracket can't nest over a:link which contains their own brackets.
2. The first a:link isn't highlighted(underlined). = error.
 
Last edited:
That is exactly the same as the first code I posted, which I noted was valid, though? I am asking why it is valid there, but not within body. Closing that bracket ends my declaration for body, meaning that declaring it outside while remaining within the head is, indeed, making it global. Correct?

If so, placing them within body, on the other hand, would "practically" be assigning it as a global, without literally doing so, is what I am thinking.

Simply put, it seems like quite the opposite of what you said, and I cannot assign local variables for different elements.

and I do hope I'm not coming off as a cunt, I'm just failing to make connections. It doesn't seem to make sense to me. :ffs:


Edit: Although it did not answer my question, your first example code gave me an idea. Thanks. ;)
 
Back
Top