[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 22
File: 1389567984959.png (123 KB, 600x811) Image search: [Google]
1389567984959.png
123 KB, 600x811
Old thread: >>55198250

What are you working on /g/?
>>
File: spoiler image.png (2 MB, 1377x1237) Image search: [Google]
spoiler image.png
2 MB, 1377x1237
pls don't bully 4-chan

first for Haskell
>>
>>55206771
Let's discuss our personal usage of terminology gee.
>how do you define a variable?
In particular, is it just a label on a piece of the stack, or the piece itself? Doess dynamically allocated memory contain variables?

I see Golang take the stance that
>A variable is a storage location for holding a value.
from which it follows that
>[dynamic allocation] allocates storage for a variable at run time.
and that &x points to the variable we were calling x itself. In C its not so, so there is a weird, difficult-to-explain distinction between variables and objects... What do you think? Would that terminology be possible in C?
>>
first for Python is cancer
>>
First for lookup table is more readable than hundreds of if statements.
>>
>>55206836
Fucked up my link

>>55206783
>>for no gain
Why express things in code logic, when you can express it in data?
My way is easily extendible, but I suppose it's not that important in this situation, because you probably won't be extending brainfuck.
>>
>>55206829
First for
if c == "":
break
elif c == '>':
sys.stdout.write("\tadd $1, %rbx\n")
elif c == '<':
sys.stdout.write("\tsub $1, %rbx\n")
elif c == '+':
sys.stdout.write("\taddb $1, (%rbx)\n")
elif c == '-':
sys.stdout.write("\tsubb $1, (%rbx)\n")
elif c == '.':
sys.stdout.write("\tmov $1, %rax\n\tmov $1, %rdi\n"
"\tmov %rbx, %rsi\n\tmov $1, %rdx\n\tsyscall\n")
elif c == ',':
sys.stdout.write("\tmov $0, %rax\n\tmov $0, %rdi\n"
"\tmov %rbx, %rsi\n\tmov $1, %rdx\n\tsyscall\n")
elif c == '[':
sys.stdout.write("\tcmpb $0, (%%rbx)\n\tje c%i\no%i:\n" % (n, n))
s.append(n)
n += 1
elif c == ']':
r = s.pop()
sys.stdout.write("\tcmpb $0, (%%rbx)\n\tjne o%i\nc%i:\n" % (r, r))

Is better because
>one dispatch structure
>regular
>freer
>>
>>55206829
agreed. Reposting:
>>55206801
Yes there is a qualitative difference. There are much more details which are fixed in a if-write program like yours than in creating a dictionnary containing lambdas or whatever. There is only one way to create the dict, but here you copy paste the exact manner in which you are going to use the string, dummy.
>>
>>55206854
No it's not, except if your goal is to express how inexpressive Python is. ffs!
>>
Made a program that does this,
What are more ways to obscure IPs/URLs?
aHR0cDovL/CdkIbwnZCO8J2QjvCdkIbwnZCL8J2QhC7wnZCC8J2QjvCdkIwvDQpodHRwOi8vMDMzMC4wNzIuNTU1OTgvDQpodHRwOi8vMHhkOC4weDNhLjU1NTk4Lw0KaHR0cDovLzAzMzAuMzg1NjY4Ni8NCmh0dHA6Ly8weGQ4LjM4NTY2ODYvDQpodHRwOi8vMDMzMC4wNzIuMDMzMS4wNTYvDQpodHRwOi8vMHhkOC4weDNhLjB4ZDkuMHgyZS8NCmh0dHA6Ly8zNjI3NzM1MzQyLw==
>Error: Our system thinks your post is spam. Please reformat and try again.
base64 decode it senpai
>>
>>55206871
They could do it while still yielding the string to the stdout.write, which is the main point of the code. Plus you can just return "" if you don't want to output anything. See >>55206361
>>
>>55206914
>all valid urls
wat
>>
>>55206887
I was joking, I'm not the guy from last thread that thought it was a good idea.
>>
File: solution.png (14 KB, 851x330) Image search: [Google]
solution.png
14 KB, 851x330
>>55206854
>this image was made ironically
>the code in this post was not
>>
>>55206970
Oh ok! I so often fall for it. 10/10 nonetheless!
>>
File: 1441769647372.png (132 KB, 604x799) Image search: [Google]
1441769647372.png
132 KB, 604x799
>GNU software
>>
It's this legal code in C?
int main(void)
{
string c;
for(int i = 0; i < 5; i++)
{
c += " ";
}
c += "#";

printf (c);
}
>>
>>55207150
>string c
No.
>>
no it isn't good at all

there is no switch or pattern match for python

you are suppose to use multiple if-else statements, that's why python is dogshit

the guido faggot
>>
>>55207150
no for multiple reasons
>>
>>55207179
I'll be using a string library.

I already know string it's not a default type in C.
>>
>>55207183
even worse, you are forced to use elif instead of else + if
>>
>>55207150
No, you need to include stdlib
#include "stdlib.h"
int main(void)
{
string c;
for(int i = 0; i < 5; i++)
{
c += " ";
}
c += "#";
printf (c);
}

There, much better.
>>
>>55207216
xD
>>
>>55207216
how do you format with tabs inside appchan?
>>
>>55207266
>tab-based language
Disgusting. I only use space-based languages.
>>
>>55207216
>#include "stdlib.h"
>not #include <stdlib.h>
>not using #include <stdio.h>
>string c
>printf(c)

hello pahjeet
>>
Can getc() return a negative value different than EOF?
>>
Is there anything more autistic than fighting over tabs vs spaces?
>>
>>55207367
>what is joke
>anon don't banter
>don't banter
>no more
>>
>>55207378
No, tabs are objectively superior.
>>
>>55207370
getc() returns the character read as an unsigned char cast to an int or EOF on end of file or error.
>>
>>55207427
>I can copypasta the man page
you did good, pajeet
>>
>>55206993
>>55206970
>>55206887
lambda chain nigguh
>>
>>55207436
>i don't read the fucking manual
back to the loo rajesh
>>
>>55207461
lambda dictionary was horrible
>>
>>55207436
(not him) read this sentence and think about it. Sometimes text analysis is no more than isolating the element and bringing it to light. Pajeet did a pretty good job at it IMHO.
>>
how do I add "\n" to a string in c?
>>
File: friendly advice.png (100 KB, 715x611) Image search: [Google]
friendly advice.png
100 KB, 715x611
>>55207482
str[0] += '\n';
>>
>>55207427
So, yes?
>>
>>55207502
why are u using 0 in the char array?
>>
>>55207519
I'm joking. That's not how you do it.

Use strcat
>>
>>55207519
it's a string array
>>
>>55207514
yes
>>
>>55207482
Depends what you're doing to it. Remember that in C you have to micromanage memory. "producing a string by adding a newline to an existing string" is not how you should think in C.
printf("%s\n", str); // if you can
size_t len = strlen(str);
str[len] = '\n';
str[len+1] = '\0'; // ONLY IF YOU KNOW FOR SURE THAT IT IS SAFE
size_t len = strlen(str);
char *str2 = malloc(len+1);
sprintf(str2, "%s\n", str); // or you can do it manually
>>
>>55207545
>sprintf(str2, "%s\n", str);
undefined behavior
>>
>>55207524
>>55207539
error: invalid operands to binary expression ('string' (aka 'char *') and 'char *')
error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
printf(tmp);
>>
>>55207560
Eh? Why?
>>
>>55207560
No.
int sprintf(char *str, const char *format, ...);
>>
>>55207583
because sprintf writes len + 2 bytes
>>55207589
you're an idiot
>>
>>55207596
>you're an idiot
why
>>
>>55207596
OMG rite! Thank you anon, I didn't malloc enough of them. Well I should probably smprintf, it boils down to the same thing.
>>55207602
You were entirely out of topic in an idiotic fashion, that's why.

Also, newfriend, don't forget to free(str2).
>>
>>55207619
>You were entirely out of topic in an idiotic fashion, that's why.
>Also, newfriend, don't forget to free(str2).

don't forget to check the return value of malloc, pleb.
>>
>>55207641
>check the return value of malloc
Fucking useless to a degree not yet described by mankind. Linux overcommits, the rest don't matter.
>>
I need to understand a MATLAB program by someone else for Uni, which is quite hard for me.

he called this function
store(variable)

at the end of almost every block.

But if I open the file store.m, all I see is this:

function store(c)

store(get(c,'this'),c);


No comments. Nothing. "store" in whatever configuration is not in the matlab documentation. It calls itself apparently recursively, so I suppose whatever is being returned by the first call triggers whatever it is doing at the second call. But I don't get where it stops, or is this just a fancy way to call

get(((variable,'this'),variable)),((variable,'this'),variable))


Whatever that would do.
>>
Wanting to get in to python and I have a few questions.
1. To write and execute scripts, should I use visual studio or something less gay?
2. Does python use pointers like in C#?
>>
>>55207941
Wew lad... You need the Python interpreter to execute the scripts. To write them, you use your favorite text editor. No, there's no pointers.
>>
>>55207721
You are a retard
http://www.etalabs.net/overcommit.html
Also on the new linux versions malloc will return null instead of killing the program.
>>
>>55207941
You need to end yourself.
>>
int main()
{
mpd::conn mpd;

for (auto &song : mpd.playlist())
{
std::cout << song.uri() << '\n';
}

return 0;
}

C++ is beautiful.
>>
>>55208291
how many minutes to compile that 5 line program?
>>
cutFunction <- function(x,y) {if (is.na(x[y])){return(FALSE)}else{return(TRUE)}}
lengthCut <- apply(lengthData,1,function(x) cutFunction(x,1))
mapCut <- apply(lengthData,1,function(x) cutFunction(x,2))
mapping <- mapping[mapCut,]
lengthData <- lengthData[lengthCut,]

I feel like I'm slowly taking baby steps toward understanding functional programming and why it's useful
>>
>>55208291
improved version, optimised for faster compile time

int main(){mpd::conn mpd;for(auto&song:mpd.playlist())std::cout<<song.uri()<<'\n';return 0;}


>>55208333
>apply(lengthData,1,function(x) cutFunction(x, _))
>>
What have been some of the most challenging and useful exercises you did when learning C++, /g/?
>>
>>55208291
C is beautifuler.

int main(int c, char **v)
{
struct mpd_connection *mpd;

char *error;
if(mpd_connection_init(mpd, error) != MPD_OK);
{
fprintf(stderr, "%s\n", error);
mpd_error_free(error);
return 0;
}

struct mpd_entry *e = mpd_playlist(mpd);
while(e != NULL)
{
fprintf(stdout, "%s\n", e->uri);
e = e->next;
}

mpd_connection_free(mpd);
return 0;
}
>>
>>55208351
>stateful functional programming
>Java
>>
>>55208333
I wouldn't describe R as a functional language, really
>>
>>55208346
da fuck
>>
pls rate my homework.


#include <stdio.h>
#include <cs50.h>

int main(void)
{
printf("How tall do you want the stair?\n");
int number = GetInt();
int stairs = 1;

for (int y = 0; y < number; y++)
{
stairs++;
for (int x = 0; x < number; x++)
{
if (x > number - stairs)
{
printf("#");
}
else
{
printf(" ");
}
}
printf("\n");
}
}

>>
>>55208383
10/10 for unnecessary braces

10/10 for pointless stairs variable
>>
>>55208359
Ew, not elegant.
>>
>>55208370
It implements some of the basic concepts, which is enough for me right now. I'm not trying to write full programs in R functionally or anything, that would be stupid as fuck. I'm just encountering places here and there where constructing a closure turned out to be easier than other ways I could think of to do a task.
>>
>>55208325
1 second.
Although that is one problem of C++, slow compile times.
>>
>>55208392
>pointless stairs variable
>wanting magic numbers in code
>>
>>55208421
I don't think magic number means what you think it means.
>>
>>55208421
>(y + 1)
>magic number
>>
>>55208431
All numbers are magical when you think about them enough, anon
>>
>>55208359
>passing uninitialized "mpd" and "error" by value to _init
ishyggy
>>
>>55208444
I don't have to think enough to conclude that you're a faggot, though.
>>
>>55208467
THIS
>>
>>55208421
>#define ONE 1
>>
>>55208432
>>55208431
if anon wanted to make his stairs offset to the right then anon could pass a number to the stairs variable instead of leaving it at one, which is easy functionality to add as the program stands. if it was a 1 in the comparison instead of stairs then that's a meaningful number that controls the output and behavior of the program that's hardcoded in - a magic number
>>
Is scala a good language for a first time programmer?
I enrolled the coursera 5-course specialization but dunno if I should switch to another language
>>
>>55208501
int stairsDifference = 1;


y + stairsDifference
>>
>>55208517
>scala
>good language
>first time programmer
bwahahahahaha
>>
Is scala a good choice for my first programming language?
I just enrolled the 5 course specialization in functional programming in scala but I dunno if I should switch to another language
Also best books in scala/ the language you're going to recommend
>>
>>55208539
posted twice, fuck
>>
>>55208539
Any language is a good first language, honestly.
>>
>>55208551
sounds like you don't know scala :^)
>>
>>55208565
Sounds like you do :&)
>>
>>55208570
I do :#(
>>
>>55208570
8===D O:
>>
File: homework.png (215 KB, 1440x900) Image search: [Google]
homework.png
215 KB, 1440x900
how do I solve this?
:(
>>
>>55208565
Care to explain why pls
>>
>>55208642
Install Gentoo.
>>
>>55208642
reported
>>
>>55208642
Lo siento, no hablo espanol :(((
>>
>>55208642
Hola Mario
>>
>>55208642
Learn to use the debugger.
>>
>>55208659
>>55208662
>>55208664
>>55208671
>>55208689
the output is correct, but it's not what they are expecting.

I'm just confused over what to do, since my answer is correct.
>>
>>55208698
See >>55208659
>>
>>55208642
I don't know those exercises. Maybe they want the very first line to be only spaces? Do you have a document stating the specs? reread it.

Agreed tho that:
expected output, but not " \n"

What did you DO expect you motherfucker ffs?
>>
>>55208642
isn't stairs++ supposed to be after the second for statement?
>>
Ok so i'm making a mobile application on Android and i want to do this.

To keep session alive and to be notified when certain event happens like with facebook when somebody posts or something you will get notified, how does this work? How do i achieve this?
>>
>>55208798
Ok, mateys. I don't want to know anything about android app development, I am not interested AT ALL. Can't you all please keep your hyperprecise niche shit out of my programming "general" pls? thanks very much fagget. Bonus point of gtfo for asking such a vague and broad question, and also for asking a question, not even bringing something to the table. This is 4chan, not stackoverflow or your indian slaves. Good bye.
>>
Hey Python newb here.

/r/ some links to cool WEB CRAWLER code I can examine.
>>
>>55208826
not your thread
>>
File: keks.png (922 KB, 1111x597) Image search: [Google]
keks.png
922 KB, 1111x597
>>55208826
XDDDD
Thanks pajeet i'll see my way out to the android general

EDIT:woaaahaaah thanks for the gold
>>
>>55208798
Your question is too vague. You can use a BroadcastReceiver for incoming GCM messages. Alternatively, you could use a SyncAdapter at a fixed interval to check if there are any messages available.
>>
>>55208838
Not yours either. O shit there's a stallmate! Who's qualified to press the stallmate resolution button? Tell me.

>>55208841
Fuck is with you? That wasn't even the least bit funny tard, 0/10 go to sleep.
>>
>>55208826
wow fuck you asshole
>>
>>55208843
For now the application does what i want.

It logs in to a webpage, web scraps it to save and show data. Now what i want is that every time this data is updated to get a notification also to keep the session alive, obviously. I barely know this thing and i used jsoup

So i has to be constantly checking i suppose or in some intervals but i have no idea how to do it
>>
>>55208866
coming from you it's a compliment.
>>
>>55208861
epic posting my friendo rep+

Remember to give some rep back ;)
>>
File: homework.png (220 KB, 1440x900) Image search: [Google]
homework.png
220 KB, 1440x900
>>55208747
nah, it was a retarded trap where 1 is ##, so basically I had to add 1 to the x loop.
>>
I just wrote a PS script, and it's sloooooooow
>>
>>55206771
I hear that C# and Java are really similar, but people seem to like C# more. what makes C# better?
>>
>>55208947
>what makes C# better?

No checked exceptions. That alone is massively liberating.
>>
>>55208947
It doesn't have a meme about being bad

In all seriousness, it comes down to things like how everything in Java "should be" an AbstractFactoryBeanFactoryBuilderFactoryBean, and the performance/memory cost of using Java
>>
>>55208866
>>55208899
fyi you're worse than an asshole androidfriend, you're ilteral asshole cancer.

t. Captain Obvious
>>
>>55208877
Read this: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html.
A SyncAdapter runs as its own process independent of the actual application. You can use that to scrape the page, store the result and notify the user by a notification of some sort.
>>
How do you do the and operator in AWK?

& yields a syntax error
AND concats two variables
>>
Should I use GPLv3 or AGPLv3 for a client/server application?
>>
>>55209158
AGPLv3 is just better.
>>
>>55209170
and you're just mentally ill
>>
>>55209228
How so?
>>
>>55209241
just!
>>
>>55206852
>Why express things in code logic, when you can express it in data?
Why express things in data when you can express it in code logic? In the end, it's all source text that you maintain manually.
>>
>>55209299
Why express things at all?
>>
As a C# dev trying to develop mobile apps, should I even bother with Xamarin or is it best to learn Java?
>>
First for Java!
>>
>>55209658
Powered by Java(TM)
>>
>>55209658
>Probably posted this right after the thread was made
>Just now showing up
Yup, Java alright
>>
>>55209658
#include<iostream>

int main()
{
std::string loo="poo";
}
>>
>>55209440
From all the shitty cross platform solutions, Xamarin is the least shitty.
>>
I got a curious question, how do I get myself into open-source projects? I have always done my own hobby stuff. But people here seem to encourage the idea that working with open-source projects not only strengthens one work and understanding but also gives merit for cv.
>>
python2
>>> print '\\\\\\"'
\\\"
>>> '\\\\\\"'.decode('string_escape')
'\\"'


WTF???
>>
>>55209813
looks correct
>>
how do you fagmeister authenicate niggers who do ajax calls to DA SERVER?
My initial page is php file and I plan on on starting session and saving generated hash to the database which relate to the user in the database.
Am in being too complex?
When should the session_id in the dabase expire or should each call set the session_id and and handling would reset the session_id in the database?
Talking quite small database so setting and resetting for each call which sounds kind of expensive, performance is not main concern so which is the safest way?
>>
How do I omit a colour with GLSL? Like say I want all red to become alpha.
>>
>>55210008
(r,g,b) -> (r*0.01, g, b)
?
>>
Using Qt, if I create a menu that's attached to a window, then create actions attached to that menu, should I free the memory I allocated for actions in the window's destructor or will Qt handle it for me since they're chain-parented?
>>
>>55210008
>>55210028

or
(r,g,b) -> (0, g-r, b-r)
>>
>>55210047
>>55210028
No I mean how do I check the colour of a specific fragment in the shader. Not specific to attribute.
>>
>>55207150
You're incrementing a variable, you dumb shit.
>>
File: Angrydome.gif (168 KB, 127x118) Image search: [Google]
Angrydome.gif
168 KB, 127x118
>>55207935
I reall start to hate this program.
% we're using a lot of try-statements, since sometimes the formats vary and
% I didn't care to make a lot of checks. Somebody should clean up this mess.


Yeah, thanks, you too.
>>
File: Capture.png (5 KB, 545x115) Image search: [Google]
Capture.png
5 KB, 545x115
>.netfags will defend this
>>
>>55210162
What's this?
>>
>>55210174
.net framework 4 will bluescreen your computer if you close the application while it's pinging something.
>>
>>55210186
Now that's some next level pajeet thing.
>>
>>55210162
Blame the Windows network stack, not the framework cattlenigger.
>>
>>55210206
>Blame the Windows network stack
That's funny. I can close ping.exe and it won't bluescreen my shit. Maybe they need to have their .net bullshit use ping.exe instead of whatever fucked up API call they currently use.
>>
>>55210218
Blue screens are caused by the kernel, not user space. User space shouldn't be able to cause a panic.
>>
>>55210249
This desu, but considering that both were made by microshit, one would expect it to work better.
>>
>>55207209
there are no operator overloading in C, c += " "; would be meaningless and wrong no matter what string library you use
>>
>>55210299
It's funny to see how little information is shared between departments in a large company. Instead of cooperating, they'll invent the wheel all over again and fall into the same traps.
I had that happen at the largest broadcasting company in my country. One department is responsible for streaming app X, the next floor is responsible for streaming app Y. None of them ever discuss their approach, but go their own way and waste a lot of time and effort.
>>
I think I'm fundamentally misunderstanding how this works.
if(gl_FragColor.x==1.0){gl_FragColor=vec4(0.0,1.0,0.0,1.0)}
else{outColor=textureA*vec4(uniformColour, 1.0)};

In my mind this replaces red pixels with green pixels and leaves everything else alone.

How do I do that?
>>
>>55210455
gl_FragColor.y += gl_FragColor.x;
gl_FragColor.x = 0;

?
>>
>>55210479
There is a texture involved here. I want to check the colour of that texture on a pixel to pixel basis.
>>
>>55210505
think of it this way

y -> y + x
x -> 0

as a matrix
[ 0 0 0 0 ]
[ 1 1 0 0 ]
[ 0 0 1 0 ]
[ 0 0 0 1 ]
>>
>>55207150
No, C does not know a concept of strings nor operator overloading. If you want to have a dynamic string construction like that, you end up with vomit triggering code like this, some smug Cfags will attempt to either defend this or post their "clever" solutions but those won't work as you expect it to.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
char *c = NULL;
int count = 0;

for(int i = 0; i < 5; ++i)
{
count++;
c = realloc(c, count);
strncpy(c + count - 1, " ", 1);
}

count++;
c = realloc(c, count);
strncpy(c + count - 1, "#", 1);

count++;
c = realloc(c, count);
strncpy(c + count - 1, "\0", 1);

puts(c);
free(c);
return 0;
}
>>
>>55210505
you are only checking red value. white also has .x == 1 but y and z are 1 too. you should check those too.
>>
int main(void) {
int a,b;
int ary[4] = {0, 1, 2, 3};
int *d = &ary[2];
int answer = *(d + 2);
printf("%d\n", answer);

Just learned pointers so can anyone tell me why I am getting a long number 4200720.
>>
>>55210600
Because you're reading from whatever is after the array in the memory. Seems like you haven't learned anything at all.
>>
>>55210600
I would advice you looking into the code again.
>>
>>55210600
d + 2 points to ary[4], which is an element that doesn't exist (aka you're pointing to something after the array in memory).
>>
>>55210600
because undefined behavior
>>
>>55210575
>If you want to have a dynamic string construction like that, you end up with vomit triggering code
maybe you do. anyone sane would use better allocation strategies if you are appending 1 char a time like that. and encapsulate char* and only access it via functions to not fuck up things.
>>
>>55210583
I got it, thanks anyway lads.
  vec4 textureA = texture(texA,oUVcoord);
if(textureA==vec4(1.0,0.0,0.0,1.0)){textureA=vec4(0.0,0.0,0.0,0.0);};
outColor=textureA*vec4(uniformColour, 1.0);
>>
>>55210629
>>55210646
>>55210654
>>55210688
I feel fucking retarded.
int main(void) {
int a,b;
int ary[4] = {0, 1, 2, 3};
int *d = &ary[0];
int answer = *(d + 2);
printf("%d\n", answer);
>>
>>55210796
>I feel fucking retarded.
First step of improvement is to acknowledge the truth. Anyway now you will learn.
>>
>>55210815
thanks anon. Any advice for my adventure ?
>>
what are the security risks in making a simple password storer that uses a master password to unlock and holds all other passwords encrypted until requested?

It could maybe copy the password on request for a site to ths clipboard or print it to a console.
>>
>>55210989
Read,experiment,trial&error and make an assumption before ask questions or assistance, most. As in "what is the program supposed to do and why does it do it".
>>
>>55211005
>what are the security risks in putting all my various passwords to everything behind one single password on my PC, on a program that I myself wrote?
>>
so should I get a raspberry pi or arduino?
>>
>>55211071
pi
>>
>>55211071
Arduino. The guys are pi do not play fair and trick their customers (see https://www.phoronix.com/scan.php?page=news_item&px=MTIxNDk)
>>
>>55211025
Please stick to constructive thoughts.

The passwords would be stored in an encrypted file with AES-GCM that would be implemented from third parties that do security libraries and have some history of audits atleast.

And given a strong secret master password that doesnt reside anywhere it would be very hard to break into the encrypted file short of physical access to the computer or RAM to look for the key when in use.
>>
>>55211150
>Please stick to constructive thoughts.
You mean
"Is this a good idea? Only yes's please".
>>
>>55211167
No, not at all.

Your complaint is basically "only trained professionals can do simple encryption because security is magic" rather than asking about specfific details and seeing if its exploitable.
>>
>>55211014
I got it . ty again
>>
File: 1461236240121.png (272 KB, 447x458) Image search: [Google]
1461236240121.png
272 KB, 447x458
Why are there over 30 versions of LISP yet only one of C?
>>
File: 1466007286813.jpg (91 KB, 750x923) Image search: [Google]
1466007286813.jpg
91 KB, 750x923
>>55211513
>Publix Pepe
Dear god
>>
I started writing a terminal file system navigator like ranger using bash. What should I call it?
>>
>>55211513
same reason why there's over 30 versions of linux but only one of mac os.
It's just better.
>>
>>55211571
banger
>>
>>55211513
there's 5 versions of C
and then there's 3 official versions of c++
and then there's 5 versions of c#
so there's at least 13 versions of c
>>
>>55211588
>HAVING A STANDARD MEANS U HATE FREEDOM XDDDDDDDDDDDDDDDDDD
I aggree, which is why I have my owne version of the English langwedge. I call it GNU/English and it has thuss fahr faled to get me a jobb.
>>
What's your job title and description (if you have one)?
>>
>>55211654
Independent Contractor
>>
>>55211597
wew I like this.
>>
>>55211637
C# and C++ are not C

and every C standard supersedes the older, the same cant be said with LISP variants.
>>
>>55211654
Seasonal Help
>>
>>55211654
PhD candidate
>>
>>55211677
Scheme, lisp and CL are not the same languages either.
>>
File: 1463389056472.png (849 KB, 1280x720) Image search: [Google]
1463389056472.png
849 KB, 1280x720
>>55206771
Say you have two controllers in ruby, one for users and one for friendships. @user is defined and most often referenced under the show action in the users controller. Ignore lists also exist, which should prevent users from adding someone as a friend if either user is ignoring the other. Under the friendships controller, how can you reference @user to specify "don't create this friendship if @user is ignored by current_user (the user who's logged in and trying to add someone as a friend) or vice versa"? No matter what I try, this always fails because the friendship controller can't figure out what @user is. It always returns nil, even if I redefine @user under every single action in the friendship controller. What should I do? And sorry for the dumb question, you can probably tell I'm new.
>>
>>55211757
Source?
>>
>>55211789
I don't know, sorry.
>>
>>55211734
scheme and CL and many other LISP are called LISPs becauae they derive from the same programming style and methodology with minute differences in syntax and other details.

C# has nothing to do with C outside of sharing the same brace style syntax. It was not created to beat C, it was not derived from C.

C++ while being very similar to C has mountains of features and incompatibility with C . To say its another C is dumb and you may as well consider Java and others with similar syntax as C then.
>>
>>55211789
Onigiri
>>
>>55211513
c
gnu c
objective c
c++
iar c
cyclone
alef
...
>>
>>55211854
>C++ while being very similar to C has mountains of features and incompatibility with C
Exactly like CL and scheme, lol.
>>
>>55211882
Jelly donut?
>>
>>55211854
>C# has nothing to do with C outside of sharing the same brace style syntax. It was not created to beat C, it was not derived from C.
Clojure has nothing to do with lisp outside of sharing the same s-expression style syntax.
>>
File: 1466570992151.jpg (95 KB, 1024x576) Image search: [Google]
1466570992151.jpg
95 KB, 1024x576
I've been trying to learn to program for little more than a year and a half, but I always end up quitting because I feel like I am getting nowhere.

Now I have started again and I was just wondering if anybody could share a particular method, something that kind of organizes my study so I can get the most out of it.

Pls
>>
>>55211854
>C++ while being very similar to C has mountains of features and incompatibility with C . To say its another C is dumb and you may as well consider Java and others with similar syntax as C then.
except you can literally take c source code and compile it as c++
because it is c, with additional features that you can choose not to use

c# is just like c++, except there are a couple of added features that they strongly recommend that you use

they are all c
>>
File: 1434234524001.png (57 KB, 276x256) Image search: [Google]
1434234524001.png
57 KB, 276x256
>>55211854
>minute differences in syntax and other details.
You have no idea what you're talking about. Say, for example, the difference between a Lisp-1 and a Lisp-2. That's more than a "minute detail". Or the different macro systems.
>>
>>55211925
I think he meant otherwise
>>
uhg, why is this giving me a syntax error on calling the main module?

def main():
for celcius in range(0,21):
fahrenheit = (celcius * 9) / 5 + 32
print(celcius, '\t', fahrenheit

main()
>>
>>55211854
>C# has nothing to do with C outside of sharing the same brace style syntax. It was not created to beat C, it was not derived from C.
same operators
same keywords
same types
has c pointers
has c enums

"Hejlsberg: One of the key differences between C# and these other languages, particularly Java, is that we tried to stay much closer to C++ in our design. C# borrows most of its operators, keywords, and statements directly from C++."
>>
>>55211919
>Now I have started again and I was just wondering if anybody could share a particular method, something that kind of organizes my study so I can get the most out of it.
What do you want to learn, exactly?
Learning to program, by itself, is reading a language's syntax and writing pieces of text confirming to that syntax. There's absolutely nothing else to it.
>>
>>55211513
>grouping dynamically scoped lisps together with statically scoped
>>
>>55211919
>a particular method, something that kind of organizes my study so I can get the most out of it
Pick a project you want to do, start working on it right now, and try to make at least a little progress on it every day

if you're into video games the typical progression would look like this:
>make hangman
>then make a breakout, snake, or asteroids clone
>then make a generic roguelike
>>
>>55211985

First I wanted to learn C++, to which I have some books.

Then I just wanted to apply C++ in any way possible. I don't know, maybe just understand how to make applications.
>>
>>55211969
>print(celcius, '\t', fahrenheit
no closing paren
also no code tags
>>
>>55212023
oy vey, ty
>>
>>55212018
Why did you want to learn C++ specifically?
When you say "applications", what exactly do you mean? Give a few examples of what you want to make.

What's your end goal?
>>
I have a small website hobby and I was wanting a bit of adv so many /dpt/ can help:

I want to build a website which will be fairly basic, needs user accounts/backend.

I just don't know what CMS to use. I have rudimentary web development skills, but this will be a hobby for me to learn from.

Should I use wordpress/drupal/Joomla or stick with a boilerplate?
>>
>>55212089

Well I simply started to learn to program because I consider it something that's extremely useful and necessary.

I am having trouble to tell you about my goal because I don't necessarily have a goal. Maybe make a game?

But I didnt want to stop there. I wanted to learn how people programmed computers, who memory management works, how the entire cpu - ram thing worked exactly etc.
>>
>>55211925
>take c source code and compile it as c++
confirmed fizzbuzz tier
>>
>>55212091
you could accomplish this with django
you'd get to learn python along the way which is a big benefit
>>
>>55212153
If you want to go that low-level, you'd have to learn C and Assembly
>>
>>55212158
>what are facts
>>
>>55212184
I'll have a look into it. I've seen it mentioned a few times but I haven't had the time to really research it. Thanks for the advice.
>>
Say I wanted to automate a task I hate doing.. It needs to do the following:
1. Check a youtube/vimeo channel for a new video
2. Rip audio
3. FTP the file to a server
4. Go to a site and fill out some forms

What language or program can I use to create this task automation?
>>
>>55212153
>Well I simply started to learn to program because I consider it something that's extremely useful and necessary.
Not really. Truth be told, knowing the basics of programming is as useful as knowing how to solve puzzles and riddles if you're not going to become a professional. There's a very low chance you'll be building anything of worth.

>I am having trouble to tell you about my goal because I don't necessarily have a goal. Maybe make a game?
>But I didnt want to stop there. I wanted to learn how people programmed computers, who memory management works, how the entire cpu - ram thing worked exactly etc.
Despite being very interesting areas, what you're interested in is in the higher end of the spectrum in terms of difficulty. It'll take a lot of effort if you want to teach yourself about these things.

Why did you pick C++ specifically? Were you pushed into it by someone? It's a powerful language, but it's not good for a beginner who doesn't even have a specific goal.

Don't let my post demotivate you too much though. Programming is hard work, and that's why most people will never get past being front-end code guru ninjas (idiots).
>>
>>55212240
interesting project, has a lot of different parts to it

you'll need a simple database to keep track of known videos in order to determine if a video is new or not
then you need a webcrawling feature, use curl

to rip the audio it's probably easier to just download the video and have your code execute a command line application to rip it for you, rather than write the code to do rip it yourself

ftp - use curl again

fill out some forms - use curl again

so, to sum it all up, the language you should use is: any language you know
>>
>>55211949
Arguably, the difference between a Lisp-1 and a Lisp-2 isn't that big of a deal. It's just a namespace detail. The various macro systems are greater deals.
>>
>>55212306
>you'll need a simple database to keep track of known videos in order to determine if a video is new or not
I know it's also technically a database, but all he really needs is a csv file.
>>
>>55212306
So to summarize, curl will let me hit an api, download, pipe the file through another application, ftp, and fill out forms online.

When you say any language I know.. JavaScript? Will that work? Is curl a framework or something?
>>
What do you people think of JavaScript?
>>
>>55206771
Snake in C++.
>>
>>55211513
What are these 30 versions of LISP that you're counting?

If it's obsolete stuff like MacLisp, ZetaLisp and whatnot, then that's like counting K&R C, PDP-10 C, DOS C and PIC C as disparate variants of C, in which case you can probably count to a hundred versions of C.

If you're counting CLISP, SBCL, CMUCL &c., then you're retarded as that would be like counting GCC, MSVC and Borland as different versions of C.

If you're counting local dialects like Sawfish's Rep, then that's arguably just because it's so easy to make Lisp implementations, which is hardly a bad thing.

If you're not counting any of those, then you must be looking at CL vs. Scheme, which is two versions rather than 30 and would be like comparing C and C++.
>>
>>55212388
curl is a command line program

>>55212423
it's honestly the worst language I've ever used. it provides the safety of C and the speed of python
>>
>>55212200
>muh fizzbuzz
just end your shit existence
>>
>>55212466
>curl is a command line program
It is also a library.
>>
>>55212489
if you want to talk about curl - the library, then you should really talk about the language you're thinking of using curl with
>>
>>55212200
>what are facts
Not that you can compile C programs with a C++ compiler, at least. Just for one simple example, take a C program that uses a variable named "new".
>>
File: 1463696945268.png (25 KB, 396x400) Image search: [Google]
1463696945268.png
25 KB, 396x400
>post some bait about C and LISP
>come back an hour later
>all these posts
>>
>>55212517
>I was just pretending to be retarded guise!
>>
>>55211925
int main() {
int new = 5;
return 0;
}


This is a valid C program
This is not a valid C++ program

C++ is not C-extended, even the creator disagrees with you.
>>
>>55212506
the only way your c doesn't compile as c++ is if you intentionally go out of your way to do something like that
don't be a pedant
>>
>>55212531
>>55212506
>they both used the reserved keyword argument
kek
>>
>>55212542
>you can't find any differences
>unless you do but those don't count!

Foo *foo;
foo = malloc(sizeof(*foo));


Valid C
Invalid C++
>>
>>55212542
>pedant
http://david.tribble.com/text/cdiffs.htm
>>
>>55212542
Using "new" or "delete" as identifiers isn't exactly going out of one's way.

It was just one example, though. This is another:
char *buffer = malloc(1024);
>>
I'm learning how to use unity right now, seems pretty flexible and I enjoy the environment desu

anyone have experience with it?
>>
>>55212599
>>55212598
>>55212588
dont forget all the new C11 features that arent part of any C++ standard
>>
>>55212599
>Using "new" or "delete" as identifiers isn't exactly going out of one's way.
yes it is
the only reason you'd do that is because you know they're reserved keywords in C++
and the only reason you'd care to do that is to play devils advocate on an anonymous internet message board
>>
>>55212692
When will GCC actually compile C11 by default?
>>
>>55212719
I've done it plenty of times without considering its effect on C++. When you allocate a new object and initialize, it's often quite natural to call the variable "new".
>>
>>55212692
Nobody uses those.

>>55212730
When glibc actually adds threads.h, which is basically never.
you can add your own if you want, it's basically going to be a wrapper for pthreads, and every platform supports pthreads now.
>>
>>55212730
GCC always is set to some bastardize C standard from GNU , commonly referred to GNUC.
>>
>>55212692
>>55212730
No compiler currently supports all C11 features, such as C11 threads.
>>
>>55212741
valgrind is your friend.
Thread replies: 255
Thread images: 22

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.