plus4chan
ImageboardsRadio
Site Theme...
imageboards
Main FAQ [ baw] [ co / cog / jam / mtv / tek ] [ ck / coc / draw / writ ] [ pco / coq ] [ a / op / pkmn ] [ n ]
Technology

 Posting a reply to post #800
Name
Email
Subject  
Message
File 
Embed  
Password  


Embedded Video: youtube.com/watch?v=qYodWEKCuGg
No.800
  I know some basic C++ and some basic Java. Any good suggestions for what to to do to learn more? And which language to concentrate on?

And, general programming thread.

Expand all images
No.802
try a simple chat program in Java.

to do that all you need to know about are threads and sockets. if you haven't learned about those yet you should.

report back when you're finished.

No.811
CONTINUED FROM FREEWARE STICKY.

Assembly is mostly used today on machines that do not have an operating system (like battle-robots but even those are moving on to C) or parts in a computer that work below the operating system. operating systems themselfs today are written mostly in C and C++ though the current Linux Kernal has some Python in it too.

C is used in relatively simple programs where speed is a necessity.

C++ is used in more complex programs where speed is still very important but you just can't spend the time to write it in C. most computer games today are written in C++ so that they can have the INCREDIBLE GRAPHIX and 60 FPS's.

anything else should be written in a new gen language (Python FTW) because it is much easier to write, read, and maintain code for such programs.

so if you're aren't a big company or working with robots I recommend Python for everything you do.

No.818
>>811
for phone aps, Java is a must though, no?

No.820
>>811
Thank you.
I'm not really a big programmery type guy. The last time I tried to get myself involved in codemonkeydom was 2002. Managed to make a little compiled function that'd let a person multiply two different numbers in Java. Also made separate functions for addition and subtraction, but they weren't together in a visually appealing series of boxes or buttons or anything.

That said, I think if I were gonna take up programming it'd be an attempt to work towards learning C, or even assembly. Why?.. Because if I'm gonna make a hobby out of it, I want a dinosaur that shows off the love and time I put in by being compact, scary to read by people that aren't me and powerful. Sounds sweet, bro.

No.829
>>818
that's because today phones have operating systems

No.833
  .

No.836
  >>833
>code monkey just like me
this is a depressing glance into my future.

another example of how today's computers run scripting languages very fast. if you're diligent enough I'm sure you can use this engine and the low poly TF2 characters to make a java TF2

No.947
  this is one of the better programming channels on youtube. learned how cluster computing works very fast.

watch lecture 4 for hot chic programmer

No.951
http://diveintopython.org/index.html

Regarding Python, I hear this is a good place to start learning

No.1438
Hi. I'm trying not to tl;dr, but I've a lot to say.

I'm thinking about flirting with programming. Not for a source of income, but as a hobby. The trouble is, while being able to use a high level language might be a good primer for more things, I'd ultimately like to learn how to work magic in very low level languages.

I realize learning high level languages might be easier, especially given that my current level of comprehension is firmly Babby Tier. But the whole point of learning to program at all for me would be to rip out as many shortcuts as possible to make the best, most efficient code as can be for the purpose I'm putting it to. Which would be absurdly efficient programs for modern computers.

I don't even know all the things I don't know, and need to know, to get where I'd like to be.
Assuming I didn't want to spend money on a course that I could just as easily drop out of if it's not for me, where would I start? What books would I need that'd have the material to get me from relying on Windows for everything to writing my own drivers in machine code?

It doesn't have to be a quick and painless process. Just one that's clear and makes sense. :X

No.1439
I took a MATLAB course last semester, but I'm pretty sure that's not really programming. I think it got me off to a good start, though. What's the best way to ease myself from that into real programming?

No.1440
>>1439
C, it will grow hair on your chest.

No.1442
>>1438
just take a course in Data Structures and algorithms and you'll know everything there is to know.

everything else like releasing and keeping information on your heap is a complete pain in the ass and only useful when you're running a bitchload of data.

No.1443
>>1442
Really? 'Data Structures and Algorithms'?
...
What else? C'mon man, there's got to be more.

No.1447
>>1443
ever read homestuck? it's all just Queues,stacks,Arrays,Trees(balanced/unbalanced),Hashmaps ,heaps and a bunch of sorting algorithms out of which only bucketsort, mergesort and heapsort are worth knowing.

no, really, there are no such things as L33T programming tricks. they sometimes write stuff in older languages if they want it to run faster but that's just a pain in the ass.

No.1451
>>1447
As a self admitted pain in the ass, I think I can live with that. But no. I've never read anything like that. That's part of my problem.

No.1454
>>1451
never read homestuck?
it's all the rage down in +/co/
http://mspaintadventures.com/

No.1459
>>1454
I am confused but compelled.

No.1464
File: 127739435966.gif-(31.18KB, 650x450, Array.gif)
1464
OK, inexperienced programmer, listen up!
I will be explaining stuff you NEED to know.

Lesson 1: the Array

an array is a piece of consecutive memory of a certain length which we use to hold memory.

the length of the array is the size of a single Item times the number of Items we want to keep.

so for instance, if we want to keep 12 ASCII characters, each of which is one byte long, we will need 12 bytes.

Note that for a computer it is extremely easy to get to each character. assume we want to reach the 4th character. the processor takes the address of the array and adds to it 3*(size of a single character) and we have the character we wanted! just 1 calculation to reach a certain characters. as cheap as we can have it.

this is why arrays are easy on the processor and should be used if we are going to go over a certain piece of memory a - lot.

however, Arrays are not always the best choice for us. more on that in lesson 2: pointers

No.1465
File: 127739528367.png-(28.06KB, 480x480, linked-list.png)
1465
Lesson 2: the pointer.

now Imagine we need to have go over a list of megabyte sized objects, what should we use?

an Array you say? well No!.

imagine saving a list of 12 megabyte sized objects. that Array would be HUEG. and theres a good change your machine won't find a consecutive piece of memory that big. well what should we do then?

here comes the pointer. a pointer is an Integer. a simple 4 byte (depending on your machine) piece of memory. which we use those to point to other places in our machine.

SUB LESSON: The Pointer Array.
a pointer Array is an Array of pointers (duhhhh). not that we can now save our HUEG memory blocks in different parts of our machine, allowing making it easier for the computer to find places to store them. -> this is what we usually use.

SUB LESSON: the Linked List.
a linked list is a trick some people use to make a more flexible Array, they save a single pointer to a single block of memory, that block has both a piece of memory and another pointer, this one to the next block of memory and so on and so one.

note that this is not as fast to go over as an array. to get to the third item is a linked list we must go through all the previous pointers. to get to it.

No.1466
>>1464
>>1465
This is helpful and interesting.
Moar?

No.1467
File: 12774023572.png-(31.94KB, 275x345, binarytree.png)
1467
>>1466
ok.

Lesson 3: Order.

usually we need to access members of an Array in a certain order.

Imagine, for example, we need to find the minimum of the Array.

[13 , 4, 5, 3, 12, 6 ]

we would have to go over ALL of it's members to do so. something we definitely don't want to do. is there a better way.

usually at this point the simple student shouts out "keep an ordered Array!". in a way he is right, this will allow us access to the minimum of the array in just 1 action.

[3 , 4 , 5 , 6 , 12 , 13]

now, what if we want to insert a number into an array?
this will require us to go over almost ALL the members till we find the proper place to find it.
this is just as bad as the previous example.

if the first example we have to only do 1 operation to insert a new number ( just stick it anywhere )

but have to do N (N = size of array) operations to get the minimum out

in the second we have to do N operations just find where we have to put it but only 1 operation to get it out

is there a better way? apparently there. there is a way that requires log(n) operation to insert a number and log(n) to get the minimum out

this is a Heap.

[ 1 ,4 , 33 , 12 , 11 , 45 , 100]

this is a little hard to understand at first. ( see image for maximum heap )

note that the first number is the minimum. the second and third numbers are larger then the first number, the fourth and fifth numbers are larger then the second number and the sixth and seventh numbers are larger then the third numbers.

am I clear?

this might explain better
http://en.wikipedia.org/wiki/Heap_(data_structure)

No.1468
>>1467
Hrm.. It's not totally clear. I think I'm missing something, but I don't know what. :X
I'll stew on it awhile. But if there's any more, please continue!

No.1469
>>1468
brb sleep

No.1472
I've been dabbling a lot with SQL Server lately at work. It seems like I need a lot if I want to get to a database admin type level.

I feel like I don't need to know full on java (although I am going to school for a Comp Sci major right now) but I do think I need to learn some sort of scripting language(s).

Recommendations? I've thought about Java, C#, Powershell, .NET, VB/VBA, as well as learning XML protocol.

No.1474
>>1472
Python is fun.

No.1480
File: 127757628577.png-(10.63KB, 289x218, heap-example.png)
1480
>>1468
Heaps are better explained as a binary tree

see that each parent Node has two sons and that both sons are lesser in value to the father?

not watch, when removing the max value of a heap all we have to do is replace it with the maximum of it's sons. which in turn has to be replaced with maximum of it's son and so on until we reach the bottom or a parent with only one son.

that means that when removing a value we have to do just a small constant number of calculations for each level (finding the maximum and replacing it with it's son). since in a balanced heap (we make sure that it looks more or less like a full heap) we have around log(n) levels that gives us log(n) calculation to remove a number.

when inserting a number we put it at the first empty spot in bottom row. (see red arrow) and then move it up the ranks until we fulfill the heap law (each parent is larger then it's sons). this again log(n) calculations.

TA DAH!

next hash maps.

No.1481
>>1480
Imagine this situation. you have a long list of information about your friends and you want to access the information about Coelasquid
because
you love her

and you want to find her in your computers memory. you would have to go over the entire list of friends and compare their names to hers so that you are able to find her info. and that's terrible.

here comes the hash table. for a proper hash table you will need a big array, the number of your friends square, and a hash function, usually it works like this, it takes all the characters of her name raises them to the power of some huge ass prime number. then mods them to that number, then mods them to a still big but much smaller prime number and then mods them to the size of your array.

this is very easy for a computer to do.

the computer then goes to that spot on your array and stores her info there. now note that you could with the same simple calculation find that number again and then access her information directly without going over the entire array.

there are different types of hash maps but they only differ in what how they deal with two different values getting the same position (most just use a list of all the values in that one spot).

and that's a hash table, should be simple enough.

and that's all I can teach you because I have 4 exams in 3 consecutive days and require much resting and studying time.

No.1485
>>1481
No rush, anon. I appreciate the fact you're taking time out of your day to explain these. Probably more than you'd ever believe, as I don't do the whole 'learn me a book' thing very well.

Sleep well.

No.1500
>>1474
Python IS fun

Here's a little text adventure I did for my final in my programing class.

http://www.mediafire.com/?ztyyzmmtgmy

No.1504
>>1474
>>1500

Are there a lot of business related uses for Python? I'd love to look into Python, but I'm already trying to learn a pile of stuff for work. Right now I'm not that interested in looking at another language on top of everything else if I can't apply it to where I am right now.

inb4 being in the wrong industry

No.1507
>>1485
TESTS ARE OVER, for now....

ok, last lesson is sorting.
there are lots of sorting algorithms out there. and all of them will (eventually) sort your array.

a big law here is the n*log(n) barrier a math-a-magician once sat down and used math to prove that a sorting algorithm over a random array can NOT be better the n*log(n) complexity, n of course is the length of the array, and complexity is how harder an array is to sort the longer it gets.

there are two well known and well used sorting algorithm which are perfect AKA reach the n*log(n) no matter the array.

these are MergeSort and HeapSort.

you remember heaps? remeber that inserting and removing a value is log(n) complexity? well what if we do that for each value in an array of length n and then remove them all?

we get a sorted array, and we did it in n*log(n). this was easy.

MergeSort uses a different approach but I like it better because the algorithm is so short. the Idea here is that it's easier to sort a shorter array. and that combining sorted arrays is easy too, so we divide the array onto pairs (sometimes living one lonely value) and sort them. then merge the sorted couples and so on and so on till the entire array is sorted.

heres a better explenation
http://en.wikipedia.org/wiki/Merge_sort

the nice thing about this is that this can be easily done with (almost) no extra memory.

the last and most used is bucket sort.
now bucket sort has a trick. it requires you to know the highest values and lowest values of an array but with this demand it can break the n*log(n) law and reach n.
it demands lots of memory and works better with a good distribution but it's still faster then most.
bucket sort is how your OS sorts.

http://en.wikipedia.org/wiki/Bucket_sort

No.1517
>>1507
So you've elaborated on data structures an' arrays and some neat things. I appreciate that. Quite fascinating and gives me something to chew on.

Any moar? Where does the wacky world of computing type machines go from there? Anything laterally important and basic? Anything lower level than that? Higher?

No.1518
>>1517
nothing i can think of really

No.1611
I have a question. I'm not sure how to word it.

The way I understand languages, high levels are either cross platform or universal by design now. They're made to be able to run and compile on all machines.. or as many as possible. Low levels are as unergonomic as eldritch language, but speak directly to the machines. However, they only speak perfectly to the most synchronized of machines.

One of the (many) reasons using assembly to optimize for every machine is impractical being that every machine is different in ways, some more fundamental than others.

Does this mean that languages like C and higher only affect and access the most basic and unchanging of code? Stuff that's static and otherwise unlikely to change unless computing itself is radically rethought?

No.1617
>>1611
you have so much to learn..

look at it this way. you want to send a message to some device so you use the bullshit() function.

now, different computers have different devices plugged into different sockets with diffrent cables etc... the way people over come this is have the bullshit function check where the device it requires is plugged in and then sends to it the message. maybe even have a different function for macs and another one for windows.

just because it's higher level doesn't mean that it can't operate on the machine level. it just means that it can operate on a simpler level as well.

No.1620
>>1617
Which is why I ask questions. You can't query books, just read them.

No.1622
>>1620
hey ram, now that I have some free time, wanna write some code project in c++ together? it might be fun! wanna choose what we're going to do?

No.1623
>>1622
'Fraid I'd be in a strictly observational role of the process, if anything. The stuff is interesting, but to be honest I wouldn't know my elbow from a compiler.

No.1671
>>1623
OK, I got an Idea, we'll make a compiler for the .^cake.

but I'm too unimaginative to think of what the syntax should be like.

so any Ideas, anyone?

any Ideas?

No.1720
A friend of mine just sent me The Art of Assembly Language; Second Edition.
This will probably be like watching a peep in the microwave, but I'll record a journal of my thoughts every chapter. Expect pain and the palming of face at my comprehension skills.



Main FAQ [ baw] [ co / cog / jam / mtv / tek ] [ ck / coc / draw / writ ] [ pco / coq ] [ a / op / pkmn ] [ n ]
0.0099709033966064 (0.01 seconds )