[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 314
Thread images: 27

File: Programming_General.png (503KB, 934x1000px) Image search: [Google]
Programming_General.png
503KB, 934x1000px
Couldn't find one in the catalog.

Discuss what you're working on.

Code of Conduct (obligatory):
https://github.com/domgetter/NCoC
>>
Hey all.
My for loop works by setting the values from values[0] to values[9] = 0.
But it won't print. What am I missing?
Thanks for your help!

for ( n = 1; n > 10; ++n ) {
values[n] = 0;
printf ("values[%i] is %i.\n", n, values[n]);
}
>>
first for poopoo caca
>>
Use your tripcode for posting silly threads. Remove for more important ones.
>>
>>51408211
n > 10

..
>>
>>51408315
I prefer anonymity.

>>51408334
problem?
>>
>>51408440
n starts at 1. The loop runs as long as n is greater than 10. n is never greater than 10. The loop never runs
>>
>>51408504
Thank you. I'll disappear now.
>>
Previous thread has less than 200 replies. What the fuck are you doing?
>>
Why does /g/ act like C is one of the hardest languages to use? You guys are aware that practically every other language is a superset of it? The textbook is 150 pages and the whole thing can be learnt in a weekend (barring weird edge cases etc). Please defend yourselves.
>>
>>51408586
At what point has one learned a programming language?
>>
What does
#ifndef RANDH
#define RANDH
do?
>>
In some alternate universe, they have solved P=NP, but have not discovered a faster sorting algorithm than bubble sort. Think about this.

>>51408315
No.

>>51408563
I searched for it in the catalog. Could not find it.

>>51408586
C isn't hard to learn. I actually recommend it to beginners. It is very easy to fuck up though.
>>
>>51408636
I just think ya'll niggas hella dumb n shit.
>>
>>51408851
if RANDH is not defined, define it and process the source code up until the #endif

This can guard your project from compiling the same file multiple times.
>>
>>51408880
That code appears in the first lines of a header file that is supposed to be able to work with several versions of a random number generating class. I think I'm supposed to do something to RANDH to specify which specific file it references. I don't know what to do.
>>
>>51409039
Preprocessor instructions being used as an include guard, as >>51408880 says.

RANDH is just a preprocessor token. It could be anything - so long as it's unique. It doesn't need to "reference a file"
>>
>>51408852
>I searched for it in the catalog. Could not find it.
There is a thread just named "/dpt"/. But fuck those threads made by people who can't even get the name right.
>>
>>51409218
>he didn't even search for dpt
>>
>>51409250
>have "daily programming thread" saved for catalog filter
>thread doesn't appear on top
>disregard shit thread
It's that easy.
>>
>>51407730
>Discuss what you're working on.
Learning Go, we'll be using it at uni.
It's actually quite nice.
>>
>>51409314
>daily programming thread
>not dpt
why live
>>
hideous c++ OOP bloat bullshit:
#include <iostream>

class MyClass{
public:
void foo() {
std::cout << "Stupid OOP bullshit bloat :^)" << std::endl;
}
};

int main(){
MyClass myClass;
myClass.foo();
}


amazing C code, so much better:
#include <stdio.h>

void myFunction(void){
printf("Extra work :^) So good");
}

struct MyStruct{
void (*foo)(void);
} myStruct;

int main(){
myStruct.foo = &myFunction;
myStruct.foo();
}


I love having 0 polymorphism and doing extra work, don't you guys?
After this I'm gonna reimplement vtables in C.
My purchase of the K&R memebook was worthwhile.
>>
>>51409398
Your opening braces ({) are supposed to go on a newline. Please fix this immediately.
>>
>>51409398
:^)
>>
>>51409448
You're disgusting
>>
i'm making a selection sort function, but it aint working.
this is the code
while len(data) != 0:

lowest = data[0]
place = 0

for sort in data:
int(sort)
if sort <= lowest:
print(sort + " "+lowest)
lowest = sort
actualplace = place
else:
pass
place += 1

sorteddata.append(lowest)


del data[actualplace]

print (sorteddata)


if i feed it the list:
9
5
2
0
1
4
7
6
3
8
10

it gives me :
['0', '1', '10', '2', '3', '4', '5', '6', '7', '8', '9']


why is this happening? why is 10 sorted incorrectly
>>
Apparently Go does not support cyclic imports.
I had the following idea:
type Game struct {
Config config.Config
Server net.Server
Clients []net.Client
}

type Server struct {
Game *game.Game
}

type Client struct {
Game *game.Game
}

This way the server has access to the client and vice versa. Any ideas on fixing this?
>>
>>51409523
why the fuck are you storing them as strings
>>
>>51407730
>Code of Conduct (obligatory):
>https://github.com/domgetter/NCoC
fuck you and sage
SAGE
>>
>>51409545
i get the list from a textfile. That's why they are stored as strings.
>>
>>51409533
It's because games are misogynistic
>>
>>51409582
>what is typecasting
>>
>>51409523
for strings, anything starting with 1 goes before anything starting with 2, convert them to numbers
>>
>>51409620
>>51409600
Yes, ofcourse. im retarded. Thanks guys.
>>
>>51409533
I'm confused, Server and Client takes a pointer to a "game" type which is never defined anywhere.
No idea what the lower case stuff is, but this works just fine:

type Game struct {
Config Config
Server Server
Clients []Client
}

type Server struct {
Game *Game
}

type Client struct {
Game *Game
}

type Config struct {
// whatever
}
>>
>>51409860
They're in different packages, that's the problem. Server and Client live in the net package, Config in the config package and Game in the game package.
>>
>>51409906
ah, gotcha
>>
How in the holy fucking hell do I call a python function from a javascript file on my web page?

Basically I need to fetch data from my database to my site.

I tried to use flask but I'm getting cross-origin errors.

$.ajax({
url: '/listen',
data: "coming from web page",
type: 'GET',
success: function(response) {
console.log("PYTHON SOMETHING " + response);
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}
});


@app.route('/listen', methods=['GET'])
def listen():
pass


Web development is a fucking nightmare.
>>
>>51409962
>>>/g/wdg
>>
>Write mostly in C and Python
>Have to pick up Java for a project

fuck this disgusting language what the fuck were the developers thinking? I feel dirty
>>
>>51410293
india needed a toilet
>>
>>51408211
since when is 1 > 10¿ change > to <
>>
File: 19cn7p7ve71yxjpg.jpg (182KB, 600x600px) Image search: [Google]
19cn7p7ve71yxjpg.jpg
182KB, 600x600px
Anyone got any problems with touch events coordinates in scaled backgrounds in java?

public void update() {
x += vx;
y += vy;
}

public void dash(double dashX, double dashY) {
this.dashY = dashY;
this.dashX = dashX;
dx = (int) dashX - this.x;
dy = (int) dashY - this.y;
distance = Math.abs(Math.sqrt(dx*dx + dy*dy));
vy = speed*dy/distance;
vx = speed*dx/distance;
}
>>
>>51410397
This doesn't have the correct behaviour. But with the test outputs the math is correct.
>>
>>51410397
Protip: Java has the Math.hypot function.
>>
>>51408852
>they have solved P=NP

Solving P=NP would imply that P=NP, which is categorically incorrect.

No such universe exists.
>>
File: 1447736563420.jpg (125KB, 951x635px) Image search: [Google]
1447736563420.jpg
125KB, 951x635px
Any PHP dev around here?

I have problem using PHPUnit.

Lets say I have 2 classes
Class A
Class B

Class B use methods from Class A.
To test those classes I have in separate folder
Class TestA{
require_once Class A
}

Class TestB{
require_once Class B
require_once Class A
}


But when I run test it crash at Class TestB
PHP Fatal error: Cannot redeclare class Class A in Class TestB


I tried, require_once, require, include. I tried to require_once only one time, in the file where this class is tested.

It does not work.

Is there any solution for error?
>>
What the fuck is with all these fucking web developers in dpt lately?
>>
I'm confused with Python right now.

prices = {
"banana" : 4,
"apple" : 2,
"orange" : 1.5,
"pear" : 3,
}
stock = {
"banana" : 6,
"apple" : 0,
"orange" : 32,
"pear" : 15,
}

total = 0
for key in prices:
total += prices[key] * stock[key]

for key in prices:
print key
print total
print "price: %s" % prices[key]
print "stock: %s" % stock[key]
print


why is this returning total as 117? I'm just trying to make it multiply stock by price and print the result of each individual item. I keep getting 117 as the total for everything.
>>
>>51409218

I search for the term "daily". If your thread only has "/dpt/" in the subject field, and not "/dpt/ - Daily Programming Thread", then your thread is wrong.

>>51410513

"Solving P=NP" means "solving if P=NP." Do we really need to be pedantic about this?

>>51410583

Lots of people are getting into web development all around, because money.
>>
>>51410613
>>> 4*6 + 2*0 +1.5 * 32 + 3 * 15
117.0
>>
>>51410648
But why the fuck are they in this fucking thread
This is a web-dev-free zone
>>
>>51407730
>Couldn't find one in the catalog.

>>51404800
>>
>>51410502
>Linear ownership makes a lot of problems much harder. To the extent that you'll basically end up Greenspunning your own NotRust language on top of it if you try to use it as a general-purpose applications language.
>If that wasn't the case C++ wouldn't even have shared_ptr; unique_ptr would be all that you need.
unique_ptr is a very specific usage of linearity. shared_ptr is another usage. Linearity is a much more general concept than just "this object has only one reference to it at any given moment".

>All that Rust actually brings to the table is that the compiler will tell you if you borrow a reference and hang onto it past the due-by date.
That's just criticism of Rust itself. I don't believe Rust is a very good example of linearity in a language because, again, linearity is more general than unique ownership.

>>51410619
>While I basically agree that defining clear ownership rules is a very good thing, I will note that single-ownership semantic is very crippling
See above.
>>
>>51410648
>solving if P=NP

I'd put big money on the answer being no in every universe.
>>
>>51407730
>Code of Conduct (obligatory):
>at least it's a NCoC...
but still:
FUCK OFF NIGGER FAGGOT
>>
>>51410650
Oh, okay. So total needs to go into the last for loop.

I thought Python was supposed to by dynamic. Why is shit like this happening.
>>
File: 1444249133606.png (81KB, 855x746px) Image search: [Google]
1444249133606.png
81KB, 855x746px
>>51410648
>>51409218
>>
>>51410700
>dynamic means the interpreter magically understands what you mean, even when you write code so wrong someone with no python experience can point out the flaw
python users actually believe this
>>
Just started to learn C. Finished a simple Celsius/Fahrenheit/Kelvin converter. What are good exercises for beginners anons?
>>
>>51410748
bjarne here, have you considered learning a better language?
>>
>>51410748
dick grinder
>>
>>51410772
As my first progamming language people, friends and internet recommended me either C or Python, so i chose C. Do you think it is bad? Or hard? Ty for answering.
>>
>>51410700
I am not sure what you mean its a normal loop and you add result of each multiplication into one var.

Maybe += confuse you?

total += prices[key] * stock[key]
It is equivalent to
total = total +prices[key] * stock[key]
>>
>>51410722
but my waifu is an expert programmer
>>
>>51410814
Yea, I think that's what confused me. I figured it out though through trial an error.
>>
>>51410455

>Java
>Functions

Errors.jpg
>>
File: 1352784495921.jpg (318KB, 1102x967px) Image search: [Google]
1352784495921.jpg
318KB, 1102x967px
> tfw work in Enterprise software

Please kill me. It's the most dysfunctional shitshow I've ever seen.
>>
>>51409494
now write a grep expression that will match functions but not expressions ;^)
>>
>>51410891
any good stories
>>
>>51410891
>iktf

Learn asm, C, web security, re and apply for NSA
>>
>>51407730
while(1) {
printf("Please don't use an anime image next time. Thanks!\n");
}
>>
>>51407730
I'm working on a programming language. It's called Valutron.

Valutron is a Lisp. It has two key differences to many other Lisps: it has actual syntax instead of S-expressions all the way down, and I place emphasis on the dynamic Object-Oriented system that is available. Neither of these impact on traditional Lisp characteristics, like expressive macros. Indeed, Valutron is arguably more Lisp than those that use S-expressions for everything. John McCarthy knew exactly what to make of programming with S-expressions; he derided it and proposed instead a system called M-expressions which are more similar to ALGOL's algebraic notation. I have realised his intentions by providing more humanist syntax, whether autists with bracket-fetishes like that or not.

Here is a code example:

// let's define a 'get-hello-world' generic
defgeneric get-hello-world (object some-object) => string;

// let's define a 'hello' class
defclass hello (object)
{
slot string hello : initarg hello:;
slot string world : accessor getWorld, initarg world:;
}

defmethod get-hello-world (hello some-object) => string
{
let result = copy(some-object.hello);
append(to: result, some-object.getWorld);
result
}

let aHello = make-instance (hello: "hello", world: "world");
// the arrow -> is an alternative form of method dispatch syntax
print(stdio, aHello->get-hello-world());


Here's the same expressed in CL with CLOS:

(defgeneric get-hello-world ((some-object object)))

(defclass hello (object)
((hello :initarg :hello)
(world :initarg :world
:accessor getworld)
)

(defmethod get-hello-world ((some-object hello))
(setq result (copy (hello some-object)))
(append :to result (getWorld some-object))
(result)
)

(setq aHello (make-instance 'hello :hello 'hello :world 'world))

(print stdio (get-hello-world aHello))
>>
>>51410924
/.*\s+.*\s*(.*)\s*{/
>>
>>51410985
Stop posting this same thing over and over again
>>
>>51410985
You forgot to mention the part where you don't support recursive construct, including mutually recursive ones.
Captcha: Bemor discreet
>>
>>51407730
while(1)
{
printf("Thanks for using an anime image!");
}
>>
>>51411014
Recursion a shit anyway.
>>
>>51410722
everything about this image is complete garbage
>>
File: 1443630956345.png (6KB, 640x480px) Image search: [Google]
1443630956345.png
6KB, 640x480px
>>51411033
>I'm working on a programming language. It's called Valutron. Valutron is a Lisp.
>Recursion a shit anyway.
>>
>>51410890
B-but there is a function class in Java 8!
>>
>>51410985

This is literally spam
>>
>>51411033
>no circular linked-lists
>good
>>
File: sussman shig.jpg (71KB, 500x375px) Image search: [Google]
sussman shig.jpg
71KB, 500x375px
>>51410972
>while(1)
>not for (;;)
>not putting a space before the paren
>not putting the brace on a new line
>>
>tfw good old classic DPT image
all those newfangled ones can suck a dick
>>
>>51411069
>not
#define ever ;;
for(ever) { printf("suck it nerd\n"); }
>>
>>51410985
MODS
>>
>>51411069
>using 2 semi colons instead of 1 number one
>>51411087
>using 4 characters instead of 1 number one

>>>/java/
I think you'll like it m8s
>>
>>51411087
#define forever if (!false) while (true) for(;;)

forever { ; }
>>
I remember back when the only DPT OPs we even had were this one and the Asuka one. Also people didn't rush to make a new thread as soon as one hit the bump limit.

I miss those days.
>>
>>51411087
i'm partial to
while(1)
myself.
>>
Is there any reason to use a do-while loop instead of just a while loop?
>>
>>51411147
do-while checks the invariant after each iteration.
while checks it before.
>>
>>51411147
when you want the loop to run at least once
>>
>>51411128
and we didn't have a million web dev javascript questions
>>
>>51410685

I wouldn't bet a dime on P ≠ NP.

https://github.com/ad-alston/PolynomialSubsetSum
http://cusj-dev.journals.cdrs.columbia.edu/wp-content/uploads/sites/15/2015/04/Alston_2015_CUSJ.pdf

>>51411070

I use the old image because it generally results in the least amount of complaints.

>>51410985

No homoiconicity
∴ not a Lisp
>>
>fans of speech impediments complaining there aren't enough homo icons and ethnicities
>>
>>51411147

do-while when you want the body in the do part to repeat itself.
>>
File: 1366358483531.gif (8KB, 645x773px) Image search: [Google]
1366358483531.gif
8KB, 645x773px
/g/ Beginner here, I got this far, I don't even know if I did it exactly right but somehow it worked so far, but I can't do the last point. This is what I just did
#include<stdio.h>
float mult(float money, float interestrate)
{
return interestrate*money;
}
int main()
{
float interestrate, money, x, months;
printf("How much money is in the account ?\n");
scanf("%f", &money);
printf("Input an integer for the number of months you want to use this\n");
scanf("%f", &months);
printf("Input the same integer until you want to exit the program\n");
scanf("%f", &x);
while(x==months)
{
if (money < 100)
{
printf("Input the value 1.1 to increase the money amount by 10 percent\n");
scanf("%f", &interestrate);
money = mult(money, interestrate);
printf("The new amount for the next month is \x9C%f\n", money);
}
else if (money < 200)
{
printf("Input the value 1.5 to increase the money amount by 50 percent\n");
scanf("%f", &interestrate);
money = mult(money, interestrate);
printf("The new amount for the next month is \x9C%f\n", money);
}
else if (money < 500)
{
printf("Input the value of 1.8 to increase the money amount by 80 percent\n");
scanf("%f", &interestrate);
money = mult(money, interestrate);
printf("The new amount for the next month is \x9C%f\n", money);
}
else if (money >= 500)
{
printf("Input the value of 1.9 to incease the money amount by 90 percent\n");
scanf("%f", &interestrate);
money = mult(money, interestrate);
printf("The new amount for the next month is \x9C%f\n", money);
}
printf("If you want to exit the program, input a different integer than the one you used for the number of months\n");
printf("If you want to continue, put in the same integer until you reach the number of months you want to simulate this\n");
scanf("%f", &x);

}
return 0;
}

>cont
>>
Where do you guys get ideas for GUI design? My GUIs look fucking ugly, and I have no idea how to make them look better.
>>
>>51411087
#define forever for (;;)
forever
;
>>
>>51410926
Not particularly good stories, just general fuckery. Everyone's QA team is shit, no one has standards, broken code gets to Prod all the time, the sysadmins are literally years behind schedule, etc.

>>51410932
I actually applied/interviewed with NSA out of school. Was lower pay and on uninteresting projects from 10 years ago, don't really regret that aspect of it. Collared-shirt and heavy regulation isn't for me.
>>
File: 1441901550861.png (21KB, 400x400px) Image search: [Google]
1441901550861.png
21KB, 400x400px
>>51411256
This is what the tasked above asked me :
d) Modify your program to ask the user how many months to simulate,
instead of just simulating one month at a time.
• This task can be done in multiple ways. Try to think of the
best way yourself.
• Think about how you can do the same task multiple times.
• After simulating a block of months, your program should be
able to simulate another block of months.
• Your program should exit if (and only if) asked.

This is what I have to do now
Finally, overdrafts have an absolute limit (for the accounts they are considering) that
they cannot go below. If applying interest to an amount would put the account below
the limit, then the account should stop at the limit.
e) Modify your program to do the following:
• Modify the function that determines the interest rate to include
(in addition to what you’ve already done) the following:
– Money < 0 => 20%
– Money < -100 => 40%
– Money < -500 => 80%
• Create an overdraft limit of £1000.
– Make sure the account does not decrease below this
amount.
– You may use a global variable to specify the overdraft limit
if you wish.
>cont on the code I tried
>>
>>51411087
ahahah so funny, my normie friend xDDD
>>
>>51411289
B U T T H U R T
U
T
T
H
U
R
T
>>
File: 1443561467422.gif (470KB, 200x200px) Image search: [Google]
1443561467422.gif
470KB, 200x200px
>>51411282
This is what I added on the code in my first post, can't put everything in here
    else if (money < 0)
{
printf("Input the value of 1.2 to increase the money amount by 20 percent \n");
scanf("%f", &interestrate);
money = mult(money, interestrate);
printf("The new amount for the next month is \x9C%f\n", money);

}
else if (money < -100)
{
printf("Input the value of 1.4 to increase the money amount by 40 percent \n");
scanf("%f", &interestrate);
money = mult(money, interestrate);
printf("The new amount for the next month is \x9C%f\n", money);
}
else if (money < -500)
{
printf("Input the value of 1.8 to increase the money amount by 80percent \n");
scanf("%f", &interestrate);
money = mult(money, interestrate);
printf("The new amount for the next month is \x9C%f\n", money);
}
printf("If you want to exit the program, input a different integer than the one you used for the number of months\n");
printf("If you want to continue, put in the same integer until you reach the number of months you want to simulate this\n");
scanf("%f", &x);
if (money < -1000);
{
printf("The account decreased below this overdraft limit");
}


}
return 0;
}

Please help me I want to understand this, its so painful
>>
>>51411147
there's not many occasions where it's necessary but there are some times it's nice.

if your exit condition is based on whatever you're looping over, it can be cleaner and more intuitive to check after the first iteration of the loop rather than having to create your exit variable before the loop even starts

compare:

exitFlag <- 0
while (exitFlag != 1) {
exitFlag <- doStuff() # returns 0 if ok, 1 if something is bad and the loop needs to halt
}

with
do{
exitFlag <- doStuff()
} while { exitFlag != 1}


Both are functionally equivalent, but personally I find the second to be much easier to read, and in practice the second is easier to maintain.
>>
File: 1363930494955.jpg (56KB, 300x360px) Image search: [Google]
1363930494955.jpg
56KB, 300x360px
>>51411256
how do i add line of codes to my post like you did
>>
File: lambda-star-red-flag.png (23KB, 1920x1080px) Image search: [Google]
lambda-star-red-flag.png
23KB, 1920x1080px
>>51411014
Use an S-expression then. You can freely switch between Sexprs and Vexprs in Valutron. Encapsulate the S-expressions within <>, i.e. <(1 ( 2 3 ))>, or call Sexpr();. To switch back to V-expressions, call (Vexpr)

>>51411188
>No homoiconicity
>∴ not a Lisp

>John McCarthy's Lisp manual does not describe a Lisp

I guess Ruby knows more about Lisp than its creator. Homoiconicity (as you incorrectly define it) isn't even the point. OpenDylan (and Valutron) demonstrate that powerful macros can work just fine with a non-Sexpr language.

By the way, Valutron *is* homoiconic in a sense. The V-expressions are implemented via a LALR parser that exists in the read layer. The output is reformed easily into lists (i.e. what S-expressions represent). S-expressions have to be parsed as well in order to become the internal representation, which is decidedly not S-expressions in any Lisp.

>>51411115
Sorry that your posts aren't as discussion-spawning as mine.
>>
What's the correct way to get a pointer to a value in llvm? Such as for
builder->CreateBitCast(<getPointerTo(ConstantFP::get(Type::getDoubleTy(getGlobalContext()), 3.1415))>, PointerType::getInt8PtrTy(getGlobalContext()))

in other words, constant -> pointer to it -> pointer to void
>>
>>51411313
...., please help me on what I have to do in return, with that overdraft 1 thousand thingy
>>
When I use protobuf-net to serialize and deserialize an array with null elements, the nulls get removed. How do I prevent this from happening?

My array looks like:
[null, Obj1, Obj2, null, null, Obj3, null]
but after serialization/deserialization the clone comes back as
[Obj1, Obj2, Obj3]
>>
>>51411313
{code} asdf {/code}
with square brackets
>>
>>51411313
>>51411355
i mean [co.de]...[/co.de] without the periods
>>
sure smells like summer in here
>>
>>51411391
Smells like flowers and freshly dried laundry
>>
>>51411419
Smells like old cum and moldy leftovers
>>
>>51411377
>>51411357
thanks senpai
>>51411355
sorry senpai i don't even know what you are doing
>>
>>51411308
Why does the user put in the interest rate manually?
>>
>>51411391
It's december season soon.
>>
>>51411479
The clients are from Israel
>>
>>51411479
It would be even better if I make the interest rate to appear automatically. How do I do it ?
Should I modify it like this for example ?
else if (money < 200)
money = mult(money, 1.5);
>>
>>51411528
Yeah that's it. What else was the issue specifically? I'm too lazy to read all of it for tiny problems.
>>
>>51411573
Ok it works, I need to do this
• Modify the function that determines the interest rate to include
(in addition to what you’ve already done) the following:
– Money < 0 => 20%
– Money < -100 => 40%
– Money < -500 => 80%
• Create an overdraft limit of £1000.
– Make sure the account does not decrease below this
amount.
– You may use a global variable to specify the overdraft limit
if you wish.
Basically make it stop if it goes over -1000 but idk how to put the If statement
>>
Is there an acceptable way of making this line not horrific in Java? With C++ I'd use typedefs:
        ConcurrentLinkedQueue<ConcurrentHashMap<String,LinkedList<String>>> workQ 
= new ConcurrentLinkedQueue<ConcurrentHashMap<String,LinkedList<String>>>();


Maybe I don't need all those type args?
>>
File: 1432677284883.png (161KB, 800x600px) Image search: [Google]
1432677284883.png
161KB, 800x600px
>>51411511
it has already begun fgt

>december: mid nov to mid feb
>>
>>51411704
>Boilerplate: The Language
>not horrific
no
>>
>>51411704
I don't think so.
>>
>>51411325
>Sorry that your posts aren't as discussion-spawning as mine.
Spamming the same post isn't spawning discussion.
>>
>>51411325
>Sorry that your posts aren't as discussion-spawning as mine.
*shitpost-spawning
>>
>>51411723
What's so special about december?
>>
>>51411704
>LinkedList<String>
>ConcurrentHashMap<String,LinkedList<String>>
>ConcurrentLinkedQueue<ConcurrentHashMap<String,LinkedList<String>>>
oh shit nigger, what are you doing
>>
>>51411765
le red cups for le holiday seesun
>>
trying to see if input in a textfield is numerical, or alphabetical. If the input contains any numbers, it ought to set validGuess to false. would this work for that purpose?

try{
Integer.parseInt(input);
validGuess = false;
}catch(Exception e){
validGuess = true;
}
>>
>>51411766
What do you mean?
>>
>>51411769
That causes a rush or retards coming to /dpt/?
>>
>>51411787
what exactly are you even trying to do? there is probably another way to do it
>>
>>51411782
why not catch it when typing in.
If typed in char not between 0 and 9, disable submit
>>
>>51411800
probably. like now you get schoolkids asking for help with their homework/exams and then during the winter break it'll be like mini-summer
>>
>>51411829
generate threadsafe queue whose elements are threadsafe hashmaps of filename,linked list of filenames.
>>
>>51411876
What the fuck? Sounds like you could do something else.
>Queue of Hash Maps
That doesn't even seem reasonable.
>>
File: [rattling intensifies].png (128KB, 446x451px) Image search: [Google]
[rattling intensifies].png
128KB, 446x451px
>>51411876
>generate threadsafe queue whose elements are threadsafe hashmaps of filename,linked list of filenames.
jesus christ
>>
File: 1431297247437.png (50KB, 426x364px) Image search: [Google]
1431297247437.png
50KB, 426x364px
If you were in charge of hiring programmers for a company what would you test the candidates on to be sure they weren't retarded sjws/pajeets who barely know how to code.
>>
>>51411935
I don't see why it particularly matters what's in the queue. My problem is with generics and their noodly syntax. It's not any more complex than an array of references to dictionaries.
>>
>>51411616
if (money<-1000)
{
//printf about user exceeding limit
//use goto to send back to beginning
}


Or put the entire program you wrote so far in
while((money>-1000)||(f=1))

So that the code runs unless the user exceeds the £1k limit or has specifically asked to exit (hence the 'flag' f=0, which can be set upon the decision to quit)

Something like that
>>
>>51411968
Binary tree inversion
>>
>>51411968
I'd ask them to write something in Ruby. If they can do it they're out.
>>
>>51411968
I'd make them write a strrev without using any built-in string function
>>
>>51411984
>no spaces
fucking faggot fuck you shit nigger
>>
>>51412015
I hate spaces
>>
>>51411984
Thanks, I did it like this with the help of a friend, its similar to what you are telling me
if(money*1.8<-1000)
{
printf("Account will go into overdraft\n")
else if
(money<100)
.....etc
>>
>>51411968
>open algorithms 4th ed on a random page
>find nearest pseudocode
>make them translate that code into their language of choice and analyze the time and space complexity, worst case etc
>>
>>51411968
What are programs? Data structures, algorithms, and IO. I'd give them problems in each category closest to what the job entailed and make them write it in pseudo-code and ask them to determine runtime for the algo and data structure problems. The detail of their pseudo-code and the correctness of the runtime estimates would be a good judge.
>>
>>51412060

Literally the worst kind of interviewer you.
>>
>>51412080
Also would talk to them about the tool the company uses and look for those that are familiar with them. It's not a trump card, but would put that person above a similarly ranked person.
>>
>>51411269
From what snowden revealed it looks pretty comfy.
250k $/year, works on hawaii
>>
>>51411325

I actually just looked up John McCarthy's Lisp Manual. This is what I find.

http://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf

>LISP differs from most programming languages in three important ways. The first way is in the nature of the data. In the LISP language, all data are in the form of symbolic expressions usually referred to as S-expressions. S-expressions are of indefinite length and have a branching tree type of structure, so that significant sub-expressions can be readily isolated. In the LISP programming system, the bulk of available memory is used for storing S-expressions in the form of list structures. This type of memory organization frees the programmer from the necessity of allocating storage for the different sections of his program.

>The second important part of the LISP language is the source language itself which specifies in what way the S-expressions are to be processed. This consists of recursive functions of S-expressions. Since the notation for the writing of recursive func- tions of S-expressions is itself outside the S-expression notation, it will be called the meta language. These expressions will therefore be called M-expressions.

>Third, LISP can interpret and execute programs written in the form of S-expressions. Thus, like machine language, and unlike most other higher level languages, it can be used to generate programs for further execution.

Well there you have it. In the creator of Lisp's own word, Lisp is defined by having S-expressions.
>>
>>51411978
>It's not any more complex than an array of references to dictionaries.
Yeah, but why? Do you need to keep track of how a directory changes over time? That seems like it's the only use of that data structure.
>>
In your opinion, /dpt/, how long should one wait for a partner's reply (assuming that you know they've received your messages) before going ahead and just doing whatever they want by themselves? I've been waiting for almost two hours now, I know the person I'm working with has received my messages and is deliberately ignoring them. Is it fair for me to just go ahead and do what I think is right and ignore them later if they complain?
>>
>>51412139
0 hours rounded up
>>
>>51412139
bool q = "Does it really need to get done now?"
if q then
"Do it"
else
"Wait you autist"
end
>>
>>51412139
Give him 24 hours and work on something else. Really, this kind of shit should've been documented before about how the decisions should be made. You've got no right to complain if you don't document it.
>>
>>51412138
generating a queue of files to parse that can be farmed out to worker threads. As you parse new files can be found and added to the queue which would explode if you did it concurrently without thread safety,
>>
>>51411968
write the dankest fizzbuzz in any language

then write a scheme interpreter in c++ and use it to calculate the flux integral of a parameterized cone
>>
>>51412181
What's the point of the map then? Just make a thread-safe queue of file objects
>>
>>51411704
>>51411876
not that i think what you're doing is sane... but how about making a wrapper class for it? then it's kinda like a typedef and you can add extra functionality to it
>>
It seems feasting on programmers flesh has made my semen leak.I am aroused.Fuck I'm crazy.I fuck the blood. I need meat on my cock.No meat can satisfy me. I must spew my seed.Spunk flows throughout the mangled programmer now I'll chop it up.
>>
>>51412292
Haskell programmer detected
>>
File: 1446494590010.png (178KB, 330x319px) Image search: [Google]
1446494590010.png
178KB, 330x319px
>tfw truSTEM and don't have to deal with even 1/10th the bullshit of meme professions like CS
>>
>>51412322
>truSTEM
what does that even mean?
>>
>>51412322
counterstrike isn't a profession it's a way of life
>>
>>51411935
A queue of hashmaps can represent linked environments.
>>
File: recording_absolutelydisgusting.png (46KB, 1361x550px) Image search: [Google]
recording_absolutelydisgusting.png
46KB, 1361x550px
I know I am overdoing things, where am I overdoing it and how can I fix it?

Someone in /vg/ told me I am trying to manage entities in lua and that I need to do it in C, using a reference table to access each entities init, update, and draw functions. However I do not know where to look on doing this. Some help would be great.
>>
Working on some prolog... How can I maintain a fraction in the form X/Y opposed to it becoming a decimal?

fraction(X, Y) :-
Z is X/Y,
write(X/Y),nl,
write(Z),nl.


returns
?- fraction(3,4).
3/4
0.75
true.
>>
>>51412345
I told you to look at the registry, not a "reference table".
>>
http://www.blackenterprise.com/technology/black-computer-programmers-why-we-need-them/
>>
>>51412348
e.g. frac(x, y) would be your canonical form, don't do Z is X/Y.
>>
>>51411343
Looks like the only solution is to emit an alloca, fill it with a constant, then cast the alloca.
>>
>>51412355
sorry, wrong word, i'm not home right now
>>
>>51412376
So, try looking at the registry?
>>
>>51412344
Yeah, I know. I asked if he was keeping track of how files changed in a directory over time or something like that and he said he just needed a list of files.
>>
>>51412360
I'm going to be using some very large fractions and i'm afraid there will be overflow, is there a way to maintain a reduced fraction otherwise?
>>
File: its_working_star_wars.gif (449KB, 400x170px) Image search: [Google]
its_working_star_wars.gif
449KB, 400x170px
>no experience with anything other than windows, notepad++
>decide to try linux
>decide to try Emacs
>decide to try Haskell
>all at once
>Finally get a program made, taking arguments, and running

What a high.
>>
>>51412407
>>51412360
i'm doing some large probability computations and if i keep multiplying the numerator and denominator the numbers will becoming much too large without simplifying the fraction, which will give me a decimal
>>
Is Visual Studio Code any good?
>>
>>51412476
It's just a text editor, not actual compiler.
>>
>>51412417
Sounds like you shouldn't be using an outdated shit language.
>>
>>51412516
I don't think I would use Prolog ever again but it's for an assignment.
>>
I do not support the inclusion of the code of conduct in the OP. Please include a more progressive code of conduct next time, for example http://todogroup.org/opencodeofconduct/
>>
>>51412515
>not actual compiler
neither is visual studio
>>
>>51412528

>A more progressive code of conduct
I'm a conservative.
>>
>>51412384
the thing is im not sure where to look

all I could find on google was this http://stackoverflow.com/questions/4417243/lua-problems-with-binding-my-games-entity-system
>>
>>51410859
Heh OK she can OP.

>>51411046
Something smells fishy here anon, but I'm pretty sure it's not coming from that image.
>>
>>51412515
That's not true anymore. It's has full debugging support now.
>>
>>51412528
FUCK OFF FAGGOT NIGGER
>>
>>51412563
>I'm a retard
I knew it.
>>
>>51412567
FFS

http://www.lua.org/pil/27.3.1.html
>>
>>51412337
Physics
Mathematics
Engineering
Medicine
>>
>>51408852
>In some alternate universe, they have solved P=NP, but have not discovered a faster sorting algorithm than bubble sort. Think about this.

My favorite variant of this is to consider that there is some universe in which extremely unlikely events have happened so many times in a row that people take them for granted. There's a universe where the lottery numbers are always 1,2,3,4,5,6. There's a universe where communism accidentally works and keeps working, and everyone in it thinks this is strong evidence that Marx was right after all because they don't see the trillions and trillions of universes where the dice don't happen to land on this exact bizarre combination every time.

And consider all the universes where this suddenly stops. Where lottery numbers have always been 1,2,3,4,5,6 since forever, and one day they just stop. And everyone is utterly baffled as to what happened, their explanations for this phenomenon just fall apart, because nobody would ever consider that this kind of thing could ever be a string of that many coincidences. But in some universe, that's the case.
>>
>>51412660
Ever read "Nightfall" by Asimov? Same idea.
>>
File: COMMENCE A JIGGLIN.png (376KB, 900x702px) Image search: [Google]
COMMENCE A JIGGLIN.png
376KB, 900x702px
>>51412660
>There's a universe where Australians are the only sentient beings that do not shitpost
>>
No one's responding to my thread so I'll post my question here:

Is this code malicious? It looks deliberately obfuscated.

http://pastebin.com/iApavZBZ
>>
>go to school for programming classes
>thousands of dollars in debt
>can't find full time programming job

what it all really just a meme, /g/?

seems like you either have to know tons of people who will get you in or be so smart and gifted and god tier at programming to get hired.

I might have just fucked up the next 5-10 years of my life by getting into so much debt.
>>
>>51412660
but Marx was right anon
>>
>>51412836
Not in this universe he wasn't.
>>
File: Karl-Marx.jpg (40KB, 444x444px) Image search: [Google]
Karl-Marx.jpg
40KB, 444x444px
>>51412844
>he hasn't read marx
>>
>>51412852
I literally have.
>>
>>51412870
If you look at the Soviet Union and see Marx then you're an idiot
>>
>>51412817
Maybe it was minified then un-minified and that's why the code seems cryptic even after being prettified.
>>
https://www.youtube.com/watch?v=SczKh8yJ0LY

Choon
>>
>>51412830
THE LAND OF THE FREE
>>
>>51412924
Wrong thread kek
>>
>>51412892
I see a repeated occurrence of poverty, starvation, and totalitarianism every time his ideas are attempted. As well as good reasons to expect this to be the case.

When arguing in defense of institutions you have to take into account what they actually end up like when they're set up. You don't get to decide what the outcomes of your ideas are and then defend that; you defend the ideas based on them actually leading to good outcomes.
>>
Communism is anti-individual
>>
>>51412939
>every time his ideas are attempted
They were never attempted.
>>
>>51412830

>mcdonalds confirmed
>>
File: L'état_et_la_révolution.jpg (62KB, 752x1086px) Image search: [Google]
L'état_et_la_révolution.jpg
62KB, 752x1086px
>>51412939
>Marx's ideas
>>
>>51412958
the ideas don't work anyways. It's fucking retarded. In his version of communism there's no economic growth. Everyone is equally poor. But apparently that's okay so long as everyone is equal.

Meanwhile I'm in a capitalist country and get €188 per week while I'm unemployed, plus rent supplements and other assistance if I need it. Which gives me a much higher standard of living than some shitty communist country might have where everyone is on subsistence farming and prone to starvation from famines.
>>
>>51412992
>didn't
>read
>marx
>>
>>51413001
I've read enough about the whole idea. Go on, tell me why I'm wrong.
>>
>>51412914
It was a big block of text but I formatted it to be readable. The variables are still given nonsense names, I don't know why that would be normal.
>>
I want to work with c++ Ive gotten pretty into python. Should I fuck with C first? Also what is the best way to learn c++ on your own?
>>
>make an offhand remark as uncontroversial as 'communism is bad'
>political argument immediately breaks out

I guess I should have expected this.
>>
>>51413037
12 year olds "and" liberals will never accept this
>>
>>51413037
You're not talking about Marx. You're talking about Lenin and Stalin and Mao, etc, all with their own ideologies that differ from Marx.
>>
>>51412583
I've read that documentation many times now, it's very barebones.

I know you are going to tell me "you're not a programmer, don't do anything" but that doesn't help the confusion.

To me, it looks like the same thing I am doing now, passing a number on to lua and from there lua runs the corresponding entity.
>>
>>51411704
>with java
no
>>51411968
I was talking to someone in charge of hiring for a software company recently and they mentioned that they're not interested in technical knowledge nearly as much as in the thought process behind it; I think based on that idea it would probably make sense to test them with some kind of logic puzzle to see if they could actually reason about things properly rather than a directly programming related test. And not something like >>51412060 (which primarily tests your knowledge of the language you're using and not your ability to come up with solutions to open problems).
>>
>>51413061
Marx was an idiot. He utterly lacked any ability to understand the most basic tenets of economics. The main benefit of capitalism and free markets is that they exceptionally good at producing wealth, this is why all wealthy countries run effective capitalist economies. Any wealthy country that doesn't is wealthy because it sells out to the countries that do in return for goods and services that those capitalist countries are capable of producing for the value of the oil.

Once your country's economy has produced exceptional wealth, you can tax a bit of it to pay for nice things your people like generous welfare programs like most european countries. While there is wealth inequality, everyone has an exceptionally high standard of living thanks to the wealth created.

A socialist economy does nothing to increase productivity and everyone is equally poor in them. Much much more so than the poorest in a well run capitalist country. While communism was never truly implemented, its economics would fail for the same reason they have in the USSR, China and North Korea.

Marx just saw businessmen and banks as evil people trying to steal working people's money. You probably think the same.
>>
>>51413109
I don't know what you're confused about. You "load" the functions by running the script file for that entity type, store references to them using the registry, and then call the appropriate ones while looping through your entities.
>>
File: Varro.jpg (75KB, 500x282px) Image search: [Google]
Varro.jpg
75KB, 500x282px
>>51411968

Mostly just theory questions about whatever tools we're using (what are the benefits of language X over language Y, how would you go about solving this arbitrary problem, etc).

I'm staunchly against coding in interviews, no real world situation would have you pulling code out of your ass when there are thousands of resources you would otherwise be able to use.
>>
>>51412516
>Prolog
>outdated shit
Tell me, what language has replaced Prolog to make it 'outdated'?
>>
>>51413144
>he hasn't read marx
>>
hello family

i get a job with C, im c# and java origined, its embedded programming, i need a good cook book with c and embedded, i have "the c programming language 2. edition"

someone said to me two books to learn c, i need the other major good book name and another book for embedded programming in c
>>
>>51412135
>Third, LISP can interpret and execute programs written in the form of S-expressions. Thus, like machine language, and unlike most other higher level languages, it can be used to generate programs for further execution.

> Since the notation for the writing of recursive func- tions of S-expressions is itself outside the S-expression notation, it will be called the meta language. These expressions will therefore be called M-expressions.

So as you can see I match this; my V-expressions are like M-expressions, but I still support S-expressions. You can write program code in S-expressions if you want. In fact, the V-expression system is actually implemented as a macro transformer which generates S-expressions (which are then subject to the usual S-expression parsing).
>>
>>51413216
If you know C#, you know C
>>
>>51413033

Anyone for advice on a c++ book or tutorial or anything?
>>
>>51413228
yea still want to know more details, and im not hardcore programmer, not so good in c# either.
>>
What's the point of Go?
It's not usable as an embedded/systems language like they're marketing it due to the forced GC and large binary size, and it's not usable as a scripting language either due to not having the conveniences of a scripting and the lack of library support.
>>
>>51412126

That's top 1% area of work, most of them are code monkeys.

You don't seriously expect the NSA, an organization of more than 40k people, to consistently pay that much, do you?
>>
>>51413257
meme
>>
>>51413222
How do your macros compare to the macro systems found in other* Lisps? In most Lisps macros would make anything even close to this kind of transformation still extremely difficult. How does your Lisp* combat that?
>>
>>51413148
>script file for that entity type
so what you are saying is each entity type (player, coin, etc.) has it's own lua_State?

It would really help to see something on the C end and Lua end, even simple code would help.
>>
>>51413376
No. The script file defines functions like "init", "update", "draw", etc. Then, when you run that script file, those functions can be accessed as globals through their name and then stored in the registry.
>>
Why do programs that are compiled on the same machine they are run on supposedly run better? And if that's the case, why shouldn't I compile everything I reasonably can myself?
>inb4 install gentoo
>>
>>51411325
you're fucking retarded, the mexprs were when he was thinking of it as a way of describing algorithms on paper, it was implemented with sexprs and never moved that way because of it's benefits, which are obvious to literally everyone but you and the dylan-shilling fagtron
>>
>>51413420
Because each CPU has its own little quirks due to how it was wired, and so compiling a program on a machine makes it use the electron pathways in the CPU in the most efficient way possible (because the computer knows all about the CPU's quirks).

e.g.: gcc might generate something like
xorl eax, eax
on my computer, but a
movl 0 eax
on yours if the pathway between these two assembler macros is shorter.
>>
So I recently started learning Python with codeacademy. I've spent quite a bit of time on it. So I finally decided to install python and try to run some code without the codeacademy.
I tried something simple like
print "Hello world"

however, with the Python I installed it's saying that I need parentheses. That's not what I learned. I feel like I've been mislead. Why is that happening? Also, what other things are different from the python that codeacademy teaches?
>>
What's the best way to count the number of occurrences of a character in a string for Java?
>>
>>51413468
String myString = /*something*/;
int numberOfOccurrences = myString.lastIndexOf(character) - myString.indexOf(character);
>>
>>51413463
So then again, if I'm on Arch for example, shouldn't I try to install everything from source if I can reasonably do it? And then why shouldn't pacman (to continue the Arch example) have packages and their respective source versions to be compiled for virtually every open source package? Which would allow us to compile from source easily if we choose.
>>
>>51413193
>doesn't have any counter-argument
>>
>>51413466
the version you have installed is python3
the version codecademy teaches is python2
http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html
>>
>>51413504
That sounds like the number of characters between the first and last occurrence. Not the number of occurrences.
>>
>>51413504
Thank you "f"am.
>>
>>51413420
>Why do programs that are compiled on the same machine they are run on supposedly run better?
They don't.
>>
>>51413512
>he has read Marx and finds his anarchoprimitivist posture conductive to human development
>>
>>51413517
Will I be able to read and edit Python3 code if I finish learning Python2, or do I have to start over? I want to continue learning Python2 since I've invested so much time into it.
>>
>>51413554
Should just as well learn a real language and go for Common Lisp
>>
>>51413507
Because most of the time, taking a 5% or so performance hit is acceptable just to avoid the long compilation times created by enabling -mUnique emulation mode (in gcc's case, for programs in C, that is. Probably about the same for C++ too).

Basically, unless you're using some piece of software that really needs to squeeze out every little bit of power it can, it's not worth compiling for your specific CPU.
>>
>>51413451
Ding dong you are wrong. The algorithms could already be described using ordinary mathemtaical notation. Some quotes to prove you're a bullshitter:

>Since the notation for the writing of recursive func- tions of S-expressions is itself outside the S-expression notation, it will be called the meta language. These expressions will therefore be called M-expressions.

> Another reason for the initial acceptance of awkwardnesses in the internal form of LISP is that we still expected to switch to writing programs as M-expressions. The project of defining M-expressions precisely and compiling them or at least translating them into S-expressions was neither finalized nor explicitly abandoned. It just receded into the indefinite future, and a new generation of programmers appeared who preferred internal notation to any FORTRAN-like or ALGOL-like notation that could be devised.

>>51413354
Well, I'll note that you could implement Valutron in Common Lisp using reader macros. Reader macros directly manipulate the input buffer before it is parsed into lists. These are available in Valutron too.

In terms of regular macros, they are supported in Valutron similarly as in Lisp; the V-expressions are processed into S-expressions before they reach macro application and evaluation phases.
>>
>>51413523
That's codePointAt().
>>
i need a good book to learn c and embedded programming on c
>>
>>51413588
>Java
NEVER
>>
>>51413572
Ah ok
>>
File: 1375547558770.png (52KB, 452x530px) Image search: [Google]
1375547558770.png
52KB, 452x530px
>>51413554
>had interview today for a teaching assistant position at my university
>knew the class material pretty well, but completely dropped my spaghetti
>misheard the question and answered something completely different and didn't realize until after the interview
>probably came off as a complete autist
>probably won't get the spot because i sperged out

Why does this happen in every single interview? Fuck everything.
I wish I was born normal
>>
>>51413554
if you learn python2, then you know python3, minus the differences outlined here
http://python3porting.com/differences.html
>>
>>51413591
"An introduction to freestanding C" by Rubert Paul (try to find the English translation)
>>
>>51413599
What's it like going for teaching assistant at your uni? Do you have much employment experience, have you done a masters, or what?
>>
>>51413599
Didn't mean to quote, whoops
>>
>>51413619
I think grad students can be teaching assistants, but I am looking for a part-time undergrad spot, and they are typically hired from courses that they have already taken and done well in.
>>
>>51413602
I wish there was only one Python version. That would be so much easier. Everyone learning the same thing instead of having to fill in the gaps.
>>
>>51413656
that's the plan, kill off python2 and have everyone switch to python3
that's not completely possible yet, because backwords incompatible changes were made in python3, so some libraries and programs are python2 only
https://wiki.python.org/moin/Python2orPython3
>>
>>51413588
>>51413608
>>51413572
These 3 lines of replies were me, and they were all gibberish. Sorry guys, just having a bit of fun (I thought you'd catch on, but that doesn't seem to be happening and I don't want to leave you misinformed).

Have a good night my friends.
>>
>>51413671
EOL for python2 is 2020
http://legacy.python.org/dev/peps/pep-0373/
>>
There's a new thread btw, saying this before some prick starts an extra one
>>
>>51413671
>If you can do exactly what you want with Python 3.x, great! There are a few minor downsides, such as slightly worse library support1 and the fact that most current Linux distributions and Macs are still using 2.x as default, but as a language Python 3.x is definitely ready

lel, what a joke.
>>
>>51413776
i heard python 3 permits static typing
>>
>>51413402
you see, this is where I am lost

I don't see any code showing how it's used like this
>>
>>51413793
>static typing in runtime
why python fags are so idiot?
>>
>>51413687
you shltstain honour and trust among /dpt/, you should feel ashamed
>>
>>51413709
>all these prematurely created threads in the last few days
>not even a link to it
even more proof that my definition of the seasons is correct >>51411723
>>
I love C but I hate C++. Is this normal?
>>
>>51413847
no, you are retarded
>>
>>51413841
I didn't start it, I was just saying to prevent yet another.

It started at like 150 or something. No joke.
>>
>>51408852
> In some alternate universe, they have solved P=NP, but have not discovered a faster sorting algorithm than bubble sort. Think about this.

plenty of people have come up with better algorithms without knowing about bubble sort though. this doesn't sound even possible
>>
>>51413847
totally different paradigms. Don't be fooled by the letter.
>>
>>51410985
> doesn't even know how to properly format lisp
> proposes making changes to the syntax
> code example longer than the equivalent CL

holy kek
>>
>>51413847
explain why c is better using this post

>>51409398
>>
Anyone know of any good interactive tutorials for java?
>>
>>51413960
>good
>java
>>>/trash/
>>
>shitting on java
Java is great after you're forced to use python for a while.
There is literally nothing wrong with using java for non-UI programs.
>>
How can i add up the bytes of only the ACCEPT rules using a command pipeline?

Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
4 583 ACCEPT all -- lo any anywhere anywhere
0 0 ACCEPT all -- tap0 any anywhere anywhere
554091 331350353 ACCEPT all -- any any anywhere anywhere
520 49008 LOG all -- any any anywhere anywhere
2576 279561 REJECT all -- any any anywhere anywhere
>>
>>51413987
quality meem friend. you sure showed me for enjoying a programming language that is widely used
>>
>>51410397
This wouldn't be the source of the problem, but Math.abs() isn't necessary. Math.sqrt() won't return a negative value.
>>
>>51408586
It is a hard language to use correctly. It doesn't provide many of the useful abstractions of newer languages. It's not hard to learn the language, but it's somewhat harder to write code that does what you need.

That being said, it's a shit language and the C circlejerk in these threads is really sad and mostly from very new programmers who have mostly written toy programs.
>>
>>51414329
I meant to add that it also makes it extremely easy to write insecure or unsafe code, and a huge number of bad bugs are because C doesn't have bounds checking.
>>
>>51414357
>it doesn't even have stabilisers!
>>
>>51414329
>>51414357
I don't think you understand the purpose of C at all. C has its niche and it fills it VERY well. People have tried to displace C for years and nobody has even come close.
>>
>>51413893
>properly format

There is no 'proper formatting'.

>proposes making changes to the syntax

Actually, I'm adding new syntax and semantics. It does not affect S-expressions.

>longer than equivalent CL

It's on par. In any case, code length is quite irrelevant. Particularly given my bracing style.
>>
>>51414377
Yes, of course it does. When I said "shit language", I meant in the general context of programming languages. I've used C on plenty of projects and it fills its niche very well. But learning C as the only language you know, and disparaging other languages, is really stupid.
>>
>>51413581
>you're wrong
>post a quote which shows I'm right
quit shilling your fucking trash here get a subreddit
>>
>>51414551
T:-9
>>>51412882
>>
File: escobar.jpg (18KB, 300x300px) Image search: [Google]
escobar.jpg
18KB, 300x300px
>>51414551
Actually I have proven myself right and you to be disgustngly wrong.

McCarthy was clear on where he stood on S-expressions being used to define code: he wanted to use M-expressions there instead. Simple as that.

Try not to let your blood pressure get too high. It's healthier to admit when you're wrong!
>>
>>51414573
wow you can't even read the quotes you mine to support your lack of a point
>>
>>51413177
Pretty much all of them. There's a logic programming framework that's more powerful and much faster in every language, and nobody really has a use for that paradigm nowadays anyway.
>>
>>51413960

Just read a book man. I always see people ask for online tutorials, but you'll learn more just reading a book.
>>
>>51413599

Most people fail interviews too pham
>>
>>51414604
Cry more. Did an M-expression kill your wife and kids? Well, I'm sorry to say that M-expressions were the intended notation for Lisp programs.

McCarthy is right, which means I am right. And that means you're wrong!
>>
>>51408636
you should do a little reading on formal languages and finite state machines and automata. theory of computing is some badass shit
>>
>>51414644
>Well, I'm sorry to say that M-expressions were the intended notation for Lisp programs.
Yes, intended. Intended but never formed. I will leave it as an exercise for you to determine why.
>>
>>51414663
>>51412882
We gi
>>
>>51412660
>gamblers fallacy
>>
>>51412830
Just don't quit trying anon. There are thousands of positions around the world needing to be filled.

Just keep 'throwing it against the wall'. Eventually something will stick.

Good luck anon.
Thread posts: 314
Thread images: 27


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.