Programming @4-ch

Programming @4-ch

Be it HTML, C++, Java or whatever language you prefer, programming is what we do best around this board.
Markup languages are also fine around here, as with all the "not so real" languages of Shell script, CSS, and other various third party scripting languages.
  • We are sick of language discrimination, more so the PHP/Java bashers. There will be little tolerance of blatant and repetitive insults. You are still welcome to bring forward a sensible, insult-free argument regarding a certain topic at the appropriate time and place for it.
  • Please use WakabaMark or the appropriate HTML tags (with HTML enabled, of course) to format your code.
Rules · 規則
基本的には英語の使用を強く希望します。ただ日本語板の場合は日本語か英語。
Board look: Blue Moon Buun Futaba Headline Mercury Pseud0ch Toothpaste

6.034 (2)

1 Name: #!/usr/bin/anonymous : 2013-06-16 19:00 ID:67KbQzeh

I expect most people here have done 6.001 (if not I strongly recommend it)

So now I'm thinking 6.034 would be fun to do online
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-034-artificial-intelligence-spring-2005/lecture-notes/

who is with me? I asked another text board but didn't get a great response.

2 Name: #!/usr/bin/anonymous : 2013-07-01 10:02 ID:0PeRK0kb

How could we contact you if we wanted to do it with you?

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Best language for starting out in functional programming? (18)

1 Name: #!/usr/bin/anonymous : 2011-01-16 01:16 ID:MSrpsEZ8

I've seen great web tutorials for Haskell, but is there any better entry-level language that teaches me to no longer think like a computer?

9 Name: #!/usr/bin/anonymous : 2011-04-01 15:03 ID:RY2DkG9Y

Erlang it's simple and cute.

10 Name: #!/usr/bin/anonymous : 2011-04-03 20:48 ID:zsE0Fk7Y

11 Name: #!/usr/bin/anonymous : 2011-05-04 18:51 ID:Heaven

>>10
this

12 Name: #!/usr/bin/anonymous : 2011-06-21 20:59 ID:rFlW1GZm

>>4
I suspect "thinking like a computer" would mean thinking in concepts of having to do stuff in a predefined algorithm sequence, which functional programming (according to my very limited knowledge of the field) appears to avoid.

13 Name: #!/usr/bin/anonymous : 2011-06-23 10:54 ID:kxTuZB/4

>>12

No. Functional programming also works in a "predefined algorithm sequence" (that's the whole point of programming, innit).

What it does, it tries to get rid of this idea, which is brittle (i.e. difficult to get right):

You have a state (a bunch of variables with their values at some time t) that you manipulate with procedures so that at time t+1, the values of those variables has changed and the set of variables has changed.

Instead the approach is:

You have functions (machines that transform input values into output values, where the input values and output values can themselves be functions) that you apply on values to get a result (and any state is temporary and just an artifice of expressing how your function works).

14 Name: #!/usr/bin/anonymous : 2011-08-27 01:10 ID:kESQsA7D

I think "a computer" >>1 means is so-called Von Neumann-type computer.

Procedural programming needs global states, variables and substitutions like current computer architectures.

Functional programming also has values but they never change once they have been defined, and yet it works because of λ-calculus like >>13 said. 

I recommend Haskell for Functional programming novices too.
Haskell is a bit idealistic language, but people can learn a lot for it.

15 Name: #!/usr/bin/anonymous : 2011-08-28 20:33 ID:DxVyW/QZ

Ruby. The Best of All EVER.

Simple. Beauty. Force.

Just Works.

require 'sinatra'
get '/' do
"Hello World!"
end

Web-server with hello-world-main-page. 4 lines. :)

p Array.new(gets.to_i){gets.to_i}.sort

Post too long. Click to view the whole post or the thread page.

16 Name: #!/usr/bin/anonymous : 2011-08-29 01:37 ID:Na6H161a

>>15
I want to punch you in the throat.

17 Name: #!/usr/bin/anonymous : 2011-09-10 03:13 ID:Heaven

>>15
I can do that with Node.js, or any other framework out there. That is still stupid. If you don't understand why "my_whole_web_site_just_work();" is lame, please stop programming.

I know, I've been trolled once again :(

18 Name: #!/usr/bin/anonymous : 2013-06-25 22:22 ID:KBxwh9MV

Such baseless novelties, try Nimrod, son.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Active (4)

1 Name: #!/usr/bin/anonymous : 2013-06-10 03:11 ID:NiAzxatO

How active is this board? I'm looking for a bbs or imageboard for discussing programming that's active and fairly troll-free. Is this the one, and if it isn't is there any luck finding another one?

2 Name: #!/usr/bin/anonymous : 2013-06-11 18:30 ID:ed/ODC4M

well, i'm here. Third time on this board, amateur, don't know much, but mostly harmless.

3 Name: #!/usr/bin/anonymous : 2013-06-12 22:36 ID:e7VR1nJ3

I lurk here. I usually can't post since I use the mobile site, which doesn't have a field for posting.

But yeah, hello.

4 Name: #!/usr/bin/anonymous : 2013-06-13 13:35 ID:qagBr5pS

Another reader. I check all the boards frequently enough, about once every two days, but I mainly stay on DQN.
>>3 I browse the mobile site and change the "mobile.pl" in the URL to "kareha.pl" when I want to post. It's slow, but it does the job.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Introduction to complexity and the idea od quantum computers (3)

1 Name: #!/usr/bin/anonymous : 2011-06-20 10:48 ID:8Esf3C5Z

This is rather cool:

"Quantum Computing and the Limits of the Efficiently Computable - 2011 Buhl Lecture"

http://www.youtube.com/watch?v=8bLXHvH9s1A

Link contribs?

2 Name: #!/usr/bin/anonymous : 2013-04-08 14:44 ID:El6PKSVm

if you care so much about those real people i suppose you give them your lunch money, not mine

3 Name: #!/usr/bin/anonymous : 2013-06-03 21:56 ID:LrikhVx6

It already exists.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Is Ruby as inefficient as they say (2)

1 Name: #!/usr/bin/anonymous : 2013-05-04 05:49 ID:pe6UtPea

I'm looking into mobile development, and Ruby looks really nice, but I heard it's fairly slow. Is it really as bad as they say? If I don't use Ruby, and I absolutely hate Java, what's a good language for developing software for Android?

2 Name: #!/usr/bin/anonymous : 2013-05-09 22:49 ID:Heaven

Ruby is fairly slow, but much of what you see on the internet about it is exaggerated.

> If I don't use Ruby, and I absolutely hate Java, what's a good language for developing software for Android?

Clojure or C.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Opinions of Codecademy? (8)

1 Name: #!/usr/bin/anonymous : 2012-10-29 14:47 ID:A/bsuojT

I'd really like to use the site http://www.codecademy.com to start learn Javascript and then go on to either Python or Ruby. To more experienced programmers or anyone who has tried the site, what do you think of it? I realize I'm not going to be a Ruby wizard in a month, but is it good for what it does?

Also, I am somewhat concerned about their privacy policy. ( http://www.codecademy.com/policy ) It seems really ambiguous and their signup page has built-in Facebook/google integration. So I feel kind of wary to sign up of give them any of my information.

2 Name: #!/usr/bin/anonymous : 2012-10-29 16:00 ID:QERsyNf4

I'm using it at the moment OP, I think it's a good introduction, and the Q&A forum is helpful if you get stuck.

3 Name: #!/usr/bin/anonymous : 2012-10-30 17:03 ID:UTJWSg78

OP, the most important thing is that you do it consistently. Just keep practicing. I haven't used codeacademy, but I'm sure it's just fine for an introduction.

Although, OP, you would probably be just fine jumping right into Python or Ruby, because they're relatively user friendly.

4 Name: #!/usr/bin/anonymous : 2012-11-01 14:17 ID:GCQAnVl1

>>2>>3
Thanks.

So once I'm done with JS, which should I take, Ruby or Python?
I am more interested in writing Web-related things.

5 Name: #!/usr/bin/anonymous : 2012-11-04 08:55 ID:4BUdibj3

>>4
They are equally capable of web-related things. Ruby is more popular for such things, but that's mostly because Ruby on Rails is more or less what made the language famous.

I suggest trying some small things (puzzles, toy applications) in both and choosing the one you like.

6 Name: #!/usr/bin/anonymous : 2013-03-09 03:41 ID:PIes3y5M

I use code academy, i gotta read that privacy policy :p

7 Name: android dev : 2013-03-27 20:42 ID:k58uh+++

Hello Guys,

i am progamming android apps for 2 month. Now i already have 2 apps. I
am progamming android apps because i want to improve my java
knowlegde.

My apps are free and there is no advertisement in it. So i dont make
any money with these apps, but that is not important for me. I focus
on learning programming and its great!

If more people would download my apps and give me feedback, i would be
able to improve it. Besides that it would give me more motivation to
make more and even better apps! :)

My first app is called "BONGI" and my second is called "GROBI".

Post too long. Click to view the whole post or the thread page.

8 Name: SomeAnon : 2013-04-04 01:55 ID:/zEVA4yC

>>7
cool beans

        ... .... ..... . ..................     ........... . ..            
..+$?I777I?$... ...+====:::~=?,.. . ....++======+...
....Z7ZZZZ$$$$ZZ$I....$=I7$$ZZ$7+=::+........I=:,::,,,,..:+,....
..:7ZZZ$7?+~,,~+ZZI..$IZ$ZZZZZ$=..++:+......?$O+,,:I=+=~:,.:?..
..7OOZ$7?+++=:,,+Z77.?8ZZZZZZZ$+..:?=~I....+~=+~,~+?O=:,.,:.=,..
.$OOZ$77?++++=:,=$$?778ZZZZ$ZZZ$=.:+I==O..,DD?+==+=++=:,..:,,?..
.$OO$$$$I?++++::+$$I$$8$ZZZZZZZZ$I+?7$8$,.N$NMMONMNNNO=:.:~:,?..
+8OO$$$$7I++++~~?$Z7778Z$+ZZZO8OZ$I?8D+++.8ZNM?+?MNNDOMD?~:,,?..
Z8OZ7$ZZ$7I+D8ND?$N8?78ZDOZZZZNDO7ZZZ$7=+:I,+7ZI+?NN$O~,~+:,,?..
. ..NM877$ZZZ88$??==I$Z$,I8Z$Z$ZMMMNOI8Z777I=?+~?ZMNN+++++=,~~,.:+..
...ZNNZO8OOO8888DZ=IZ$N8D8NNMMN8MMMN8Z$777$=O$ZII887++++++~,~,.:O..
....$8ZI7ZDNMNNNMD$$MNMNN8MDNMMD7$O$$8$$$$$$$?DZ7Z$?+++++++=:~,.I?..
Post too long. Click to view the whole post or the thread page.
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Interpreted vs. compiled labguages (25)

1 Name: #!/usr/bin/anonymous : 2011-03-07 12:48 ID:Aep/pjix

Would you say it's easier for a newbie to pick up programming by learning an interpreted language ?

16 Name: #!/usr/bin/anonymous : 2012-06-18 13:30 ID:nCLwiqu9

17 Name: #!/usr/bin/anonymous : 2012-07-01 01:26 ID:E6kT7erT

ITT: Pussies who don't have the brain plasticity to learn assembly

18 Name: #!/usr/bin/anonymous : 2012-07-04 00:51 ID:Heaven

>>17
I wasted all my grey matter on eroge and 4chan, leave me alone.

19 Name: #!/usr/bin/anonymous : 2012-09-14 05:23 ID:6GcFPCrk

>>13
ASM is not a clusterfuck. C and its undefined behavior is a clusterfuck.

20 Name: #!/usr/bin/anonymous : 2012-10-09 13:52 ID:hKPHxe0D

>Would you say it's easier for a newbie to pick up programming by learning an interpreted language ?

I would say it depends on what are you like/want to do more.
I'd recommend starting with PHP and continuing with C. Because it's easy.

21 Name: #!/usr/bin/anonymous : 2012-10-20 13:39 ID:77BK0eUh

>>19

I dare to object. Every self-respecting C compiler should spill warnings about UB, until you bend over. To top it off for a bit, stronger typing of C++ treats some UB as hard errors (while creating plethora of new ones in it's wild-west approach to OO).

22 Name: #!/usr/bin/anonymous : 2012-11-24 14:31 ID:/vjq3rnG

>>20
Please don't start with PHP, for the love of God. That is the worst thing anyone could do.

23 Name: #!/usr/bin/anonymous : 2012-11-24 22:29 ID:Heaven

>>22
I mean, feel free to learn it at some point as I fully understand it is necessary to know in some lines of work, but to learn it as a first language will give you bad habits that are hard to drop if they're the first things you learnt.

I recommend learning Scheme while reading SICP. It will start you off with a nice, high standard. Python is okay too if you would rather.

24 Name: #!/usr/bin/anonymous : 2012-11-29 18:32 ID:7Bu9YmDM

>>20
No, oh my god no. PHP is no. Just no.
Is you want to pick up an actual language that is easy, go with Python or Ruby.

25 Name: #!/usr/bin/anonymous : 2012-12-06 19:55 ID:Rm+oYDsT

PHP is an actual programming language. It is, however, not a general-purpose programming language.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

Programming languages with fast matrix operations (15)

1 Name: #!/usr/bin/anonymous : 2011-03-19 21:56 ID:hBekoLl7

Sup. Can you guys show me a list of PL's that have fast/easy matrix operations. I am thinking of languages like Matlab where you can play with matrices, multiply, do eigen analysis, etc. without having to do loops and so on. I am working with mostly 3D data right now, so the ability to view 3D images would be nice too. Also nice would be if it came with libraries that have geometry stuff like triangulation, convex hull, and so on.

6 Name: #!/usr/bin/anonymous : 2011-09-24 19:54 ID:trzXDjoh

>>4
I am doing research in 3D vision. I actually do use R for the simple statistics stuff that I do. It's quite useful in that regard but I don't think I can write larger programs using it. It's too messy. For the 3D stuff, right now I am using C++ with VTK and sometimes OpenCV. And trying to use Ocaml whenever possible. Though from the looks of it, I am just going to end up with Matlab due to the amount of relevant code that I can use.

Openframeworks seems interesting, I'll look into it, thanks.

>>5
The concepts used in J is pretty amazing but no way will I be able to use it and be sane.

7 Name: #!/usr/bin/anonymous : 2012-06-19 14:13 ID:rnZVfANB

How about Fortran? :-þ

8 Name: #!/usr/bin/anonymous : 2012-07-10 20:33 ID:qZ0VOJgt

>>7
Hell yeah.

9 Name: #!/usr/bin/anonymous : 2012-08-29 19:31 ID:M+zF+icO

With C++ you can try the Eigen library, it seems pretty good.

10 Name: #!/usr/bin/anonymous : 2012-08-31 13:04 ID:tr5ggSOD

11 Name: #!/usr/bin/anonymous : 2012-09-14 05:14 ID:YTZ7lFrC

u w0t m8

12 Name: #!/usr/bin/anonymous : 2012-09-14 05:15 ID:YTZ7lFrC

If you buy MATLAB, you can call MATLAB functions...I don't know how.

13 Name: #!/usr/bin/anonymous : 2012-09-29 05:40 ID:Heaven

A crusty old neckbearded Unix hacker I knew a few years back had very fond memories of programming in APL as a university student. I wish I could have told him about J at the time, as he wasn't even aware that anyone had made an open source APL interpreter.

14 Name: #!/usr/bin/anonymous : 2012-11-14 22:54 ID:POkW8UHb

Pure looks nice, what do you guys think? It's a functional language, so that's nice, and has matrix support. It interfaces with lots of things including OpenCV and Octave (an open source attempt at Matlab).

15 Name: #!/usr/bin/anonymous : 2013-01-04 04:19 ID:Heaven

As a general policy, the more niche a language is, the more problems you'll have using it -- more compiler bugs, fewer libraries, less documentation, fewer debug and profiling tools, and so forth. As such, Pure isn't in the running yet.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

OOP vs functional (9)

1 Name: #!/usr/bin/anonymous : 2011-03-26 13:11 ID:tubYEjxP

in layman's terms what is the difference between the two ?

2 Name: #!/usr/bin/anonymous : 2011-03-26 21:22 ID:fy1QcJq/

Functional programming isn't the direct opposite of OOP, but of imperative programming. Imperative programming operates on the principle that programs have a global 'state' which should be manipulated to produce the desired results, while functional programming attempts to avoid state and treat all data and program flow as interactions between functions. Having no state is often described as being "functionally pure" or "no side effects."

To use an example, consider possible programs in an imperative and functional style:

def x_plus_three(x):
y = 42 # this would be a side effect
# it's poor programming, but the language won't stop you
return x + 3

Algebra, while not technically a programming language, is indeed functional:

f(x) = x + 3

Notice that using algebra, you couldn't change the value of y from within a function that operates only on x. Purely functional languages are subject to the same constraint- in fact, they don't actually 'change' anything at all, they merely produce brand new outputs by performing calculations on their inputs. This prevents errors in case you didn't want y to become 42 or x to permanently increase by three.

Post too long. Click to view the whole post or the thread page.

3 Name: #!/usr/bin/anonymous : 2012-01-26 01:47 ID:auY5imFY

Functional isn't opposite of OO, because there is functional OO.

OO with immutable objects is functional. (States can still be represented by creating new objects based on old ones.)

From a functional point of view, OO is a way of organizing the types into classes which are tuples of properties optionally linked by inheritance relationships, and of dispatching methods based on class-based pattern matching over the argument lists.

Functional OO is "cleaner" than regular OO in some ways. For instance circle-ellipse issues don't arise, because you can't mutate a circle or ellipse once it is constructed.

4 Name: #!/usr/bin/anonymous : 2012-04-11 02:57 ID:x2KjDRnY

>>3

> circle-ellipse issues don't arise, because you can't mutate a circle or ellipse once it is constructed.

I don't believe you here. You can still make a copy of some object A, and call it B. Hell, you can even call it A with a let statement.

5 Name: #!/usr/bin/anonymous : 2012-07-17 22:25 ID:n43w4UzA

I had an interesting realization on the nature of OOP once. When you think about it, it effectively models multiple computers running programs and interacting with each-other.
Even in game programs you have the 'view' model where one ticks each registered object in the main loop - it can be viewed as multiple processors being 'ticked' to the next CPU cycle.

6 Name: #!/usr/bin/anonymous : 2012-08-27 12:46 ID:BkDUZxkD

>>3
Pure OOP [i]is[/i] the opposite (dual) of pure FP. OOP is modeled by terminal coalgebras, FP by initial algebras. The distinction you're making is imperative vs declarative.
To solve the ``Expression Problem'', you need both.

7 Name: #!/usr/bin/anonymous : 2012-08-27 12:47 ID:Heaven

>>6
is

8 Name: #!/usr/bin/anonymous : 2012-10-08 20:33 ID:g8LKidg7

OOP is not needed in most small projects as it only complicates understanding of the code and, as a result, increases time spent on its' reading and monies spent on its' support.
OOP makes life easier when dealing with something really obstructive. Instead of making clusterfuck of dynamically loaded modules and thousands functions in the global namespace, you simplify (or trying to) program structural organization, dividing it into classes and objects. Saves lots of time when amount of actual developers is more than 3.
Oh, and, of course:

object->doSomething(whatever);
doSomething(object, whatever);

9 Name: #!/usr/bin/anonymous : 2012-10-20 13:51 ID:ExnosPyy

Note that variables captured in closures/continuations are technically equivalent to instances of which all members, including methods are private - and only visible to child classes defined in it's own scope (NOT derived classes, protected: is a sideffect).

In the same vein closures are just class instances without sideffects (are we comparing to pure-functional, right?).

Btw, this is clearly visible in C++11 and it's implementation of lambdas.

However nobody uses pure functional style, nor OO with such a rigid encapsulation. Both are most widely deployed in multi-paradigm systems, on that level, they could be IMO treated as equal.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

[JS] Help me find out the correct speed to sync up with the song 太陽いわく燃えよカオス (5)

1 Name: #!/usr/bin/anonymous : 2012-08-10 08:31 ID:2Uhzsz2B

Hi, so a friend made this for me after I linked them to the Nyaruko-san OP on YouTube. He said that using the + and - buttons, it ought to sync up with any beat.
My apologies if I mesed up the indentation in the following copypaste:

<html>
<head>
<title>(」・ω・)」うー!(/・ω・)/にゃー!</title>
<script type="text/javascript">var speed = 250;
var looper = setInterval(function(){ u.style.display="inline";
nya.style.display="none";
setTimeout(function(){ u.style.display="none";
nya.style.display="inline";
},speed);
},speed*2);
function unya(){
Post too long. Click to view the whole post or the thread page.

2 Name: #!/usr/bin/anonymous : 2012-08-10 08:32 ID:2Uhzsz2B

I should probably add that the title of the Nyaruko-san OP is 太陽いわく燃えよカオス.

3 Name: #!/usr/bin/anonymous : 2012-08-10 08:33 ID:2Uhzsz2B

err, not 太陽いわく, but 太陽曰く. My apologies.

4 Name: #!/usr/bin/anonymous : 2012-08-14 21:35 ID:owHAmwwP

I think Audacity has a beat-matcher built in. That is, it can detect the BPM of a song. I used it to make StepMania simfiles.

Also, you should send this to Tokiko when it's finished (if you're not him).

5 Name: ni : 2012-08-25 07:41 ID:vzwhkGjH

http://ieserver.net/

roujinkai dip.jp pass//// 4rfv6yhn1qak

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification:

New thread

Title:
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: