/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: image_266317d7-631e-4199-bccb-484170f25f7720180523_023117.jpg (1000x1000, 238K)

Other urls found in this thread:

autoitscript.com/site/autoit/downloads/
youtube.com/results?search_query=c# autoitx
twitter.com/elonmusk/status/999374720368689153
twitter.com/elonmusk/status/999368393420488704
yandex.com/search/?text=cross product&lr=105001
better-dpt-roll.github.io/
jsfiddle.net/XwN2L/
twitter.com/SFWRedditImages

>he says "eff stab", not "eff ess tab"

That one shitty OP pic, pajeet.

fuck you atheist fuck

If you're writing anything moderately complex in C and leave datastructures and algorithms to a library as 'high level' parts you don't care about you're not really writing low level code in a sane way anymore.
If you're writing low level code you care about how your data is handled. There's plenty of datastructures you can use appropriately but you probably want rather intimate control of them.

I haven't followed the discussion, but in general it's a bad idea to reinvent the wheel. For example, if you need a RB-tree in your Linux kernel module, you should use the kernel implementation and just call those functions, rather than trying to implement your own.

Not only does this reduce the number of bugs, but it is a lot easier for anyone trying to maintain your code to read it and understand what it is when you use a well-known API.

>f you're writing anything moderately complex in C and leave datastructures and algorithms to a library as 'high level' parts you don't care about you're not really writing low level code in a sane way anymore.
I disagree with this. After pulling in a bunch of helpful libraries, your code will still be faster than python or similar language. And as a bonus, if you want to get more low-level, you can identify bottlenecks and manage it yourself better at those points.

If you're programming in C you should be doing your own data structures by hand because you WANT to, not because you have to. If doing data structures is not your idea of a fun afternoon, C++ might be more your speed.

>And as a bonus, if you want to get more low-level, you can identify bottlenecks and manage it yourself better at those points.
Additionally, if you really wanted, you can fine tune your compiler optimizations more than just setting -O

cool opinion bro, but what if you like the simplicity of C but aren't interested in writing a data structure you've written a million times before?

I wish I could learn programming without the lack of a CS degree hanging over my head and demotivating me.

Attached: 1471735508407.jpg (1296x1300, 514K)

I'm currently doing a PhD in CS, but I say this in all honesty, don't let a piece of paper demotivate you, user. Anyone can learn how to program, and anyone can become a good programmer if they find it interesting and are willing to make the effort to go into the details.

>and anyone can become a good programmer if they find it interesting
this is what I am trying to keep in mind. I love all of this stuff so far, even the 'boring' parts and I can happily sit and study for 4-5 hours per day.

But then I come on here or [spoiler]reddit[/spoiler] and people always say that realistically you're competing against people with degrees and I won't make it past HR.

While the big companies might use HR to screen, plenty of companies will talk to candidates that are interesting as long as they have skills to show for it.

The CTO of the first company I worked for was self taught, and had written much of the code base we still maintained 15 years later. A degree is just a piece of paper, honestly. When companies approach me on LinkedIn, they don't care that I'm currently doing a PhD, they only care about specific repos I have on GitHub or code that I've contributed to other projects that they've seen.

It seems that your portfolio is much more important than your education. I guess my fear is that employers eyes won't even reach my portfolio because I don't have the degree. However, I don't care too much about working at one of the big companies as long as I can find work.

How often do you get approached?

Just stalk the big shots of a company u wanna work in and go in their fav bar.
Buy em a drink and if you're interesting they'll hire you.
Mad Men style.

I've watched enough mad men that I could probably pull this off as well

Attached: 1513009917789.png (500x482, 269K)

>How often do you get approached?
There are two kinds of people approaching me: There's those recruiters who are just searching for certain keywords in your experience/education/skills section, and work their way through your network by adding a first degree connection and then asking all their connections, and adding some of those etc. These people contact me probably between two times a week and once every other week.

Then there are those that have come across my code on github and contact me regarding a specific repo or something like that. That's a lot rarer, probably once every 5-6 months. The upside is that these people usually are CTOs or tech managers and actually understand what they're looking at.

>Then there are those that have come across my code on github and contact me regarding a specific repo or something like that. That's a lot rarer, probably once every 5-6 months. The upside is that these people usually are CTOs or tech managers and actually understand what they're looking at.

This must feel pretty good, right? Like you said, when someone understands what you're doing and are still impressed that's gotta be good. Are you waiting to finish out your PhD before you take anything?

Which language to use to make a basic MIDI editor?

python, C# or Java?

cannot post what working on due to limits in characters even when using code tags, stupid if you ask me...

C# just because its adapt to almost anything you want.

>This must feel pretty good, right?
Indeed it does. it's the same the first time people start reporting issues on your github repo, because it means that someone out there is actually trying to use something you created.

>Are you waiting to finish out your PhD before you take anything?
In the beginning I didn't really care. I already have a masters, so my educational goals were already met, I just wanted to do something more exiting than the company I worked for before, and the PhD thing was a nice justification to leave despite meaning a drastic pay cut. But now I get to work with bleeding edge tech instead of rotting away fixing memory leaks for clients that doesn't care that the product we sold them barely worked and was held together with ducktape and glue.

But now I only have a couple of months remaining, and kind of want to see it through. I'm doing my PhD in collaboration with a company, so I'm guaranteed a job there, I just have to work out the details. However, just recently an American start-up contacted me regarding some library I had written, and I feel they were quite interesting so I want to talk to them.

Pastebin exists.

well it was just some stupid shit for ingame scripting in C# for space engineers, I code as just a hobby, it would have been shot down desu.

Hey girls

There is a bug in the code somewhere, basically its a script for adding ships/drones into my network through radio antenna blocks, it handles network join requests but it has to be capable of sending join requests and also processing join requests if the ship in question has the callsign "MotherShip".

The problem I have is a callsign gets added twice, more explaination how this shit actually works ingame, there is a block called a programmable block which holds the code and runs the code. This block can call it self over and over but it it can also be connected to an antenna block which serves as a means to transfer data from one ship to another ships antenna which is connected to its own programmable block. In Main() there is a string called argument which is what gets filled from radio transmissions which then triggers the programmable block to run, the argument must then be handled.

The problem I have is the callsign (other ship) making the request is doing it twice it seems and thus all its data is added twice to a List of List strings.

List callSigns = new List();
/* Contents of List
*
* CallSign
* Type
* Mission
*
*/


I then use an argument "list callsigns" as my run command for the motherships programmable block to display the contents onto an LCD block

if (arguments == "list callsigns" && callSigns != null && callSign == "MotherShip")
{
for (int i = 0; i < callSigns.Count; i++)
{
for (int j = 0; j < callSigns[i].Count; j++)
{
DisplayBuffer(callSigns[i][j].ToString() + "|", false);
}

DisplayBuffer("", true);
}

DisplayWrite();
return;
}

Dynamic scoping is pretty comfy desu

Attached: daily programming club.jpg (1280x720, 166K)

I've developed a fully functional blog site with the following features:
>user system where a user has an ability to create, edit, post, delete your own blog entries
>comment system that allows replies + adding images like Jow Forums
>algorithm that sorts blog entries by rating system. (Currently disabled though and currently loading articles randomly, may re-enable the algorithm in the future)
>rating system that allows you to rate users and individual blog entries that does affect placement on listing based on overall rating
>Ability to see notifications of people commenting on your blog as well as people commenting to your comments on other blogs
>SSL
>No data mining whatsoever - my code is entirely created so I grab as little information as possible just so the site can run.
>Advertising system that is simple to add an image + anchor tag attachment so if someone wanted to sponsor me I can add them to the sql table.


1stamender.com

>basically everything in Java starts numbering at 0
>SerialBlob, part of the standard library, starts numbering at 1
I bet it was one of those Lua people who did this

Attached: 1436294402067.png (365x318, 245K)

algorithm that sorts blog entries by rating system.

Won't this create a negative feedback loop where only the top entries are ever looked at?

then put it in a header

thats where I implement date. After a certain point no matter how good the score is it will eventually fall off due to the date.

The idea is: rating + blogger rating - days old
Eventually it goes into the negative and would slowly go down the list.

How old are you m8 doing all of this?

I'm 31.

Sounds good. Site backend probably functions like a charm I'd only recommend tweaking the aesthetic to more modern times. Site looks like a project from 2009 or so no disrespect just if you're trying to to really do something with this people are gonna want that.

I am assuming you guys have seen this autoitscript.com/site/autoit/downloads/

Can be used with C# youtube.com/results?search_query=c# autoitx

how hard then do you think it would be to create a Jow Forums bot? I ask because my native board Jow Forums seems to be flooded with such bots... The capture system google uses is an utter joke, that could be easy to solve through some learning program, autoit actually has a pixel hash function to compare images but that alone would not be enough, however many of captures are predictable, they are either sidewalks, bridges, vehicals, mountains, street signs or store fronts...

Does inheritance mean using the declared variables and methods from a class and be able to use it to other class..

what language?

Fuck man people keep saying shit like that... I have people say it's really good looking and others that tell me I need to work on design. Jow Forums of all people telling me that. I think you mean you want it to feel more responsive. I kinda went to school for it and graduated with first an AS in web design and now a BA in information systems management. So really I feel like I could learn so much more like github and how to create 'responsive' sites that live update without having to hit the refresh button. I've been playing around with stuff like that but it's been a bit much for me to wrap my head around it all.

Inheriting from the super class means aside from constructors the subclass has access to everything in the superclass.

I LUA comfy language to learn?

Your background is broken when scrolling on tablet, there is white at bottom

Attached: Screenshot_20180524-153037.jpg (1024x768, 388K)

I'm just saying it could look better work on the CSS and such. Just go to other blog sites and see how they look and run. Live updating and stuff like that is completely optional.

damn annoying gradient. I'll have to figure that out.

Within golang, slice declaration requires two indices, one of which can be implicit, an inclusive low bound and an exclusive high bound. i.e
nums := int[5]{ 2, 3, 7, 5, 1}
var s int[] = int[1:4]
s == [3 7 5]

inheritance

say you have a class called Cat

it has fields such as
string eyeColor;
string gender;
double weight;

now a cat as you know is a mammal, so it could inherit from class mammal which has fields

int legs = 4;
string blood = warm;
etc

Mammals are also animals so the mammal class could inherit from the animal class

etc

>imagine being this old and still hanging around on Jow Forums
That's pretty sad

all that shit is white or like this light cream color look. I wanted it to be very easy to read with a dark look. I would need to find a blog that has a dark look to it for me to get a good idea of how it should look...

fixed.

and inheriting from another class means it would also have the properties and fields of the class is is inheriting from. In case with C# that would mean using the . access modifier on an instance of our cat class would bring up intellisense lists for things like legs so...

Cat cuntCat = new Cat();

var numLegs = cuntCat.legs;

Console.WriteLine(numLegs.ToString());

that would print the number 4 on the console.

Yepp its fixed just tested it, otherwise it works and looks fine to me. Good job

Because

Public Class Cat : Mammal
{

}

Nvm its still broken

java
yes, with except of constructors

I would have the decay factor be more than linear. You'll want things to fall down almost definitely after some period of time.

finally found the animal analogy people have mentioned in previous threads

whenever you use the keyword extends or implements in a type declaration, that's inheritance

>Then there are those that have come across my code on github
I have never experienced this

>I have never experienced this
Do you have anything interesting or novel on github?

i hope it helped it did take me some time to get my own head around it, that does not mean that you are just thick/dumb its just that many people do not understand some people have a hard time reading through paragraphs and paragraphs of seemingly useless shite to get their answer.

>still
where else is there to go

I also highly recommend top answers on stackoverflow.com but sometimes its still not enough to understand, then use youtube examples.

well I thought so but I'll take this as evidence I don't

Could just be a lack of proper exposure as well. Have you tagged it appropriately and included a README that explains what it is?

thanks user. There are a few loose ends I am aware of and I still need to tie. I learned a bit on how to build databases in the future... but there is an occurring problem that I noticed...

Basically I have 2 tables... One is for sources, and the other is for the blog entry. The issue that I have seen (doesn't happen often enough to replicate it)

I have the unique identifier to be the blog ID for both Sources and for the blogs. For blogs it makes perfect sense as you can id a blog very easily with the unique identifier.

Now here is where I fucked up. I made the unique identifier for sources to be the id of the blog as each blog will have 1 source. (Should have been designed with its own special unique identifier, then another cell for the blog id) However... if there is any error... it can cause one insert query to post while the other one does not, effectively de-synchronizing the entire system and outputting an error that an entry like this already exists. I designed it like shit and I don't know what I was smoking when I made it this way.

But I wanted to see if I could embed a hidden checker somewhere to see if these tables are misaligned in any way, and if they are to simply align it back again versus trying to recreate the entire table for sources. very annoying.

it's your cache causing that... I tested it just now it is working.

>But I wanted to see if I could embed a hidden checker somewhere to see if these tables are misaligned in any way
it's called using a database with constraints like FOREIGN KEY

nice

twitter.com/elonmusk/status/999374720368689153
get this trending topic on there twitter.com/elonmusk/status/999368393420488704

That should boost your traffic if you want that.

Any other SEO tips?

thanks for the advise

twitter trending topics are basically it bro.

But you have to think about your target audience is all.

yes that is what the blog ID is for both tables. The problem is that sometimes one will post while the other one doesn't rarely but I have seen it happen a couple times.

Lets say sources table is shaped like this:
BlogID(primary key int)
Source(varchar)


And article table shaped like this:
BlogID(primary key int)
Body


so what I do is I check what is the maxID of the blog id and apply that id to a new entry on both tables.

So lets say one gets inputted (like a source) while the source could not for some inane reason.

Tables look like this for the top entries:
Article IDS:
1356
1355
1354
1353
1352

Blog IDS:
1357
1356
1355
1354
1353
1352


So when the code executes to make a new article... it thinks: Okay new article is 1357. Now create 1357 for the source. ERROR. Can't put in source because 1357 already exists. It's just a shit piece of database that I need to do some tweaks to fix.

but your site will be buried by google so try yandex instead, I am not an SEO guru but I know that google isn't exactly Jow Forums or conservative friendly...

if you actually wanted to make lots of money then go pro feminist, pro progressive, pro commie, pro jew, pro everything you see when you walk through your city that is promoted like it is the only thing that ever mattered to mankind...

honestly you will get a lot of traffic if you blogged about being so pro equality and feminist you might even make national or international news... sick world we living in...

why dont numpy.matrix have cross product
WTF

they so dumb they would pump millions into you for a JOB WELL DONE... you won't get much traffic if you are the voice of dissidence from a Jow Forums perspective, they will simply make sure your site is never listed at the top.

So do not pay for adwords from google and co.

yandex.com/search/?text=cross product&lr=105001

learn to do it your self?

in postgres this is just
create sequence source_article_id_seq;
create table sources (
blog_id int primary key default nextval( 'source_article_id_seq' ),
source text not null
);
create table articles (
blog_id int primary key default nextval( 'source_article_id_seq' ),
body text not null
);

you are such a fucking waste, its math problem, google it or yandex it and learn how it is done, create the function and call it when you need to do cross product. WTF is wrong with you?

well, the whole point of using a library is so that i dont have to deal with these shit
oh yeah why not implement FFT myself while im at it

WELL FUCK

perhaps coding isn't your thing?

you will feel much better once you have tackled it yourself trust me you will, because that is the point of coding to solve problems. If not then download some macro it software nobhead.

I wanna do some useful/eye catching stuff that I can put on my portfolio, but I can't think of anything. Where do I find inspiration?

Attached: 1496971961302.gif (540x652, 1.7M)

like what is the point in coming here to bitch about it? You want a library that already includes that? Then you best find it or stop bitching and do it yourself, how else are you expecting to learn anything? You stupid young fags piss people like me off with your bitching...

Sorry to bight at you but you sound like a typically whiny cunt who just wants everything to work with minimal effort on your part, if you need to bitch,then bitch at the developer of said library because there isn't anything here that is ever gonna change it.

I mean come on its simple math problem that you have to solve by learning how it works and then implement in your own function.

better-dpt-roll.github.io/
I've been thinking of making something that helps me organize my hard drive. Finding user folders with lots of files and helping tag, rename, move or delete them.

How do I have all the divs hidden on page load until the user selects an option?

HTML

All
Div 1
Div 2
Div 3
Div 4


Lorum Ipsum1
Lorum Ipsum2
Lorum Ipsum3
Lorum Ipsum4


jquery
jQuery(function(){
jQuery('#showall').onload(function(){
jQuery('.targetDiv').hide();
});
jQuery('.showSingle').click(function(){
jQuery('.targetDiv').hide();
jQuery('#div'+$(this).attr('target')).show();
});
});


jsfiddle.net/XwN2L/

im just curious it doesnt have that you stupid fucking cunt. of all the things, if its so simple, why not have a cross product? sure i could implement it you fucking nigger but im just curious.
jesus christ this is Jow Forums? fuck me.

python users are tremendous crybabies, it's frustration at either having to use such a shitty language or at their growing sunk-cost and deepening bad habits

>NumPy is the fundamental package for scientific computing with Python.
numpy.matrix should have the cross product. That is really funny.

Let's say I have a loop like
for (int i; i < function(n); i++) {
//do stuff
}


would gcc optimization compute function(n) and unroll the loop?

>trust me, I'm an expert on maths and scientific computing
>if you disagree with me, you're just a crybaby

I meant for (int i = 0; i < function(n); i++) {
//do stuff
}, you get the idea

Is function defined in the same compilation unit? If yes, it might do that. If no, it most likely wont do that.

no because function(n) might be non-deterministic
>yes user, muh side-effects is not a meme

but you are a fucking crybaby, be a man for once in your life and take it upon yourself to learn how it is done so that when such a problem pops up again you can call everyone else a crybaby instead of being the crybaby.

Cross product, i might have some code somewhere for that, i will check...

I'm making a small smart watch like thing. I used an old watch's body to house the circuit. In using an ESP8266 as the brain, and an SSD1306 based OLED screen as a display. Also going to add 2 buttons. There isn't going to be a battery, I'm going to use those small 3V3 watch cells. I'm later going to write a server for my phone to transmit text and images (also going to write a software to convert them to something the screen can display)to the ESP
The real reason to why I'm making this is to cheat in exams. I live in an Asian country, and exams are all fucking memorization based. I am not too dumb, but I can't get to force myself to memorize useless facts.

Attached: IMG_20180516_220253~01.jpg (2392x3024, 1.78M)

seems I only have code for dot product, i've not done much 3d stuff.

OK I've installed visual studio 2017
What now?

Anyone writing in /sec/ related shit?

Currently learning golang and I'm writing a mitm monero miner. I want to automate my recon flow after I finish this project.

Attached: 1525367638447.jpg (960x720, 193K)

Is it better practice to write instead
int A = function(n);
for (int i; i < A; i++) {
//do stuff
}
?
Now that A is a constant number, will gcc unroll the loop?

I'm a brainlet for now but I want to obey good practice so I can improve my skills.