/dpt/ - daily programming thread

Old thread:

Attached: 1517930120413.png (1017x692, 89K)

Other urls found in this thread:

support.office.com/en-us/article/Overview-of-formulas-in-Excel-ecfdc708-9162-49e8-b993-c311f47ca173
software.intel.com/sites/landingpage/IntrinsicsGuide/#
youtube.com/watch?v=I1L8l3LrzLA
youtube.com/watch?v=N9wsjroVlu8
jscape.com/blog/load-balancing-algorithms
github.com/cockroachdb/cockroach
nginx.org/en/docs/http/load_balancing.html
twitter.com/NSFWRedditGif

reminder that C++'s noexcept is bullshit

C++ is bullshit

>working on a project
>have it outlined and ready to code
>only problem is finding the motivation to do it

Anybody else know this feel?

check out my random dungeons

Attached: dungeonexplore.webm (576x672, 2.35M)

nth for C++ is disgusting.

Usually I want to jump into the code so eagerly after I've outlined it, especially if the idea is somewhat novel. (If it's not though... yeah same)

what could you possibly mean

Attached: Screen Shot 2018-04-30 at 9.08.39 PM.png (1598x1594, 552K)

Hatred is my fuel

Come on, using gl is cheating here. That's a disgusting lib; the language itself can look far worse than that.

I've been working on an emulator for a few months and it is now mostly complete.

However, I'm thinking of refactoring the memory model. Currently, most components simply modify an array of 64K bytes, representing the memory of the system. I can avoid this direct modeling if I intercept every memory "write" and instead of modifying my memory array, modify a field on a struct or some similar abstraction.

This has the benefit of potentially being more "semantic" but requires making the code for writing data more complex. Also, seems like a less "accurate" way to do it? Would like thoughts

Hey, extension of .

I'd really appreciate any help with this.

this is solvable.
have fun on your homework

thats cool as hell. nice job

classic greedy algorithms problem
hit the books

is it possible to create an *.exe, hell even executable from UNIX using c# console application? the only thing being built are bunch of *.dll that cant be executed.

>c# dev on *nix
why though

YES!
all that
usage beyond the rest

i heard that windows are beginning to make their dev environment cross platform. im just asking i started working on a c# project and i wish i can make an exe out of it.

Do you have mono installed?

im on windows

based

You can invoke dotnet on Linux systems so you should be able to do build. No idea if Linux can run .exe yet. Main question is still

sure it's possible to code for windows on mac.
but it will be hard. there's pretty much no built-in helpers. you'll have to keep all the nuances in your head.

if on mac, install windows10 (dual boot).
you can get a legit license really cheap at kinguin.

no, i am already on win10 but whenever i build my project it only creates a dll file and the exe is the dotnet.exe itself

lemme ask you this:
does it NEED to be .exe?
or can it be UWP?

I've been working on my notification server for Wayland/Wlroots based compositors. Finally finished up classes so have more time to dedicate to it. Got a lot done so far. Just implementing layer_shell stuff now.

Hey everyone, I need some help but I don't know if this is the right place.

>family own several town cars
>each driven daily by two drivers (day and night shift)
>currently do everything by hand
>notebook for each car and driver, listing their work days, wages, fed and ss (which I have to pay for them)

I would like to have something like a spreadsheet where I can type all the info I get on each end of shift (gas receipts, earnings, daily wages, etc.) and then to be able to set a period of time in which I can see 'reports' for each car and driver and keep it as simple to use as possible (my father struggles with excel, and we split the work)

Could this be done with excel (how, please point me in the right direction)?

On the other hand I've been trying to learn programming, and I've gone through the basics of Cpp a couple of times before. What troubles me is that I have no idea on how to work with tables, gui, etc, and it might be a fun project to tackle, not to mention that I KNOW there's a huge market for this and I've heard of shitty, bug ridden DOS legacy looking piece of shit go for around 2 grand per license.

That's more business management type shit. Excel was designed for that shit.

The shitty DOS legacy shit you speak of are called "enterprise resource planning systems." It's much larger scale than just some family balance sheets.

2K is honestly a steal for such software because the main benefit is the support and the nerds who hook it up. Such software is heavily customized for each business.

also, try "evernote", "freshbooks", "and.co"

Leave me an email address and I could give you a quote for such software. I would make something web based to run in your own computer.

like google sheets

This will get you started:
support.office.com/en-us/article/Overview-of-formulas-in-Excel-ecfdc708-9162-49e8-b993-c311f47ca173

You enter data in some sections of your document and designate certain cells to be formula cells which calculate with the contents of those sections. You can make graphs and stuff too.

i kinda want it as exe, u cannot distribute UWP freely can you?

I honestly couldn't even figure out how to get Ruby started... And on code academy couldn't figure out where I left off..

At least I read the entire manual..

Attached: 1525129421891.png (302x310, 138K)

>walk into systems programming class
>"Now what would you do to get the child to kill the parent?"

just glanced at stackoverflow and youtube
there easy how-tos for exe in VS2017

>professor have thick accent
>"now, does anyone know how to furk a child?"

Yeah just use JetBrains Rider or something, or use dotnet core with the terminal emulator. I'm pretty sure you can run console applications built for the CLR with mono, just run mono *.exe from terminal

github link?

Im working on a website and I have a .php file that accepts information from a partner. All hits on the page are logged and out of nowhere someone started feeding bad information through the page using the correct POST'd variables but without the right signature. No IP has ever hit this page before besides my personal IP and my partners site (medium sized company). How can someone figure out a page URL like this? The url is like gibberish and unlisted, stuffed down several directorys. Can people scan my site somehow and see all the files?

You'll need to use dotnet core to build the thing for linux. With dotnet core installed, running this should work to target whatever platform. You can get the runtime identifier for your target platform by googling "RID dotnet core" or something, an example of one would be, ubuntu.16.04-x64

cd into project directory
dotnet build -r

soz, it was used for part of a bigger project and the function to render it like that is gone (was an android game)

>Can people scan my site somehow and see all the files?
yes

But can I create a 'database' of drivers and cars?

No, no, trust me. This was a piece of shit that would delete a months worth of work when printing. It was not in any way a legitimate product, it was more of a quick job (in programming terms) to cash in those sweet dollars and run. The guy who actually bough it could never find the guy again.

>also, try "evernote", "freshbooks", "and.co"
Not really what I'm looking for, I don't really deal with invoices.

Thanks, I'd rather learn to do something to get my by in Excel while I find out more about actually making a dedicated piece of software for it as a side project.

I do know excel basics. If I had to manage one car, with one driver, month to month, I think I could do it fairly easy. The problem is drivers switching cars or say listing every workday when JOHN SMITH worked in the last month.

For example:

Say it's the 30th and I have to pay the taxes the state demands I collect from the drivers, so I have to see how many days and how much money did John make. But john might have worked in three different cars, taken days off, or not showed up.

Or I might need to know if a driver is making decent money, so I'd have to be able to see weeks, months or years back of their daily earnings.

Or I might want to know how much money is a car actually making, so I'd have to add dailies for every driver that has worked in the car in say, the past month, and from that, subtract taxes, repairs, etc.

The only programs I found for this usually involve a word list to try to guess files/directorys. This page is like "companyname-" then a mixture of numbers, uppercase, lowercase. The directory has blank index files. Nothing links to the file or directory. This just got me really spooked because my project is financial based and this person attempted to trigger a financial payment. Ive been going through logs, logins, and I just cant seem to understand how he got the file name, then without even a test ping, started immediately trying to push through falsified data.

HACKERS are a real thing
also, inside job is possible

there are no other alternatives.

YOU set up an UNSECURE system

So far it seems like For Loops and Recursion can be both used to solve problems.
In what scenarios/problems would you be dumb to use Loops over Recursion or where it'd be impossible to do so?

see the church-turing thesis

I doubt ill get an answer but, fuck it.

Does anyone know how to "extend" an XMM register? (Basically I want to take a 32 bit chunk of an xmm register, say xmm0, and copy that over the rest of the register. )

Ill give an example:
suppose you have an XMM(128 bit) register,xmm0, with values {1,4,2,9} packed into it.

How do I take xmm0 and get {1,1,1,1} or {4,4,4,4} or {2,2,2,2} or {9,9,9,9} ?


I've been looking for hours on for an instruction that would help me do this on here:
software.intel.com/sites/landingpage/IntrinsicsGuide/#

Im fucking losing it man.

Attached: ORCED_blacked.png (500x500, 377K)

obscurity is no form of security

Reposting cuz deep down i want to learn c but if enough Jow Forums people tell me not to then i won't

Should i learn c++ or c? Currently my uni is forcing us to use Java, and Python is my most used language. I want to know a low level so Jow Forums people stop calling me mean things

For real what should i learn, in the short term for competitive programming — trying to be a CS researcher in the long term

Attached: IMG_20180305_153050.jpg (3120x4160, 3.33M)

I found it. If anyone cares its called _mm_shuffle*

Anyone trying out Perl 6? It's quite hard to go back to Python or Ruby after using what just may be the perfect language.

Attached: p6-book-flowchart.png (1361x1123, 689K)

Same here. Learning Python and wanna know if C or C++ is still useful/good to learn. (Or something else instead)

damn, it feels good to be in the flow
banging out some good code
working on a project i believe in

youtube.com/watch?v=I1L8l3LrzLA

Attached: Feels_good_man_2.jpg (418x371, 32K)

Can you even systems program with Perl?

youtube.com/watch?v=N9wsjroVlu8
classic shit! still holds up today. 2 decades later.

ok so.

int a = 10;
int totalcombo = a( a - 1 )/2;

How do i get this to work if JAVA keeps thinking 'a' is a method?

err: 'method call expected'

C is comfy.

There is a language which literally does not have for loops or while loops called Scheme. It is maximally comfy.

It's trivial to convert tail recursive code to use loops, and you can convert non tail recursive code to tail recursive code with continuation passing.

wtf i hate java now

get rid of the first a?

Holy fuck this has to be bait.

calm down neckbeard

a*(a-1)/2
compiler only reads multiplication via *

aaaaaaaaaaaah yes, thank you so much. I think the hydrocodone combined with my hate for java is making shit hazy.

here, have something that may or may not be funny.

Attached: truck bee.jpg (584x447, 46K)

user, can you recommend some good information resource on how to write servers that scale horizontally?

I'm interested in learning what it takes to go from a backend server program that can run on only one machine to one that can be distributed across many machines for redundancy or ability to handle higher load.
I know I'll most likely never be blessed to have problems of that caliber, but I'm still curious.

Attached: hqdefault.jpg (480x360, 11K)

C++'s thread is really confusing.
How to make a thread pause itself until other thread give command to resume it without implementing busy waiting?

A mutex or something?

Or you could learn Go :^)
It's real nice for concurrency.

>this is the average java hater

A semaphore.

jscape.com/blog/load-balancing-algorithms

There's not really much to write for scaling horizontally, it's straightforward until you get to the next level of scale (which means your db is the blocker), where you'll usually have read-only replicas of the db, and then going past that you'll need a real db cluster like github.com/cockroachdb/cockroach

I think most people people would agree with this once they wrap their head around it, but I find recursion easier / more intuitive to implement than a loop in most cases. That said, in most professional environments, recursion is generally looked down upon. This is because of the overhead of adding new function call to the stack each time, and in some cases it can possible to reach a maximum recursive depth.

That said, for most recursive algorithms, you can make it tail-recursive. Compilers will usually turn a tail recursive function into an equivalent loop. If you are writing in a language that doesn't do that (Python), you can still convert it to a while loop yourself in a relatively straightforward manner.

Also, a fun aside, not all recursive algorithms can be turned into a loop (or series of loops). A famous example would be the Ackermann function.

nginx.org/en/docs/http/load_balancing.html

just to add onto that, you could do it in an afternoon for fun. AWS also makes it very simple. one key thing you'll need, if you don't yet, is a way to setup the other server and keep it consistent. I'd use ansible for control/deploys as it's pretty straight-forward. Quite a few people use docker images as well. This is w/o the crazyness of managing dbs though. cheers

Thanks!

Just as a curiosity, if I have some experience with coding, would about 9 months be enough time to learn enough to make a project that would make me employable to possible employers?

Applied to a full stack swe, they sent back a timed HackerRank test so I'm brushing up on things before l start.
I can't afford fail it l can't be a neet forever!

I think quite a few code academies are shorter than that, and we've hired people from those before. Have you tried applying to a couple? I mean, definitely look into reviews since I think some are scamz, but there's some good ones out there.

>coding
you got the job

How do I write a program that finds the first consecutive pair of prime numbers?

Attached: 1522999517089.jpg (1125x1124, 82K)

for (int i = 1; ;i++) {
if (isPrime(i - 1) && isPrime(i)) {
printf("Found prime pair: %d %d", i - 1, i);
}
}

Does Visual C++ have a problem with fseek()? It's giving me sort of exe error.

I'm also a bit afraid of those institutions, primarily because they're so damn expensive, but it's good to hear with intensive guiding and work, anything's possible.
:D

thanks fren

Attached: 1524319863233.jpg (1024x536, 68K)

Does No.65750357 have some sort of problem with Googling? It's giving me sort of shitpost error.

yup, i hate it now. used to feel comfy. but its just too babying. Im going back to C after i finish this fucking cert. C wont get me a job, but at least I wont be another of the 1mill webdevs fighting to be part of some hipster, numale Agile team.

dumb frogposter

Nice, but I can't help wondering what happens if you resize the terminal.

If everything else is already working, and this is not getting in your way, don't rewrite.
If it's a pain in the ass to change or add stuff because of the memory model, rewrite. I would probably do what you said, a struct with simple methods to prevent accessing wrong places and stuff like that.

I know that program won't ever end but thanks anyway

Attached: apu_hammerbully.gif (487x560, 898K)

stupid frogposter

>Also, a fun aside, not all recursive algorithms can be turned into a loop (or series of loops). A famous example would be the Ackermann function.

Interesting, thanks

you're not gonna make it

>java
>webdev
...?

printf("The first consecutive prime numbers are 2 and 3\n");

but does it find the first fizzbuzz

i like how audible does this
my device logs in
it downloads my list of titles from a db
and displays them in neat tidy uniform tiles (scrollable)
upon tapping a tile, i'm taken to that title and other options from there

i'd like to add something similar to my app.
it would be a list of parts for certain pc builds
each tile would have small image, and brief description

trying to do this using xamarin forms.
been googling and youtubing for hours trying to find something like this. no luck.

asking here if anyone knows of a good tutorial/walkthrough.
or some keyword i haven't tried in the google machine.

Attached: sc1.jpg (540x4437, 819K)

>my hate for java

the multiplication symbol is common for 99.9% programming languages

2 is the only even prime number
if i variable was more than 2 the loop would run through all the numbers until integer overflow