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



Thread archived.
You cannot reply anymore.



File: DPG.png (389 KB, 934x1000)
389 KB
389 KB PNG
Previous Thread: >>66674533

>What are you working on, /g/?
>>
File: Selection_008.png (51 KB, 1552x856)
51 KB
51 KB PNG
>>66685117
What could a boxplot like this show me?
Every box is a feature of the dataset.
What other sort of plot could be useful for me?

Jesus what a mess of data.
>>
>>66685117
ur mom lol XD
>>
is gnuc an acceptable untyped lambda calculus?
>>
Does anyone know if there's anywhere i could possibly find a
listing of movie/release dates similar to IMDB's calendar (https:// www. imdb. com/calendar)?

I'm working on writing a script that exports those into an icalendar file regularly,
so it can be imported to say, Google Calendar and similar but i wanted to avoid having to resort
to scrapping that specific imdb page since it's agaisnt their ToS (Not that i think it would matter to them at all thought)

Even a listing containing already released movies for a given year would work, as long as it had outside of the US dates aswell,
but i've been having no luck messing with OMDB and other similar stuff, these pretty much are only usefull for fetching movie metadata.
>>
>Issue: C - array pointer linker

For some reason, I am having a SIGSEGV issue with array pointers.

I use a globally defined struct array
object_t GAME_OBJ[512];
. Functions have the parameter
object_t *obj
but that is simply
&GAME_OBJ[i]
passed onto it in some way. For now it has worked, but somewhere in my way to remove an object, my game crashes.

Within object_t is a link to the previous object_t, and a link to the next object_t. When an object is made, it'll use the freespot available in the array, and set the links. When an object is removed, it should set the previous objects next link to the current object next link, and it should set the next objects previous link to the current objects previous link; then, it should tell the program that it is the freespot.

Somewhere in the removal function it's causing a problem.
bool first = false;

if ( object == frstobj )
{
frstobj = (object_t*)obj->nxt;
first = true;
}

if ( obj == lastobj )
lastobj = (object_t*)obj->prv;
else
obj->nxt->prv = obj->prv;

if ( !first )
{
obj->prv->nxt = obj->nxt;
}

obj->prv = freespt;
freespt = obj;

But I am not sure where.

I think I may need to redo the entire struct system. I found this thing a long time ago on something called the backaward linked list (something like that) and I thought it would work.
>>
>>66685142
That depends highly on the question you want to answer. The boxplot just reduces your daily subset into a simpler form, but without knowing what this is all about, you learn nothing.

Looks like you have a bit of a spike on day 13, but the significance of that might be questionable.

What's the question you wanna answer?
>>
>>66685117
Can a language with Idris/Haskell-like type system have a quick compiler? Or they have unavoidable bad compilation time asymptotics due to the complexity of such type systems?
>>
File: 1531216572745.jpg (13 KB, 480x360)
13 KB
13 KB JPG
Does anyone here know how to add a .py module to Python in Visual Studio Community 2017 or even IDLE?

Is there a better alternative to Visual Studio? How is it better?

Thank you.
>>
File: 9d0.png (31 KB, 344x326)
31 KB
31 KB PNG
>>66685117
what is the closest language to python that is actually fast? it's slow as hell i've heard but very useful in many situations so what would be the faster version of it?
>>
>>66685117
what is the erlang programming language and what are its uses? and what is haskell with its uses?
>>
>>66685517
lua is nice
>>
>>66685517
What's the use case? For scientific programming, Julia looks like a viable option. Not quite as mature yet, but slowly getting there.

I don't know about webshit.
>>
>>66685405
There's no such thing as "actually fast" without dropping down to C.
>>
>>66685576
There is.
[spoiler]Dropping down to Pascal. C grammar sucks.[/spoiler]
>>
>>66685315
So if i understood correctly your code does this:

#1
if first then first = next (Drops first from list)
#2
if last then last = previous (drops last from list)
else next.previous = previous (drops any in the list not on the edges and count > 2 )
#3
if not first then previous.next = next (restore next link to changed object in #2)
#4
Flag previous as a free spot

the code looks correct so far, the only stuff i can point out is that you're using "object" instead of "obj" in #1, if that's the actual code, and maybe you're forgetting to unflag the removed object as no longer being the first?
>>
>>66685585
C is inherently faster than Pascal for all intensive computational purposes.
>>
>>66685594
#4 (correction)
link previous to freespot
replace object with freespot
>>
>>66685557
>>66685560
to be completely honest. i'm talking about a variety of uses from scientific programming to hacking(no meme) so a general language very similar to python but faster and my priorities are definitely learning hacking and scientific programming.
>>
>>66685405
In short, no because CPUs are designed in a procedural manner rather than functional, so every operation has to be translated to a procedural design.

>>66685517
Ruby or Perl if you want to keep simplicity, Scheme is a good and fast algorithmic language, using Racket instead might help you get around its quirks, but C++ is necessary you want to design a fast, complex system
>>
>>66685491
Anyone? How to add a .py module to IDLE?
>>
>>66685658
use unix
>>
>>66685117
Question:

Why is Go so much more popular than Dart? This seriously confuses me.
>>
>>66685661
What is unix? I only started learning programming 2 days ago.
>>
File: qfli0f7.png (40 KB, 1209x680)
40 KB
40 KB PNG
>>66685609
>>66685645
Wait-wait-wait, a "quick compiler" and a "compiler that produces quick code" are completely different things.
Pic related. (Visit https://imgur.com/a/jQUav if you want more info)
>>
>>66685628
>> Has any useful libraries for scientific programming
>>fast

At this point, your options are Fortran, Sepples, and Julia.

>> Similar to Python
Julia.
>>
>>66685669
Dart has inheritance and if you care enough to change languages you're fucking done with that shit
>>
>>66685669
Look at who promoted Go vs. who promoted Dart.
Think of Go. Does that remind you of any big names? What about Dart... yeah.
And since the begining Dart was being promoted as a replacement for JavaScript. People don't want to replace JavaScript (fuck me many people do), just look at how popular it is.
But Go... people have been wanting a systems language to replace C and others for a long time, so it was easy for Go to grow in that niche since it was empty
>>
>>66685690
Yes (>>66685645) I was talking about a quick compiler. To produce quick code, the functional architecture in the Haskell code has to be converted to an efficient procedural architecture for the x86 bytecode in runtime, this is why Haskell is slow to compile, because every step might have to be translated differently to assembly according to context. You can't just use a regular pattern like C's for loops.
>>
>>66685693
thanks, i'll go with fortran then. can you tell me what the best languages for hacking are?
>>
File: dyel.png (177 KB, 397x640)
177 KB
177 KB PNG
You haven't forgotten to lift today, have you, anon?
>>
>>66685771
Why fortran? C++, R and Python are defacto scientific programming languages in 2018. Learn one of them if you don't want it to be useless.

The best languages for hacking are C and Perl because of the freedom they give you in manipulating the data because of their weak type system and procedural design, along with their easy access to raw syscalls. Perl has a bit more abstraction on top though.
>>
>>66685737
Go and Dart are both promoted by Google and have many of the same people behind them.
>>
>>66685797
What's the definition of hacking here?
For hacking I would say Python since it's quick to prototype things in, as in "hack things together real quick".
>>
>>66685341
It's a football dataset with yards, punts, etc.

Trying to predict the winner.
>>
>>66685797
>C++
Stopped reading right there. The fuck outta here with your meme languages
>>
>>66685919
Perl is entirely designed around this principle, but my definition of hacking is more about freedom to manipulate data and to interact with the operating system.

This is why perl is described as the perfect hacking language, you glue together many small modules using basic but powerful language tools to make it do what you want quickly and painlessly.
>>
>>66685541
someone answer plox
>>
>>66685982
Is it C++? No? It's shit then. Learn C++ and stop wasting time
>>
>>66685954
I see.
You're correct on both counts.
>>
>>66685919
Then say quick prototyping.

Julia is definitely your best bet here, if you want speed, quick prototyping, and scientific programming. If you're fine with two out of three of these, there's lots of options.
>>
I did this for a laugh
>>
>>66685117
>open a new tab in browser
>type something in url bar
>made a mistake, instinctively hit Ctrl+W to erase the last word
>tab closes

LORD, give me PATIENCE with this SHIT technolgy
>>
>>66685797
I chose FORTRAN because I've heard a lot about it but the others that were mentioned, namely lua, Sepples and Julia I've literally never heard of and I don't want to learn obscure languages.

>>66685919
I just want to hack systems and do some scientific programming. What would be the best language for hacking other systems? Sort of like how Hillary's emails were hacked.
>>
>people want better C
Literally just C with better standard library, like define the fucking API for threading and add compiler flag for platforms that supports it. Now do the same for utf8, directories and file paths, basic data structures.
Maybe smarter compiler like, recursive macros and maybe some kind of modules instead of headers.
Saner types without the _t ending so every faggot doesn't have to rename uint32_t to u32.
>Solutions proposed
GC
Uglier syntax than ATS
Name mangling
nonstandard ABI
Anything but what people want from C
>>
>>66686270
>I just want to hack systems
C.
>>
File: images.jpg (8 KB, 259x194)
8 KB
8 KB JPG
>tfw you get a comfy code refactoring day
Is there any better feel, lads?
>>
>>66686420
Being at home with your loved ones.
>>
>trying to build ogre3d v2-1
>following the """official""" guide
>keeps complaining about missing library files
>have to modify cmake files and/or copy library files across folders
so this is the power of FOSS...
>>
>>66686420
>you get a comfy procrastinating-while-looking-busy day
FTFY
Making something new is better. Throwing something away completely is even better.
>>
>>66686495
>using library that uses cmake
your own fault. Cmake is shit and anybody relying on it should be shot, so most sepples "programmers".
>>
I have to teach my small dinosaur dev team full of people who have almost no background in actual development or computer science how to use git, and I'm actually going to kill myself.

I know only inflicting your code upon others if it compiles first is a foreign concept, but goddamn.
>>
>try to write a """simple""" powershell script to change default audio device, to switch from my headphones to speakers without the gui
>turns out its borderline fucking impossible and I had to reverse engineer how wangblows stores the default device
>>
File: 948238472384723.png (434 KB, 454x699)
434 KB
434 KB PNG
>>66686270
>Sepples I've literally never heard of
kekels
It's codename for C++
>>
>>66686419
No, seriously. Where can I learn to hack emails or other things just like what happened to Killary?
>>
>>66686587
Shut up, retard. You aren't being funny at all.
>>
>>66686587
In case you're not baiting (you are), it was a case of "boomer fuck gets tricked by literally a Romanian taxi driver"
>>
>>66685517
C. Learn the Python API so you can move the slower parts to C while using Python for everything else.
>>
Are .jar files the standard way a java application is ran?
>>
>>66686635
.class files are java bytecode. Jar files are zip files with .class files and some metadata.
Jar files are usually distributed but technically you could only distribute .class files.
>>
>>66686635
There's native Java nowadays.
>>
>>66686672
So in a way more or less, because of convenience, .jar files are the standard way to run a java application.
>>
>>66685491
>>66685658
BUMP
>>
>>66686686
For users yes. In development phase you won't build the .jar file but just run the .class files I think at least, but that's for the IDE to handle.
>>
>>66686717
>using an IDE for python
very epic
>>
>>66686587
That stuff is just social engineering or phishing sites which boomers fall for.
>>
I'm trying to write some self-modifying code. It seems that executing something the first time after it has been modified is very slow, several hundred ns. I guess it probably has to reload from memory, but why should that invalidate the cache of the CPU which is modifying it? Maybe it is something else.
>>
Who the fuck still uses java applets in the year 2018 when IE is the only major browser that still supports them?
>>
>>66686726
What else do I use then?
>>
>>66686672
>.class files.
Aren't .class files compiled .java files with .java files being the actual source code?
>>
>>66686741
>https://en.wikipedia.org/wiki/Julian_Assange#Hacking
What about this? How would one go about hacking the NSA and the Pentagon? Is Julian the King of hackers?
>>
>>66686877
A .java source gets compiled to java bytecode in the extension .class which is interpreteted at runtime and possibly JIT-compiled at runtime if considered to be a "hot spot".
>>
>glibc doesn't support c11 threading API
>musl supports it but
>tcc doesn't support c11 atomics
so you can't use c11 threading if you want to use tcc with glibc.
Fuck tcc for lack of support.
>>
>>66686887
Literally no one can answer this. Julian confirmed for the greatest hacker of all time, hacked the motherfucking NSA and the Pentagon. I only wish someone here could guide to to his path.
>>
>>66687145
>>glibc doesn't support c11 threading API
It's actually planned for the next release: https://sourceware.org/glibc/wiki/Release/2.28
The patch set has existed for a while.
>>
>>66685491
PyCharm is a pretty good IDE and probably better than VS. PyDev is pretty nice too.

If you're talking about importing, then "pip install setup.py" in a module directory usually does it. If it is a simple .py file than just have it at the same directory level as your .py file and you can import it.
>>
>>66687145
Just use inline assembly
>>
>>66687181
yeah well tcc still doesn't support atomics so you might as well just start using gcc extensions because gcc/clang are only compilers that support c11. Clang supports almost all of gcc extensions.
>>
File: 1507006217937.jpg (31 KB, 451x512)
31 KB
31 KB JPG
>Java is so needlessly complex you're actually recommended and encouraged to learn an IDE before you program in the language.
>>
>>66685517
I'm going to go out on a limb and say that the bottleneck is your algorithm
But lua and julia are nice, too bad both have 1 based indeces
>>
>>66687229
You can use simple editor and makefiles for java if you want to.
It's just that people writing the guides suggest you to use IDE.
>>
I want to set up VS Code to run with a MinGW compiler whose path may change
e.g. it could go from F:/MinGW to E:/MinGW
How would I do this in VS Code's intellisense thing so that I don't have to change it all the time?
>>
>>66687197
What?
>If you're talking about importing, then "pip install setup.py" in a module directory usually does it. If it is a simple .py file than just have it at the same directory level as your .py file and you can import it.
Yes I want to import it but how to do it? What is pip install and which directory should I put the file in?
>>66687197
>If it is a simple .py file than just have it at the same directory level as your .py file and you can import it.
Where is this directory in VS Studio 2017? I found one folder which says that you can put the modules there but the module still doesn't work in the Studio itself.

How are PYcharm and PYdev better than VS 2017?
>>
>>66687290
Perhaps get used to launching it through a .bat file that does the check and copy over the appropriate config
>>
I wish Google had gone full evil and included an open-source Dart VM in Chrome.

It would have caused an ungodly schism between Javascript and Dart in the web ecosystem, but at least we wouldn't have to deal with the current Javascript hegemony where it is creeping into every fucking thing including desktop apps.
>>
>>66685785
>principles of model checking
>principles of cps
You sound like a guy from one of my unis research group
>>
>>66687290
I doubt you can, hows the program supposed to know where it is? Unless the MinGW dir is in the PATH envvar
>>
>>66687305
How would I go about doing that?
No experience with making .bat files.
>>
>>66687388
D-Dave?
>>
>>66687401
>No experience with making .bat files.
.BAT files are extremely simple and you can get the gist in 5 minutes assuming you're not doing anything extremely complex. Just search in your favorite search engine a tutorial about it.
>>
>>66687426
>a*glo
Then probably not
>>
>>66687491
Y-Yuri?
>>
>>66685117
just solved an online programming screen for a job application. the task was to see if a number N could be found by subtracting and adding the elements of an array.
Example: N = 2, array = [1,2,3,4]
Yes, 1+2+3-4

Before I post my solution I would like to see how you would solve it
>>
Hello, /dpt/. I have a very simple question to ask you.

I have started to try learning a programming language and chosen C++ for reasons. My only problem is that the book most recommended for learning C++ as an absolute beginner is The C++ Programming Language by Bjarne Stroustrup the designer of the C++ language. Though the thing with this book is that it DOES presume that you have some background knowledge in programming even though it says it doesn't. For example it talks about compilers and several other things in the very start of the book without mentioning what they are that I don't understand.

So is there a book that can teach me the very basics of CS so I can start with this book already?
>>
>>66687590
You coudl start out by trying all the combinations.
>>
>>66687596
I think you mistook the c++ programming language for his other book (programming principles and practice using c++ or something like that). The former is not for c++ or programming beginners, the latter is for beginners of programming of any kind
>>
>>66687590
Sounds like a fairly complex problem actually, from a mathematics point of view. Sure, you can just brute-force the fuck out of it, but I'm not sure if that's the point..
>>
What's that new hip language used to make desktop applications that isn't javascript, but very similar to it? No, it's not java I'm trying to think of.
>>
>>66687641
that's what I tried at first but my solution uses O(n) time complexity
>>
>>66687673
>>66687690

>but I'm not sure if that's the point..
Come on, the guy didn't say anything wrt efficiency. It is dishonest to request one thing while looking for another.
>>
>>66686726
>I write my python in nano bow down before me visual bloat retards
>>
>>66687658
Fuck, I got confused actually. I meant Programming Principles and Practice using C++ and not The C++ Programming Language. It is talking about compilers and other things I don't understand so I need a book that can prepare me for this book.
>>
>>66687772
A new book just got released called A Tour of C++ (2nd Edition) and is specifically written as an overview.

>his concise, self-contained guide covers most major language features and the major standard-library components—not, of course, in great depth, but to a level that gives programmers a meaningful overview of the language, some key examples, and practical help in getting started.
>>
I can't stop masturbating
>>
>>66687787
Cool story, bro.
>>
File: 1521078923880.gif (858 KB, 500x500)
858 KB
858 KB GIF
what are the most obscure programming languages you know
>>
>>66687596
Look at "Starting Out with C++: From Control Structures Through Objects"

It's a babby's first programming book, also note that programming and computer science are distinct things and you don't have to know any nitty gritty details about compilers or anything else like that to start writing programs.
>>
>>66687673
idk how it passed their tests but here is how my solution.
def solution(n, array):
curr_sum, i = 0, 0
array.sort()
while i < len(array):
curr_sum += array[i]
if curr_sum - sum(array[i+1:]) == n:
return True
i += 1
return False


>>66687702
sorry its actually O(nlogn)
>>
>>66687786
Well the second edition isn't online yet and I want a book that can teach me the basics of programming, not just C++. For instance, what a compiler is, what assembly is, what GNU, Unix or BSD are, etc. But I want to stick to programming.
>>66687839
Thanks, will look into it. What book(s) would you recommend for C++ after it?
>>
Why do frameworks, libraries, and IDEs get talked about in modern computing than the actual language? Like Node.JS, electron, and angular aren't languages, but means of using an actual language to do something easier than making it from scratch.
>>
Anyone else grinding leetcode to get a job? Any tips?
>>
>>66687837
ATS
>>
>>66687877
Starting Out with Programming Logic and Design (4th Edition)
>>
>>66687842
just noticed a few bugs oof
>>
>>66685405
Functional language type checkers are usually exponential in the worst case but linear in the average case. They're also notoriously hard to parallelize aside from obvious things like checking different definitions in parallel, although work is being done in that area. I'd also take into account that academics are usually not good software engineers.
>>
>>66687882
because JS is so awful, webshits have been trying to fix it for decades.
>>
>>66687877
Also, what, frameworks, libraries and IDEs are.I have no background in programming whatsoever.
>>66687935
Are you replying to the first part of the post or the second? By the way, who is this Gaddis guy?
>>
File: 232051.png (64 KB, 460x460)
64 KB
64 KB PNG
>>66687675
it's obvioysly factor, com on
>>
>>66687842
I looked at it a bit and I tried this one. Seemed to work on a few tests but cba to comprehensively test it. It makes the assumption that the array is already sorted.

#include <stdio.h>

#define ARRAY_LEN(x) (sizeof(x)/sizeof(x[0]))

static int arr[] = {1,2,3,3};

static int find(int n)
{
int idx = ARRAY_LEN(arr) - 1;
int tmp = arr[idx];

idx--;
while (idx >= 0) {
tmp -= (tmp > n) ? arr[idx] : -arr[idx];
idx--;
}

return (tmp == n);
}

int main()
{
int target = 3;
printf("find %d: %d\n", target, find(target));
return 0;
}
>>
>>66686560
Share?
>>
i'm trying to get sdl building on visual studio code and it's giving me include errors.
my include path is the exact path of the folder it's in. to add insult to injury, the headers are in the fucking include folder of the mingw compiler. so i've got two copies of the headers and vscode is still moaning.
is it just shit or am i doing something wrong here? what more does it want?
>>
>>66687675
I don't know if it's against /dpt/ policy to mention it, but I think you're talking about Electron.
>>
>>66687837
C++
>>
>>66688100
reported you fucking faggot
>>
>>66687882
I was just reading about how/why MIT went from teaching SICP/Scheme in their introductory courses to (now) using Python, and it touched upon this.
http://www.posteriorscience.net/?p=206

I'd fathom that it's because people have big ideas to implement, and rather than spend time building those ideas from the ground up, it's more "efficient" to just find and use existing tools, be they parts of a large standard library or external library modules.
>>
I need to learn a new skill.
I've been a full-stack web developer for a while, but I need more things in my portfolio. Wanted to learn mobile, but with Android Studio/Emulator requiring 5GB just to start a project, that will have to wait a while.

I have no idea of what to do now.
>>
>>66686412
Jai by Johnathan Blow? It's still not out yet last time I checked.
>>
>>66688198
Also, is there a lighter way of doing this?
Even if it's not the proper way of learning it, if I start with Flutter/React Native/Ionic, will I be able to develop in a toaster?
>>
>>66688198
Just ask yourself what you (i.e, the whole company) do at your current job that you'd like to be better at.
>>
>>66688198
>Wanted to learn mobile, but with Android Studio/Emulator
Don't lower yourself to the level of a Pajeet, man. It's not worth it. Learn something better.
>>
>>66685117
pls recommend me your best programming-related anime
>>
>>66686412
C is a standard. Slight improvements to it won't give enough to outweigh the advantage of drawing from C's popularity.

It would have been nice if C was less terrible, but there's not a lot you can do about it.
>>
>>66688350
Serial Experiments Lain
>>
>>66688362
dropped it halfway through, too scary :(
>>
>>66688350
NEW GAME!
!
>>
>>66688373
Go finish it. Also, be sure to write ALL the references to NeXT and Apple. There's at least one every minute.
>>
>>66688379
already saw it, very good show

>>66688403
n-no thanks...
>>
Does anyone here know where the fuck is the specification or SDK for Xbox and Playstation? I have been searching for a while and got no results and I don't want to use retarded shit like Unity and UE
>>
>>66688198
If you have lots of Javascript experience, you might be better off learning react native and drawing from that experience. The native Android API's are horrible.

Learning the native API's in Java can be useful, but I'd honestly wait another year or two until the vast majority of Kitkat, Lollipop & Marshmallow devices get replaced so that you don't have to support Java versions older than Java 8.
>>
>>66688433
They are usually given with devkits. So, unless you're already an established dev or you don't have a working prototype to show it to Sony/MS, you're out of luck.
>>
>>66685117
Just my own little forum software written in Java without any of the Spring/SpringBoot cancer.

It's so refreshing to just not have to care about retarded enterprise rules that prohibit you from using Lombok because some retarded code generation tool doesn't play nice with it 4 years ago. Not that anyone like the codegen tool, but it's needed for the specific Avro implementation. Not that anyone actually wants to use Avro, the preferred solution would be JSON and just dealing with issues when they arise, or failing that, "how about we just use XML, but don't use all the stupid bullshit people always add on". But phasing out Avro would take eons. So it's not done yet.

But here, I can just use fucking Lombok. Suddenly, I can just make some small classes again, and just put on @Data, and @AllArgsConstructor, and I don't have to write stupid shit, or worse, ask the IDE to write the stupid shit code for me.

Also, now that I'm not using Spring, I don't have to use Spring integrations for everything. So I can just pick and choose what libs I want and what libs I need. And it feels kinda weird to just go and use the latest version of everything and just have it work, because Spring isn't forcing you to stick to the release that's from just before they made it fast/easy to use/documented. (Looking at *you* Kafka. It fucking hurts having the new and shiny stuff out there but have to be stuck on some old and shitty version due to spring integration retardation.)

I don't even use a dependency injection framework. I just new up the controllers and DAOs in the main method, construct the dependency graph and I'm... done.

It's simple. I know how everything works. If I hired some new guy to work on this, he could look on it and understand everything immediately. No fucking @Autowire bullshit.

It's almost as if Java could be a comfy language if we could just stop doing stupid shit all the time.
>>
>>66688742
>autism: the post
>>
>>66685517
Probably something like Java or C# if you want simplish syntax and high speed. But you have to be more wordy.

If you're willing to accept more unconventional syntax, but in return have more speed, and be even more expressive, you have Common Lisp.

There's also Ruby, but it's not appreciably faster than Python.

Make some stuff in some of these languages and see what you think.
>>
>>66685693
Or something like R that uses libraries for other languages. Especially Fortran's (excellent) stuff.
>>
>>66686635

Actual entarprize Java dev here:

> Jar
A standard way of doing it. It works, it's simple, it's good.

> WAR, RAR, etc.
JEE stuff. WAR is the one that makes sense though: It's like a JAR, but it contains enough metadata that you can tell an application server to serve that application. So you build your website, get the war, and tell wildfly to hop to it, and it's all good.

> An unholy mess of class files and other bullshit in a zipped folder with "runme.bat".
This is what happens when you don't have the time to make a proper build. Don't do this to people. Give them a jar if it's a standalone program, and a war if it's a web service of some sort. You can run a warfile with java -jar if you so choose.
>>
>>66688742
>No fucking @Autowire bullshit.
Many times this. Having an explicit graph in code is great, which is why I liked working with Ninject last time I used C#.
>>
>>66688913
>Actual entarprize Java dev here
Do you like being an enterprise Java dev?
>>
>>66688832
>Java or C#
Fuck both those shitty, shitty, dismally shitty languages that seem like they were designed for lowest common denominator users. If you don't want to drive yourself to utter despair then use Lisp or OCaml or Haskell.
>>
>>66688742
OOP frameworks are all such bullshit. The boilerplate and spoopy magic almost all disappears if you switch to a decent functional language.

Nobody fucking needs Spring. Ever. Anyone who tells you otherwise is lying.
>>
>>66688827
It's /g/dpt/.
That's what it's there for.
>>
>>66688931
Not particularly, but it pays rather well.

>>66688947
They're not that bad, it's just that since they let the lowest common denominator retard write in the language, the style guides tend to cater to retards, the frameworks cater to retards and so on.

But if you just step slightly outside the mainstream, you find good libraries that does shit for you, and you don't have to worry about idiots spending time discussing how to do stupid shit.

>>66688972
The whole point of them was to remove boilerplate, which makes it all the more funny/sad/frustrating.
>>
>>66688073
Sorry I wasn't home. Its rather Ad-Hoc, let me try to explain:
under
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\

there is a list of guids with format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx} -> {guid} from now on
You have to find the values of those which are the devices you wanna switch between. The human-readable name (what is shown in the gui) is under {guid}\Properties\{b3f8fa53-0004-438e-9003-51a46e139bfc},6
now, in the topmost {guid} folder, there are 3 keys:
Role:0, Role:1, Role:2

These keys store a binary timestamp which means the last time this device was set to default. The timestamp is binary representation (little-endian) of struct SYSTEMTIME, defined in Windows.h:
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;

To get this timestamp, you can use:
GetSystemTime(struct *SYSTEMTIME)

when audio is played, the function MMDevAPI!CLocalEndpointEnumerator::GetDefaultEndpoint() picks the device with the newest timestamp.
So, what I did is check which of the devices has the oldest timestamp, and set it to the current time.

I told you, it was a mess :)
>>
>>66689069
I seem to remember reading at some point that spring xml was designed to allow high-level logic to be written in xml so that managers could write it.

I never want to have to deal with logic written in xml. I never want to have to deal with logic written by managers who can only write it in xml.
>>
Excellent video on why static types aren't just for preventing type errors: https://www.youtube.com/watch?v=3U3lV5VPmOU
>>
>>66689176
Obviously if you don't have types then there are no type errors to be prevented. I have no idea what this guy is trying to say and I'm not going to watch that video.
>>
>>66689153
Spring + XML was so shit. Now it's mostly code annotations, but that just makes it feel more retarded. You create a method that returns some type, and tell Spring that this is a bean, and you must give this bean to classes that want it.

Then Spring goes around and beans stuff you tell it to.

You literally make a Map<Class, Object>, make it global, and prevent you from easily accessing it.

That way you avoid globals. By creating a big global map that the compiler has no hope of helping you make sure works.

It's so fucking stupid I'm surprised nobody has pointed at it and laughed about how naked that particular emperor is.
>>
File: 1525891708311.png (6 KB, 229x220)
6 KB
6 KB PNG
>>66689211
>>
>>66689239
Wow. That sounds fucking awful.

Currently working with a guy who keeps wanting to use frameworks with huge amounts of magic. It's a constant battle to stop his attempts to slip them in. We're not even using a verbose language, it's not like we're having to write Java levels of boilerplate without them.
>>
>>66685594
>>66685621

> you're using "object" instead of "obj" in #1

oops my bad, I typed it up instead of copying because right now I have a bunch of printf statements trying to see where things are getting messed

>replace object with freespot

which one where?
>>
>manager won't let me work remotely because he wants to be able to do face-to-face communication
>he always emails or slacks me when I'm in the office, never talks to me in person except about his family or other stuff from his personal life
please send help
>>
considering writing a torrent client
>>
Anybody savvy with OpenGL or general 3D/Game camera work?
I have a program that display multiple viewports onto one screen, and rotates them appropriately to end up working as "one" viewport (multiple cameras stacked together to create a single coherent viewport). Yes I have perfectly good reasons for this.

I posit to you a question: Why would pitch rotation start to skew when using multiple _windows_ each with a single viewport and keeping pitch/yaw/FOV in sync over a socket?
Should it not logically be the same math?
If I have a 1920x540 window split into three viewports, each at 640x540, then they stay aligned.
If I have three windows, each at 640x540, then they stay horizontally aligned but begin to skew vertically.

Por que?
>>
>>66689312
I've been working on a project and making an effort to keep it as small as reasonably possible. No actual need to, just a sense of professionalism.
Had the compiled version down to 161KB. Somebody joined the team and attached 32MB of libraries and added so much useless code and overkill header-libraries that the executable compiles to 1.2MB now, along with needing the 32MB of external libraries to be shipped with it.

Import cancer makes me want to slap people
>>
>Use a text editor (emacs suggested - you should learn how to use it at some point, even if you later use something else - although it ok to use vim instead if you insist)
This is from an assignment I'm looking at right now. Why does academia fear np++?
>>
>>66689366
Keep a list of every in-person interaction you have with him for a month, then talk to him about doing remote again.
This will either work on a reasonable human being who simply thought they were doing more in person than they thought, or it will turn him into a vindictive hawk and never leave you alone.
>>
>>66689552
Just statically link it with LTO. Takes almost no space at all, and everything you need is in the binary.
>>
>>66689555
Notepad++ is garbage is why. Literally the only reason it exists is because microsoft has two options:
-Notepad which offers even less than nano
-Wordpad, Office, Visual Studio, or some-other-fuckhuge-editor
Notepad++ is popular because its a lightweight, simple text editor with syntax highlighting and useful plugin tooling.
It is absolutely not a match for emacs or vim and would be a fucking nightmare to program anything extensively in. Use it for one-off text files that you don't already have the settings for in emacs/vim like XML files, but don't try and program in it. You'll only hate yourself for it.

>t. Used to write Java assignments in ed
>>
>>66689555
seriously. do the emacs or vim built-in tutorials.
>>
>>66689555
Notepad++ doesn't have the power of vim/emacs for the long term. Starting out you MUST use Notepad, however, until you get brace placement, semicolons, indentation etc down. If you don't, you'll be left crippled and over-reliant on the editor.
>>
>>66689555
>Why does academia fear np++?
literal-who-tier shit editors need not apply. You can install WSL and have a sane development environment if you insist on using windows.
>>
>>66689555
the absolute state of cs students today
>>
>>66689588
I have the misfortune of having to support windows, which means dlls, which means (unless I'm some old foghat) there's no way to statically link them to the program.
We have to ship with some dll's no matter what afaik but they're only a fistful of KB. One of the ones he included is fucking 21MB by itself, its absurd. It doesn't even do anything that useful.
>>
>>66689092
Wow, that is some convoluted engineering. Thanks, anon.
>>
>>66689619
You can statically link libraries, just not dlls. There's also the ghetto hack option of doing something like this:
#ifdef RELEASE
#include "lib/s_library1.h" //#define internal_symbol *random hex name*
#include "lib/library1.c"
#include "lib/us_library1.h" //#undef internal_symbol
#else
#include "lib/library1.h"
#endif

What compiler are you using?
>>
>>66689555
Emacs has modes and IDEs for dozens and dozens of languages built-in.

It has extensions that add other languages that are dirt simple to install.

It has online manuals that tell you about every little detail you may ever want to know.

The thing is that even if you tell yourself that you're just a Java dev, you'll also have to write in these:
> bash (Windows is hipster tier for development, and even then, there's cygwin.)
> groovy (to script Jenkins)
> SQL
> XML
> YAML
> CSV
> JSON
> .properties files
> HTML/CSS/JS
> Various custom grammars that you'll hate but you at least want some syntax highlighting for
> Python (a lot of glue is in python)

And that's just what I remember I've written personally over the last year. You want tools that know how to speak every single one of these formats with validation, autocompletion, compilation, and so on.

notepad++ gives you some syntax highlighting. That's just plain not enough.
>>
>>66689674
By "having to support windows" I mean "our primary platform is windows". It's mostly C++ 11 standard compliant with only a sprinkling of WIN32 bullshit (that can easily be macro'd away), but I don't think we can statically link in the dlls which are the problem.
Hell MSVC is too stupid to properly deal with standard C++ 17 options like std::filesystem.
He found libraries to do X or Y but they came with precompiled sourceless dll's that weight a metric ton.

The actual solution is to be a dick to him and go back through everything he wrote and rip it to shit and replace it with lightweight or custom solutions. 21MB dll, fucking hell.
>>
and people wondered why I insisted on getting a job where I only use lisp
>>
>>66689618
I'm not a CS student, I was just curious. I used to use vim when I ran Linux as my os, but don't really see pros and cons between either except I don't lift my hand off the keyboard with vim. emacs is goofy with the long keyboard reaches for shortcuts.

IDK, from everyone's responses, I guess I have never worked on a big enough project to see the advantage. Although if I were to work on something really large, I think I'd rather VS or an IDE.
>>66689677
I suppose since I've never worked on a real project outside of academia, I can't quite fully appreciate what emacs does.
>>
>>66688094
VSC is just pure dogshit.
Never ever use it.
>>
>>66689724
Are the libraries closed source? That feels like a legal liability.

A simple solution ought to be this:
>open library file
>copypaste functions
>copypaste in functions it calls, too
>repeat this process, unless it's a clusterfuck of a library, in which case you give up
>dump it all in util.cpp
>repeat for all libraries

But MSVC can do static linking:
https://msdn.microsoft.com/en-us/library/ms235627.aspx
>>
>>66689748
2/10 made me reply. had me going for a moment
>>
>>66689779
I still meant the question. I'm going through course material from a class my friend took, and was surprised to see the instructor being adamant about emacs. I'm suspect of anything /g/ recommends, so to see it irl is surprising.
>>
what's a good/recommended ide for c++?
not visual studio though
>>
>>66689806
>two of the most popular and long-lived editors in the world, both having their origins in the 70s
>huge communities surrounding both of them
>huge amount of documentation for them and articles about them and books about them
>huge numbers of plugins for them
>both still under active development
>but /g/ recommended them so they must be garbage
>>
>>66689758
Ripping the functions out from the source would entail slacking on 200MB of dependencies in order to compile it (the fat one is QT based so a 21MB dll isn't AWFUL, but it's insanely overkill for what we're doing with it).
Also I know it can do static linking, but you can't statically link a dll. Cause its not static.
>>
>>66689883
Build a lib file, then statically link that.
>>
>>66689806
>I'm suspect of anything /g/ recommends
Ignore brand advice
Take programming advice with a grain of salt
All programmers are uber elitist retards, its not just /g/ being /g/, and the bitter hatred usually ends up with well formed and informed (if biased) opinions.
VIM and Emacs are both unbelievably powerful editors. Some people prefer Vim, some people prefer Emacs. Your professor prefers Emacs and is going to shill it over Vim but it doesn't matter, so long as you become competent with one of them.
Don't be a faggot.
>>
>>66689900
Well I'll take a look at building a lib file but I'm not hopeful given how much of a pain in the ass it's been to get MSVC to work whatsoever.
It also definitely isn't going to fix the core problem, which is adding what appears to be a 100k LOC project into a 10k one as a library
>>
>>66689924
Complete and utter shit. Use the parametric picker. Also, wrong thread.
>>
>>66689837
visual studio code
>>
>>66689912
>Some people prefer Emacs, some people haven't used Emacs in anger yet.
FTFY
>>
>>66689994
>Some people aren't retarded, some people are
FTFY
>>
>>66689955
damn and thanks I just found the right thread.
>>
File: 1529879682554.jpg (791 KB, 2048x1670)
791 KB
791 KB JPG
I've sat on my lazy ass for 2 months "recovering" from the year at Uni. I have 2 months of summer left, I want to learn a skill.
How should I start learning basic coding? I don't need to be amazing, I just want to say I can do it. Put it on my resume maybe. Is there a widely accepted starting point? A book or a site or something? I have plenty of time and want to better myself.
>>
>>66690018
learn rust
>>
File: 1505456395010.png (104 KB, 792x1023)
104 KB
104 KB PNG
>>66690018
This is all you need. Widely available as pdf online.
>>
>>66690018
>I just want to say I can do it, put it on my resume
I just want to say I can do Mechanical Engineering, put it on my resume, you know?

Go get a PDF of K&R 2nd Edition and do every single exercise in the first 3 chapters.
>>
>>66690043
Not in 2018.
>>
File: 1520501277601.jpg (680 KB, 2309x3180)
680 KB
680 KB JPG
>>66690059
>CURRENT YEAR+3
>>
>>66690059
If you can program in C you can write whatever memeshit scripting retardation is popular. You'll want to vomit, but you can easily write javascript or python or ruby or fucking excel macros all day long without ever being exposed to them before.
>>
>>66689961
He asked for a good one.
>>
>>66690086
C has a limited amount of tools to do even basic tasks and those most of the time are unsafe. A lot of the times you will have to use unsafe hacks that are hideous that you could have done in another language in a few lines of code and is much safer.
>>
>>66690039
I don't know what that is.

>>66690043
>>66690049
Thanks anons. Seems everyone suggests that book so I'll definitely start there. I appreciate it.
>>
>>66690124
You're an idiot. For a lot of reasons, but particularly for so grossly missing the point.
>>
>>66690124
>>66690141
Guy look to learn
Okay so C is where I start then I branch out is what I'm getting from this? The constant arguments over which language is best is one reason I've never started to learn. I didn't want to commit the time then find out it was for some garbo useless language.
>>
>>66690186
>I didn't want to commit the time then find out it was for some garbo useless language.
That's nonsense. The skills you learn will transfer easily to other languages.
>>
>>66690186
There is no "best language"
There are better "learning languages"
Python, Javascript, Ruby, et al are objectively fucking shit for learning.
Will you write more, faster? Yes. Will you understand what in the fuck you're doing? Not a goddamn chance. Not until you spend a lot of time reading on what's happening below, at which point you may as well have just learned a proper language in the first place that would have taught you this as you used it.

Learning Language A does not prevent you from using Language B. Transitioning between and learning additional languages becomes trivially easy after you get over the hard part of understanding what you're doing.
Learn C. Understand what you're doing. It's a simple language with little to fuck up, unless you write it fucked up. Learn how memory works, how a pointer works, how arrays work, and the importance in distinction between data types.

Then go fucking hog wild. You wrote a simple text editor in C? Dope, do it again in Python in half the lines if you want, but you'll need to know exactly WHY python is half the lines and 8x slower if you're serious about it.
>>
>>66690202
Wish I knew that when I was all motivated a bit ago. Oh well, no time like the present. Grabbed the PDF, put a copy on my phone and tablet too for portable reading.
I have some extra electives I'll need to fill in the coming years at uni. I was thinking of using them for programming classes. Any idea if that will be a useful experience or if it will just be basic stuff I could have taught myself in a week or two?

>>66690231
Thanks anon, that's really useful to know. I appreciate the motivation. I'll do my best.
>>
>>66685594
>>66685621

If you are still here, the SIGSEGV fault happens here and crashes the game

obj->nxt->prv = obj->prv;


The memory thing in the code blocks debugger showed me that obj->nxt->prv is 0x534, but obj->prv is 0x0. I am assuming 0x0 is NULL. I also checked obj->prv->nxt, which is 0x538, and obj->nxt, which is 0x0. Do I need to refine this area of code?
>>
>>66690256
> Any idea if that will be a useful experience or if it will just be basic stuff I could have taught myself in a week or two?
I just graduated and all the things I was taught could have been learned in about 6 months with a copy of K&R, MIT's Algorithms and Data Structures book (also free as a PDF), Distributed Systems by Tanenbaum (also free), and maybe some shitty OOP design book, though that one I already understood by fucking around in C# for a month.
Intro CS classes tend to be a complete waste of time outside of getting some practice in. Look into MIT's or Standford's online CS courses, they're excellent and don't suck up a lot of time.

Otherwise just talk to the CS advisors about your current skill level vs what would be taught in the classes you qualify for.
>>
Why are FPL(s) so slow and useless?
>>
>>66690309
Good idea, thanks.
I guess practice is practice. From what I can tell all the other classes offered are political so I might just take it for the practice anyway. I'll talk to the advisers about what's best.
>>
>>66690309
>american """universities"""
>>
I know enough Python to read scripts, and fix bugs, but I don't know how to get to the next level. I don't know what to write, other than what my employer asks me (which is less and less as I'm not a dev). How do I get out of the school mindset of "I need to be told what to do"?

Just made a rock, paper, scissors game real quick:

# Python3 - Rock, Paper, Scissors
import random


def cpu_makes_a_choice():
choices = ['rock', 'paper', 'scissors']
selection = random.randint(0,2)
return choices[selection]

def determine_winner(user_hand, cpus_hand):
# given two hands, return the winner hand
if user_hand is 'r' and cpus_hand is 'paper':
return cpus_hand
elif user_hand is 'r' and cpus_hand is 'scissors':
return user_hand
elif user_hand is 'r' and cpus_hand is 'rock':
return 'draw'

def main():
user_hand = input("Pick One: Rock (r), Paper (p), or Scissors (s): ")
cpus_hand = cpu_makes_a_choice()
winner = determine_winner(user_hand, cpus_hand)

print("CPU choice: {}".format(cpus_hand))
print("Winner: {}".format(winner))

main()
>>
>>66690297
>previous is 0x0
>previous->next isn't
That sounds like some undefined shenanigans to me

>>66690351
Never understood this meme, if our unis were such unbelievable dogshit why would all you retards be begging for student visas to study here?
>>
File: 1489531947889.jpg (61 KB, 580x580)
61 KB
61 KB JPG
>>66690392
> I don't know what to write
Consider edgecases for whatever it is you've written, and then start accommodating for them.
Or just write anything at all. Tic-tac-toe, something to read a JSON file and pretty print it with tabs, count the number of times a given letter is used in a document
Codecademy isn't super awesome for learning, but it provides a bunch of puzzles and challenges that are good for "I need to practice with something but no idea what"
>>
anybody know of any good virtual network software for me to test my programs on? im trying to learn about encryption and stuff so i wanna make an IRC client and test it but i only have one machine atm so virtualization is the way to go, but i have NO experience with this
>>
>>66690399
I've never set foot in the United States, and the ones begging for the student visas are mostly Pajeet and friends.
>>
it sucks to be a basic math brainlet bros
>>
File: C_dpt.jpg (582 KB, 1280x720)
582 KB
582 KB JPG
>>
>>66690462

Yeah, but at what point can someone be like "Oh, I'll just create a startup ala Uber, or Facebook with my coding skills". Just seems impossible. Feel like I learned how to nail some boards together, and don't understand how to create modern complex architecture. There is something missing...
>>
>>66690475
It's okay to be jealous of our STEM programs and general superiority, anon.
At least you have us beat on liberal arts schooling, ours would rather focus on "inner expression" than teach you the actual fundamentals and history of anything.
>>
File: 1529195435180.png (2.46 MB, 5198x2124)
2.46 MB
2.46 MB PNG
>>66690392
>>66690462
>>
>>66690519
>at what point can someone be like "Oh, I'll just create a startup ala Uber, or Facebook with my coding skills"
The second they don't ask themselves, they just do. That's also irrelevant to the point.

>Feel like I learned how to nail some boards together, and don't understand how to create modern complex architecture. There is something missing...
...yes, practice, knowledge, and expertise.
Read a book, practice more, study, learn, communicate. You made rock fucking paper scissors, which is basically like rolling a 3-sided die to see who wins. You've only picked up the hammer, start slapping shit together and see how long it takes to build a shitty box. Then build a shitty shack. Then build the worlds least livable home. Then go back and make a better box.
It's a skill just like anything else, you're not gunna whisk yourself into rebuilding the chromium engine with a technically functional knowledge of python.
>>
>>66690231
Idris is the best language for learning programming.
>>
File: 1502886127460.png (681 KB, 976x4520)
681 KB
681 KB PNG
>>66690528
But that's just the thing, the CS programs in particular are an utter joke. CS in the US has lots of filler courses and is 3 years. This would be called "IT" in European universities, and be completely open about being geared towards shitting out software development.
The CS educations, in contrast, are proper (5-year) engineering educations - pic related. There are no unrelated politically motivated courses.
>>
File: file.png (111 KB, 208x250)
111 KB
111 KB PNG
>>66690480
i hate myself
>>
C++ question.
Class Leg extends ID
Class Head extends ID
Class Dog extends Leg extends Head extends ID

Dogs have an ID
Legs have an ID
Head have an ID
should be the same ID.

I want to have:
Vector<Leg *> legs;
legs.pusback(some_dog_pointer);

then use the IDs to access things in the vector (or whatever structure. Lets say map or something).
>>
>>66690644
>sp1/sp2/sp3/sp4
Breaking down classes into tiny 5 week lectures doesn't mean it's better because you took more classes
It just means you didn't compound the knowledge you were being taught and left incomplete
I could lump all these classes together into their US (single semester) equivalents but there's no point. I mean for fucks sake you take Linear Algebra in your first year and then only take Matrix Theory in year 4, OPTIONALLY?
You don't even do cryptography until year 4?
Or learn about Compilers, C Programming, or Computer architecture until year 4?

I thought the first two years of my crappy state school CS program were a waste of time but holy fucking shit. I was even gunna assume you guys have a better Maths system than us in general, but my word.
I was shitposting to your shitposting but I feel bad for you now.
>>
>>66690769
Can you elaborate on what you're trying to do? That sounds a lot like a bad hierarchy more than anything else
>>
>>66690816
I'm trying to have a component system. Where I can build objects.
More appropriately:
Entity has:
Physical Object
Weapon holder
...ect
>>
>>66690848
So like
>Being (the noun not the verb)
>-Human [is] Being
>-Dog [is] Being
>--Human [has] Leg
>--Dog [has] Leg
Kind of deal?
Then a big list of Being's, which may or may not be Dogs or Humans?
I'm just not sure I understand the
>vector [of legs]
>[add to vector legs] [a dog]
thought
>>
>>66685491
>>66687293
BUMP
>>
>>66690887
>>66690887
Let me explain another way
Lets say you have:
Entity
Physics Object
ID

I have another class
Physics_Processor which has a vector<Physics_Object*>
I might have another class that has a
vector<Entity *>
In both cases I want to use ID to refer to them.
>>
>>66685117

>this whole thread

https://www.youtube.com/watch?v=Kr0tTbTbmVA
>>
>>66690644
>CS in the US has lots of filler courses and is 3 years

>3 years

no they aren't.

3 years is a CS diploma. Degrees are 4 year programs.
>>
>>66690953
>Python
>IDE
Use notepad++ or vim/emacs with some lovingly crafted modules.
Python can't make use of an IDE by the nature of the language, you just have to hope you don't fuck whatever you're doing up without noticing.
There's not really "include" in python, either it's installed into your python system (if you're on windows, good fucking luck) or it's not.

>>66690955
Then both should [have a] ID instead of extending it.
"extend" implies that it's some kind of subset of the original thing, or an interface of the thing, like a sword and a knife would "extend" some 'sharp edge' class somewhere up the line, but not necessarily have the same exact functions as a result.
But both of them have handles, so both of them would [have a] handle. They wouldn't inherit or extend Handle, they just have one. So they can refer to handle stuff.

Ultimately this is a design decision only you can make and stick with, but if you want A and B to both be referable by C, either A and B need to have the same reference to C or C needs to have references to both A and B, or both. Simple pointer settings can enable this is you're careful about how you do it.
Assuming A and B aren't related to some superclass anyways. Dog and Human shouldn't directly inherit from the same thing but Nigger and Jew could both inherit from Rat.
>>
>>66690770
The international league tables are mostly dominated by US institutions with a smattering of UK ones mixed in.
>>
>tfw planned on starting a commit a day
>tfw new ssd came in for old thinkpad
>tfw spent all of my time setting up new KDE neon installation
>tfw onedrive daemon hasn't downloaded my ryuko pics yet so I can't even avatarfag
fuck
>>
>>66691045
Well it isn't installed but there must be some way to use the module.py in any IDE? I've tried in VS 2017 and IDLE so where should I go next and how would it be used? I have the module in code also, since it's a .py file.
>>
>>66691210
??? just clone the drive ya dingus and move on with your life what kind of a retard sets up their system anew when getting a new drive rofl
>>
>>66690770
>>66691039
They are still filled with irrelevant courses. If all the courses are relevant, that is clearly superior, or you're effectively comparing a 2-year degree to a 5-year degree.
Enjoy your $50k a year feminist theory.
>>
File: 1518419069652.jpg (85 KB, 680x680)
85 KB
85 KB JPG
>>66691275
>Sustainability and Resource Use with Perspectives on Information and Communication Technology
>The course also aims to inspire students to reflect upon how ICT can contribute to sustainable solutions to societal problems.
>>
File: 1515406319807.jpg (529 KB, 852x1600)
529 KB
529 KB JPG
Reminder that programming in C++ is like feeling the soft supple breasts of a cute anime girl all day long and then resting your head on them at night while receiving head pats.
>>
>>66691351
No, that's C because C is pure.
>>
>>66691045
Thanks. I think I will either use a pointer or just duplicate the ID values in each class.
>>
Why are Java programmers allowed to program?
>>
>>66691275
Every degree program in the world is full of irrelevant bullshit. If you think yours isn't then I pity you.
>>
>>66690644
lmao

>>66690317
because they're intentionaly designed to not resemble the normal flow of a computer, so the compiler has a much greater challenge on its hands

>>66690231
python can help people learn to indent their shit correctly, but I agree with everything else

>>66690124
C sacrifices safety for speed and size. As such, it requires a competent user to make a working program.

C is a procedural language. Use it like one. For some reason, people complain that C is ugly because they hacked shit together to use it like it's in some other paradigm that they're more familiar with. You can hack shit together to make any language act like any paradigm, but it's going to be ugly. C isn't an exception.

>>66690018
If you want to get started quickly, and you aren't particularly concerned about the practicality of what you make, python is simple and quite fun.
>>
>>66691247
>he doesn't know what MS onedrive is
>>
>>66691425
Freedom
>>
>>66691362
>structs
>arrays
>convenient struct member and array access syntax
>a type system
>distinction between "pointers" and other normal values
>functions
>variables
>macros
Nah, C is bloated impure trash.
>>
>>66691448
Has freedom gone too far?
>>
>>66691351
Girls with white/silver hair look so pretty.
>>
>>66690399

Not sure why it's undefined. When the game/level starts, the entity array links are set:
int i;
for ( i=0; i<MAX_OBJ; i++ )
{
GAME_OBJ[i].prv = &GAME_OBJ[i+1];
GAME_OBJ[i].nxt = NULL;
}
GAME_OBJ[MAX_OBJ-1].prv = NULL;


And then when an entity is made:
// Set the links
if ( lastobj )
lastobj->nxt = obj;
obj->prv = lastobj;

// Set as oldest, if applicable
if ( !frstobj )
frstobj = obj;

// Set as latest
lastobj = obj;


Has to be either in one of these three snippets i've posted (the one in my first post, and the two here)
>>
Checking out Godot game engine. I like it so far.
And it is of course better than java.
>>
>>66691479
Even better with red eyes.
>>
>>66691545
Why red over blue or green eyes?
>>
Post your most common language and your dev environment

>python
>atom
>>
>>66691605
>C
>atom
>>
>>66691605
>common lisp
>emacs
>>
If you could redesign the entire C standard library, how would you do it? Starting from freestanding C and inline assembly for Linux system calls and building your way up.
>>
File: 4.jpg (90 KB, 806x415)
90 KB
90 KB JPG
>>66690769
>Class Dog extends Leg extends Head extends ID
please stop
>>
>>66691644

Class Human extends Male extends Genitalia extends Penis

Extensions are here to stay.
>>
>>66685628
Oh come on. You just want a language with libraries available to do all the heavy lifting for you. Kill yourself brainlet.
>>
File: 1529260504552.jpg (685 KB, 1000x718)
685 KB
685 KB JPG
>>66691570
I don't know, maybe it's the contrast between the white hair and red eyes that makes it cuter and lovelier somehow. I can't explain it.
I just like it.
>>
>>66691673

So...basic?
>>
>>66689724
>our primary platform is windows

My condolences.
>>
What purpose does indentation serve other than better reading of the code?
>>
>>66691787
it's significant in some languages
>>
>>66691787
Nothing.
>>
>>66691492
>current game obj.prev is set to the address of the current game obj+1
Youre writing an extremely obtuse linked list. Just use a regular linked list.
>>
>>66691362
>>66691462
sepples - used up 30 year old roastie with as many previous partners, makeup caked on
c - pure
assembly - lolicon
simple as that
>>
>>66691820
You can't call C pure with all those unnecessary abstractions.
>>
>>66691605
>c
>vim
>>66691638
it's pretty good actually
maybe standardize src, dest order but that might just restrict things
I can talk about changes to C though, that's much more interesting.
>>
>>66691638
My first step would be to change the compiler from gcc to g++
>>
File: 1516582471354.png (1.9 MB, 1920x1080)
1.9 MB
1.9 MB PNG
>>66691705
Albinism?
>>66691462
Half of those aren't unnecessary abstractions. For instance, CPU ISAs are optimized for function calling, int is usually 32 bit while most 64-bit pointers are 64 bits, and so on.
>>
>>66691862
>CPU ISAs are optimized for function calling
So? all you need is a call statement that takes an address sized integer
In fact, () call syntax should always just take an integer on it's left side.

>int is usually 32 bit while most 64-bit pointers are 64 bits, and so on.
then use 64bit ints as addresses. If you want to be portable then all you need is a integer type that always matches the address size. like uintptr_t or size_t.
You do not need pointer types. They are unnecessarily restricting.
>>
Will HRT and fursuits really save programming?
>>
(re-edited because I changed all the names in my code but i'm still too used to writing entity)
>>66691815
only other way I know how to do it is

object_t *obj = &GAME_OBJ[0];
int i;
for ( i=0; i<MAX_OBJ; i++, obj++ )
{
// set next link
obj->nxt = NULL;

// set previous link
obj->prv = i!=MAX_OBJ ? &GAME_OBJ[i+1] : NULL;
}
obj = NULL;


to try and catch it, I tried this out
if ( obj->nxt )
printf ( "next\n" );
if ( obj->prv )
printf ( "prev\n" );
if ( obj->nxt->prv )
printf ( "next prev\n" );
if ( obj->prv->nxt )
printf ( "prev next\n" );


It doesn't print "next" or "prev", and crashes on checking nxt->prv. I know it should be:
if ( obj->nxt && obj->nxt->prv )
printf ( "next prev\n" );
if ( obj->prv && obj->prv->nxt )
printf ( "prev next\n" );


But then it just skips over.

Very confusing.

>You're writing an extremely obtuse linked list. Just use a regular linked list.

But I don't know what a regular linked list would look like in this scenario.
>>
>>66691899
No, with the stack. How is it supposed to fill the stack? Calling conventions vary, also.

>You do not need pointer types. They are unnecessarily restricting.
And say you have 12-bit arithmetic registers and 60-bit memory indexing. What now, faggot?

>>66691920
if (obj && obj->nxt)
>>
>>66691944
And sure, you might also need a separate size for function pointers, since that might be in different memory.
>>
File: 1398517797146.jpg (376 KB, 1000x1176)
376 KB
376 KB JPG
>>66691210
update: the onedrive daemon made it to my ryuko folder, downloaded like a third of it and then went somewhere else. Nice.

>>66691638
I think the stdlib is pretty good overall, just bake the GNU C extensions into the ANSI standard.

If I were to add some features to C, here's what I would add:
>allow for function pointers in struct definitions to define the function they're pointing to.
>add the elvis ?: operator
>add an idiom for array iteration, e.g.
 for(unsigned int x : a) 
where a is an array
the last two could probably be implemented with some preprocessor shit. The first one would be a bit more tough, though not impossible. Could be honestly just be implemented with some kind of name mangling in the backend, if nothing else.

>>66691820
>versatile and lightweight
>compilers for every relevant platform and various use cases
>other languages use it as an intermediate compilation step because it can be compiled to machine code so efficiently
>syntax laid the foundation for almost every other imperative language except for python and pascal
C is my wife irl
>>
>>66691944
>>66691956
>portability
bloated impure trash
>>
>>66691944
but that doesn't do anything. the function already checks and stops if the object passed to it is null.
>>
>>66691644
why shouldn't I do this?
>>
>>66691833
>>66691959

I don't think it's very good.

I'd get rid of all null-terminated C string handling and their associated str* functions. They're really special cases of mem* functions and treating strings as arrays of known size is the best practice in modern C. The only str* function that should be kept is strlen and it should only be used on string literals.

I'd have the following standard struct:

struct memory {
size_t size;
uint8_t *pointer;
};


And all functions that require memory would use it.

I'd get rid of all global state as well. That means errno and global I/O buffers. All functions would return status codes to indicate failures.

I think there are many GNU C extensions that are really good. My favorite one is the ability to take address of a label. I usually compile files in ANSI C mode though.

>>66691857
Why?
>>
My code can only be compiled with a GCC toolchain (and maybe Clang if someone ported it).
I do not give a single shit about compilers other than GCC and Clang.
Give me one reason why I shouldn't enable and use GNU extensions.
>>
>>66692109
>Why
Because you can't go very far in designing a better standard library when you're limited to C.
C can't even do generic data structures in a sane and efficient way.
C strings are 100% pure trash.
>>
File: autism.png (976 KB, 1280x720)
976 KB
976 KB PNG
I want to learn Game Programming for fun with C, however, I feel like I am cheating when I use libraries like SDL. Can I create a simple 2D scroller game from scratch, with no libraries? Is it a fools errand? I just feel empty by using libraries, like the library is doing everything for me. Is it autism?
>>
>>66692129
>Because you can't go very far in designing a better standard library when you're limited to C.

Well you can't go very far in designing a library of any kind when you use C++. Shit like name mangling and exceptions pretty much ensure your library will ever only be touched by other C++ code.

I think libraries must have extremely stable and well-defined binary interface and C++ does not have that. It's a mess. There's a reason Python faggots can use Fortran libraries written decades ago, and that reason is a simple and stable binary interface.

>C can't even do generic data structures in a sane and efficient way.

I think intrusive data structures are excellent and they can be done in C.

>C strings are 100% pure trash.

Agree. We can't fix C string literals, but we can fix the standard library functions that programs use to make them not take C string parameters. Every pointer to memory must have known size.
>>
>>66692188
>Shit like name mangling and exceptions pretty much ensure your library will ever only be touched by other C++ code.
How is this a bad thing?
Why would I want dirty foreigner shitcode interfacing with my perfect and cute standard library?
>>
>>66692218
>dirty foreigner shitcode

You mean C++ code compiled with different or older compilers? Those will break too.
>>
>>66692188
>Every pointer to memory must have known size.
That has nothing to do with pointers, though.
>>
>>66692245
>different [(anything other than GCC or Clang)] or older compilers
Yep, disgusting shitcode alright.
Fuck off with your outdated irrelevant software.
Update or fuck off. If you're interesting in using outdated irrelevant software than the normal C standard library is probably more for you.
>>
>>66692188
>I think intrusive data structures are excellent
And I think you're a retarded idiot.
Also I said sane.

>Want to store third party type
>Want to store basic builtin type
OOPS
>>
>>66692326
What's insane about it?
>>
>>66692355
Needing support from the type being stored just to store it.
Also, for builtin or third party types, you have to wrap it.
>>
>>66685117
Trying to come up with a way to generate the entire MULE character set in Postgres. Every other character set can be iterated using convert_from/convert_to and UTF-8, but PG doesn't support converting between UTF-8 and MULE. This means I can't even use the psql interactive mode (which runs in UTF-8 mode), I have to send it a script to run after setting the environment variable PGCLIENTENCODING=MULE_INTERNAL
>>
>>66692386
That's the whole point. It's an intrusive data structure.
>>
>>66692423
>That's the whole point.
Exactly. That's why it's bad.
>>
>>66692423
Yeah, and it's shit.
>>
>>66685117
x = int(input("enter a number>>> "))

def is_even(x):
if x % 2 == 0:
return True
print ("%i is an even number" % x)

else:
return False
print ("%i is an odd number" % x)


why the bloody shit wont this print the results i know its something terribly retarded im missing
>>
>>66692434
nevermind
x = int(raw_input("enter a number>>> "))

def is_even(x):
if x % 2 == 0:
print "%d is an even number" % x
return True
else:
print "%d is an odd number" % x
return False


print is_even(x)
>>
File: food.gif (1023 KB, 500x281)
1023 KB
1023 KB GIF
>>66692109
At my company, we have a pascal-esque language that's maintained in house (some of our products are customer-programmable, and they use this language to program their stuff) and this is essentially how it handles arrays. Strings are null-terminated still, but arrays start with a few bytes specifying their size and length.

The advantage of doing like that is that you have a reliable safety check for out-of-bounds access. It's a huge advantage and it would allow for C binaries to be compiled with injected runtime array access checks.

>>66692129
Using null-termination allows for a string to "change length" in a way that is easy for a computer to work with. Remember that most branch instructions are exclusively zero/nonzero comparisons. moving a pointer until the value under the pointer is zero is a very trivial task, and can be done extremely fast, which is the purpose of C.
>>
>>66690392
Most of my practice comes from just making things that are useful. If you ever think about using an online tool or phone app try doing it yourself. Yesterday I made a script that yells at me every 20 minutes to stretch and today I made a calculator for take home pay after taxes, security etc. Not hard stuff, but I learn something every time.

you could also tackle http://www.pythonchallenge.com if youre really aimless
>>
>>66692524
>The advantage of doing like that is that you have a reliable safety check for out-of-bounds access.

Yes that's the exact type of advantage I'm trying to buy with a custom standard library. Although I pay the cost in the form of a length variable, lots of code out there will end up creating such variables via strlen anyway. Might as well standardize on it.

When I look at actual system calls, for example, they all take length specifiers. It's only the C world that deals with null terminators. I think treating memory blocks uniformly will make programming easier and more disciplined.

>moving a pointer until the value under the pointer is zero is a very trivial task, and can be done extremely fast, which is the purpose of C.

I agree with this but the fact is a great number of strings come from untrusted sources and this algorithm makes unsafe assumptions such as "there will be a zero byte at some point".

Optimization in C is performed based on the C standard, which says "every C string has a zero byte at the end" and "this function takes C strings", therefore the compiler is allowed to conclude "I can loop through this pointer until I see a zero byte at the end". Unfortunately, this doesn't exactly match reality.

I think this "C was designed for speed" mindset is very dangerous. For example, C imported strict aliasing rules from Fortran despite the fact it greatly complicates systems programming.
>>
>>66692600
>C imported strict aliasing rules from Fortran despite the fact it greatly complicates systems programming.
Not really, no.
>>
>>66687842

You know sum() is O(n)? Your solution is O(n^2).

It doesn't obey the problem spec, but maybe you specified incorrectly.

1. You only add numbers, never subtract.
2. You don't use all the numbers.

>>66688027

This is closer to correct, but still has problems.

By initializing to the last element, you are implicitly always adding it. You will fail the trivial case of (-1, [1]), stating false instead of true.

If you fix that, there is a more difficult problem.

Consider (-3, [-4, 2, 2, 3]).
>>
I soiled my pants.
>>
>>66692153
In C?

I can't even imagine how that'd be possible. Unless you're smart and patient enough to build your own personal image processor, you're just wasting time and energy.
>>
New thread:
>>66692722
>>66692722
>>66692722
>>
>>66692414
How delightfully esoteric
>>
>>66692434
>>66692467
The problem is youre trying to learn in python




Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.