[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: 317
Thread images: 43

File: timetocode.webm (2MB, 1152x648px) Image search: [Google]
timetocode.webm
2MB, 1152x648px
This is /dpt/, the best subreddit of /g/

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

/!\ ** Read this before asking questions ** /!\

http://mattgemmell.com/what-have-you-tried/
http://www.catb.org/~esr/faqs/smart-questions.html


What are you working on ?
>>
>>57017238
What do you guys post code to, made something I can't post to github so looking for a more lenient alternative

don't want to use pastebin cause it can't have readmes and shit like that
>>
You should never use the unsigned types, they are slower and using them with signed is a mess.
>>
File: BHWjTX_CIAEOp1q-large.png (368KB, 498x707px) Image search: [Google]
BHWjTX_CIAEOp1q-large.png
368KB, 498x707px
Haskell thread

>>57017296
Leave it in last thread desu

Don't mix signed and unsigned to begin with
>>
>>57017285
https://gitla.in/
https://gitgud.io/
>>
I'm making a decentralized, dead simple to use, television system. It can run on a Raspberry Pi and dial-up. Dial up is free in a lot of cases, and all parts included costs around ten. Multi-screen setups, Bitcoin donations, multiple quality settings for all connections and setups (current max is 4x4 8K screens), and an extensible macro system to control it. If anybody is interested, tell me on Tox at B183A4A9CC9E026DF4345EA31ACBE185ECA39656210F38736BBED62AD68DCF4F7E08A5D9960E
>>
File: triggered.png (5KB, 434x51px) Image search: [Google]
triggered.png
5KB, 434x51px
swamped a little into discussion, still need to implement silhouette for clusters and F-Score for classification.

also, pic related.
>>
>>57017296
can you cite your sources?
>>
>>57017337
>mfw noone noticed I MS'd the thread
you're all \botnet\ now
>>
File: 1431635201758.gif (1MB, 346x317px) Image search: [Google]
1431635201758.gif
1MB, 346x317px
I want to run a command line C# application on my (android) phone for the purpose of testing remote internet features
Is this possible?

>>57017296
Unsigned integers are good for very specific cases, such as something I'm working on right now (Sending a large N-dimensional array of probability data to a user without them noticing)
>>
>>57017285
gitlab
>>
>>57017404
>I want to run a command line C# application on my (android) phone for the purpose of testing remote internet features
Is this possible?
If you have the source code then yes. Look up Xamarin.
>>
File: last.png (11KB, 519x309px) Image search: [Google]
last.png
11KB, 519x309px
This took longer than expected, wrapping is hard.
>>
>>57017285
BitBucket?
>>
>>57017390
here a valid software engineering argument against the use of unsigned types
http://www.aristeia.com/Papers/C++ReportColumns/sep95.pdf
>>
>>57017458
God that's fucking ugly.

>>57017468
>C++
Good job.
>>
>>57017444
Thanks, anon. I saw that suggested by somebody else but their comment mentioned that it was "A shame about the price, though" so I didn't even bother going to the page.
>>
File: Abundance.jpg (86KB, 300x300px) Image search: [Google]
Abundance.jpg
86KB, 300x300px
trying to write a 3x3 rubik's cube solver in C (first time writing C, i'm a C++ guy) has really rekindled my love for programming. holy shit i love this
>>
>>57017497
>"A shame about the price, though"
Xamarin is free
>>
>>57017482
That's a matter of taste, but that wasn't what I was talking about, I'm making the actual terminal emulator.
>>
>>57017509
https://www.reddit.com/r/learnprogramming/comments/2oi5my/how_to_run_a_console_c_program_on_android/

>It's actually quite easy with Xamarin. Those guys have done some amazing work. Too bad about the price though.
>I don't usually pay attention to expensive stuff... I'll buy it if I do :(

I guess leddit is just being dumb again unless they changed it since last year
>>
>>57017468
>don't mix signed and unsigned and C++ uses signed for stuff

okay

>overflow checking

been over this, use better types

>you can just check < 0 in places and it's cheap and use debugging CPP

I'll never understand why you'd do this (conditionally at that) in 100 different places instead of 1
>>
>>57017520
You made it ugly and your taste is shit.
>>
>>57017498
What's your algorithm?
>>
>>57017458
Ayy anon I saw your text editor before and I thought it was extremely cool
Please give me the details, I really like what you've got going on there
>>
File: AMERICA.jpg (111KB, 1920x1200px) Image search: [Google]
AMERICA.jpg
111KB, 1920x1200px
>>57017509
is it free as in
FREEDOM
>>
>graphics programming

hell: the experience: the tour: the voyage: the concert
>>
>>57017558
Just use Emacs
>>
>>57017539
>unless they changed it since last year
They did. Microsoft bought them and made it part of VS.

Actually maybe it's not free as part of the community edition... not certain about that. I thought it was.
>>
>>57017551
I did not make the shell running inside it, and my taste is mine, I like it, I use it, that's all.

>>57017558
What details would you like to get? I use vim.
>>
>>57017573
graphics programming is easy
>>
File: liberdade.jpg (178KB, 619x447px) Image search: [Google]
liberdade.jpg
178KB, 619x447px
>>57017564
>is it free as in
>FREEDOM
>>
>>57017556
i don't know yet, (i just did mostly architectural stuff and shit like moves) but i'll probably use the one thats easiest to program lmao
>>
>>57017592
maybe after you're comfortable using your library of choice

learning glsl and remembering geometry/linear algebra that I haven't touched in years while juggling other classes is hell
>>
>>57017520
You should make it so that the user can specify font and colors etc
I personally think that it would look really neato with an orange and white color scheme

>>57017579
Can emacs do this?
Serious question, I've never done anything outside of an IDE but I want to move onto a portable and lightweight text editor that I can take with me


>>57017588
Any resources that you have for that slick multiwindowed output that you posted about a week ago. I apparently dropped the pic tho
I might not be a gigantic fan of the typeset but I really liked the ultra-minimalism
>>
>>57017602
Who are these nu-males?
>>
>>57017602
The American flag symbolizes The Utopia. In a perfect world, America will be The Utopia of Libertarian freedoms, but that is impossible. However, for being impossible, seeking perfection shall not be in vein, and the flag is a reminder that a brighter future is ahead, regardless of what country takes the role of supreme liberator, the center of The Utopia.
>>
>>57017642
The user can specify fonts and colors.

The color scheme or the color of things aren't part of a terminal emulator, all a terminal does is render what it's asked to.

That stuff is handled by the programs that run inside the terminal.
>>
BitBucket vs GitLab
>>
>>57017642
>Can Emacs do this
Emacs can do everything, but it isn't portable if you add a lot of functionality. Magit manages pretty much everything in Git in the most elegant way possible. However, you should get comfortable with a non-GUI environment and the macros to get the most out of Emacs
>>
File: last.png (109KB, 1920x1080px) Image search: [Google]
last.png
109KB, 1920x1080px
>>57017642
Are you talking about this desktop?

It's just Fluxbox with two terminals, the one above has vim, the one below is GNU screen with inside mutt and irssi.
>>
>>57017675
Ah, das pretty neato anon
I wonder why modern terminals have stripped away so many of the features that older terminals needed to use.

Can your emu actually run incredibly old programs? If so, what platform? Are you emulating any particular platform, or just the terminal itself?

>>57017692
I personally use bitbucket but I don't think that one is better than the other

>>57017706
> you should get comfortable with a non-GUI environment and the macros to get the most out of Emacs
>>
File: 1373662916812.jpg (171KB, 600x400px) Image search: [Google]
1373662916812.jpg
171KB, 600x400px
>>57017664
>>57017602
>>57017564
This is a programming thread, the only flag we recognize is SICP. Please, leave.
>>
>>57017714
>> you should get comfortable with a non-GUI environment and the macros to get the most out of Emacs
A lot of the power comes from the Extensible MACroS, so having a GUI is temptation to not learn how to use it
>>
>>57017692
Maybe GitLab in a year.
>>
>>57017714
>4chan x posted my post before it was done

>>57017706
> you should get comfortable with a non-GUI environment and the macros to get the most out of Emacs
That's one of the reasons I want to learn a flat text editor, I want to be able to work in systems even where there's 0 access to anything visual(I.E. writing a script on a server)
>>
>>57017714
I've been working on it for a week, it baraely supports basic controls to run vim and a shell.

I don't plan to implement anything that isn't needed, I don't want to make the next xterm or rxvt, those already exist.

I'm just making a modern terminal, with as fast as possible rendering and the features I need, which I can't find in any terminal that exists.
>>
File: 1409259598534.jpg (116KB, 433x709px) Image search: [Google]
1409259598534.jpg
116KB, 433x709px
>I'm seriously considering using GitHub instead of anything else because literally all job applications ask for specifically github
Why do they do this
>>
>>57017747
C=ctrl and M=alt (Meta)
C-x C-s to save
C-s to search
C-x o to switch windows
C-x 2 to make a window (split up/down)
C-x 3 to make a window (split left/right)
C-x 0 to remove the current window
C-x left/right to select a buffer
C-x b to select a buffer by name
M-x shell to get a basic shell
M-x customize to get to the settings

There is a lot more, but I use those about 90% of the time
>>
>>57017761
Because managers and human resources don't have any clue about anything.

But they heard every good programmer has a GitHub, so they ask for it, they don't even know what it is.
>>
>>57017749
What's wrong with xterm/uxterm?
>>
>>57017792
danka anon

>>57017799
Why not simply have a field that states
>Enter the location of your public version control repo
>>
>>57017818
Because they do not know what version control is.
>>
Any nice intermediate book on assembly programming (either in general of specifically about ARM (v6))?

I'm done a little bit of programming on MIPS and 8021 and I'm playing around on a raspberry pi now.
>>
>>57017842
Every company I've worked at has the department hire its own people and this still happens
these people DO know what version control is and that's the retarded part
>>
>>57017809
True color support sucks, there's no support for keyboard only scrolling/selection and URL hints a la' vimperator.
>>
>>57017857
Then they're just retarded, most programmers are.
>>
>>57017859
>>57017749
Why need more than 0-255 rgb color space in a terminal?
>inb4 muh ascii videos
>>
>>57017911
>not using 8-bit color depth
>>
>>57017911
I want to make a couple TUI programs that need true color support.
>>
>>57017888
ah
yeah, that might be it
Yhack asked for my github too, though
>>
FUCKING JEWISH CUNTS I HATE RUST
>>
File: maxresdefault[1].jpg (139KB, 1364x766px) Image search: [Google]
maxresdefault[1].jpg
139KB, 1364x766px
>>57017926
Especially those need limited colors, not to confuse the average user.
>>
>>57018023
They're programs that REQUIRE true color support.

And what I make is not for the average user, it's for myself, I provide no help nor support for dumb people.
>>
Have you all had the fun of having to create the LinkStrand class?
>>
File: 1469131103363.jpg (549KB, 1500x2121px) Image search: [Google]
1469131103363.jpg
549KB, 1500x2121px
I kinda want to contribute to projects on github but how do I know if I'm "good enough" for it?
>>
>>57018017
What don't you like about it?
>>
>>57018115
it's dumb xD
>>
>>57018068
>How to tell if you're good enough:
>1. Read the rules and practices
>2. Follow the rules and practices
>3. don't not follow the rules and practices
done
>>
>>57018127
Epic.
>>
>>57018068
Are you capable of catching typos?
Are you capable of recognizing gendered language?
If you answered yes to either, you can contribute.
>>
>>57018068
As long as what you are submitting doesn't break standards and does something useful, then you "good enough"
>>
>>57018115
Lexical borrows are a pain in the ass.

The borrowing semantics of inherent impls methods become impossible to work with as soon as you start mixing mutable and immutable calls within the same method. (the methods don't know you're actually touching unrelated fields in the same struct, because the borrow checker is dumb).

There's no way to tell the borrow check that a method taking &mut self and returning an immutable reference doesn't need the lifetime to be bound to the mutability, i.e. dropping the mutability of the reference on return. (this is useful for methods that mutate and return immutable references within the struct, you won't be able to call anything immutable on the value again while those borrows are active).
>>
I have a offensive project, where do I post it?
>>
>>57018175
what project?
>>
>>57018189
You rape a girl then have to make sure you don't get caught
>>
>>57018207
lolisim?
>>
>>57018256
no idea what that is senpai
>>
Hey anons, i have few months (6months) to learn something fun
Any recommendations for first language ( i know bash but is more a scripting language)
Basically this is just time off work so like 2-3 hours a day
>>
>>57018115
The specialization RFC doesn't cover a lot of really required stuff.

To, for example, do something when two generic parameters are the same, and something else when they're different you have to jump backwards, and then you can't even make it generic, you have to pass the concrete types because the genericity rules are way too strict.

Even assuming the lattice rule is accepted and implemented, it won't be enough, and it will be years before anything that covers what's needed is stable.

Macros in Rust are complete and utter shit as soon as you want to do anything a little more complex, the hygiene is limited, there's no modularization, and there's no eager expansion. Macros 2.0 should cover all those issues, but again, it will be years before anything is stable.

Macros 1.1 brings at least some often used crates up to stable with the introduction of gimped procedural macros, but clearly if you're not a crate that has a bajillion of users they don't give a shit about you.
>>
>>57018286
C
>>
>>57018298
I was thinking C : a modern approach but i heard primer is a good one too
>>
>>57018115
Compilation times are utterly awful, one of my crates started requiring 20 minutes to compile, and it's roughly 2K LOC.

Incremental compilation isn't going to fix this specific issue either, because it's not about recompiling, it's just awfully slow.

There are a bunch of other issues too which I can't recall right now, Rust a shit.
>>
File: quesiton.png (30KB, 1055x701px)
quesiton.png
30KB, 1055x701px
Hey everyone

Im writing a simple program to read in and average out student grades. My question is assingning the letter to the reporting average value.

I keep getting an error...... not sure what I am leaving out.
>>
>>57018452
Your code smells.
>>
>>57017238
I need to write a bash script that does a task once every five minutes for 20 minutes. Obviously I need to use cron to do this, but as far as I can tell cron is exclusively for tasks that you want to be repeated indefinitely.
Any help?
>>
>>57018488
Thanks?
>>
Thinking of getting https://codeplane.com/ anyone here use it? I mean I pretty much pay the same price for github premium so it doesn't seem like a bad deal
>>
>>57018452
>I keep getting an error
What do you mean? What error are you getting? We can't help you if you give effectively no information.
>>
>>57018452
average >=
>>
>>57018647
Ok, in my program I read in a txt file with scores, i've gotten to the point where I do just that but, I am having trouble assigning a letter grade to that score.

I want to have a grades column next to the averages, I tried to do so by having if/else if statements but I keep getting an error...
>>
>>57018452
>I keep getting an error

>>57018707
>but I keep getting an error

What did she mean by this?
>>
File: halp.png (56KB, 1229x913px)
halp.png
56KB, 1229x913px
>>57018724
lol

I included the err... error at the bottom.
>>
>>57018750
What's life like in India, I'm curious?
>>
>>57018750
>error: expected ';' before 'return'
Huh, I wonder what the issue could possibly be? It's literally impossible to figure out.
>>
>>57018779
Werks fine when I leave that if statement out tho...

if srs...
>>
>>57018750

WHAT DID GCC MEAN BY THIS!?
>>
>>57018797
Line 38 numbnuts
>>
troll me into oblivion.
>>
>>57017458
Your mum took longer then expected.
>>
>>57018175
>>57018207
Post it here.
>>
>>57018826
thank you.....
>>
>>57018575
Write a script with a loop that runs 4 times and sleeps for 300 seconds after doing the task.
>>
>>57018945
That would only work if the task takes 0 seconds to finish. This one will so it's good enough, but it's still a lazy solution because if you increase the time complexity at all it stops working properly.
>>
File: halp agin.png (8KB, 960x478px) Image search: [Google]
halp agin.png
8KB, 960x478px
guys how do I make the letter appear on the same level as the average...
>>
>>57019020
You're inserting an end line character immediately after average.
What the fuck did you think that endl did?
>>
>>57018999
while true, if current time % 5 minutes do task increment counter
if counter = 4 exit
>>
File: gettin der.png (10KB, 955x474px) Image search: [Google]
gettin der.png
10KB, 955x474px
>>57019047
sigh im getting chill bruh
>>
File: 1449518084464.png (125KB, 400x393px)
1449518084464.png
125KB, 400x393px
>tfw really want to learn how to program
>tfw 27

well g-good luck for you guys....
>>
When using va_args, do i have to va_end and call va_start again if I want to pass it to vsprintf?
>>
>>57019252
Its not hard, you just have to put in the time like anything else in life.
>>
File: thanks4halp.png (9KB, 887x356px) Image search: [Google]
thanks4halp.png
9KB, 887x356px
>>57019252
ey man, its not that hard. Im 26 struggled with this but if you give it team each day im sure you can too.

Probably better to start on python or C++ go buy a book and read, thats the first step.


ALSO THANKS FOR HELPING ME WITH THE ERROR.
>>
>>57019049
I'm trying to implement this with
if ($startingDate - `date +%s`) % 300 == 0;
and i'm getting a syntax error.
Can you tell that I've only ever used C-style languages before? Bash is utter nonsense to me.
>>
>>57019252
You can also start here https://www.sololearn.com/Course/CPlusPlus/

but getting a book to read is essential.
>>
File: 1VHZYKk.jpg (2MB, 2304x3072px)
1VHZYKk.jpg
2MB, 2304x3072px
>>57019252
Don't be dumb, I learned at 29, two years ago.

However I do think it reduced my chances of losing my virginity.
>>
i think i need to drop Gtk in favor of Qt
>>
>>57017285
Why can't you post to github?
>>
>>57019514
game about getting away with rape and githubs SJW heavy
>>
>>57019549
Oh, well there aren't many hosting sites like github.
>>
>>57019430
Holy shit. Who is that girl?
>>
>Tfw making a comfy idle game

Anyone else here making a /comfy/ game?
>>
>>57019564
going to post it to github and hope for the best, if it gets taken down I'll just use gitlab on a VPS from now on
>>
>>57019571
>girl
>>
Posting from last thread. I'm taking a data structures class, and it's shit. Lectures are just the prof rambling about shit and sometimes typing something in CLion, we have no textbook, no real syllabus, and have had 2 lame assignments since August. It feels like a waste of time.

Is there a good free online course for data structures with C++? Barring that, a good recommendation for a textbook I can pick up, or hell, just a site with a good amount of practice problems I can work through? I've been looking at an algorithms OCW course and it looks good, but is more theoretical, and I was looking to improve my C++ skills.
>>
>>57019587
Post the link here so we can see before sjw's come and fuck your shit up.
>>
>>57019618
it's not at a release stage yet, so going to keep it private on gitlab for the time being, will post it here when it's public though
>>
>>57019549
Is that you, lolianon? Usually you're more upfront about your project.
>>
>>57019645
Why not just make it open source so we can make pull requests(or the gitlab equivalent)?
>>
>>57019682
Don't think thats him, he doesn't have the juice like lolianon
>>
>>57019682
no im not lolianon
>>57019686
it's based on the life of some r9k poster who films people shitting so unless you guys knew all about him you couldn't really help
>>
>>57019716
Oh, ShitMan. That's my guy.
I honestly just want to see the source cide
>>
>>57019732
*code
>>
>>57019571
sweetraven doot deviantart doot com/gallery/
>>
>>57019732
>>57019738
it's text based but if you really want I can show you a little bit of the code?
>>
>>57019752
Im cool with that.
>>
File: 1469091169346.png (83KB, 443x521px)
1469091169346.png
83KB, 443x521px
should I use my waifu's name to name my project?
>>
>>57019762
pls no bullying my shit code and autistic dialog

from sys import exit

# Variables

girl1_alive = True
girl2_alive = True

# UNI 1

def uni_1():
print("You're walking around your UNI when you see two cute girls what do you do?")
print("(1): Follow them. (2): Go to your lesson cause you're not some creepy cunt.")

choice = input("> ");

if "1" in choice:
bathroom_1()
elif "2" in choice:
game_over("""You go to your lesson, everything seems fine - then you get home and your shithead dad is yelling about
something, you go to confront him and he's covered in blood your mother lies dead on the floor. You run but he catches
you he stabs you in the stomach and fucks you as you bleed out.""")
else:
uni_1()

# BATHROOM 1

def bathroom_1():
print("You follow them into the bathroom.")
print("they go into the cubicals to piss, what do you do?")
print("(1): Attack one and rape the other.")
print("(2): Go into the next cubical and jack off to the sound of them pissing.")
print("(3): lean over the cubical wall to record them.")

>>
Hey /dpt/ do any of you know mysql, I need to print the handles of all the pairs of users that like at least three of the same titles.
>>
>>57019381
I'm still trying to work on this. Literally nothing is working. I even tried to do the stupid route of just stacking several expr calls within each other, but the last one always claims it's missing an operand.
Is it just not possible or something?
>>
Why is this not working?
>ionic
<div ng-app="myApp" ng-controller="myCtrl"> 


<h1>{{myWelcome}}</h1>

</div>


<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http.get("http://localhost/API.php")
.then(function(response) {
$scope.myWelcome = response.data;
});
});
</script>



output is
{{myWelcome}}
>>
>>57019773
God, I thought you were actually doing something. This is literally just if/else and print statements. Learn something like c++ and try to incorporate linked lists or something into a shitty text based game, thats the only way your gunna get some type of benefit out of making this game. Since you're using python, do something more interesting. here are some projects to get you started.

Just some fun little things to show you what python can do
http://pastebin.com/LqBwd0ag

server to a reverse shell
http://pastebin.com/siizc9hx

client to a reverse shell
http://pastebin.com/R23BBcVy

I have a bunch more if you want to see them but don't waste your time on shit like this
>>
>>57019803
Probably need to self-join and group by titles having count >= 3
>>
>>57019880
is your promise hitting the then or is it catching?
>>
>>57019912
ok, thanks
>>
File: mspaint_2016-10-10_22-18-44.png (61KB, 954x534px) Image search: [Google]
mspaint_2016-10-10_22-18-44.png
61KB, 954x534px
>>57019930
I'm not sure how to do that I'm a really retard
>>
>>57019937
I dont know, it is not doing shit.
I am not into angular, just got this code from w3school.

localhost/API.php outputs something like
{"name":"1456848891298.webm"};
>>
File: here's-your-homework.png (13KB, 483x320px) Image search: [Google]
here's-your-homework.png
13KB, 483x320px
>>57019956
someone prove me wrong but hopefully I'm also not a retard
>>
>>57019765
Yes.
>>
File: ss+(2016-10-09+at+08.50.01).png (42KB, 940x468px) Image search: [Google]
ss+(2016-10-09+at+08.50.01).png
42KB, 940x468px
rip, the top is supposed to be the one that is more efficient.
>>
>>57020114

Is this an ArrayList vs. LinkedList test or something?
>>
>>57020146
Linked List vs String w/ string methods/builder
>>
>>57020019
<div ng-app="myApp" ng-controller="myCtrl"> 


<h1>{{myWelcome}}</h1>

</div>


<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http.get("http://localhost/API.php")
.then(function(response) {
console.log('success', response);
$scope.myWelcome = response.data.name;
}, function (error) {
console.warn('error', error);
});
});
</script>


Try this, format as you like. The second arg to get is the failure callback. If there's something wrong you should see it log the error. I suspect that it's working, but that you're using the data incorrectly - data isn't name, it's the entire body of your get request. response.data.name should get you "1456848891298.webm", in your example
>>
Can I use the OFFSET keyword in a DELETE SQL statement to delete the bottommost rows of a table?
>>
>tfw carmack has issues with ndk also
pretty good desu fampais
>>
File: SS_002.png (107KB, 1029x716px) Image search: [Google]
SS_002.png
107KB, 1029x716px
>>57020166
>>
>>57020257
whats the console log m8
>>
>>57020323
Nothing in console
>>
>>57020257
your issue is that none of the javascript is running. not just your script, but angular as well. if it were working, the {{foo}} would be blank
>>
>>57020163

LL a fucking shit.
>>
>>57020399
I don't think so. If no JS ran it will just render the HTML as is, hence {{myWelcome}}

>>57020342
Are you sure? Open the console first and then refresh.

Do you know how to use the debugger? Put a breakpoint on your first JS line, var app = .... and inspect the your variables.

If you're not comfortable with the debugger, put log statements all over your code. Put one on the first line of your script and right after it. You want to see how far your program runs which should help you see what the problem is
>>
File: SS_003.png (154KB, 1922x988px) Image search: [Google]
SS_003.png
154KB, 1922x988px
>>57020399
>>57020459
I think it is loaded
>>
Hello, may someone direct me to the standard graphical (GUI) library for the C++ language by Bjarne Stroustrup? Thank you in advance.
>>
>>57018810
"gcc has cryptic errors"
>>
>>57020459
btw i added in 1st line of script
console.log("starting");
and it didnt output that.
>>
>>57020506
maybe I'm wrong, but shouldn't it be localhost:8100/Api.php
>>
>>57020544

It definitely does.
>>
>>57020560
no, i have apache, where is localhost/API.php
that from screenshot is ionic serve
Im using browser as emulator
>>
>>57020434
Its probably just my coding. I'm supposed to make one more efficient.

What we're doing is searching for a phrase within a string and replacing said phrase with another.

What I've done so far is:
Split a string using the phrase which put those into an array.
The initialized a linked list with array[0], then add the new phrase and then add the next item in the array. And repeat for the length of the array.

I've tried adding new nodes for each array item but it seemed a lot slower than just concatenating the strings. So I have no idea how to make it more efficient.
>>
>>57020528
One doesn't exist, and you know it.
>>
>>57020611
>Its probably just my coding.

No, linked lists are shit.
>>
>>57020257
maybe it has to do with the fact that you have an app inside an app? I don't know what the problem is, but Angular is definitely not running properly
>>
>>57020582
If it's not even logging then your JS isn't being executed. I'm not too good with Angular but shouldn't you only have one ng-app? Delete ng-app off the body and try again.

Also, debug with Chrome
>>
>>57020643
So i changed angular link to:
https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.17/angular2.js


and this is what i get in console:
ReferenceError: System is not defined
<anonymous>
angular2.js:2
[Learn More]angular2.js:2:
- this is in ionic

I also create test.html and added same code, and this is what i get from console:
ReferenceError: System is not defined
[Learn More]angular2.js:2:1
ReferenceError: angular is not defined
[Learn More]test.html:15:9
>>
taking database class, and was curious. I have a table "Employees", and a table "Orders", with a foreign key of the employee ID. I need to make a query that will return all the employee info, combined with how many orders the employee processed.

How do I do this? I assume I have to somehow do an inner join between orders and employees, but then how do I count?
>>
>>57020676
go back to the first link and change the <body ng-app="whateverItWas"> to just <body>. see if that works
>>
>>57020660
<script>
console.log("start");
var app = angular.module('myApp', []);
console.log("after var app");



I tried opera console, and in opera script stops after
  console.log("start");
>>
hey guys is there a discord for this thread?
/
>>
>>57020611
Linked lists have been proven to be less efficient than basically any other possible way of storing information.
>>
>>57020714
no discord spys on it's users
>>
>>57020714
>a discord
A what?
>>
>>57020728
a discord
>>
>>57020701
it is same
>>
>drop gtk
>install qmlrs
>install qt everything
>rewrite whole app so far to use qtquick instead of gtk
>compile
>fix all errors
>
$ cargo run

>
Finished debug target(s) in 0.0 secs
Running `target\debug\app.exe`

>literally does nothing
ffs
>>57020714
i can make one if yall want, people have talked about it before but nothing ever came of it
>>
teamspeak3 anons, teamspeak3
>>
>>57020755
no I don't want you as an admin
>>
>>57020735

There is. But it's completely dead. No posts since April 19th.
>>
>>57020772
rude desu
>>57020813
invite me, i promise i can crank up the shitposting
>>
>>57020735
I don't know what the fuck you're talking about.
>>
>>57020755
I hate all kinds of devops bullshit desu. Why can't stuff just work? Most of the things I make just work.
>>
>>57020813
yea same just put an invite here
>>
>>57020826
>>57020841
Have fun

https://discord.gg/upea9
>>
>>57017238
weebshit >>>/a/
>>
>>57020927
lol
>>
File: SS_004.png (205KB, 1696x869px)
SS_004.png
205KB, 1696x869px
>right -> test.html on apache -> working
>left -> index.html ionic -> not working
>tried without ng-app="starter"
>tried different type of angular
>btw, right one only work on that version of angular

tldr. Fuck javascript fucking shit
>>
>>57020927
>Complaining about Chinese food in a Chinese restaurant
OP is a faggot for a different reason, though.
>>
>>57020939
Take this shit to >>>/g/wdg
>>
>>57020950
fuck off faggot
>>
>>57020958
Nobody cares about "meme.js" or whatever.
This thread is for actual programming.
>>
>>57020964
Well if you look older post, you will see how people care.

btw look at this >>57020958
>>
i wanna program shit why do I have to do bash scripts and makefiles this is retarded
>>
>>57020939
>Fuck javascript fucking shit
this post is redundant
>>
>>57020981
If your project is small enough you might not need all of that overhead. And it's a good habit to get accustomed to bash, it's super fast and can do just about everything you could ever want.
>>
>>57021009
I don't really get a choice one of my classes is literally all about bash scripting and the other one was C but it became makefile shenanigans along the way
>>
>>57020981

Bash and Make are useful tools to learn. Bash because of its use for general system scripting, and Make because it is one of the more common build systems used for C and C++ programming. When not written in directly, it is nonetheless common to use Makefile generators for more complex cases.
>>
>>57019252

it's not about learning to program it's learning about logic and how computers interpret things then translating those concepts to any programming language out there. so start doing logic puzzles, learn some syntax with python or whatever and learn some discrete math if you're that dedicated. Also boolean algebra is a good thing to pick up.
>>
>>57020939
Don't try to learn a framework before you even know how JS works. You're doing way too much at once with Ionic and Angular. Also, the guide you're following is also way out of date. Angular is on version 2.something now, and the latest Angular 1 is 1.58. Maybe that syntax doesn't even work with an older version. I agree though - JS sucks for beginners.
>>
>>57021098
fucking shit
i just found what is error
Looks like you are not allowed to type <SCRIPT> </SCRIPT> inside html file, you need to have script.js.
omfg
>>
>the register keyword
>this keyword gave the compiler-writer a clue about what variables the programmer thought to be frequently referenced, and hence, could usefully be keptin registers
>it turns out to be a mistake
>you get better code if the compiler does the work of allocating registers for individual uses of a variable rather than reserving them for its entire lifetime at declaration
> having a register keyword simplifies the compiler by transferring this burden to the programmer

t. deep c secrets

is this true, should I justg ignore "register"?
>>
>>57021199
Yes. It's far more useful for the programmer to assert the opposite, using "volatile".
>>
>>57020636
>>57020720
This is when I actually have a linked list without any string splitting. Kill me. At least I'll get most points from the project just from having no errors and having it compile.
>>
File: 19_211814.png (115KB, 380x337px) Image search: [Google]
19_211814.png
115KB, 380x337px
>Want to contribute to a project
>Has a billion outdated libraries
>Some are proprietary and require registration
>>
Don't generational/moving garbage collectors make linked lists much more efficient? Cache locality can be maintained and allocation in such GC schemes is absurdly cheap anyways
>>
>>57021199
Compiler ignores you. A massive waste of time.
>>
>>57021169
(thou)
>>
>>57021199

There are some cases where the register keyword has provided better performance. Most of the time, the compiler is pretty damn good at doing register allocation itself, and the compiler is free to ignore your usage of the register keyword if it so pleases.

I would not use it in regular code, but when doing optimizations, it might be one approach for speeding up certain sections...
>>
File: this-guy.gif (4MB, 411x227px)
this-guy.gif
4MB, 411x227px
>>57019773
>>
>>57019773
>>57021369 here
i did something a little similar to this and let me give you some advice, you can make it less of an eventual clusterfuck it'll become by making it modular. in main, call the function that progresses the story or whatever, but keep all the variables in main. don't just let variables get strewn all over the place
>>
>>57021340
>I would not use it in regular code, but when doing optimizations, it might be one approach for speeding up certain sections...

Almost never.
>>
>>57021414
we're talking about the register keyword in c, not about how often you get laid
>>
>>57021340
IIRC the register keyword does absolutely nothing and is entirely ignored by compilers, and spits out a warning as such. That may just be specific compilers though.
>>
Trying to get a server up and running. However, I need to tweak some guys code. First I need to create the database then "deploy it to a server."
He used an eclipse server. What is the alternative if I'm using IntelliJ? Also by create the database does that mean fire up MySQL and do a bunch of create tables and fill in values? Or is there a way to take an sql dump and fill it in semi automated?

>trying to adapt other people's code can extremely difficult
>>
File: output.webm (606KB, 526x310px) Image search: [Google]
output.webm
606KB, 526x310px
Man that DL/IL bullshit vim uses was a pain to figure out the actual semantics of.

But hey, now vim mostly works!
>>
https://www.quora.com/Would-Thomas-Cormen-forgive-me-if-I-printed-a-pirated-PDF-copy-of-the-CLRS-book-for-personal-use-only

apparently the answer is no
>>
>>57021513
lol

not sure why you'd ask some guy if he's cool with you pirating his shitty book
>>
>>57021513
>stolen merchandise
>It is not my forgiveness that you need.

Well isn't Cormen a sanctimonious fuck.
>>
>>57021491
wtf, I though rust was a meme language
>>
>>57021551
It has some warts, but I like it.
>>
>>57021491
did you make vim in rust?
>>
>>57021491
hi friendo
>>
>>57021596
No, I made a terminal emulator in Rust, that happens to be able to run vim now.
>>
>>57021592
Do you come from C,
how many warts does C have?
>>
File: laffin.gif (3MB, 360x203px)
laffin.gif
3MB, 360x203px
>>57021618
>No, I made a terminal emulator in Rust
>>
>>57021647
not him but why are you laughing?
thats something admirable
I bet you haven't programmed worth a shit in your life.
>>
>>57021668
probably because le reinventing the wheel with a meme language or something shitters would say
>>
File: bjarne.png (91KB, 136x275px)
bjarne.png
91KB, 136x275px
>>57021668
cuz rust is gay, call me back when he does it in a patrician lang like c++
>>
>>57021635
I don't come from any specific language, but C is one of the ones I know most and the longest.

C is undefined behavior made into a language, if you like that kind of thing, no problem.

I just tend to prefer languages with a proper type system and less instances of undefined behavior than atoms in >>57021647
dick.
>>
It's 2016

Should I bother going through the effort of optimizing my code to reduce the runtime in less than a half second interval?
>>
>>57021703
Why don't you jump off your high chair and break an ankle Bjarne?
>>
Currently learning python...

Kind of confused on immutable/mutable data types.
So I know immutable data types are types that can't change once they're created, but int is an immutable data type, yet something like this
foo = 5
foo += 5
print(foo)

correctly evaluates to 10... What am I missing?
>>
>>57021766
i've never programmed in python, but from what i understand, if you do

x = 5
y = x + 1
x = 9

y will be 10. is that what you're talking about?
>>
>>57021792
>y will be 10

In what retarded language does such a thing happen?
>>
>>57021766
>foo += 5
is going to give you an error in python

It's because you're reassigning foo.
ie:
>a =1
>b=a+1
>b==2

Instead in your case b is also foo.
>>
File: XAndY.png (12KB, 182x152px) Image search: [Google]
XAndY.png
12KB, 182x152px
>>57021792
Not really... It's more of a question of the object types in python.

If int is immutable, why can I change it?
>>
>>57021792
not even python is this retarded
>>
>>57021792
>i've never programmed in python
It shows
>>
>>57021792
No, that's FRP for retards.
>>
File: foobar.png (17KB, 412x118px)
foobar.png
17KB, 412x118px
>>57021809
I didn't get an error when I ran it...
>>
>>57021813
You're not changing the "object", you're changing the binding.

x = 5
x = x + 5
>>
What is the purpose of all these different programming languages?

What is the difference between the same program written in Java, C++, or some meme language like Go?

Why would there be differences?
>>
>>57021841
Okay... That makes some sense. Thanks!
>>
>>57021836
I think it's an error in python3 but not python2 or something dumb like that.
>>
File: 1474684798547.jpg (64KB, 599x449px)
1474684798547.jpg
64KB, 599x449px
>>57021792
Wew
>>
What OS, language, and Editor does everyone use most of the time?

>Debian
>C
>Emacs
>>
>>57021870
>exherbo
>C, Rust, Ruby, Elixir, JavaScript
>vim
>>
>>57021848
Trade offs. Java trades off performance and features for ease of use. C++ enables good performance and is feature-filled at the cost of being one of the more difficult and complex languages. Go is less general-purpose so it can be good at what it focuses on while being still pretty easy.
>>
>ghc bug casued it to delete source code files if it had a type error

hahahaha
>>
>>57021848
Basically, it comes down to certain languages being better at certain things.

Example:

MATLAB (Technically a programming language) is a really cool calculator you can use to solve linear equations in an intuitive and effective manner.

C++ could also solve linear equations, but you would need to do a lot more work to do it and it wouldn't necessarily be as efficient as something designed to solve those linear equations.

This wasn't the *best* example, but it shows how each language has its own pros. Ex: Java is widely considered a "safe" language because you have to make it crystal clear what you want to do before you program a large amount of objects, but it's not as fast as something like C++.
>>
>>57021870
>Windows 7
>Java
>Eclipse

Can I get more plebian?
>>
>>57021792
nice time-travelling variables :^)
>>57021888
le bumblebee-Old-and-abbandoned
>>
>>57021888
>write invalid code
>complain it gets rejected
>>
Anyone write their own algorithms for trading?
>>
>>57021870
>wongo bongos
>OCaml
>emacs
>>
>>57017238
What is the sauce on the OP?
>>
>>57021870
>Arch
>C++
>ST
>>
>>57021941
Win
C++
MSVS
>>
when should I care about portability
>>
>>57021870
i think my answers to all three will lead to bullying
>>
>>57021870
Windows 10
PHP
Microsoft word
>>
>>57022040
Wat? You code in Word?

>>57022035
Deal with it and post.
>>
>>57021870
>Gentoo
>Ruby, Scala, Python, Common Lisp
>Emacs
>>
>>57022035
Or people will just think you are joking like this guy >>57022040
>>
>ghc
4.0k
>gcc
920.0k

why the fuck are compilers so small
my fucking hello world in haskell is 1.8mb
>>
>>57022066
they're OPTIMIZED
also
>haskell
kek
>>
>>57021870
>Ubuntu
>C
>Gedit
I just started learning, no bully pls.
>>
>>57022066
>1.8mb
Looks like I'm never touching Haskell
>>
>>57022066
Maybe the haskell compiler links the binary with the entire Haskell standard library (if that's a thing, I'm not sure, not a Haskeller myself). Which would explain why.

For example, if I compile a barebone C++ hello world it will be only 9 kB, but that's with dynamic linking, but if I compile it with -static-libstdc++ and -static-libgcc (which is probably what's happening by default with Haskell), the binary will be 1.2 MB instead.
>>
>>57021269
Allocating nodes from the same pool would certainly be better, but you still have the problem of the cpu prefetcher not knowing what's going on because it can't look more than one node ahead.
>>
>>57022031
When you're writing a program that needs to run on more than one platform.
>>
>>57021870
>Windows 10
>Visual Studio Code
>HTML,CSS,JS(React, Node)
>>
>>57022106
>implying you ever were
anyways
the actual hello world part is small, its just that it includes other crap
>>
>>57021870
Funtoo
C, Go, Python
Vim
>>
>>57022103
gedit's pretty comfy once you get the preferences set up right with line numbers and highlight current line and match braces and all that. i genuinely don't believe learning vim or emacs is worth the effort in the slightest bit whatsoever
>>
>>57021870
Lubuntu, Python for job but Haskell or Racket for fun, Emacs. I want to try NixOS and I'm always interested in new languages though.
>>
File: dicks.png (72KB, 652x352px)
dicks.png
72KB, 652x352px
>>57022066
>>57022120

And likewise GCC dynamically links to libc.
>>
>>57022153
well, you don't have to learn emacs, but vim is useful for remote work
even at that, basic commands would be sufficient if you're only making simple edits remotely
>>
>>57022149
I actually was looking into learning it, if only because of functional programming.
>>
>>57022153
>i genuinely don't believe learning vim or emacs is worth the effort in the slightest bit whatsoever
This would be more credible coming from someone who uses vim or emacs.
>>
>>57022153
I've been a developer for almost ten years, still use Gedit on the regular, despite being proficient with vim. It's a very underrated and pleasant minimalist gui text editor.
>>
>>57022176
when i was just starting out and chipper about everything tech i used to think exactly that, what if i have to do system administration stuff. but i've started applying the YAGNI rule in my personal life. if i'm in that situation for some reason i'll manage
>>
>>57022196
What do you think about geany?
>>
>>57022106
>>57022177
A lot of that is the Haskell runtime, which has been statically linked in. It's not like if you printed "Hello World" twice that it would double in side
>>
>>57022177
its neat, but expect mb sized binaries
one of the things I hate about haskell
>>
>>57022205
Good point, basic vim commands are simple enough to learn on the fly anyways.
>>
>>57022214
>>57022216
Is there no dynamic linking option?
>>
>>57022239
There is, look up haskell binary size on stack overflow
>>
File: DMUX_198.png (19KB, 1368x795px)
DMUX_198.png
19KB, 1368x795px
Got some networking done for my game; trying to get it so the game servers and client connect to the master server. Now the server list shows the game port where before it was showing the port it used to connect to the master server. Networking is pain.
>>
>>57022239
>>57022253
found this
https://downloads.haskell.org/~ghc/7.0.3/docs/html/users_guide/using-shared-libs.html
>>
>>57022239
This would make it a lot more practical for me to play with. Currently stuck on a shitty little chromebook until i get a replacement board for my main PC.
>>
>>57022257
It might be worthwhile to peruse Quake source for insights (both for your game and networking).
https://github.com/id-Software
>>
>>57022313
I am using RakNet for networking at the moment; all my networking code at the moment uses RakNet (master server is written with it).
http://gamedev.stackexchange.com/questions/131257/raknet-connection-error
>>
File: hooo momma.gif (2KB, 360x72px) Image search: [Google]
hooo momma.gif
2KB, 360x72px
I'll bet that the paheal admins are super happy with what I'm doing
>>
>>57021467

I had believed that for a while, but an anon here had shown me some code where it made a difference, at least in the generated assembly. So at the very least, gcc is not outright ignoring it.
>>
>>57021870
>Ubuntu
>Java
>Nano, Geany, Android Studio
>>
>>57022389
I once scraped some porn site to the point that they exceeded their monthly allowance with the database queries (they weren't hosting the database themselves) and they were down for a week until the limit refreshed lol.
>>
>>57022498
Oh man
That's funny
I'm making a super-aggregate database right now, combining all the content from every single booru I know of, then I'm probably going to make a frontend and post it here or something
>>
>>57021870
>OSX
>Swift, ObjC
>Sublime, XCode

I'm well represented in the real world and a pariah on /g/.
>>
>>57021870
macos
go
textmate
>>
>>57021870
Windows 10
>Java
Netbeans
>>
>>57017853
please
respond
>>
>>57017853
(You)
>>
>>57022930
(Me)
>>
New thread:
>>57023079
>>57023079
>>57023079

No stupid reddit shitposting in the OP edition.
>>
File: 1473552249773.gif (13KB, 633x758px) Image search: [Google]
1473552249773.gif
13KB, 633x758px
Is it worth going through and trying to do challenges on hackerrank? Most of them seem out of my league but maybe it's worth it.
>>
>>57021870
>Debian
>x86 assembly and C
>KDevelop
>>
How can i send a ctrl+c to an invisable console application running on another process, from another process
>>
File: radare_overview_interface_001.png (14KB, 752x535px) Image search: [Google]
radare_overview_interface_001.png
14KB, 752x535px
> What are you working on ?

I've just completed IOLI(it's ioli, not loli): babby's crackme collection.
And I have to ask.

Why Radare2 is such shit? It's been in development for a decade and it feels they need to abandon it and start a new project again. (Maybe this time with background analyses).

It can't `aaa`nylize fucking /bin/bash, forget about vidya (I tried witcher 3, gave up after more than hour).

And that's bad: more and more vidya move to x64, so free ida doesn't cut it anymore, and demo binary ninja is useless (can't save projects).

I also still hadn't figure out how to use `asm.emu`lation if it's even possible (e.g. in crackme03 there's basic arithmetic challenge, I used gdb to get the result)

Oh, and its frontends are complete garbage (bokken and web UI) that crash the moment you look at them funny. Or just for fun.
>>
>>57017317
>open git gud
>literally gamergate girl

wow
Thread posts: 317
Thread images: 43


[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.