/dpt/ - Daily Programming Thread

old thread: What are you working on, Cred Forums?

Other urls found in this thread:

docs.oracle.com/javase/tutorial/java/concepts/object.html
en.wikipedia.org/wiki/Longest_common_subsequence_problem
proofgeneral.github.io/
github.com/dlitz/pycrypto/issues/187
akaribbs.mooo.com/
en.wikipedia.org/wiki/Suffix_array
icube-icps.unistra.fr/index.php/File:ModernC.pdf
akaribbs.mooo.com/js/script.js
akaribbs.mooo.com/css/style.css
akaribbs.mooo.com/img/banner/129.png
149.202.189.83/
github.com/fogleman/primitive
steve-yegge.blogspot.de/2006/03/execution-in-kingdom-of-nouns.html
wiki.hackerspace.pl/projects:zsun-wifi-card-reader
help.github.com/articles/what-is-my-disk-quota/
en.cppreference.com/w/c/io/fscanf
bricklin.com/wontprogram.htm
youtube.com/watch?v=zQLUPjefuWA
youtube.com/watch?v=1S-szvmZReI
youtube.com/watch?v=xAjtTdkYl4M
help.github.com/articles/changing-a-commit-message/
github.com/microsounds/akari-bbs
twitter.com/SFWRedditImages

First for faggotry

I have to learn python. I took a class on machine learning and it said in the description that all you had to do was be able to implement algos in the language of your choice, but now that the first assignment has been published it says it has to be in python or R, neither of which I have much experience with.

Python is for babies. You should do fine.

If you actually knew how to program, you could pick up the syntax in a day.

Python is easy as shit. It is a good language just not for big programs, so stick to small stuff

docs.oracle.com/javase/tutorial/java/concepts/object.html
is this REALLY the best way to learn java?

Currently reading K&R. Just on chapter one, I struggle a bit with the explanations, and when it comes to the exercises, some I don't even know how to approach. I get the feeling the book is a bit hard for me, anybody know a good C book that's more easy going?

Post the exercise you're having trouble with.

tenth for akari-bbs!

Ok, what's wrong with this line?
/((.*|^)(?!\fb/).*img+(?!\fb/).*)/gi

It should match:
>anything, globally, case-insensitively that contains
>>img
>>that does NOT have "fb" before or after it at any point
I'm both using this as a practice and also to help me filter bullshit on some of my frequented threads

But it's no good if I have to ask here for every exercise.

go right ahead user

Actually, if someone could also give me something that detects pseudo-random strings, that'd be fantastic. So, anything that contains a non-word/non-numeric stream of random characters
NOT 718263876
NOT helloWorld15
BUT YES 12gh1U1gf2gh
Or would this require some sort of dictionary..?

>Write a program to print a histogram of the lengths of words in its input. It is
easy to draw the histogram with the bars horizontal; a vertical orientation is more challenging.
I'm not sure how to draw the thing

I stopped caring about Haskell when I was introduced to the concept of monads. What a crock of shit. If your program can only modify state by inventing a higher-order abstraction that can't exist, like some kind of programming deity, then you are fucking wrong and the language is flawed. Same for type checking that basically says "the correct type is whatever the correct type is". That's what the error message said transcribed to words, but god forbid if i wrote in down in English instead of the meme Haskell runes that GHC marks me wrong.

Haskell is logical and category theory never lies my ass. Haskell is just as flawed as any other """functional""" language.

Shouldn't I cast the return value of malloc?
Like


int *p = (int *) malloc(n*sizeof(int)) ;

If I want to make a game from scratch with c++, is winAPI + opengl the best option?

Just use something like String.indexOf or whatever language you're using. There's no point in using a regex for this.

no

>There's no point in using a regex for this.
I'm using the shitposting that's going on in my thread AS practice. It has to work on Cred Forums filters

>ESSENTIALLY: /dpt/ help me make these filters work on Cred Forums, and as a bonus, I'll be getting better at RegEx

for C++ yes for C no

You don't have to. Most people don't. In the end it's a personal preference.

Why

But the compiler will complain because one is int * and the other is void *

A C compiler shouldn't.
C++ on the other hand requires the cast, but how often do you use malloc() in C++ when there is new.

alright I tried this, and it SEEMS to be holding:
/([^fF]+[^bB]+.*img|IMG.*[^fF]+[^bB]+)/i

I guess, ultimately, whatever...

I don't know if I should learn Go. Should I?

See you next thread

Parsing IMDB URLs from an unsanitized, wildly formatted list of ~2000 movies.

sub omdb_search {
my ( $title, $year ) = @_;
$title and $year or croak $!;
my $url;
if ( $year ) {
$url = "omdbapi.com/?s=$title&y=$year&plot=short&r=json";
} else {
$url = "omdbapi.com/?i=$title&plot=short&r=json";
}
return lwp_get( $url );
}

sub lwp_get {
my $url = shift;
my $ua = LWP::UserAgent->new();
$ua->timeout( 10 );
my $response = $ua->get( $url );
if ( $response->is_success ) {
return decode_json( $response->content );
} else { croak $response->status_line; }
}

Is there really any point in freeing all my memory and calling quit on my libraries before exiting my program?

libraries may need to flush buffers, remove hooks, or reset something
you're fine not freeing memory

Wouldn't that leak memory if another program forked itself to run yours?

It's the difference between a good coder and a filthy code monkey. Chose you side user.

forking A to execv B makes B a seperate process with seperate buffers

>unix

can someone explain how to do ROT-1 in python here's my code
test1=input("Enter your string: ")
from codecs import encode
test2=encode(test1, 'rot1')
print (test2)

here's my error
lookuperror: unknown encoding: rot1

But code monkeys love their patterns and rules. Not freeing is "against the rules"

>anything else is better

>/dpt/
>Cred Forums.stackexchange.io

I'm taking computer science courses. Could you guys recommend me a good Java book?

malloc returns a pointer of type void in C

Segfaulting is also "against the rules".

C implicitly casts void * to any T *.

I'm aware

for C++ yes [you should cast,] for C no [you shouldn't cast]

But all memory is freed anyway when exiting the application.
Deleting it all one by one is just a waste of time.

Why do you think it takes modern video games so long to shut down?

If you have a bazillion heap allocations, sure. That also means you're taking a long time to start up.

...

Is Go good language to learn?

yes, now start before someone tells you it's super shitty and puts you off

No, it isn't.

This has happened to me sometimes.

It is shitty, though.

>listening to /dpt/
>ever

I had the same problem as you. "C Programming: A Modern Approach" by K.N. King might be more suitable for you.

I'm currently taking an online course on Computer Science and Programming with Python, and I'm having a bit of trouble with one of my assignments. I think I know what I need to do, but I'm a bit lost on how to go about it.

I need to write a program that will take a string of characters and print out the longest substring in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl' then my program should print Longest substring in alphabetical order is: beggh

I believe what I need to do is compare each letter in the string and see if it is

LCS en.wikipedia.org/wiki/Longest_common_subsequence_problem

and compare wirth the alphabet

if you are aware of this, then you know that the type of the pointer matters. why wouldn't you cast?

>his language doesn't have move semantics

because google reveals all to those who ask

I'm not sure it would work. Looking at it, it looks like it wouldn't list duplicate characters. The example answer for my problem lists the letter 'g' twice. The LCS example compares '1234' with '1224533324' and returns only '1234'

To fit my problem, shouldn't it print '12245'?

Maybe I'm understanding this all wrong.

do you have to make them from scratch? You could just use the R libraries for it

i want to hear your answer specifically. i can think of cases where pointer type absolutely matters, so want to know why you are saying not to cast.

Is there any difference between initializing in the header vs the constructor?

class Sprite
{
public:
uint32_t width;
uint32_t height;
uint8_t *data = nullptr;
};


vs
class Sprite
{
public:
Sprite() : data(nullptr) {}

uint32_t width;
uint32_t height;
uint8_t *data;
};

I should be working on real projects, but Windows 98 and Turbo C is so comfy.

longest_seq_pos = X
longest_seq_length = X
current_seq_pos = X
current_seq_length = X

and then go through the string and see if the current character starts a new sequence or adds on to one and then check if you need to update the longest_seq

if you forget to include headers for malloc then malloc is implied to be a function that returns and int and casting to a T* can prevent errors and such

since malloc returns a void* converts to T* in C you don't need to cast

there's a blank line in your circle

Wich uni are you in?

how do I do rot1 in python?

Apparently dir() is a built-in function in Python and I've been using that name as a variable unknowingly.
What should I change it to? Something similarly short, preferably.

>What should I change it to?
What's it for?

For Directory objects.

>there's a blank line in your circle

Yes, I realize that.

>Directory objects.
Hungarian notation it since it's two words. Fast, easy, is exactly what it says it is.

dirObj

Not a whole lot you can do with "directory object" and still have the variable name state explicitly what it is.

I read "Why are you *calling* the return value of malloc()?".
Hmm...

in this case no

C++ can be evil sometimes.
class Foo
{
public:
Foo()
{
big_und_expensive_call();
}
};

class Bar
{
public:
Foo *foo = new Foo();
};

int main()
{
Bar foo;
return 0;
}

This is thoroughly intuitive

So I think I know C pretty well.

Anyone got some tasks/projects/etc to challenge me to check I really do know how to do C?

Define a function that returns a function pointer of the same type.

what on earth are you doing

HTTP/1.1 server
single-threaded handling one request at a time, serving files from the directory the server is running in
you only need to handle GET and HEAD requests
you can skip GZIP and deflate compression

IETF RFC7230 and RFC7231 are the only ones you'll probably need

This is thoroughly intuitive
>Define a function that returns a function pointer of the same type as current function that returns a function pointer of the same type as the current function.

how did you go about doing this?

Borland Graphics Interface.

He's trying to define a post that returns a post of the same type

anime proofgeneral.github.io/

"I call it The Shitpost!"

Should be close enough
struct penis {
struct penis *(*dicks)(void *);
}

kay guys, i've got a problem. I'm trying to create a image encryption software in python.
But i don't know how to deal with images that arent multiples of 16 in size. Any advice?
Im currently filling them with "metadata" about the height and width of the image that i'd like to use for decryption and then i fill it with
random chars. It is obviously not working.

1st: you should not do your own encryption, leave it to an encryption library or program
2nd: what encryption cipher

Im not using my own encryption, working with PyCrypto AES

see github.com/dlitz/pycrypto/issues/187
rebuild the package from source and use AES.MODE_OFB

Why can't you just pad with random bytes ? What isn't working ?
Rebuilding the package from source like the other guy is suggesting may be a lot more complicated than padding. Complex libraries often have c bindings, cobol bindings, other dependencies, etc.

In a pinch, Python isn't hard to learn. That said, you may consider asking your professor for clarification, if the syllabus is contradicting the assignment description.

Akari BBS rev. 11 is now live!
akaribbs.mooo.com/

Added in this update:
>Rotating banners
>Interactive linkquoting
>404 page
>released as GPL v3 (see bottom)

Learn what suffix arrays are. They are probably one of the more amazing data structures.there just simply with how simple they are relative to how they are used.

en.wikipedia.org/wiki/Suffix_array

Read through icube-icps.unistra.fr/index.php/File:ModernC.pdf and try and understand it.

Does C do return value optimization?

here's what you should do:


>Eliminate render-blocking JavaScript and CSS in above-the-fold content
Your page has 1 blocking script resources and 1 blocking CSS resources. This causes a delay in rendering your page.
Remove render-blocking JavaScript: akaribbs.mooo.com/js/script.js
Optimize CSS Delivery of the following:akaribbs.mooo.com/css/style.css

>Leverage browser caching
Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
akaribbs.mooo.com/css/style.css (expiration not specified)
akaribbs.mooo.com/img/banner/129.png (expiration not specified)
akaribbs.mooo.com/js/script.js (expiration not specified)


>Enable compression
Compressing resources with gzip or deflate can reduce the number of bytes sent over the network.
Compressing akaribbs.mooo.com/ could save 20.5KiB (79% reduction).

I'm coding a modernized imageboard :^)

Anyone could give feedback on the design?
149.202.189.83/

(Filled with randomness)

Seems decent but lacking some color. I like it.

fucking love the minimal design.

awesome

Could you give more details how are you doing this?

languages? architecture?

Can you maybe think for yourself when forming an opinion?
None of that advice is applicable to my website in it's current state.

You should make it clear where posts begin or end.
Everything sorta blends together.
I do like the general design tho.
Also, what's your production stack?

I'm sorry with the blunt criticism but copying what is essentially Reddit's front page post format and adding hashtags to it like Twitter doesn't make it anywhere near an imageboard.

It is modern though.

It's kinda a mix between twitter and Cred Forums, I like it. It's actually something i wanted to do myself.

I've come up with another challenge for the dpt programming challenge:

Implement a Brownian Motion using linear interpolation (Lévy construction).

C doesn't have any copy constructors, thus have no need to ellide or optimize away anything in the first place.

Yeah but

big_struct some_function()
{
big_struct t;
// ...
return t;
}


Would this return a copy or would it optimize the copy away? Or should I play safe and pass a pointer to my struct.

I don't want to overload the design with colors, else they would be meaningless

Thanks

This is true. This is basically a crossover between Cred Forums, Reddit and Twitter, nothing else. I'm planning to release this as an open-source board.

I can't get the posts easier to discern without essentially changing the design, but thanks for the feedback. I'll try harder

Debian > (Nginx?) > Go > Html+CSS+Javascript, no framework.

who else remembers getting their free snacks while working at google back in the day?

Right now your background colors change for no reason.
Give each post a unique light background so you can tell them apart.

This will be the case. I'm actually putting random colors for testing purpose

Also:
Blue = Yourself
Red = Admin / Mods
Purple = OP (when a specific tag is used like #ama)

Give administrators a special icon next to their name instead.

I'd be pretty jazzed about free snacks tbqh. The best my company does is throw us leftovers from exec luncheons, etc.

Like we're a bunch of dogs

We get free fruit.

>Like we're a bunch of dogs

That's about what they think of you.

I see you are adept at reading between the lines. Well done.

To be honest I believe hashtags to be far superior than boards or "subreddit". They allow the users to be split without isolating them, and I find myself pretty bored on Cred Forums when I want to post something but there is no board for it.

A special icon would be nice. There is no name though. I'm not sure about writing "Anonymous" everywhere... it's kind of useless

Signed up for an intro HTML5/CSS/Javascript course.
Its a bit wayyy too Intro level.

You also have no sense of community or a "us vs them" mentality when the only thing affecting the visibility of your posts is a single hashtag.

>Would this return a copy or would it optimize the copy away?
Logically, it copies. All sorts of things can happen in reality; optimizing compilers have many tricks they can do.

Does anyone know how I can request admin rights from inside a running C# application?

Currently I detect if I have admin rights and close/restart the whole program with an added 'runas' argument if I don't
This works fine but doesn't really seem ideal

S

if the application requires admin privileges you can change the manifest to make it prompt for privileges before starting

Yeah, this can be seen as a downside as well, but it would prevent the forever circlejerking loophole that's Cred Forums...

>Like we're a bunch of dogs
If your company feeds you, you are a dog.

is rust a meme?

So I switched to VIM for doing python, got it configured with nerdtree now how do I exit nerdtree not close it but bring my cursor back to the main window i.e where my code is, I pressed the nerdtree keys by accident

In terms of how much it gets promoted around relative to its actual stability and usability? Yes.

I really wished that Rust would've done quite a bit more work before landing 1.0. Granted, that ship has sailed but they are already having backward compatibility issues with one or two things they didn't think through.

Is there any way to do it in code?
Xamarin Studio apparently doesn't support application manifests

probably not a way that is as simple as using runas

Why? What's wrong with Rust? The main reason I love it is for its full memory management w/o gabarage collector.

I'm an expert in subtlety.

Is :Sex not enough for you?

...

I wonder how long it will take me to get tired of this.

have you seen
github.com/fogleman/primitive
? pretty cool

What's wrong with this c code?

typedef struct TRIE_NODE
{
char* word;
TRIE_NODE node[26];
}TRIE_NODE;


I get the following error:

definition of 'struct TRIE_NODE' is not complete until the closing


If i do
typedef struct TRIE_NODE
{
char* word;
TRIE_NODE *node;
}TRIE_NODE;

it works just fine though. Arrays are allowed in C structs, that's whats bugging me really.

Sorry. It was supposed to be struct TRIE_NODE[/spoiler]. I'm getting the error with the correct syntax. The code i'm replying to would give a syntax error.

I've attempted something very similar, uses triangles, though.

Still better than the original

maybe you didn't include ?
You can't have a TRIE_NODE in another TRIE_NODE, because that TRIE_NODE will have another TRIE_NODE and that one will itself have another TRIE_NODE and so on and so forth.

It's gets touted as a C replacement when it's not anywhere near suitable as such in several domains, which I happen to work with.

But it is well designed for the moment in most areas that have been stabilized. I only wished the designers thought about its verbosity in some places and compared it with how other languages do it much less succinctly.

do you have any sense of why they rushed to 1.0?

>when it's not anywhere near suitable as such in several domains, which I happen to work with.

Which are those?

Not trolling, just curious.

Can someone explain when or why I should use static methods in c# or java. I understand static variables but I can't wrap my head around static methods.

You might not need to actually instantiate it, because it won't have members.

Think about Math.xxx();

All for "stability" but IMO, they rushed it IMO because the amount of missing library features they had to add and the amount of breaking changes they have announced since 1.0 and taking only until recently to release libcore makes the language look very unstable compared to other languages like Python which don't have ISO standardization like C or C++ and use community based planning.

It does seem to be slowing down now so that is a good sign for the language. But it really should have stayed in the cooker a tad longer. If it had released May this year instead of last year, I think certain parts of the language would've been a lot more robust.

Embedded PIC microcontrollers.

>kingdom of nouns
How do people defend this shit?

Whatever point you're trying to make, I don't care. I'm guessing it's a quote from a rant that a Haskell user wrote while he was at the coffee shop.

>Embedded PIC microcontrollers.

That's pretty much what I was expecting.

Building a website

This is how to build a webpage


First you must add <!DOCTYPE html> for html 5
<img src="images/test.png">

HOVER YOUR MOUSE OVER ME! THIS SHOULD SHOW 5
<h1> This is a heading & it is the "biggest" one in this page>/h1<⩳

this is the new list
git gud
git muney


then aquire $

kingdom of nouns is quite a bit older than haskell users posting while in coffee shops
steve-yegge.blogspot.de/2006/03/execution-in-kingdom-of-nouns.html

...

what's he up to anyway

>snowboarding, guitar, piano, juggling, video games, golf, mountain biking
fucking normalfags

Probably ""accidentally"" posting nudes on his G+ account.

Hello, I've been a computer hobbiest for probably 10 years now but my first exposure to a formal computer science education was in August.

When we covered modularization(they also used the term "functional decomposition") what the professor described as a module is more or less what I thought an object was. A logically cohesive block of code that is separated into a module so that it can be invoked when needed, providing efficiency and reliability(if it works once it should work every time).

So my question is what is the actual difference between an OOP language and a standard one? If you can use modules in a non-OOP language then what exactly is it that OOP offers to earn it's, rather significant, distinction?

He's a Washingtonian. There's a LOT of outdoorsy folk here.

Why would you use that instead over a namespace?

OOP

oop is very loosely defined, don't worry about it.
the core functionality oop should provide is to encapsulate state to reduce invariances and code to simply provide a consistent public api that is guaranteed not to break, allowing you to change shit up under the covers.
encapsulation is the core principle. some languages additionally provide a special syntax for functions that operate on state encapsulated in composite types (methods, objects) or add further ways to abstract with this special syntax, like interfaces, abstract classes, inheritance and all that other bullshit.
people have been bullshitting the term oop into meaninglessness.
imo: got some kinda encapsulation? got oop. header files are a kind of encapsulation (assuming you provide a "stable" header file) as well, modules/packages are, objects are, scoping + closures are.
normally it's about some kinda state that persists across calls though, so only having some kinda concept of "scope" without closures isn't enough for proper encapsulation.

what would you do with a system that has a 400MHz MIPS CPU and 64MB of RAM (~32 MB available for an application)?
I bought one of these, and I want to make something interesting with it:
wiki.hackerspace.pl/projects:zsun-wifi-card-reader
was thinking about making a map app, seems like a good target, since everything could be done client-side... but I still can't find much info on how to do this

Neither Java nor C# support free functions.

I would make a tiny operating system written entirely in MIPS assembly.

*web app

I dunno much about OSes
that would take a lot of time, and I could end up breaking the little thing
plus, it wouldn't be of use for anyone

>I could end up breaking the little thing
With specs that weak, it cannot be too expensive to replace if you accidentally brick it.

>plus, it wouldn't be of use for anyone
Well that's how you do things. I don't really write programs so that other people might find them useful. If I'm not being paid, I either write code for fun, and to do something interesting, or because I might find it useful.

>support
Is it really that complicated?

It's not that they're complicated, it's just that they're not supported.

>imo: got some kinda encapsulation? got oop.
Er, you kind of need OBJECTS specifically for it to be OBJECT-oriented programming.

eh, semantics

It literally cannot be done.
No free functions are one of the tell-tale signs of a meme language, and you should cease using it immediately.

Why the fuck else would you call it object-oriented programming? The name also kind of implies that you're using objects a lot, not just incidentally.

Snake Oil Programming

So a friend told me github has a 1GB cap on repos, what happens when you hit that cap do you have to abandon the project? how can you free up space on your github repo

help.github.com/articles/what-is-my-disk-quota/

just store the source code and not assets and you're fine

>this, again
C uses objects a lot, too. actually, you use objects in all programming languages...

my D is gonna use your A alot, too. acutally.

why?? and how?

What's your point?

in C, "object" means anything that takes up space

...

The difference between displaying the histogram vertically and horizontally is that you must buffer the input when doing it vertically.

Save the input into an array, and once all the input is received, draw the histogram. Remember that you don't have to save the actual input, just the word lengths.

If you want code I'll try, but I'm on mobile so it's hard.

if (grade2 >= 96)
gpa2 = 4.5;
letter2 = "A";
else if (grade2 >= 92)
gpa2 = 4.0;
letter2 = "A";
else if (grade2 >=88 )
gpa2 = 3.5;
letter2 = "B";
else if (grade2 >= 84 )
gpa2 = 3.0;
letter2 = "B"
else if (grade2 >=76 )
gpa2 = 2.5;
letter2 = "C";
else if (grade2 >= 72)
gpa2 = 1.5;
letter2 = "C";
else if (grade2>=68)
gpa2 = 1.0;
letter2 = "D";
else if (grade2

OOP doesn't simply means "usees objects heavily"

just like in every other language

Who said you couldn't do OOP in C?

>just like in every other language
no

if (x)
{
//shit
}
else if (y)
{
//more shit
}

k

yeah, who said it? no one

fuck i forgot if its more than one line you needed braces. thanks senpai

This conversation is retarded.

python zipf thingy, run the code, tell it which file to read, tell it to create a xyz.csv , load it up in excell (or calc if your cheap like me), and see that some words are said proportionally more
import collections, string, csv

name = input('enter a file->')
handle = open(name, 'r')
table = str.maketrans('','',string.punctuation)
text = handle.read()
text = text.translate(table)
words = text.split()


x = collections.Counter(words)


print (x.most_common())

filename = input('nameit.txt-->')

with open(filename, 'w') as resultFile:
writer = csv.writer(resultFile)
for row in x.most_common():
writer.writerow(row)

pic lated

you don't even understand oop at the most fundamental level, let alone industry "OOP"

He sound like somebody who wants to say that OOP is great and doesn't deserve the hate it gets whilst moving the goalposts entirely by redefining it.

the weak points are I have to do some clicking in excell/calc cause It loads the cells vertically, and im not leet enough to figure out how to get it to load horizontally

also I have to cut my pasta short cause more then about 25 words makes the graphs unappealing

OOP is great and doesn't deserve the hate it gets.

>inb4 it's FUNDAMENTALLY FLAWED!

i guarantee you don't program in actual OOP

It's good when it's appropriate, but it's so rarely appropriate and it's usually implemented so poorly that I think the hate it gets is deserved.

So it's not fundamentally flawed, just practically flawed.

lol, I didn't even say anything about OOP itself.. I'm

It's fundamentally flawed, you stupid microcuck race-mixer.

So I was right, because you're redefining OOP by using the C standard definition of "object" rather than the generally recognized conceptual definition.

>microcuck race-mixer.

I detest the accusation that I'm a microcuck.

You're always flaunting how much you love being cucked by Microsoft. You're sitting idly by while someone else has control of your computer.
You also have a small penis.

This rant would have been better if he didn't spend most of it spewing literary fluff

I'm in 4th year CS and I have to do a project for a course. I am thinking about doing a peer to peer app to sell textbooks like OpenBazaar, but for mobile. Their mobile app is a clusterfuck for some reason and it doesn't exist yet. Why is it so hard to make a p2p auction app? I don't want to make something that uses web servers, because that already exists, and necessitates overhead fees.

I would stay away from Buttcoin for this so normies could use it.

A few questions involving C. Help would be greatly appreciated.

How would I write a C program that converts a length in inches to centimeters (cm). It should prompt the user to enter the length in inches then convert and display that length in cm. Output should show the conversion for 35". (1" = 2.54cm.)


How would I write a program in C program that lets the user enter an ASCII code value, such as 65, and then outputs the character that corresponds to that ASCII code. Output should show the characters for decimal 81 and 113.


Provide some origin information on the C language (background, inventor(s), reasons for existence, best uses, etc.)


Provide three specific examples of programs or types of programs where C would be a good choice for the programming language. Give specific reasons why C would be a good choice for those examples.


Name at least three advantages of the C language.


Name at least three disadvantages of the C language.


Thanks

read sicp

If you can't do any of your own homework, what's the point in doing it at all? Just fail.

Do your own homework.

These are textbook problems. Read your textbook.

C was invented by Barney Throatstrep so that he could put a virus in the compiler to control the computers of everyone who ever ran a program written using C. Unfortunately, the plan backfired because C has never been used in practice.

>You also have a small penis.
Then how he would please negresses?

Did you try turning it off and on again?

I used to for loop geometry stuff like this in turing (the language) back in highschool.

I don't know how to answer the last 3 questions. qualitative questions have always been my nightmare.

But I don't have the time :(

I really would rather not. I want to learn C.

Please don't troll me. I'm not that retarded.

meh

>implying he actually has sex with any sheboon as opposed to fapping to one
>implying any of us can get laid

>I want to learn C
You clearly don't if you're posting entire fucking pages of questions

If you can't make a program to convert units you should just drop out now.

>I want to learn C.
Then do your own piss easy homework, not make us solve it for you.

pasting*

your first 2 questions aren't even C related

I promise I will contribute to this thread if someone helps. I will learn C!

Then read K&R.

Then do the questions yourself dumbass

Without calling me a faggot what is a good programming language to learn first?

Something that lays down the framework for other languages in the future

j-java?

Obviously the syntax and everything has to be C.

Haskell

The ending of that gif is hilarious

I told you guys. I'm fucked. I don't have time to read my textbook right now :(

...

But you have time to shitpost

Into the unemployment line you go

you forget to import studio.h

We use Primer Plus.

If you want to learn to think programatically, that is learn to program rather than learning syntax, then python or a Lisp (Scheme, Common Lisp, Racket, Clojure, just pick one).

Don't learn java first, java is for when you know how to program.

>how to convert inches to cm
float cm = inches * 2.54;
>how to convert integer to ascii character
printf("%c, %c", 81, 113);

A social neural network.

AppAmaGooBookSoft gonna get shrekt.

Thanks... I truly appreciate that.
But I don't know how to write the rest of the two programs.

perl

Then read your textbook.
Why the fuck are you even in school?
I didn't even go to college to learn programming and I'm gainfully employed as a software dev.

Why do I even come here anymore.

#include
int main()
{
printf("hi");
return 0;
}

C IMO pham

so I'm doing codecademy and I've ran into an error
my code is
def spam():
eggs = 12
return eggs

print spam()

and I get SyntaxError: invalid syntax line 4

what if i told you he was just pretending to be retarded to elicit a response from you

I didn't mean to piss you off. I truly appreciate the help. Sorry brother.

it means you have invalid syntax on line 4

what language?

>float cm = inches * 2.54;
So I put that after "}" for example?

python, also nevermind I used 2to3 the issue was I was running python 2 code with python 3

no you need to put it in the ( )

Damn, questioner here; if only that were the case :(

Do I include quotations?

it's up to you, C is cool like that it

>I don't have the time
You have the time to make this post on Cred Forums.

>I really would rather not. I want to learn C
Then read your fucking textbook.

>>implying any of us can get laid
Yeah, just gonna throw this out there, but I'm not a virgin, user. Not all of us are complete losers.

This is a good textbook. Much more up to date than K&R.

en.cppreference.com/w/c/io/fscanf

For reading input. But please, learn the basics of variable assignment and function usage BEFORE asking questions.

I more or less know how to "program" but I feel like I am missing some of the more foundational theory stuff. I've mostly learned just by noodling around writing shitty scripts and the like over a few years but never actually got any "good" a programming, so I'm wondering what some good books are for getting my compsci foundations down.

I'm looking at The Elements of Computing Systems, and also thinking about picking up some sort of book on algorithms (currently looking at The Algorithm Design Manual, or Sedgewick & Wayne's Algorithms). Any recommendations, /dpt/?

then fuck off. i knew a hundred people like you in intro to programming, and there's only a couple of them left now in junior year. the computer science program has a huge bottleneck at the start when people with 90 iq's who want to be hackers or video game developers get their asses handed to them, but the ones who squirm their way through by copying classmates or online code samples get weeded out in the advanced courses. read this
bricklin.com/wontprogram.htm

the type of person who will be able to graduate the csci curriculum didn't have any trouble converting inches to centimeters on day 1. your brain isn't wired to program if you can't figure it out immediately, and i truly mean immediately. switch majors

youtube.com/watch?v=zQLUPjefuWA

You're clearly in over your head if you're coming to ANYONE for help with programming.
All programmers worth their salt are autodidacts, the rest are new-age-blue-collar code-monkeys.
Honest advice: Drop out / change majors to something you're more interested in and at least slightly competent at, learn to program in your free time, and only ask questions that are either about finding existing documentation or are improving documentation, anything less is a waste of everyone's time including yours.
Pick something cool you want to make over the course of a week, search out what's needed to make it, simplify it if you realize it's beyond the scope of a week, then repeat that until you end up with some small cool thing that you made on your own.
Repeat that, keeping in mind that a small cool thing may be an addition to something that already exists made by you or someone else.
Gradually make cool things more frequently and/or cooler.
Repeat indefinitely.

This applies to most other crafts as well.
And instead of getting a degree that's worthless outside of academia, you get a portfolio that objectively demonstrates your skill.

read sicp

Thanks. Do I just put the text where "hi" is?

Also, Tiny C Compiler just flashes on and off my screen. What am I doing wrong?

bump

>21yo physics degree dropout
>NEET
>I've started programming Android games in Java
>Want to get a job that uses Java
>All jobs require a degree

What are your thoughts on computer science degrees?
I'll give myself a deadline of 10 months to make money via my own ventures before I commit to spending £50k and 3 years of my life.

Advice please.
>inb4 shit talking java instead of giving me advice

Your program needs the greeting at the start so you can tell your cpu that you want to run a program. The conversion goes into the main( ) since main is an int already

Thanks. I'm going to try GCC since I can't get Tiny C Compiler to run.

you could fall for the bootcamp meme

i need more top programming choons

all choons is programming choons
youtube.com/watch?v=1S-szvmZReI

youtube.com/watch?v=xAjtTdkYl4M

only pretty korean singers can inspire good coding

So what you're saying is that nothing can inspire good coding?

nothing can help you
stupid ch*nk

Anything by kraftwerk

Various Mega man X soundtracks

She's cute :)

Is there any way to change a commit message after I've pushed to github?

git commit --amend should work

help.github.com/articles/changing-a-commit-message/
m8...

>Binary files in git repo

I could have dropped in my 15MB 404 page, but nah.

Ummm.. I don't think it's the compilers. I think it's me. How do I start a compiler?

where is the source code?

github.com/microsounds/akari-bbs

>This is basically a crossover between Cred Forums, Reddit and Twitter, nothing else
huh, I've wanted to do this for quite a while. congrats!

>c
godspeed

>This is true. This is basically a crossover between Cred Forums, Reddit and Twitter, nothing else. I'm planning to release this as an open-source board.
You should rename it C.A.N.C.E.R.

Can anyone point me some retard proof tutorial on python3 asyncio stuff? Thanks

>come off my meds
>done more programming in one day than I've done in the past month
feels good lads

...

My game is coming along nicely. It's still not making much, only ~$30 a day, but it keeps getting better and better.

Through what payment medium are you receiving $30 a day? I'm impressed, user.

bump

Steam. I'm currently in early access. Based on my conversion ratio and the views (1mill) I'll get when I transition out of early access I predict I'll get ~$10000.

Yah, cool, but not much considering I've spent like 2 years on this game haha. A fun hobby though.

What's the game?

Last time I posted it on Cred Forums I got a bunch meme riddled reviews. Many positive, but I still found it had a negative effect on the community. Because of that I'm not going to name it.

It's a (small time) space game with coop multiplayer currently in early access.

I want to find the highest density area in a (2D) point cloud.
Here's how I'm going to go about this: I'm going to make a quadtree of certain depth d. For each point, I'm going to 'add' it to the tree by traversing from root to leaf while incrementing a counter on each level so we know which branch has the highest density.

Is there a better way to do this? I don't really like it, because I wouldn't be able to detect the highest point of density if all regions were roughly equally distributed (meaning that the highest point of density is in the center of all of the regions)

What is the easiest C compiler for a noob? I can't get TCC or GCC to work.

I'm working in an android app that my company is thinking to rent (not only the app, but all the system) to banks and stuff. Its a good business, but Im having a problem. Boss wants users to have one phone per account. I mean that they could only login in one one phone.

What's the best way to control this? With cellphone's IMEI? I'm using webservices, I was thinking to use some kind of flags... Any idea Cred Forums?

gcc -o main main.c too hard?

Is it one of these?:
Interstellar Rift
Sirius Online
XenoRaptor

What exactly do you mean when you say you can't get them to work?

Because unless you're attempting some kind of witchcraft, both of these should be very simple.

Working in a UNIX environment for the first time

Whats the proper file naming convention here?

my gut tells me "myFile" or should I just name it "myfile"

is goto a thing in python? if so how do I use it

I click the exe files, a cmd window quickly appears, then disappears immediately.

Simple.
- If you work with other people, use their naming convention.
- If you don't work with other people, it doesn't matter.

>begin new thing
>immediately seek out convention

hilarious

Run it from the command line dummy.

What's best IDE linux

Nope. Goto is shit and modern programming languages don't support it at all.

>Goto is shit
(You)

VS in a VM.

How do I get to desktop from system32?

so what's the alternative in python?

Yes? It is shit and the only few use cases it has can easily be replaced with other language features.

Nevermind. I got it.

Nevermind. I got it.

Use cd command to change directory.

Never mind, I got it!

NEW THREAD!

funny joke

What the fuck is up with Java's memory usage?
I'm trying to make a 2D array of doubles (10k x 10k) and it fucking explodes to gigabytes of memory.
Logically it should only use 0.8 gigabytes because it's a contiguous memory space, right? But no. It's using over 6 gigabytes of RAM and isn't stopping.

>because it's a contiguous memory space, right?
Don't underestimate Java's retardation.