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

old thread: >>59988813

What are you working on, /g/?
>>
nth for 2lazy to think of a new nth
>>
>manager asks for new feature
>Existing code was a designated shitting repo for some Indian guy that left

Do I refactor or just get the feature done quickly and avoid cleaning up someone else's poo?
>>
File: kanye west.png (135KB, 273x351px) Image search: [Google]
kanye west.png
135KB, 273x351px
>try out new terminal color theme
>not used to the new colors
>pussy out and revert back

every time
>>
>>59994465
Umaru on the front page once again!
>>
>>59994525
The moment you touch it, you are going to be responsible for every possible way it fucks up in the future.

Put your gloves on and wade through the poo now, it'll be easier in the long run.
>>
I've got an SDET I interview coming up and I'm not sure what kinds of questions to expect. I assume it'll mostly be technical, but if that means standard coding problems or problems focused specifically on testing, I'm not sure. Anyone actually done an SDET interview before?
>>
0.9999...= 1
>>
Repost from last thread.
I'm looking for help with some Python. I have the logic written, but I don't know the language. If there's a student or someone who could use some extra cash for a few hours' coding, hit me up.

[email protected]
>>
>>59994569
wow dude just do your own homework
>>
>>59994544
Technically, the limit of 1/X as X->inf. Is 1.
>>
>>59994569
Lol, just post it here. I'm not gonna dick around with email
>>
>>59994575
Oops, fucked that up. Whatever.
>>
>>59994569
email sent
>>
File: 1490181498765.jpg (31KB, 491x707px) Image search: [Google]
1490181498765.jpg
31KB, 491x707px
Learning c++(first language).I need to start working asap, I decided to go with a painful shit, so that later my anus will be relieved when I reach php/java/whatever.
>>
File: green anime girl.jpg (150KB, 1276x648px) Image search: [Google]
green anime girl.jpg
150KB, 1276x648px
>>59994526
>install any dark/non-white theme
>never look back
>>
File: ef374184b66e49ad9a26bd7b76ea8e6b.png (411KB, 1887x932px) Image search: [Google]
ef374184b66e49ad9a26bd7b76ea8e6b.png
411KB, 1887x932px
can anyone think of a good background to go along with this web page? Black seems dull, and it's also too empty.
>>
>>59994602
Gross. Just do C then Java or whatever OOP shit
>>
>>59994569
Just post it you fucking faggot

>>59994613
>posting worst girl
>>
>>59994615
steal from apple and dynamically get the background color from the card
>>
File: 1492744900484.png (336KB, 1887x932px) Image search: [Google]
1492744900484.png
336KB, 1887x932px
>>59994615
>>
G(foo(G, G(length([zero, true, fun(X,Y) -> X(3) end])))))

How do I tell what is bound and what is free?
>>
File: fcdf2f1e21ae46b38a89255e565e6d5a.png (462KB, 1900x927px) Image search: [Google]
fcdf2f1e21ae46b38a89255e565e6d5a.png
462KB, 1900x927px
>>59994659
>>59994641
very pretty, although I don't see how this can be done dynamically.
>>
>>59994677
It's bound if it's in a scope where it's been declared.
>>
>>59994683
Its just finding the majority color in the area to return
>>
>>59994692
would I need css/javascript for this? Not familiar with either, and getting tempted to hardcode this for each type. :S
>>
>>59994683
CHECK THE COLOR OF THE CARD BORDER
>>
>>59994730
good news
https://github.com/lokesh/color-thief
>>
>>59994684
So G, foo, length and X are all bound, Y is free, and zero, true, and end are atoms?
>>
>>59994753
would this still work if I don't know the image url until runtime? I'm using Python.
>>
First time arduino user here.
I have to do some basic coding for measuring shit from a sensor. I've done a basic code using serial for communication, and gathering the results on MatLab.
However, the real application will run with an SD card attached. And I can't get this shit to work at all. I think I'm really skipping something in here.
What i've first done is to try using SD.begin. However, that gives no answer at all (my program has some basic coding to analyze wtf is going on). So I tried with some numbers I found on the internet (SD.begin(4), SD.begin(10) and a few other random ones) and most give no answer, while SD.begin(10) just returns false.

Here's how I know wtf is going on BTW
 while (!SD.begin(10)){ 
if (ledState == LOW) {
ledState = HIGH;}
else {
ledState = LOW;}
digitalWrite(led, ledState);
delay(1000);}

Easy stuff, just flashes the LED while it can't read. For SD.begin() and the other few numbers I tested, it doesn't even flash the LED, which makes me believe the begin function fails to return a value at all.

Anyone can shed some light on what to do? the arduino is a uno r3 btw, and the SD adapter is the thing in the picture (it has no writings on it, but a google search gives me the name w5100 ethernet shield, so I guess that's it)

I posted this on the last thread and someone told me to look into the arduino's datasheet, but I have no clue what I'm looking for. Please help, this is the first time I've messed around with arduino. I was able to breeze through everything else because I have quite a bit of experience with C so it wasn't that hard, and this SD begin thing is the only thing setting me back rn
>>
>>59994569

How much of a faggot do you have to be to not be able to put already figured out logic into Python?

Python is practically pseudo-code. Getting the right logic is 90% of the work if it's a one-off script or something that doesn't need to be maintained (which must be the case, assuming your situation).

Either you're a retard, or you don't know how to program and don't actually have the right logic.

Seriously, RTFM

http://www.learnpython.org
https://docs.python.org/3/
https://docs.python.org/2.7/
>>
>>59994755
Only X is bound.
>>
>>59994922
Yeah, I suck. I know Py is on the simple side of things, and it's something I plan on learning when I have time to sit down and study it, but I'm in a hurry and just don't have the time to learn a new language right now, especially if it's something that someone can slap together in a couple hours. Paying someone else to do it is just a better use of my time at the moment.
>>
>>59995000
in the two times you posted the request you could have learned everything there is to learn in python.
>>
>>59994569
i think "dpt please do my homework" has just reaches its peak
>>
if i have a 2d array how can i break that 2d array up into k smaller 2d array blocks?

e.g. a 8x8 array into 4 2x2 arrays
>>
>>59995054
You got this, buddy.
>>
>>59995054
How much time have you put into thinking about the solution to your problem?
>>
>>59995088
im trying to do it in pseudocode right now

i know im going to have to iterate twice by the width and the height its just after that im getting a bit lost. my current thought process is to use the width or height somehow and maybe divide that by some variable to get the starting point
>>
File: ....jpg (18KB, 480x270px) Image search: [Google]
....jpg
18KB, 480x270px
>>59995126
You're on the right track, friend.
>>
How do i into application version numbering?
>>
>>59995169
Just assign the numbers randomly.
v0.0.7 - First stable release
v1.0.3 - Small update
v7.3 - Minor bugfix
v7.3.1 - Major version; ABI breakages and backwards incompatibility
>>
>>59995146
ive got this so far

input_arr = some square 2d array
k = # number of partitions
int width_chunk = input_arr.width/k
int height_chunk = input_arr.height/k
result_arr[k][k]
for int i = 0; i < k; i++:
for int j = 0; j < k; j++
result_arr[i][j] = input_arr[width_chunk * i][height_chunk * j]


but on that last line im only getting the current element of that target array when in reality i want to get a range. any idea?
>>
>>59995217
ideally it'd be something like this (there would be some edge cases id need to take into account)

        result_arr[i][j] = input_arr[width_chunk * i-1:width_chunk * i][height_chunk * j-1:height_chunk * j]
>>
>>59994825
idk anything about arduino but wouldn't you need to decode the partition table and file system when accessing an SD card directly?
>>
>>59995217
why are you multiplying i * width_chunk and j * height?
>>
>>59995169
afaik some projects go for first-second decimal being the release and third being bugfixes, but you might skip to the next first (like in Python 2.7->3) if the change is significant. but you can really do what you want if it's your project
>>
>>59995201
eh, seems about as good a scheme as any.
It's kind of what i'm doing now.
>>
>>59995261
thats the bit that i got stuck on see >>59995226
>>
>>59995169
first stable release: 1.0
major version number changes when API or ABI changes or theres an important new feature
minor version numbers change with bugfix releases and new features

everyone expects API/ABI to stay stable within a major version
>>
>>59995290
where's this problem from? post it, i don't understand the question
>>
>>59995169
use git commit hashes
>>
>>59995217
>>59995226
Only index i. If you index j you're getting an element and not an array. This also means you don't nested loops.
>>
>>59995327
its part of an assignment in my image processing course about motion estimation with macroblock matching. im trying to divy a frame up into k blocks

see step 1
>>
>>59995350
so something like this?

input_arr = some square 2d array
k = # number of partitions
int width_chunk = input_arr.width/k
int height_chunk = input_arr.height/k
result_arr[k]
for int i = 0; i < k; i++:
result_arr[i] = input_arr[width_chunk * i]
>>
>>59995321
API/ABI isn't an applicable concern for end user binaries.
>>
>>59995367
drawing some pictures might help
>>
PRIMARY KEY(key1, key2)

How do primary keys work in SQL when you have multiple fields defined?
Does the database check if the second value is unique to the left one?
Or do they both have to be unique?
>>
>>59995010
That's just blatantly false.
>>
Hi guys been a while

I'mma look around and post if I can
>>
File: 1478737699750.jpg (121KB, 1280x720px) Image search: [Google]
1478737699750.jpg
121KB, 1280x720px
trying to figure out how to mess with the person who gave me a virus. i found a folder called resspam deep inside system. the contents of the folder were recognizably shit that runs as many programs as it can, and a bunch of logs confirming my suspensions that this was definitely the folder i wanted. however going though the log i found this little gem
17:05:01 [002624] [CLSK][YouCam] SR = YUC150326-03
17:05:01 [002624] [CLSK][YouCam] UserName = HP
17:05:01 [002624] [CLSK][YouCam] CompanyName = Hewlett-Packard
17:05:01 [002624] [CLSK][YouCam] ComputerName = UMV90M34CG1OP
17:05:01 [002624] [CLSK][YouCam] OS Display Lang = 1033
17:05:01 [002624] [CLSK][YouCam] OS Non-Unicode Lang = 1033
17:05:01 [002624] [CLSK][YouCam] Location ID (GeoID) = 0xF4
17:05:01 [002624] [CLSK][YouCam] ProductName = YouCam
17:05:01 [002624] [CLSK][YouCam] Version = 6.0
17:05:01 [002624] [CLSK][YouCam] Command Line = "Setup.exe" -s
17:05:01 [002624] [CLSK][YouCam] OS Version = Win10
17:05:01 [002624] [CLSK][YouCam] Bit = 64.
its been a while since i last got really into computers so im pretty much just working off of what i remember,and google. so all i could gleam from that was that he's somewhere in the U.S. help if you can. i could really use it.
>>
>>59995376
Closer. However you need to get rid of width_chunk and height_chunk. All you need is chunk_size. This value should be equivalent to input_arr.x such that k | x where x is the width or the height.

Now you can produce the proper range of the subarray.
>>
>>59995592
We aren't your script kiddy army
>>
>>59995484
The combination of all of the primary keys has to be unique.

for a table
animal(type*, name*, age*)
dog bob 1
dog bob 2
dog jim 1
cat bob 1
cat bob 2
cat jim 1

are all unique primary keys in the table
>>
>>59995592
Install Gentoo. That'll show 'em.
>>
>>59995592
how did you unironically fall for a skiddie from 2006
>>
>>59994825
can you please post your actual code dude, i don't want to trouble shoot this generic loop. port your setup() and loop() and everything else. Tell me what SD library you are using and how you have the SD shield wired to the board. Tell me if the compiler is compiling or throwing errors or warnings etc.
>>
>>59995484
>>59995628
this gets interesting when you begin to work in clustered OLAP databases. Primary and foreign key constraints become mostly informational and sort/distribution keys determine storage and traversal
>>
Working on an encryption decryption program that doesn't use any of the encryption libraries in c#

because I'm a masochist. and yesterday someone said it wasn't even possible.
>>
>>59995929
what library/API are you leveraging for ciphers, RNG, etc?
>>
>>59995955

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


Thats all I'm using.

The hardest part is finding an encryption method that's actually reversible.

But I think I have it.
>>
>>59995929
It is not impossible but it is very possible that your implement is flawed and has some vulnerabilities.
>>
>>59996015
so, just out of curiosity, are you going for something like a gpg or openssl type utility? That is quite an endeavor indeed.
>>
>>59996045
Honestly i'm just being basic.

take text, change text into something else semi-random and give a key.

then decrypt by giving that same text and your key.

When I'm done I'll pastebin it here.
>>
>>59996063
have fun
>>
>>59996019
Wouldn't doubt it.
The problem yesterday was me trying to reverse modulus, because I'm stupid.
so tonight I'm trying something different.
>>
>>59994575
yeah...
>>
File: 1485890385859.jpg (65KB, 700x700px) Image search: [Google]
1485890385859.jpg
65KB, 700x700px
>>59996085
>tried to reverse a modulus operation
wew lad
>>
>>59995837
code is too big to post all at once, but setup is the following:
void setup() {
pinMode(led, OUTPUT);
pinMode(swi, INPUT);

while (!SD.begin(4)){
if (ledState == LOW) {
ledState = HIGH;}
else {
ledState = LOW;}
digitalWrite(led, ledState);
delay(1000);}
digitalWrite(led, HIGH);
analogReference(EXTERNAL);

calib();
}


all the led stuff is for debugging there, and calib doesn't use the SD. However, the code doesn't even reach calib(), it stops by the SD.begin(), (I know this my using the led - by flashing at different frequencies or just staying on/off, I know where in the code it currently is) so I don't think I need to divide my code into mulltiple posts. loop() doesn't even get called as well. The compiler gives no errors, and the only warnings are
WARNING: Category 'Device' in library ParPrinter is not valid. Setting to 'Uncategorized'
WARNING: Category 'Device' in library Radar is not valid. Setting to 'Uncategorized'

But i'm using neither libraries, so I don't think it matters (or does it?).
The sd library i'm using is just SD.h. I didn't even know there were other libraries. As I said, it's my first time messing around with arduino. The ethernet/SD shield only has one way into the arduino, which is literally placing it on top. As you can see from the pic, it just has it's pins that connect to the arduino analog/digital/source entrances, and it has six ICSP connectors that connect the SD reader to the arduino itself. That's the thing I should be accessing, but idk if I should be stabilishing shit like >>59995241 said, but I was hoping it would be kinda like standard C programming where you only mess with file pointers and that's it.
I use the standard arduino compiler btw, not sure if there are others.
>>
File: 1479181576869.png (29KB, 882x1289px) Image search: [Google]
1479181576869.png
29KB, 882x1289px
>when you add a bracket around a variable and it fixes the code that you've been working on for 2 weeks
pic related me, taking off my noose.
>>
>>59996172
>whip up some quick n dirty code
>hmm i wonder if i could make this a bit more efficient

>4 hours later on history.stackexchange reading about the Saud family and the destabilizing effects of discovering large pockets of fossil fuels leading up to WW2
>>
>>59996159

https://www.arduino.cc/en/reference/SD
https://www.arduino.cc/en/Reference/SPI

The communication between the microcontroller and the SD card uses SPI, which takes place on digital pins 11, 12, and 13 (on most Arduino boards) or 50, 51, and 52 (Arduino Mega). Additionally, another pin must be used to select the SD card. This can be the hardware SS pin - pin 10 (on most Arduino boards) or pin 53 (on the Mega)

I don't see those pins being set here or being #define above
>>
>>59996219
>aka taking your first dose of the redpill
>A few more steps and you are on /pol/
>Then you realize that it is just the start of the bunny hole
>>
>>59996219
>>59996239
>a few more days go by
>writing haskell to scrape loli threads on /b/
>finally hit final form
>>
>>59996246
>Hits final form
>Knock on the door
>"FBI here!"
>Its go time
>>
>>59996120
>>59996076
this is over my head but I'm refusing to give up.
>>
>>59996219
>>59996239
>>59996246
>>59996254
>hit killswitch
>all drives wipe at once
>FBI rolls in
>Me in my ergonomic chair
>leather trenchcoat
>leather fedora
>let_the_bodies_hit_the_floor.jpg
>>
>>59996234
When looking through the SD reference and the examples it gives, no function is ever called from the SPI.h library, neither are any of those pins
Just look at this example:
https://www.arduino.cc/en/Tutorial/ReadWrite
after estabilishing a Serial connection, it just jumps straight into the SD. Is there something I'm missing? I feel really lost desu, i was finding most of this stuff easy until I hit this fucking problem
>>
>>59996291
I'd suggest that you dupe your friend by making an application that uses base646 and ROT13 (both should be hellishly easy to implement) and with both they probably wouldn't be any wiser that it was a sham.

Just a way to best your mate and not drive yourself insane with a Sisyphean task
>>
File: 1492241054140.jpg (65KB, 626x626px) Image search: [Google]
1492241054140.jpg
65KB, 626x626px
>>59996172
>spend an hour wondering how I'm getting exactly the wrong output for a function
>realize I forgot to escape my "." delimiter
>>
File: 1455627844909.png (581KB, 438x897px) Image search: [Google]
1455627844909.png
581KB, 438x897px
In my stress testing of akari-bbs, I managed to increased the maximum post rate to around 40 posts per second and I fixed a glaring oversight that was allowing multiple posts on the same board to share the same post number.
>>
>>59994569
Fuck off and kill yourself
>>
>>59996294
>You have prepared for this moment for a long time
>Go down in a blaze taking down as many of the Jew's pigs as possible
>Immoralized on CNN and /pol/
>Another anon is tricked into visiting /pol/ upon hearing your story
>So the cycle begins again
>>
>>59996314
>>59996219
Wow thank you for responding.
I'm just very happy.
Hahaha (:
>>
>>59994575
That makes no fucking sense faggot
>>
>>59996308
can you try using an if statement instead of while here:
while (!SD.begin(4)){ 
if (ledState == LOW) {
ledState = HIGH;}

thats one difference I see between what you have here and that. From a logic perspective it makes sense you'd only proceed to open the file called later if the SD card was initialized.
>>
>>59996311
there's no mate involved. its just the dpt roller task I'm doing. Thats why I'm sure I'm being a masochist.
>>
>>59996343
>>
>>59996340
tried it, it still doesn't reach calib()
>>
>>59996324
Grats man.
>>
>>59996116
>>59996336
Ooooh, two people didn't bother to read the thread before posting.
>>
    if (ledState == LOW) {
ledState = HIGH;}
else {
ledState = LOW;}
digitalWrite(led, ledState);
delay(1000);}
digitalWrite(led, HIGH);
analogReference(EXTERNAL);

try running it without all this. include only like a serial println or something
>>
>>59996120
also I was thinking if I knew all 3 factors to the modulus I'd be able to just find one of the original values from it.

the value is 5, my key is 6
so I encrypt by doing
(5*6)%4
coming up with a new value of 2 with a key of 6

I was looking for a way to use that 2 and that 6 to figure out my original value was 5.
>>
>>59996372
I don't get it.
>>
>>59996324
>40
THOSE ARE ROOKIE NUMBERS GET THOSE NUMBERS UP
>>
>>59996383
I have an exact version of this code that uses Serial instead of SD, and it works perfectly.
That's why I'm trying to reach calib() btw, given it is a literal copy paste, and from there I can know that at least the basics of the code are running
>>
>>59996324
>40 posts per second
Jesus fucking christ, how slow.

You should be able to do thousands.
>>
>>59996390
I admitted I messed it up 2 posts later
>>
File: ArmyDog.jpg (259KB, 365x516px) Image search: [Google]
ArmyDog.jpg
259KB, 365x516px
>tried learning Java a few months ago from a book
>got through the whole book but still couldn't build any program of my own
>didn't understand OOP or why/how it's used in the real world

I want to try learning again, but this time I want to learn C because I figure it would give me a better basic knowledge of programming without worrying about OOP yet. Are there any good online courses or MOOCs that teach me C and provide programming projects?
>>
>>59996324
I'm no expert, but I can guess that your datastructure is trash
>>
>>59996401
It seems like, when running the code, even though the LED doesn't flash, the processor still gets quite hot, which makes me imagine it is at least trying to get to the SD. By this point, I can only assume the SD is the problem. I'll try to get someone to lend me theirs tomorrow.

Thanks for the help, anon
>>
>>59996431
Go to youtube.
Seach "learn C in one video"
Watch that
Google "dtp roller"
Start writing those programs 1 by 1
If you need help with anything google your errors, ask for logical help only in here.
and if you don't know how to do something, google it.
You'll learn the language in no time.
>>
>>59996401
Trust me you'll run into weirder shit. I work mostly with ESP8266's but every embedded uC has strange nuances. the Serial and SD libs dont have anything to do with each other. if you're defining your if/while statement off of the serial connection starting successfully of course that works :-p.

Check the leads on the shield (with a multimeter or led bridge) check your arduino. Look and see if you can find other libs out there for it
>>
>>59996446
Forgot to say pastebin your finished projects here, someone may tell you how to do it more efficiently next time.
>>
>>59996403

Right now, I'm using sqlite.
I'm not trying to be facebook or anything.
>>
What are the best resources for learning C? Should I use something like Cygwin to start programming or is running a Linux VM better?
>>
>>59996480
Cygwin
>>
>>59996480
If you're using windows, go for MSYS2
>>
Oh yeah forgot to say not gosu. Never was. They just wanted to pretend a little harder for once's sake. Don't worry.

Fuck Korea. Pieces of shit all over. Total cucks.

Have some water. Ask for more. Discretely.
>>
>>59996480
MSYS2
>>
>>59996324
Is the latest source on GitHub? Curious as to why DB statements are being prepared more than once per application run, as the gain from reusing a prepared statement is quite high.
>>
File: 1491957157050.png (32KB, 555x421px) Image search: [Google]
1491957157050.png
32KB, 555x421px
>>59996537
what? who are you talking to?
>>
>>59996587
I was under the impression that you weren't allowed to reuse prepared statements like that unless you precompiled them or something.

Also, I'm generating all the statements during execution, I can't reuse any of them except maybe the initial board fetch, which is only done once.
>>
>>59996612
I think it's a /pol/fag having a stroke. Hope he's alright.
>>
>>59996646
Take it easy on him. He's new.
>>
>>59996537
Shillbot malfunction confirmed
>>
File: 1476195160683.jpg (26KB, 320x395px) Image search: [Google]
1476195160683.jpg
26KB, 320x395px
>>59996646
>>59996671
>>59996682
>>
Java fag here

for lower level programming, should I rather learn C/C++ or Rust?
>>
>>59996768
>C/C++
Why are you grouping two completely different languages together?
>>
>>59996788
He also grouped them with Rust. Is Rust like both C++ and C but those two aren't similar enough to be grouped?
You're very picky anon.
>>
>>59996768
Why not java?
Do you even know what you're asking for? What do you indent to write at a lower level? There's some things where java isn't sufficient but in other cases it's safer for you to stick to java.
>>
>>59996801
He didn't group Rust with the others using a slash.
When people say "C/C++", they seem to think of the two as interchangeable, which is completely wrong. They are completely different languages, and should be treated as such.
It makes about as much sense as saying "Java/Javascript".
>>
>>59996431
if you really want to learn C:
start with K&R C, then whatever posix c programming book you can find, then "expert c programming: deep c secrets" and then read the C standard.

the problem with C is that there's only "can't program in C" or "mastered it". there's nothing in between like with other languages where some knowledge is enough to get by, because even small errors are fatal.
>>
>>59996480
see
>>59996841
>>
>>59996814
I need to control X11 on my Raspberry PI. Right now I'm using java.awt.Robot but it's slow af of course.
>>
>>59996816
>It makes about as much sense as saying "Java/Javascript".
Except there isn't an attempt from the European Computer Manufacturers Association to keep Java code trivially translatable into Javascript.
>he didn't group them using a slash
Again, very picky anon. Slash is just another way of writing and/or (and and or. and or or).
>>59996841
>there's nothing in between like with other languages where some knowledge is enough to get by
Except that's blatantly false. C is easy to master as a language but designing the systems you aim to design may be hard.
>small errors are fatal
As they should be in almost any language. Having errors laying around is dumb.
>>
>>59996841
>then read the C standard
I skim read this shit every now and then. Sometimes there are some surprising features in there which most people don't even know about.
>>
>>59996870
>>59996841
calm down, I thought C was completely compatible to C++ / C++ being a C-fork and therefore it was politically correct to group them
>>
>>59996870
>Except there isn't an attempt from the European Computer Manufacturers Association to keep Java code trivially translatable into Javascript.
The intersection between C and C++ is smaller than people realise. Trying to write code which compiles as both is a fucking stupid goal, is incredibly finicky to do (there are many cases of identical C and C++ code with different semantics), and gains you basically nothing.
You can get header files to work between languages, but there is seriously no fucking reason to write code to compile as both. You pull in the retardation of C++, but don't even gain any of the shit that C has done since fucking 1989.
>Slash is just another way of writing and/or
Why did he use both a slash and 'or'? He was implying that C and C++ are the same entity.
>>
>>59996638
I think you can simply reset the statement and bind the latest parameter values to re-run it without any problems, but I see your point about them being prepared during execution. I thought maybe part of the board app was stateful and persisted longer than a single request, but I guess not.
>>
https://macton.smugmug.com/Other/2008-06-22-by-Eye-Fi/n-pxKmq/i-7WzHQ74
What does gateway mean?
>>
>>59996870
>Except that's blatantly false. C is easy to master as a language but designing the systems you aim to design may be hard.
no it's not. i never said mastering C is hard, but people who didn't read the standard write horrible code with a lot of undefined behaviour, like conditionals on uninitialized memory, invalid memory accesses, memleaks, etc, etc and think that just because it seems to work it actually works fine.

>>59996876
what surprised me the most after reading the standard the first time is how much i was actually doing wrong but still works with linux/gcc/glibc most of the time for some reasons.
>>
>>59996420
What was it supposed to be?
>>
>>59997072
1-1/X
>>
>>59996478
SQL was a mistake.

Just use a custom binary format that doesn't require you to fucking run bytecode to save some data.
I have no fucking idea why someone would want to use something as complex and inefficient as SQL.
>>
>>59997084
For heavy related data, SQL is great.
>>
>>59996446
>dtp roller
What is this meant to find? I tried searching for it and didn't get anything obviously C related
>>
>>59997136
Clicks the link and reads the text as a c program and then returns the desired info.

In c I believe it goes socket, network, html, scrape, load, read. And by load read I mean load into second buffer and then output to desired location.
>>
>>59996372
i saw your admission of incorrectness but i wanted to make fun of you anyway
>>
Trying to learn latex and setting up latex in emacs (specifically aquamacs)...

Is there a way of having the latex be displayed as I type, or would I need to compile it?
>>
>>59997237
latex is compiled, you could compile it on every save or something and auto preview it ?
>>
File: emacs-latex-preview.png (135KB, 742x890px) Image search: [Google]
emacs-latex-preview.png
135KB, 742x890px
>>59997245
Alrighty... I was just wondering how to get something along these lines
>>
I'm confused about unique_ptr in c++. I have the following piece of code:

template <class T>
class Node;
template <class T>
using Knoopptr = std::unique_ptr<Node<T>>;
template <class T>
class Tree: public Knoopptr<T>{
};
template <class T>
class Node{
friend class Tree<T>;
public:
int data;
Tree<T> links, rechts;
Node(int d): data(d){}
Node(Node& n): data(n.data){};
};
int main(){
Node<int> n(10);
Tree<int> t(new Node<int>(n));
std::cout<<t->data<<std::endl;
return 0;
}

And I get the following error:
error: no matching function for call to ‘Tree<int>::Tree(Node<int>*)’

Why doesn't it use the constructor of uniqiue_ptr? And how can I fix this shit?
>>
>>59997282
Whats not clear there, you are passing Node<int>* and you dont have constructor with that type signature...
>>
>>59997300
oh, I'm retarded. Thanks.
>>
when you are programming "C but with some C++ features" which C++ features do you use?
>>
>>59997676
std::string for sure, maybe std::vector and if im lazy std::algorithm but if I'm doing C i try to use pure C i have my own simple string implementation that i always use
>>
>>59997676
Why would I do that? Why would I just pick the only logical decision and just use C?
>>
Programming a min-oriented binary heap. I'm currently storing values within it as objects, but I'm thinking of switching to tuples.

Are tuples more performant? More cache-friendly due to their contiguous nature?
>>
>>59997704
Shakespeare
>>
>>59997704
>mfw you don't understand the dynamic nature of language

read some wittgenstein
>>
>>59997724
I don't think he used words such as "pussy out" and "scrape loli threads on /b/"
>>
>>59997719
It depends on language you are using if you are using for e.g structs in C as objects they are contiguous in memory. If you are using pythong RIP since nothing is
>>
>>59997742
it's js (i know)
>>
>>59997728
Yeah, I could tell by the greentext abuse and posting
>mfw
without an image. Posters like you are the exact type of garbage that collects in /dpt/ threads.
You are precisely what's wrong with not only these threads, but the internet as a whole. Your predisposition to posting without lurking is exactly what kills a community.
>>
>>59997676
templates, and auto type deduction
>>
>>59997752
>mfw you still have not read witty

intent, context, example

>muh community
ayyy lmao
>>
>>59997750
uhh man, i dont even know if its possible to do anything about cache misses... Just use data structure with least overhead.
>>
>>59997771
You're some trendy teenybopper dicksucker who probably just heard about this place within the last two years. You don't belong here and you never will. Your faggotry is exactly what enables memespouting retards like >>59997676 to feel at home. You're a fucking embarrassment. Don't ever post here again. I'm tired of seeing all you petulant newfags run amok. You want to be a mouthbreathing retard for your first few years here, do that shit in /b/, okay faggot? Just fuck off.
>>
>>59997771
>mfw
>muh
>ayyy lmao
>>>/r/abbit
>>>/v/
>>>/b/
>>
>>59997794
>>59997819
>muh sekrit club

am i crumbling your johnathans?? :^)
>>
File: 1433729434633.png (115KB, 365x328px) Image search: [Google]
1433729434633.png
115KB, 365x328px
Suggest to me a project preferably doable in the C programming language.
>>
>>59997878
Game engine.
>>
>>59997878
File indexer daemon/wangblows service with ability of sorting per type, last modified, creation date etc.
>>
>>59997847
>@

wow imposter get out of here before you taint the purity of this elite and esteemed sanctuary

you should go back to <other site>, where <people i do not like> are, you <boogeyman>
>>
>>59997878
>No mention of skill level or time investment
Write an kernel, then.
>>
@59997899
>wow
>elite and esteemed sanctuary
>boogeyman
You not knowing about "@" obviously means you've been here for less than a week. Jump off a bridge already.
>>>/r/abbit
>>>/v/
>>
File: 1491299243518.jpg (38KB, 362x346px) Image search: [Google]
1491299243518.jpg
38KB, 362x346px
>>59997237
>>59997260
I'm looking into it too, did you find anything?
>>
>>59997919
Im looking as well, compilation, preview works great but not inline like on pic... Really nifty plugin
>>
>>59996856
Rust has decent X11 bindings afaik. Haven't tried them myself though.
>>
File: Screenshot_20170421_130337.png (32KB, 800x774px) Image search: [Google]
Screenshot_20170421_130337.png
32KB, 800x774px
>>59997919
I did it anon!!
>>
File: 1484620387411.png (618KB, 738x845px) Image search: [Google]
1484620387411.png
618KB, 738x845px
>>59998050
How? And what's your font?
>>
>>59998074
just added this package, and it works with no config

https://bitbucket.org/mortiferus/latex-pretty-symbols.el/raw/ef4ea64c09ea182f38ecb88dfb31d58ed5e6063e/latex-pretty-symbols.el

downloaded that into folder latex-pretty-symbols and added following into~/.emacs
(add-to-list 'load-path "~/.emacs.d/latex-pretty-symbols")
(require 'latex-pretty-symbols)
>>
>>59994465
wrf I love anime now
but it was a mistake...
>>
>>59997676
>std::string
>std::array
>std::vector
>range based for loops
>auto
>templates
>OO libraries, even though I absolutely hate writing anything object oriented in C++
>>
Which GUI library to use for cross platform(pc, mobile) appliactions?
>Javafx
>+
decent tooling
>-
Kind of slow
Doesn't provide native API for gps for example.

>kivy
>+
Good API for native hardware.
>-
Hard to debug and also if you don't use the kv language you are going to have bad time because just changing the color of button in raw python is borderline impossible.

>qt
>+
supports many platforms
>-
(lisence?)

>SDL with nuklear(or some other opengl based gui library)
>+
I assume small binary size
Can use any language that compiles to C
>-
You propably need to implement your own library if you want to access GPS or such, unless there already exists library for that.

Hello World in Kivy and javafx on android is about same size. No experience with QT but I assume it's smaller.
>>
File: 1490504339473.png (304KB, 722x768px) Image search: [Google]
1490504339473.png
304KB, 722x768px
>>59998088
Got it set up too. Thanks.
What's your emacs font? Is it the default KDE one?
>>
>any scripting language either shit or dead
>>
>>59998360
its default one, noto sans, but you might have rendering problems since most fonts should look ok, look into infinality
>>
File: 4.png (332KB, 872x1241px) Image search: [Google]
4.png
332KB, 872x1241px
Can someone for the love of god explain to me how to do (c)?

At the point of (c) E and F (the descendant sequences) should have a uniform distribution of A/T/C/G right? I have that but how the fuck is the proportion of G's in E and F when they are both lined up to G 0.66? Makes no fucking sense

I know this isnt supposed to be a homewerk thread but this question is making me angry because it feels like its just written like shit
>>
>>59998239
Something built from Electron, or an actual website.

C#/Java/C++/Python literally does not have an acceptable solution for this.
>>
What subjects should I know before I even start learning how to program? Any recommended books?
>>
>>59998738
Oh yeah, Im willing to offer a little paypal tip to anyone who can explain this to me if youre reading this and cant be fucked but understand it, secure trip your name if you do explain it
>>
>>59998779
You only really _need_ high-school level maths. Only if you're going to go into specialised areas of programming later would you need to pick up something else.
Discrete mathematics is good to know, though.
>>
>>59998779
Dont need to know jack shit but for university courses you'll need to know lots of retarded shit that you'll never use go figure
>>
Rate my fizzbuzz
word = {"Fizz", "Buzz", "FizzBuzz"}

for i = 1, 100 do
print(word[(i % 3 == 0 and 1 or 0) + (i % 5 == 0 and 2 or 0)] or i)
end
>>
>>59998837
Is that Lua?
>>
>>59998779
Algebra, maybe some shoddy understanding of calculus, discrete math and some set theory is nice. But more important is to understand the context you're working in.

If you're working in Python you shouldn't aim to understand what happens at a low level. you should try to understand the semantics of the language and the program you're writing. If you're writing in C it's a different story because you're not aiming to do the same thing as you would in python, you're using a high level language to produce machine instructions conveniently, you care about how things are stored there.
It's helpful because it lets you frame your knowledge well. Makes things easier to remember and keeps you from getting distracted by irrelevant details.
>>
>>59998865
looks like it
>>
>>59998865
Yes
>>
>>59997676
Function overloading. automatic struct typedef. In prototyping code I use some of the standard datastructures.
For profiling blocks I construct a timer block which logs the time the block took in the destructor (done via globals).
I use extern "C".
>>
How do I muster myself to do something with development?
I can't really motivate myself enough to type any "code" at all.
>>
>>59999223
Get a job.

If you can't motivate yourself to actually create some sort of application that does something fun, interesting, or useful, programming is not for you and you need to try another profession.
>>
>>59999304
>Get a job.
Well I am educating myself in CE/CS
>If you can't motivate yourself to actually create some sort of application that does something fun, interesting, or useful, programming is not for you and you need to try another profession.

Thing is I used to do it daily before, code and learn new stuff, improve on what I used to know. But recently, 2 years ago. I lost the interest, I just don't know what to do, start or think.Sure it's enjoyable to read books and read what other people done when coded and what not. But for my own good, I can't muster up the feeling to go through such.

Anyway, bad post of me, just wanted a quick hint from here before I go back reading.
>>
>>59999091
>Function overloading
>I use extern "C".
Dumbass.
>>
>>59999418
I don't combine them obviously.
>>
How do I into modern opengl for efficient 2d graphics?
>>
>>59999578
https://learnopengl.com/
>>
>>59995501
not him but he couldve copy pasted everything he needed in the time from stackoverflow posts
>>
>>59994824
run the color thief in the event of image DOM changing

https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
>>
File: anal beads.png (30KB, 1005x225px) Image search: [Google]
anal beads.png
30KB, 1005x225px
>not being ready for the GET
>>
>>59998239
React-native + electron, seriously.

Sad days we live in.
>>
C# is so fucking comfy.
>>
>>59999992
missed
>>59999999
>>
File: ebin.png (68KB, 420x420px) Image search: [Google]
ebin.png
68KB, 420x420px
>>59999812
>>
>>59995341
Are you serious?
Do people actually do this?
>>
>>59999653
>https://learnopengl.com/
2d games is one of the latest topics. All of the previous topics will likely require CG related math knowledge that I don't have.
>>
>>60000252
>CG related math knowledge that I don't have
Well? Do you need a written invitation? Get to learning what you need to know in order to make what you want to make, Anon!
>>
>>60000252
>All of the previous topics will likely require CG related math knowledge that I don't have.
It's trivial stuff that they cover completely. You don't even need to know what a vector is.

And how is that even relevant. You can't possibly expect someone to make you able to do efficient rendering without teaching you anything.
>>
>>59995169
http://semver.org

OpenSSL do it like 1.0.1g with a letter for whatfuck reason
>>
>>59999812
Why not use newestPost directly instead of adding it to another object? Losing precious milliseconds there if you want to your lousy get

>>60000250
It is the easiest way to tell which commit is that release at. No need to use the whole hash, 6 or 8 first characters will do. You can add a tag with year.month for humans to read.
>>
>>60000000
>>
File: anal beads.png (17KB, 841x195px) Image search: [Google]
anal beads.png
17KB, 841x195px
>>60000359
Mostly because the code I wrote was just ripped from a larger method that did other things in that anonymous object, and I couldn't be fucked to rewrite it to actually make sense.
>>
>>60000359
>It is the easiest way to tell which commit is that release at.
life goal. Use the source Luke, people who want something higher-level are just cucks.
>>
>“What if you could type directly from your brain?” asked Regina Dugan, who runs Facebook’s secretive hardware division Building 8, during a keynote address at the company’s F8 developer conference Wednesday. Facebook job postings show the company is looking to hire engineers to work on “brain-computer interface” technology.
well? is /dpt/ getting chip'd?https://www.wsj.com/articles/elon-musk-lays-out-plans-to-meld-brains-and-computers-1492738741
>>
>>60000467
That sounds like a horrifyingly awful idea
>>
>>60000467
I'm already chipped though.
>>
>>60000467
keep your gay shit out of my brain.
>>
>strong metaprogramming, running arbitrary code in the same language, before lexing, after lexing, before parsing, and after semantic analysis
>no garbage collection
>very low level but high level constructs are supported by metaprogramming
>good AOT optimizing compiler for deployment
>fast (think luajit) jit for development
>lisp like syntax for effortless tooling and ide support
>good C FFI, FFI for any other language via metaprogramming

why doesn't this exist
>>
>>60000535
Because that sounds like a clusterfuck that no one would want to use.
>>
>>60000535
Guile
>>
File: kid-programming-a-robot.png (155KB, 478x439px) Image search: [Google]
kid-programming-a-robot.png
155KB, 478x439px
>>60000586
forgot pic
>>
File: 1491702730960.png (603KB, 630x630px) Image search: [Google]
1491702730960.png
603KB, 630x630px
Just implemented a stop-and-copy garbage collector for a toy LISP. Execution speed quadrupled.

>yfw you realise just how much fragmentation from manual management hurts performance
>>
>>60000586
I don't use GNU garbage though.
>>
>>60000586
SBCL.
>>
>>60000628
Soon.
>>
>>60000604
>Execution speed quadrupled.
Unclear. On all your benchmarks? Do you have a wide variety of such?

Other than that I have no difficulty believing that, now that storage is cheap enough, ppl are increasingly turning away from mutability because it has these kinds of drawbacks. You can't do a stop-and-copy GC if you're hella memory-constrained, which is fine because no one sensible is.
>>
>>60000566
Your mom.
>>
>>59998826
>>59998836
>>59998868
Thanks anons.
>>
>>60000661
No, thoroughly half-assed benchmarks.

To be fair, this is to be expected in a language like a functionally-inclined LISP, where huge amounts* of garbage values are generated during evaluation, with only few remaining active.

The first draft just hijacked the Boehm GC, second was mark-sweep, and now we're on Skwigelf (which has the discussed bonus of free compaction). I'm essentially running down the standard approaches to GC: next up will be Cheney on the MTA, and at some point I'll have a crack at concurrent. I'm pretty sure I can hack mark-sweep to run 'almost concurrently' by keeping two lists of allocated objects and purging inappropriate marks after collection.

*Not quite 1GB/s
>>
Sorry guys, just curious.

>>60000000
>>
>>60000756
Very interesting. I assume the skwigelf doubles the memory usage tho? Or am I being dumb?
>>
In python, say I've got two lists/arrays like:

[1,2,3,4,5]
[10,20,30,40,50]

How can I export them to a .csv file formatted like this?

X,Y

1,10
2,20
3,30
4,40
5,50
>>
File: pnl9j.jpg (52KB, 889x500px) Image search: [Google]
pnl9j.jpg
52KB, 889x500px
>>60000782
In it's pure form, yes, but it's not really 'wasted' if you're taking a quasi-generational approach (where you want more than one 'block' anyway), such as the JVM or Cheney [on the MTA].

Here are some interesting links:
https://www.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.win.70.doc/diag/understanding/mm_gc_generational.html
https://en.wikipedia.org/wiki/Cheney%27s_algorithm
http://home.pipeline.com/~hbaker1/CheneyMTA.html

In my Googling, I have just now discovered (in horror) that someone else has already implemented what my speculative end goal is (i.e., concurrent Cheney on the MTA):
http://justinethier.github.io/cyclone/index

Skwigelf now doubly relevant.
>>
>>60000850
>In python
Stopped reading right there.
>>
>>60000850
>How can I achieve a babby-tier shit that should take any absolute beginner 1 hour at most.
Fucking read any language tutorial, it'll teach that almost rightaway. Maybe you need file I/O but that's fucking trivial, it's like your not even trying. Do you understand the concept of "interesting post" ?
>>
>>60000873
>Skwigelf now doubly relevant.
fitting expression
>>
>ludumdare starts today
>google code jam starts tomorrow
FUG
>>
>>60000535
>muh metaprogramming
>>
>>60000951
Most metaprogramming is just about language limitations.
>>
>>60000983
It always is. If a language has "good" metaprogramming it can be otherwise shitty and it doesn't matter because you can just implement every language feature yourself!
>>
>>60000850
import csv

You can steal code from here: https://pymotw.com/2/csv/
>>
>>60001021
what? that's not what i was saying at all

99% of times a language advertises "metaprogramming" it's because the language is stunted in many ways

you don't need metaprogramming to implement features, you just need a good programming language
>>
>>60001075
We agree.
>>
>>60001081
no, we don't
>>
>>60001081
>>60001095
/g/ - Technology
>>
>>60000998
have you considered automating this?
if you did, share code
>>
>>60001075
M8, implementing a language is metaprogramming by definition. If you want a feature, someone has to do it, be it the language author or someone else with a stupid macro or ast transformer or bytecode transformer or whatnot. No language can be perfect, hence post-hoc metaprogramming is needed.
>>
>>60001125
>implementing a language is metaprogramming by definition.
That's not true.
>>
>>60001125
Metaprogamming is writing a program that writes a program, not writing a language in another language.
>>
>>60001168
>Metaprogramming is a programming technique in which computer programs have the ability to treat programs as their data. It means that a program can be designed to read, generate, analyse or transform other programs, and even modify itself while running.
(Wikipédia)

You give the compiler a program as its input data and it outputs another program in another language based on it. This is metaprogramming. not embedded metaprogramming, but metaprogramming nonetheless, and things that are done by compilers can also be done by ad-hoc metaprograms and vice versa.
>>
Metaprogramming is working in the syntax world whereas regular programming is working in the semantic world. With homoiconic languages, these two worlds are the same.
>>
>>60001230
>(Wikipédia)
>>
>>60001208
>writing a language
programming language are used to write programs, not languages. your statement is syntactically invalid.
>>
>>60001244
jokes on you I did it on purpose
>>
>>60001230
Writing a compiler is not metaprogramming.
Spending 3 days fucking around with templates that take an hour to compile in order to fit some simple system into C++ because C++ has such an awful fucking type system, is metaprogramming
>>
>>60001272
Spending 3 days fucking around with registers and calling conventions in order to fit some simple C++ semantic into x86 assembly because assembly has almost no fucking type system, is metaprogramming
>>
I'm at a crossroads /g/

I've been working on my portfolio for a while now and I'm looking to drop my part time job thats keeping me afloat in favor of going for an actual job or university?
What do you think?
Would it be better for me to just dive straight into work and then do my degree over the course of like 5 years in two or so years or should I dive straight into Uni? Is it really worth it?
>>
>>60001299
You can't metaprogram x86.
That's just programming.
>>

section .text


global _start


_start:



mov edx,len
mov ecx,msg
mov ebx,1
mov eax,4
int 0x80



mov ebx,0
mov eax,1
int 0x80

section .data

msg db "Hello, world!",0xa
len equ $ - msg
>>
>>60001307
Actually, assembly is one of the fastest routes to metaprogramming, since a program can trivially modify itself.
>>
>>60001346
That isn't metaprogramming
>>
>>60001357
You can write a program in assembly that writes bytes to memory and then executes them.

Writing programs that write programs is metaprogramming.
>>
>arguing over definitions again
>>
File: unnamed.png (34KB, 300x300px) Image search: [Google]
unnamed.png
34KB, 300x300px
>>60001346
>>60001357
>>60001373
>mfw
>>
>>60001387
That is also metaprogramming.
>>
>>60001373
That isn't metaprogramming.
You aren't working against the language, or modifying the language, you're just doing regular x86 programming.
>>
>>60001392
Yes, but it just seems strange to me as a lisper to hear it talked about in another context, people hardly ever metaprogram in assembly, sure you can, but it's rarely done
>>
>>60001397
>regular x86 programming.
>dynamically self-modifying code
You don't program a lot, do you?
>>
>>60001397
Metaprogramming isn't 'working against the language', and it isn't necessarily modifying the language: it's writing programs that write programs.

I'm pretty sure someone has already posted the Wikipedia link.

>>60001420
Yup.
>>
>>60001397
>regular x86 programming.
see >>60001420
>>
>>60001425
>>60001433

You aren't listening.
You are working within the language.
That what you do "produces a program" therefore means it is metaprogramming is completely nonsensical.

Consider this:

func fun(int x) {
print(x);
}


When you call fun(3), you are creating a new program, a program with a unique set of instructions.
When you call fun(4) you are creating a different program.


Is this metaprogramming?
Obviously fucking not
>>
>>60001438
Actually, lisp guy here, I agree with him

What you're talking about is normal x86 programming, not metaprogramming, programming produces a program, metaprogramming is producing a program that produces a program

A C compiler does not alter the operations of C code, it translates it into machine code for execution, an assembly instruction which calls other assembly instructions is not a metaprogram, you'd have to write a program that wrote another, separate program
>>
>>60001450
>When you call fun(3), you are creating a new program, a program with a unique set of instructions.
>When you call fun(4) you are creating a different program.
No we're not dummass, it's just a fucking parameter.

If put fun(3) into a file and compiling it is metalinguistic, but not programming since it's done manually.

Metaprogramming doesn't have to be something very special you know?
>>
>>60001473
>a program that produces a program
>A C compiler does not alter the operations of C code,
alter or produce? make up your mind, because afaik my compiler, when run, does produce a program.
>>
File: 1471527619297.jpg (27KB, 633x758px) Image search: [Google]
1471527619297.jpg
27KB, 633x758px
>alright class your final assignment for the semester will be a group assignment to build a cms
>hey guys it looks like "muhammed" doesn't have a group so i'm putting him in your group
fuck me. whats worse, pajeet or arab foreign exchange students? At least pajeets can usually produce a result (no matter how much poo is in it) but the god damn middle easterners are literally useless.
>>
>>60001485
>No we're not dummass, it's just a fucking parameter.

func fun<T>(T x) {
print x
}


fun(3)
fun("hello")

In some (shit) languages, this creates two seperate functions
In good languages, this (generic) function is just a regular value.
In many good compilers, it may well generate two different definitions (in either case) and inline them.

In some languages you don't have parameters.
x86 does not have C style functions or ML style functions.

Either way, the point is it is very much a program, and one is a different program to another. You might call it a sub program.

Only by thinking from your limited point of view can you have this opinion of metaprogramming. You are taking your idea of a language (probably C style) and thinking every other language must work the same way, that procedures are not themselves programs.

The point of metaprogramming is you are programming the language.
Not programming A language, but programming the language you are working with.
This does become a bit shady and connotative in usage though
>>
>>60001517
Muhammed here, Pajeets are worse.

also
>group assignments

What are you, in high school?
>>
>>60001548
>In some (shit) languages, this creates two seperate functions
>In good languages, this (generic) function is just a regular value.
>efficient = shit, inefficient = good
Hahahah okay man.
>>
>>60001450
>different program
technically correct but sub-program or subroutine would have been more apt
>>60001485
>metalinguistic
If a word has enough syllables, you can use it to mean whatever you want it to mean, it's like a wildcard for winning arguements
>If put fun(3) into a file and compiling it is metalinguistic but not programming since it's done manually

Putting code in a file and compiling it is programming dipshit

>>60001511
Your compiler is not producing shit, it's taking instructions written in C and translating them into machine language

You could technically argue
>Well isn't the machine language a program
But the Compiler hasn't produced anything different from the instructions it was explicitly given, passed to a machine in a slightly different way, it has made no changes to operation or function

in english coffee is 'coffee'

in esperanto coffee is 'kafo'

They mean the same thing, I haven't replaced coffee with trampoline, neither does your compiler, it is a translation, not an alteration of function
>>
>>60001517
Serves you right for signing up to courses with group assignments.
>>
>>60001548
I'm not the guy with the narrowest definition of metaprogramming, I'm the one arguing a C compiler is metaprogramming. Question for you: if I write my C compiler in C, it is metaprogramming, but not if I write it in anything else. What sense does such a constraint ("must be in the same language") make?
>>
>>60001485
>>60001548

Otherwise you could say

int main(int,char**) {
return 0;
}


and
int main(int,char**){
return 1;
}


are the same program, but with different parameters.
when you say "ah but that isn't a function" you are tying it down to a specific C language feature

your definition of metaprogramming would extend to a vast majority of regular programming. in fact almost everything considered regular programming today would be, by your definition, considered metaprogramming a few decades ago

>>60001565
One can be specialised, the other MUST be specialised.
Compare template bullshit and the constexpr functions that replaced them.
>>
>>60001586
Writing a program that wrote a C compiler is metaprogramming

Writing a C compiler is not

Running a C compiler is not

Being a pedantic dickhead is not

These have been facts
>>
>>60001586
That's not what I mean, you've misunderstood me.
I said that programming a compiler is not metaprogramming.
When you're programming the language itself you are metaprogramming, i.e. macros.
>>
>>60001591
Now you have the problem of coupling specialization to inlining.
>>
File: Emacs-screenshot.png (25KB, 672x614px) Image search: [Google]
Emacs-screenshot.png
25KB, 672x614px
>>60001616
>macros

triggered
>>
>>60001591
>>60001633
Also consider that you can "specialize" to a dynamic type with existentials so really you can get from either to the other, but specialization by default doesn't require inlining.
>>
>>60001633
When you see someone write

int fun(int);

Do you complain that it isn't exclusively inlined at compile time?
>>
>>60001606
>stating shit without evidence like I'm God or something

is that how you generally argue? if so, you're shit.
>>
>>60001616
Ok if you want, so back to the original argument: is it better to have a batteries included lang that has every language feature the author could think of, or a small core language with loads of metaprograms in the standard library? The second has the advantage that almost nothing is "magic", and has some built-in property you can't replicate yourself, which I like.
>>
>>60001640
>.cs
>emacs
What the fuck are you doing.
>>
>>60001728
You're wrong, it's better to have a good programming language (like a Lisp or ML derivative) that doesn't need to resort to metaprogramming, because of how flexible its semantics are.
>>
>>60001679
You're a random fuccboi on an anonymous internet forum, in a flamewar on the subject of metaprogramming with a bunch of other random fuccbois

For all you fucking know I'm Richard Torvalds, the gentoo penguin who founded facebook

or, the far more likely option just some random cunt who's telling you you're wrong, and because you don't know enough about the topic at hand to come up with a decent counter-arguement you're asking for citations

Can you tripfag already so I can filter you?
>>
>>60001742
Not my screenshot, I just google imaged emacs for the macros joke
>>
>>60001763
>lisp
>doesn't need to resort to metaprogramming

BITCH DON'T TELL ME WHAT TO DO
>>
>>60001763
Re-programming lisp in lisp is literally meta-programming though.
>>
>>60001812
Lisp programming isn't metaprogramming
>>
>>60001849
No it isn't.
You have a very simple syntax, with a few core operations, and the language behaves exactly as specified.
You aren't creating new language features, you're just creating values and variables; a library.
That is lisp PROGRAMMING, not metaprogramming.
>>
>>60001855
Not necessarily no, but it's used as such quite frequently, and I was attempting to mock the use of such techniques with a reference to DBZ Abridged

>You mean I don't HAVE to metaprogram in lisp?

>Yes, you can actually write quite concise programs without resorting to metalinguistic structure

>.... Well where's the fun in that?
>>
>>60001894
Who are you quoting?
>>
>>60001927
is this just another repost or is it an elaborate lisp joke?
>>
File: 200_s.gif (40KB, 280x200px) Image search: [Google]
200_s.gif
40KB, 280x200px
>>60001927
There, I'm not, just figured the text should be green
>>
>>60001969
let's all love lain
>>
>>60001874
Wrong.

http://stackoverflow.com/questions/514644/what-exactly-is-metaprogramming
>>
File: help.jpg (25KB, 249x249px) Image search: [Google]
help.jpg
25KB, 249x249px
>shodan.me is down
>>
>>60001993
I don't care what stack overflow thinks
>>
I got a question.
Why do C tards delude themselves into thinking they know what they are talking about even though they are not familiar with it?
>>
>>60001996
libgen.io fgt
>>
File: orkz__by_fonteart-d5y7wqz.jpg (422KB, 800x1000px) Image search: [Google]
orkz__by_fonteart-d5y7wqz.jpg
422KB, 800x1000px
>>60001996
wuzzat?
>>
>>60002018
library with a bunch of programming books
was planning on abusing my uni's 200 page printing policy to print out the entire c programming textbook but the site's down
>>
>>60001958
It is both at the same time actually.

>>60001969
Then please use some other notation, I propose the following:

Green ↓
sentence1
sentence2
_


'_' marks the end of green text so that you can write multiple lines easily.
>>
>>60002010
I got a question.
Why has /dpt/ associated knowledge of C with being narrow minded and opinionated about programming, there's nothing inherently wrong with C, it's just a tool like anything else

It's almost like because it's popular a certain subset of users love to bash on it because it makes them feel superior
>>
>>60002007
http://link.springer.com/chapter/10.1007%2F978-3-642-17511-4_5

>Many programming languages, going back at least as far as Lisp, have explicit
meta-programming features.

There's a bunch more examples of how you are wrong on google scholar if that's more your cup of tea.
>>
>>60002035
>
Testing
Neat!
_
I'll be sure to use this in the future

This is the kind of thing we need in /dpt/, people being helpful and sharing knowledge with one another, rather than pointless flaming about programming terms
>>
File: 1473727760877.jpg (13KB, 236x306px) Image search: [Google]
1473727760877.jpg
13KB, 236x306px
>>60002049
>It's almost like because it's popular a certain subset of users love to bash on it because it makes them feel superior

wait why are you here? isn't this why we're all here?
>>
>>60002010
Found the hasklel memer.
>>
>>60002077
Kek
>>
>>60002085
>memer
This post sounds like it's straight from /v/ or some other shithole. Please refrain from posting here.
>>
>>60002049
Because C users really are nrrow minded and opinionated. Otherwise they'd start using C++ a long time ago.
Also
>It's almost like because it's popular a certain subset of users love to bash on it because it makes them feel superior
Yeah that totally explains why you hate Java, it's more popular than C
>>
>>60002085
No that was a legit question.
WHY would you think you know what X is while your language doesn't support X? You never used it and you would not know about it. Plain and simple/
>>
@60002119
>Otherwise they'd start using C++ a long time ago
I don't think it was intentional, but you just made them look a lot smarter than you (which they probably are).
>>
>>60000535
Except for lisp syntax (although you can of course hook the parser via recognizers and essentially use any syntax you want) you perfectly described Forth.
>>
>>60002119
I've worked with Java. No further explanation needed.
>>
>>60002078
I'm here because I like discussing programming, even though I'm not that experienced at it

Why bother standing off with other posters about their habits or preferences, it's not like it determines anything long term, let's focus on assisting each other in learning more about this under-appreciated art/science/profession

>>60002085
I actually don't know any haskell, I know it's something else /g/ hates on because there were a lot of functional programmers here a while back, never really understood it beyond users being convinced their way of doing things was the right way, and should be the only way

>>60002119
I don't care much for Java because of how the JVM operates, and how poorly optimized code tends to be, I understand portability and expressiveness get put on a pedestal, and I can see the arguement there, but it seems like you're sacrificing a bit too much in the realm of performance once you scale up to larger applications

Also people who stay on C have their reasons, look at Linus Torvalds, sure he's a highly oppinionated foul-mouthed finn, but he's also way smarter than me, I don't know that he's right, just that he's reached his own conclusions, for his own reasons
>>
>>60002136
Are you both physically and mentally weak?
Do you look other ways when people talk to you?
Are you scared of people or any confrontation?
Are you still living with your parents?
>>
File: 1456516427257.jpg (90KB, 493x600px) Image search: [Google]
1456516427257.jpg
90KB, 493x600px
>>59994465
Dependently typed Lisp with manual memory management.
>>
>>60002182
You know, most of those actually apply to the majority of the board's population, so it's not very fair to direct questions like that at a singular user, statistically, you're going to be correct
>>
>>60002182
I don't understand what you mean.
>>
>>60002172
I was makin' a joke m8. I'm here for why you're here too.
>>
>>60002224
Case on point.

Fucking weakling.
>>
>>60002242
He's a fucking idiot and this is the best he could hope to achieve.
>>
>>60002201
>lisp with manual memory management
I'm really curious as to why

Like, isn't that a lot of pain for not much gain? What purpose would the memory management fulfill that automatic couldn't?

>>60002226
I can't really tell, these threads have just been so toxic lately, we need to get back to more friendly-posting
less like this guy
>>60002242
Is there something wrong in your life that makes you feel the need to lash out online?

We're here for you man, we get it
>>
What the fuck is up with all this metaprogramming BS?
>>
>>60002224
I can picture you looking the other way like the lowest weak beta faggot and saying "I don't understand what you mean."

Grow some balls or get rid of them. You pathetic lowlife.
>>
>>60002269
>Is there something wrong in your life that makes you feel the need to lash out online?
Honestly, yes... I wouldn't mind tumbling down to the bottom of humanity with someone like that. That's how I feel right now.
>>
>>60002303
How often do you masturbate?
>>
>>60002301
t. brainlet
>>
>>60002269
>I'm really curious as to why
Garbage collection makes me sick. It's an irrational reaction which I don't quite understand myself yet.
>>
>>60002035
>it is both at the same time
this is making a nonsense of words

>>60002068
I don't doubt a lot of people use the word that way, but using it that way is pointless
>>
>>60002356
Sounds like the feeling on not being in full control of your system.
>>
New thread >>60002401

New thread >>60002401
>>
>>60002269
don't let people like that get you down, Just realize that is some jagaloon on the internet and they have no say or weight in the going-on's of your life.

I joke around a lot but I'm here because I love this stuff :-p.

Right now I'm writing a decentralized Service Discovery Layer for AWS Lambda and ECS (AWS Docker implementation)--for work.

for fun--my coworker and I are writing an API for the Mars Viking data. I'm going to write the endpoints as docker containers running Common Lisp so that the language is like that used on the original program :)
>>
>>60002411
Possibly. But it doesn't extend to everything since I'm using a Turing complete type system which I can't fully control.
>>
>>60002450
That's the weird thing. At some level you just stop and feel like this is the level i'm comfortable on. Everything below is black magic, but i don't care.
I suppose where any individual draws that line is rather irrational.
>>
I've been making plugins for awhile for a program that uses C# as the supported scripting/plugin language, and I'm looking for the answer to a question I've had for awhile now.

In C#, is there really no way to manipulate(store, alter, or assign) class instance member variables without using their actual identifiers? Assume you're working with code/classes/structures in someone else's running application and redesigning the classes isn't an option.

For example, in C++, C, etc. you can do this kind of thing indirectly with pointers and references. In Python, you can make use of functions like getattr, setattr, and dir.

Does C# simply not offer this level of abstraction? If for some reason I'm forced to work with someone else's named member variable laden code where even simple things like position vectors can't be treated as a numbered array, do I have no choice but to write the specific class instance and member variable names(i.e. Book.Author) every time I want to do something significant to actual instances of data structures?

Related, a simpler question: is there no way to store references in an array/list/any container in C#?
Thread posts: 357
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.