[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: 1541483607240.jpg (114 KB, 1000x1100)
114 KB
114 KB JPG
Old thread: >>68814458

What are you working on, /g/?
>>
>>68820951
Nothing, go shoot yourself subreddit niggers
>>
File: images (15).jpg (38 KB, 715x429)
38 KB
38 KB JPG
Can you write a computer program to grade students answers? I was thinking of creating a small online history course that uses NLP to compare users answers to the accepted ones, based on keywords and sentence similarity. Obviously it won't be able to grade entire essays, but what about maybe 1 or 2 sentences?
>>
The project I picked up is built with visual studio which I am not familiar with and it is not building because some object defined in the shader is not being found

Is it possible I have to manually do something within the IDE to link the shaders to the project?
>>
Rust was supposed to be OCaml without a GC. Did it succeed?
>>
What is encapsulation?
>>
>>68821273
Stop trying to make Ocaml a thing. It's a shitlang that's only used by Jane Street.
>>
>>68820974
might as well just set the score to randomfloat(0, 100)
>>
>>68820951
No because I'm an i/g/norant who only cares about being a member of the Linux master race, praying to Richard Stallman (the saint of Emacs), and having the right specs to play Deus Ex...
>>
Best programmers:
>furries
>trans folk
>women
>enbies
>>
>>68821304
It's no Haskell but it's certainly better than Java and Python.
>>
>>68821701
please don't disrespect the good name of programming socks by falseflagging this hard
>>
I have this copy function in C. I use to copy a line from a file into memory. Any way I can optimize it, resources to learn algorithms, or does my compiler take care it for me?
int copy(char *src, char *desc, const char stop)
{
int cnt = 1;
for (; *src != stop; cnt++)
*desc++ = *src++;

return cnt;
}
>>
>>68821897
>function returns number of bytes written + 1

you could probably speed it up by just scanning for the stop char and then using memcpy instead of doing it one byte at a time
>>
>>68821897

This copy function is insecure. Use of it could constitute a security vulnerability.
>>
>>68820951
Lisp is the most powerful programming language.
>>
>>68822020
>This copy function is insecure
Why?
>>
>>68822033

The size of the destination buffer is not provided as a function parameter. If src is a string provided by a user, this can be used to execute a buffer overflow vulnerability.

Similar behavior can be found in the gets function (which reads from standard in until a newline character is read) and the strcpy function (which copies characters until a null byte is found). You should read the man page for gets. It might give you some perspective.
>>
>>68822102
I'm not writing a library. Just need this function for aoc.
>>
>>68822128

Since you're not using a scripting language like Python or Ruby, I'm assuming you don't give a shit about leaderboard scores. In this case, you should focus on developing good programming habits. Among these should include:

1. Always include size parameter for a destination buffer, never writing more characters than the buffer is capable of storing.
2. Any parameter that is a pointer should be const if you are not writing to it.
>>
Reposting from last thread
I just got accepted to a 6 figure salary position up in boston. It'll be the first time I'll live a city other than NYC

What is it like to live in a place other than NYC? Do they have halal? What about pizza? Or hobos? Do they even have cheap Chinese food?
There's so many questions I need answered
>>
>>68822198
I appreciate the help, and you're right, I don't give a flying fuck about showing off, but I'm not a newbie. I know about type qualifiers, and I chose not to use const in that function, because it isn't necessary in my use case. src is a pointer to mmapped file, that is opened with the O_RDONLY flag, with PROT_READ. I need to know the advanced stuff.
>>
>>68822142
strchr(stc,stop)='\0';
strcpy(src,desc);

Fite me code safety nerds. Why do you even care how big the copy was? I'm assuming that you're writing to the beginning of 'desc' so you might as well just strlen it later.
>>
>>68822278
nobody cares
>>
>>68822303
>"copy" function that modifies the copied-from string
good fuckin job idiot
>>
>>68822303
I can't do that. src is a pointer to mmapped file, that is opened with the O_RDONLY flag, with PROT_READ. I wouldn't need to copy, if I was okay with modifying the file.
>>
>>68822347
Baaaaaaw, const that shit if you don't want me overwriting it.
>>
>>68822278
where are you moving
>>
>>68820951
Is C++ a good language to start for a (almost) total newbie?
I'm using Bjarne's "Programming: Principles and Practice"
plz no rude
>>
>>68822417
C is fine. Think of C++ as a syntax hack of C, because people got tired of passing structs around.
>>
>>68822417
Nope
>>
>>68822441
also it comes with a complete other turing-complete language attached to it as the template system
>>
>>68822463
Deep, unintelligible magic system is more like it, fun to use at least.

Though it can also be used to compile the same code twice swapping 'float' for 'double', bloating object size by 2x for no goddamned reason. Oh well.
>>
>>68821055
Could someone please explain, are shaders always included through code or does the IDE play a role as well?
>>
>>68822381
Boston
>>
>>68822514
What sort of shaders? What language is this even? I am assuming you mean object not found errors as-in C/C++ linking errors. If you see a linking error, likely a source file isn't getting built (i.e. not added to the project in vstudio)
>>
>>68822529
How many figures are you being offered?
>>
>>68822278
>>68822529
You can get a condo down by Fenway Park for like $4000/month, and have tons of wacky food within walking distance
Or you can live in Cambridge, drive to work every day, and deal with shithead massholes who don't fucking know how to drive
Pretty sure those are all your options
Boston is a puckered anus leaking blood
>>
>>68822579
6
>>
>>68822577
They are glsl but saved as .c

Is there a way to add them manually?
>>
Managed to ask in the wrong thread. I'm doing some graphics programming and I'm looking for some fun shapes to procedurally generate. Any ideas?
>>
>>68821701
Remove all of these except "women(male)" and it's ok
>>
Dependent types make programming practical.
>>
>>68822625
What other cities have you lived in?
>>
>>68821292
The segregation of state.
>>
>>68822644
Oh, it's shaders saved out in const char[]s so you don't have to load at runtime. Yeah it sounds like the .c files aren't compiling == not added to the project.

Look in the project explorer and it should indicate that you have files there that aren't added to the project. Right click them or something?

Altenatively, just #include the .c files somewhere that is already compiling, good enough for simple shader sources.
>>
>>68822677
Have barely left Brooklyn the 22 years I've lived on this earth
>>
>>68822717
What are your go-to eatery choices, ethnic or otherwise?
>>
File: niggerlicious.png (28 KB, 582x922)
28 KB
28 KB PNG
critique my niggerlicious code
>>
>>68822757
Halal or pizza
>>
>>68822710
Ah so he saved them as .c so they could be included by Visual Studio?
>>
>>68822761
Reading assembly for the first time. Incredibly ugly senpai

Please explain the following to me
>DifferentINputs
Are functions case sensitive in assembly?
>JNE L3
What does this line hope to accomplish. I thought when a jump fails, it just keeps going. So you're just jumping to the next assembly instruction anyway
>>
>>
>>68822955
Thank you?
>>
>>68822882
You have .c's so that you don't have the load the shaders from disk when your program runs.

The way OpenGL works, you have to load your shader code into memory, then compile them at runtime with glCompileShader(...). The purpose of the .c files is that the shader code is dumped into constant memory that is automatically loaded when your program starts: lazy and efficient.

Remember that every .C source file gets individually compiled into an object file, then visual studio links all of the object files together to make a program. The error you saw was telling you that an object file was missing, which means you didn't get one of the .C's compiled.
>>
File: 1468197421600.jpg (23 KB, 400x400)
23 KB
23 KB JPG
>>68822955
x86 a CUTE
>>
>>68822983
Thanks for explaining that to me. I tried moving the .c glsl files into my source files filter in Visual Studio

It is giving me many syntax errors on those files. I suppose it thinks they are supposed to be cpp? Or is glsl not compaitible with c? Or do I not have C compilers installed?
>>
>>68823030
>>68822983
>reddit spacing
Did you just catch his autism.
>>
>>68823045
it is github markdown spacing
>>
File: s.png (7 KB, 583x171)
7 KB
7 KB PNG
>>68823030
glsl is neither C or C++, it's a separate language. All saving them as a .c or .cpp file is for is simply to declare them as constant raw data: char* or equivalent. The language would only matter if there is actual (non glsl) code in the file.

Pic relates in an example of this. The "proper" glsl source is in grey, but the whole thing is wrapped up as the equivalent of const char* just so the data is auto-loaded when the program starts. Yes you have to add the line breaks manually, hence why this is usually only done for small things.
>>
>>68823110
I see what you are saying but the shaders do not look like that unfortunately, they are written normally (starting with #version)

I suspect they are saved as .c just so his editor could recognize the keywords BUT at the same time I can't for the life of me see how they are connected to the project in the source code, so I wonder if it isn't through the IDE somehow
>>
i can't read other peoples programs
>>
File: haskell guidelines.png (8 KB, 424x176)
8 KB
8 KB PNG
threadly reminder
>>
File: c.png (32 KB, 1186x511)
32 KB
32 KB PNG
>>68823146
Oh, well that's weird and strange. Yup if they are just straight up glsl files saved with a misleading extension then I guess you don't need to build them.

Presumably you got a function that loads the files somewhere else in the code? If not, here's a thing from my babbys first OpenGL demo
>>
>>68823189
that's why i love using irrelevant langs.
>>
Are programming socks only available in pink and white, or are other colours acceptable?
>>
>>68823222
You mean socks for women.
>>
>>68820951
I am working on learning XAML and C# from scratch for Xamarin.

How fucked am I, and when can I into employment?
>>
>>68823196
The names of the files never appear in the code. How else could they be added?
>>
>>68823238
>women
what is that, anon?
>>
>>68823297
Not you no matter what.
>>
>>68823297
What you want to be.
>>
>>68823314
I just wanna learn how to program
>>
Lets say hypothetically speaking I have a 0day for filezilla server v3.39.0 with a working poc and added shellcode for windows?

would it be illegal if I were to try and sell it back to them or to someone else on the internet? Shodan is showing tons of Filezilla servers online right now, how much money do you guys thing this 0day is worth? and if so, could I be held accountable if I were to sell the code to someone else other then Filezilla themselves? Not really in the right position to be selling over 0days and I dont want to get into any trouble. Also not trying to sound like I know more then I do about binary exploitation; I was just fuzzing this new version for fun and found a weak buffer. thanx
>>
>>68823325
#MeToo
>>
>>68823336
do you accept bitcoin?
>>
>>68823360
I dont have a bitcoin wallet. I've never sold any code before. I just currently got a full done putting it all together with py2.7

the actual crash took forever to be able to add shellcode I just pulled from metasploit since the buffer that is actually weak was not big enough to fit it all. its kinda long and I think I can still brush it up abit. im just wondering if I could get into any trouble for selling it. I dont want to email them and have them call the police on me.
>>
>>68823400
Give to us, don't be gay.
>>
>>68823395
>>68823418
Meant for you
>>
>>68823400
>Did you roll your own fuzzer?
no im using peach fuzzer.

>What version of windows?
Windows 7 Ultimate x64. Its running inside a VM

>How did you bypass EMET?
in emetv5.52 you can jump over hooks. without an issue

> Of course it's illegal or a breach of contract, especially in the states.

Im not american. I live in chile.
>>
>>68823410
>They probably won't do that, they might not even take you seriously or just flat out ignore you.

If I can sell it back to them and give them the addr that is vulnerable and prove that the exploit works. You think they be willing to pay me?
>>
>>68823484
>You're fine, pendejo.
thanks johnny.

>TOPKEK. No, they'll just laugh at you, if anything. 0day.today.

pretty sure that website is ran the the police or government in America. Not about to go on that website and get arrested by someone in my country who works for your country.

maybe the real deal? I hear bitcoin is traceable now? any way of getting paid without it being able to be linked back to me?
>>
How is much is too much to allocate onto the stack?
char array[1000][1000] = {};

Overkill?
>>
>>68823559
>How is much is too much to allocate onto the stack?

depends on the operating system.
if your on windows dont go over 1mb
but on linux i believe it is more.

what os anon?
>>
>>68823588
Stack space is compiler-dependent, not OS-dependent. It's even configurable in most compilers.
The default for MSVC is 1MB, and the default for GCC/MinGW is 2MB, if I recall correctly.
>>
>>68823588
>>68823608
Linux, the patricians choice, of course. Anyway, should I dynamically allocate the memory, or let my system automagically do it for me. Not for cross platform work. Asking for a friend.
>>
I unironically like Go
>>
File: 1541538239237.png (74 KB, 450x489)
74 KB
74 KB PNG
>>68823629
>>
>>68823629
wonder how long it's gonna be before they cave and finally add generics.
>>
Do I totally misunderstand how python iterators are supposed to work or something?

from multiprocessing import Pool
from time import sleep
def expensive_func(n):
sleep(n)
return n*n
if __name__=='__main__':
p = Pool(1)
data = range(5)#works as expected
#data = filter(lambda x: x%2==0,range(5))
#exits immediately if line above uncommented
results = p.imap(expensive_func, data)
for a, b in zip(data, results):
print(a, b)


Why does this work as expected when 'data' is a range iterator, but when 'data' is a filtered iterator the loop exits after the first result is printed?
>>
>>68823620
>let my system automagically do it for me

I would go in with this route.
>>
>>68823620
Basically what the other guy said, just don't exceed 1mb and most of the time you should be safe. (The compiler will not automatically decide to dynamically allocate an array that is too large to fit on your stack)

For anything bigger, or even slightly smaller, you should use malloc or whatever memory allocator you use to be safe.
>>
>>68823620
>Linux, the patricians choice, of course.
nice meme.
>>
>>68823650
It's been nearly ten years, I doubt it will ever happen, but who knows with cucks.

>>68823652
>>68823659
Ah, kk, good to know, thanks guys.

>>68823662
>nice meme
nice nice meme meme. Works on my machine.
>>
File: 123.jpg (16 KB, 400x300)
16 KB
16 KB JPG
>>68823684
>nice nice meme meme. Works on my machine.

even though I use debian as my daily it still sometimes makes me cant to rip all my hair out of my head.

eh, as long as remmina stays on my desktop and I can reach my vps im fine i guess. and linux does run good on my computer and its really old and really shitty. (pic related)
>>
File: sc.jpg (1.35 MB, 3840x1080)
1.35 MB
1.35 MB JPG
>>68823724
>debian as my daily
Arch + sway + vim master race. What kind of problems are you having? What IAAS do you use?
>>
>>68823650
They already are adding generics to go 2
>>
>>68823764
oh no, what will /dpt/ shit post about then?
>>
>>68823769
The same as usual. Mental illness, OOP, FP, and C.
>>
>>68823724
as the other anon said, install arch.
i was a long time debian user, but having to compile everything like gentoo because all the packages were 3 years old got tedious.
>>
>>68823753
>What kind of problems are you having?
Its not windows. that's my main problem.
I like reversing 32bit windows binaries and hate having to load them on a vm. it would be nice to be able to buy a new computer that can handle a vm and not swallow all my ram whole.
I was using 7 but decided to switch it since it could not handle kali on a vm. i like being able to use msf shellcode and its also nice to load a single iso and not have to worry about having to download everything for windows.
recently I came across this software called expliot pack. it costs alot of money (no free trial to it cant be cracked yet *sad*) but I was thinking about buying a new computer and then using exploit pack to continue working on that.

>What IAAS do you use?

ovh


Nice desktop anon. mine is just the generic kali 2 gnome 3 fallback desktop and I just use my vps if I need a windows.
>>
>>68823785
>as the other anon said, install arch.

is there an arch version that comes with security oriented tools for binary analysis? its really nice to be able to just install it and not have to fetch any packages onto it once its on my hard drive and just continue working my projects.
>>
>>68823852
theres BlackArch, but that's more for pentesting.
But why are you afraid of a PM?
pacman is simple.
>>
File: aids.jpg (22 KB, 437x75)
22 KB
22 KB JPG
>>68823822
>I like reversing 32bit windows binaries and hate having to load them on a vm. it would be nice to be able to buy a new computer that can handle a vm and not swallow all my ram whole.
Ever heard of wine, my dude? I have a videos series on exactly that topic, he goes over how to set it up. Picture related.

If you like kali, you're going to love Arch. You simply add the black arch repo, and presto, you have access to all tools you need.

>ovh
Parlez-vous français?

>Nice desktop anon. mine is just the generic kali 2 gnome 3 fallback desktop and I just use my vps if I need a windows.
Thanks, bruh. Look in to getting wine.

>>68823852
Yes, but just get vanilla arch first. Don't be discouraged at first. Took me 30 mins my first time, before I realized that I needed to create a efi boot partition.
>>
>>68823852
Trust me, you'll
 sudo pacman -Syu 
a few times a day out of habit. I'm actually going to do that now.
>>
>>68823869
its not that im afraid of it. its just that i've never used it and got really used to just apt-getting everything if I need it. also installing with gdebi is really nice as well. just dl the .deb file and cd into the dir and install it.

also I've never been on a arch based system. never even played around with it. only ubuntu based and debian based and i've also played around with CentOS trying to setup my website a year ago.

it would be cool to get a new desktop and have it work with a windows vm or have a windows desktop and have it run without any lag a kali vm. but with my hardware its one of the other. I either run 7 (cant handle 10 and I dont have a key for 10 and not about to execute random "cracks" and get added to a botnet) or run kali and VNC into my VPS and work from there.
>>
>>68823896
You'll love pacman more than apt. It's also much smarter with handling dependency hell.
And anything not on pacman, you can use the AUR, aurman is nice because it has the same syntax as pacman except no sudo. And any program that only has a .deb or tar.gz, you can just do
pacman -U /path/to/tar.gz
like debian has.
>>
>>68823877
>Ever heard of wine, my dude? I have a videos series on exactly that topic, he goes over how to set it up. Picture related.

I also have took a look at that o'reilly series. its a good book. most of what I have learned since leaving school about binary exploitation has been from either papers I've downloaded in pdf format from exploit-db or the offensive security course I read or the lena151 tutorials when I was learning about cracking (patching really) games for windows.

>Ever heard of wine, my dude?
yeah but on a linux environment its unstable from what I have gathered. thats why most engineers trying to reverse use a vm instead.

>If you like kali, you're going to love Arch. You simply add the black arch repo, and presto, you have access to all tools you need.

BlackArch seems to pretty cool now looking at the website. have those .py files been looked at? theres alot of code there and I'd hate to get backdoored loading a random iso and working on it. (not that, that cant happen on kali) but still. kali is industry. blackarch I dont know.

>Parlez-vous français?

chilean sorry. not french.

>Look in to getting wine.

i theory, if running under root on kali with wine installed malware could execute if wine is present no?

>Took me 30 mins my first time

damn son. it has never taken me that long to set up a linux environment.
>>
>>68823925
let me see if I can dl an iso of arch and load it onto a vm environment I have on a remote desktop. lel I've been using Bugtaq2 (spanish hacking distro) and its comes with generic kiddie backdoors. been using this one called BiFrost since its native and using CVE-2018-0802 to spam it out and seeing if I get lucky.

I have a windows vista machine that is never turns off in canada and im I used the remote desktop to install virtual box. Im going to see if I can download arch, install it on the remote vm environment and then install TeamViewer and play around in it. never used pacman before.

checkout BugTraq2 Black Widow. its a pretty neat iso. Its really old and the guys who maintain it are faggots and dont want to drop a new version, but its by far the best point and click pentest iso I've used outside of kali and backtrack 5.
>>
>>68823964
>BlackArch seems to pretty cool now looking at the website. have those .py files been looked at? theres alot of code there and I'd hate to get backdoored loading a random iso and working on it. (not that, that cant happen on kali) but still. kali is industry. blackarch I dont know.
I use vanilla Arch. Not black arch, you can add the black arch repo. It's a small shell script that adds the black arch keyring, that's it.

>i theory, if running under root on kali with wine installed malware could execute if wine is present no?
>running root
Stop that.

>damn son. it has never taken me that long to set up a linux environment.
kek I was mistaken at first. You have to install arch yourself. I could do it with my eyes closed now.
>>
>>68824074
>kek I was mistaken at first. You have to install arch yourself. I could do it with my eyes closed now.

>I have a windows vista machine that is never turns off in canada and im I used the remote desktop to install virtual box. Im going to see if I can download arch, install it on the remote vm environment and then install TeamViewer and play around in it.

do you also like reversing? i've been looking at exploit pack lately and been thinking about buying it. do you have irc or discord?
>>
>>68824104
>do you also like reversing?
Yes, but I don't have too much knowledge. I have basic skills, that's it.

>do you have irc or discord?
Nah, I only post this here chinese image site.
>>
>>68824129
>Yes, but I don't have too much knowledge. I have basic skills, that's it.

Read the bug hunters diary.
its been my best friend trying to hunt down there buffer overflows.

>chinese image site.
topmeme.
>>
>set up project template in repo on GitHub
>write bash script that fetches each raw text version of each file and echoes the content into a new file
>voilà, ez project generator
Are there any downsides to this /dpt/, I figure there must be something in the way of using GitHub like a static file host
>>
>>68824142
>Read the bug hunters diary.
I have a copy of it on my hard drive. Though reading off my computer and not an out of a book isn't as comfortable. I'll give it another go though.

>topmeme
4channel, best channel.
>>
>>68824153
Is this next level bait?
>>
>>68824163
https://www.amazon.com/Bug-Hunters-Diary-Software-Security/dp/1593273851

its worth the money imo. one of the best books i've read in a long time.
>>
>>68824190
I should probably ask /wdg/ instead since they generate projects all the time
>>
>>68821897
You don't need a cnt increment. Store the original src pointer and once you hit the stop character, subtract dst from the original src. But that's not really going to be much more efficient than this. Try using memcpy instead, which will probably be inlined by the compiler. You can also scan multiple characters at a time.
>>
>>68824222
I do need the count inc. I have a file mmapped into memory, it's a whole thing. Anyway, I have this now.
size_t copy(char *src, char *desc, const char stop)
{
size_t cnt = 0;

char *ptr = strchr(src, stop);
if (ptr)
cnt += (int) (ptr - src);
else
return cnt;

memcpy(desc, src, cnt);

return cnt;
}
>>
>>68824249
I should change that cast.
>>
Here's another stupid question.

How do I limit the number of inputs allowed within a certain timeframe in C++?

Say for example, I am using:

GetAsyncKeyState(VK_RETURN)


How do I limit the number of presses the program will register?
>>
>>68824258
cast it to ptrdiff_t
>>
>>68824273
>ptrdiff_t
I thought you were joking, I didn't a type like existed, but would I cast it as that when cnt is a size_t?
>>
>>68824293
For your code example, using ptrdiff_t or size_t probably wouldn't matter. I mainly suggested ptrdiff_t because that's exactly what you're adding to cnt: the result of a subtraction between two pointers.
>>
File: 123.png (41 KB, 592x391)
41 KB
41 KB PNG
am I retarded or is scale and vertex never defined?

how am I supposed to know what the value of pos2 is??
>>
File: 1490225736569.jpg (107 KB, 726x982)
107 KB
107 KB JPG
Working at the project with my friends atm, I missed some classes and im far behind feel like a brainlet, they are doing pretty much all the programming.
Wat do.
>>
It is Go
=== RUN   TestSearch
--- FAIL: TestSearch (0.00s)
grep_test.go:70: PASS: One file, one match, no flags
...
grep_test.go:67: FAIL: One file, several matches, match entire lines flag
Search for pattern "may"
expected []
actual [].
FAIL

I'm annoyed
expected []
actual []

the extra dot is just formatting from the test suite. it's the same thing, but still fails!
>>
>>68824608
dumb frogposter
>>
Alright. So i have a bunch of small devices (arduino) which make simple get requests to my php server.
What is the best way to ensure that the get reqest is actually coming from one my devices and not some edgelord faggot replaying the get request?
I can't really use any decent encryption since arduino is too shit to handle it.

So far my only solution is an IP whitelist, but will that be enough?
>>
>>68824743
The data doesn't need to be encrypted, i just need to make sure it is really one of my devices.
>>
>>68824722
HELP ME
>>
>>68823651
>Error: You cannot delete a post this old
Wow, I'm a retard and am programming too late.
>>
File: laughing_crows.jpg (68 KB, 900x600)
68 KB
68 KB JPG
>>68824780
>>
>>68824958
Extremely rude and not nice.
>>
File: 1543642105763.jpg (201 KB, 777x897)
201 KB
201 KB JPG
>>68824972
>>
>>68824554
anyone pls
>>
>>68825054
Stop using shit languages.
Problem solved
>>
>>68820951
Im sick of love2d
Recommend me a good csharp game framework that works on windows,linux and android
>>
>>68825060
>help
>stop using this u retard lmfao
typical /g/ troubleshooting, very helpful.

I bet they just don't know, but don't like to show it.
>>
>>68825087
>Cshart
>Gaymes
>Linux
>>
File: 1540332291550.jpg (152 KB, 960x960)
152 KB
152 KB JPG
>>68825102
Fuck off i need to learn a marketable language asap because lua and nim will get me nowhere and i feel like writing a cute game
>>
>>68825119
wtf is up with that deer's hind right leg?
>>
>>68825119
Excuse me, Deering around in public is of outlaws, you will have to come with me sir.
>>
>>68825087
>>68825119
what's wrong with love2D?
MonoGame is the only C# game framework
>>
File: 1493334092282.jpg (93 KB, 570x760)
93 KB
93 KB JPG
>>68825164
11.2 runs like shit on my intel igpu while 10.1 is okay and nobody can really help
>>68825157
You talkin shit?
>>
>>68825189
probably your best bet if you're stuck on a toaster
https://github.com/flibitijibibo/SDL2-CS
>>
>>68825189
how does it run like shit?
>>
>>68825189
legit want to fight a roo once in my life, I don't know why it attracts me so much
>>
>>68825189
If you're worried about performance, you want to do it C with Vulkan.
>>
>>68825223
stop recommending Vulkan, nobody uses it
>>
Learning Java as my third programming language (already learned C and Java). Holy shit this language is fucking ugly and convoluted.
>>
>>68825240
Yes they do. Also, it's quite a nice API, despite how verbose it is.
>>
>>68825296
>learning java
>already learned C and java
>and java
Did you mean javascript? Both java and javascript are fucking ugly and convoluted though so who knows
>>
>>68825313
No I meant Python, sorry.
>>
>>68825209
Try it... i updated my drivers and with the new gl4 context it runs 50% slower at 100% utilization
>>68825223
Yeah but good luck writing C thats portable across the platforms i mentioned
>>68825201
Ill check it out thanks anon
>>
>>68825325
>Yeah but good luck writing C thats portable across the platforms i mentioned
C is an extremely portable language.
>>
>>68825305
Being a hipster about programming and adopting tech just because it's new is universally a bad idea, Vulkan adoption is low at this point, there's no reason not to stick with OpenGL
>>
>>68825325
>good luck writing C thats portable
anon...
>>
>>68825341
>Nobody is allowed to create new technology ever
What an extremely retarded and shitty attitude.
>Vulkan adoption is low at this point
It's higher than you realise, but why the fuck do people expect everything to magically become 100% adopted overnight.
>>
>>68825341
Vulkan is great, albeit much lower level than OpenGL (which isn't a bad thing, imo)
There's nothing wrong with using Vulkan, provided you're prepared to get past the large amount of initial setup code. Actual rendering code with Vulkan tends to be smaller than the equivalent OpenGL too.
>>
>>68825359
well Vulkan gives you an entirely new API to learn for trivial performance gain, perhaps that's the reason adoption is low, it's not like new tech has trouble catching on if it's actually practical
>>
>>68820951
How do I structure pure imperative programming? How do I know if what im doing isnt procedural, and how to structure procedural programming
>>
>>68825395
Write some functions that do some shit.
Have other functions call that those functions.
Done.

Procedural programming is basically the intuitive way to program without imposing a bunch of stupid shit onto yourself.
>>
>>68825395
>How do I know if what im doing isnt procedural
lol what?
>>
>>68825395
literally what's the difference.
If you aren't doing POO or FP, as long as it works, what's the issue?
>>
>>68825429
>>68825414
>>68825408
Im programming C. So far I have a main file which calls the big functions and does initializing. A data file which contains all my static data and now I want to put all my functions in a method file or something?
>>
>>68825395
Don't fall for buzzwords and memes, just write code the way you prefer and enjoy
>>
>>68825459
just do whatever you want
theres no pretentious requirements to write a procedural program
>>
>>68825459
Just structure shit how it makes sense. Being overly structure or using something which doesn't fir how your code actually works just leads to a fucking mess.
>>
>>68825479
Well I have tons of global scope data which has worked fine so far. Should I make use of forward declarations in the method file so I can define it and include in any order as header files? I.e. forward declare global data or something, and all the functions
>>
>>68825500
I seriously hope that global data is immutable.
Also again, I'm not going to prescribe how to structure your program. Just do what you want to, and if it doesn't work, just change it.
>>
>>68825507
Most of its const, but not all of it. Some of the data has to change during runtime.
>>
Caring about portable C is a meme. How often do you port code between different compilers? Even changing the build system is a nightmare.

If implementation defined behaviour is useful, use it. Hide it behind a macro if you must, but don't cripple yourself.
>>
File: 1527059834571.jpg (146 KB, 800x600)
146 KB
146 KB JPG
>he refers to himself as a <language> programmer
>>
>MIT OCW Intro to CS and Programming with Python
>Harvard's CS50
which is the best?
>>
>>68825535
>tfw can compile for wangblows from GNUL with a simple compiler switch
>>
I really want to learn programming but I do not know a single thing. Please, I really want to learn it. Help pls.
>>
>>68825582
Print("Hello world")
>>
>>68825582
what do you want to make lad?
>>
I want to make a webapp for fun, but using all the devops AWS garbage.

I have some CFN templates and pipelines that set up a VPC with public and private subnets, a cache cluster, an ECS cluster, and I'm building my rust web API in a docker container.

But I dunno what webapp I want to build now.
>>
>>68824855
>>68823651

top lul
>>
>>68825240
And how do you expect people to use it if nobody recommends it?
>>
>>68825897
me on the right
>>
>>68820974
I wouldn't want that
>>
>>68825296
Why are you learning Java? It's one of the worst languages and only code monkeys use it.
>>
>>68820974
What the fuck?
>>
File: 1543016946969.jpg (76 KB, 500x496)
76 KB
76 KB JPG
Stop talking about non-programming topics
>>
>>68826025
And install F* and write verified programs.
>>
>>68826028
FUCKING BASED AND REDPILLED

>>68826042
>F*
What this?
>>
>>68826053
>What this?
A research language for writing security-verified programs.
https://www.fstar-lang.org/tutorial/
>>
>>68826068
>https://www.fstar-lang.org/tutorial/
Looks gay.
>>
>>68826081
>dumb frogposter is a brainlet who has shit taste
how shocking
>>
File: 1544127697998.jpg (34 KB, 551x511)
34 KB
34 KB JPG
Does anyone know of a way to make vim execute
script on write command based on the first line of a given file. For example, if created and am editing a file, and the first line is
#!/usr/bin/env
, how can I get vim to chmod +x the file on write?

>>68826096
Nobody wants to use that autistic shit.
>>
>posts anime
>on frog website
>doesnt kill self

???
>>
>>68826042
does F* support something like separation logic?
>>68826266
people who use frog websites should kill themselves desu
>>
>>68826309
F* supports salty autists.
>>
File: 1534853898382.png (536 KB, 1280x867)
536 KB
536 KB PNG
how do I make a REST api for my very useful CRUD application in F*
>>
>>68826396
By sucking dick
>>
>>68826396
>>>/g/wdg/
You don't, stupid animefag.
>>
>>68826309
nope, but it has plenty more.
Like a C subset DSL for verified low-level stuff
https://arxiv.org/pdf/1703.00053.pdf
>>
how come reading wikipedia I see 10,000 references to smalltalk, but I never see it referenced anywhere else?
>>
>>68825591
I want to discover and understand the basics of programming and maybe later use it with language-related business.
>>
>>68826682
smalltalk is an iconic lang, but it's fallen out of favor because ironically, it's the "wrong" kind of OOP. Look into Pharo if you want to mess around with actual OOP, and not java POO.
>>
>>68826716
>actual OOP, and not java POO.
Clever, girl.
>>
>>68826727
was that literally your first time reading OOP backwards? also there's no comma in that line.
>>
>>68826747
Lol yup, and true. I'm sleep deprived right now, excuse my erroneous grammar.
>>
>>68826760
fucking hell, you dumb redditors need to fuck off.
>>
Trying to read some input from a string containing 5 numbers separated by various amounts of various characters. However when I run my code I get an InputMismatchException telling me that nextInt is not an int. Do I need to add something to the regex to make it accept more than one char as a delimiter?

// Java
Scanner scanner = new Scanner(input).useDelimiter("[^0-9]");
i1 = scanner.nextInt();
i2 = scanner.nextInt();
//...
>>
>>68826868
Shot in the dark here, but why not "^[0-9]" ?
>>
>>68826900
>>68826868
^ outside of brackets does not mean the same as ^ inside. Inside it negates, outside it does some other shit. However [^0-9]* should do the job.
>>
>>68820974
Just make it with closed answers.
>>
So I have been trying to learn programming with the book C# Player's guide v3 and there's a problem where you need to reverse an array of 10 numbers.

The author did it like this but I find it difficult to understand
http://starboundsoftware.com/books/c-sharp/try-it-out/reversing-an-array


static void Reverse(int[] numbers)
{
// Initialize one index at the start of the array, and another
// at the end of the array. The index of the last item in the
// array is the length of the array - 1.
int firstIndex = 0;
int secondIndex = numbers.Length - 1;

while (firstIndex < secondIndex)
{
// To swap two numbers, we need to copy one value out
// to a safe place so that it doesn't get overwritten.
int temp = numbers[firstIndex];
numbers[firstIndex] = numbers[secondIndex];
numbers[secondIndex] = temp;

// Move on to the next pair.
firstIndex++;
secondIndex--;
}
}


I did it like this
static int[] Reverse(int[] numbers)
{

for (int index = 0; index < 10; index++)
{
int a = index + 1;
int b = numbers.Length- index;

numbers[index] = b;
numbers[9 - index] = a;
}

return numbers;
}


output for both is correct = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1

Yes I am a brainlet but my question is: should I try to understand the authors solution? Do people use the way he does it often?
>>
I'm working with an STM32 and want to use a timer interrupt. My goal is to have function that starts the timer for n milli- or microseconds (n is a parameter) and then executes another function on the interrupt. Then the timer should stop.

Is it a bad idea to keep enabling and disabling the timer (using TIM_Cmd) to accomplish this?
>>
>>68827387
Does C# really not have a .reverse / .retro function?
>>
>>68826682
Wikipedia editors tend to be snivelling nerds with a ridiculous bias that they'll edit in whenever the guise of neutrality can be maintained
So if someone likes Smalltalk then they'll go and write references to Smalltalk whenever possible and it won't be deleted because they're still technically factual
They do it with Haskell too
>>
>>68827418
>NPOV is broken
No fuck off. Smalltalk has been a very influential language. Same with algol 68.
>>
>>68827444
>>NPOV is broken
You can see it broken all over the place when you know where to look. Humans aren't the perfect system. It's especially easy when you're editing in information on a subject barely anyone knows anything about so they can't correct you
>>
>>68827387
the authors way is really weird
the way you did it is basically the way he did it if you change the 10 in the for loop to "numbers.Length - 1" both pieces of code become functionally identical.
>>
>>68827461
>You can see it broken all over the place when you know where to look.
Of course "if you know where to look". Just go to the most recent new articles and you'll find them filled with it. But "npov is broken" implies the system is broken. Which was what you implied.
>Wikipedia editors tend to be snivelling nerds with a ridiculous bias that they'll edit in whenever the guise of neutrality can be maintained
I disagree. The rules are well defined and adhered to quite strictly. You'll see it's one of the most common complaints and the article exposure with rampant NPOV complaints tend to be incredibly low with regards to total site traffic.
>It's especially easy when you're editing in information on a subject barely anyone knows anything about so they can't correct you
So you're saying you can just say whatever without sources?
[citation needed]
Nobody should listen to cases like the above.
>>
>>68827404
It does, the List<T> type has a .Reverse() method, and the System.Linq namespace offers a Reverse() extension method for enumerable types.
>>
>>68827511
>So you're saying you can just say whatever without sources?
You can say whatever you want about an obscure subject and link a dubious source that won't be corrected because most people looking don't know enough about the topic
I didn't say it was a broken system, it's as good a system as humans can come up with, but humans have biases
you sound like a butthurt Wikipedia editor
>>
>>68827531
>you sound like a butthurt Wikipedia editor
You sound like someone who couldn't be a wikipedia editor.
>You can say whatever you want about an obscure subject and link a dubious source that won't be corrected because most people looking don't know enough about the topic
So you're doing vandalism regularly and have found this to be true?
>I didn't say it was a broken system
You said
>Wikipedia editors tend to be snivelling nerds with a ridiculous bias that they'll edit in whenever the guise of neutrality can be maintained
Implying that MOST editors are intentionally breaking NPOV all the time. Yet you don't even seem to have any experience with wikipedia editors.
Saying "but humans have biases" implies there's some elements of the system that aren't perfect, which is fine. What you said before was that the site is rampant with corruption (NPOV) essentially. Which would imply it's broken.

I'm sure if your self projection onto wikipedia editors were accurate they would be scum of the earth. But I don't think that's accurate.
>>
>>68827387
Are you sure your method actually works, say, if the input array isn't 1, 2, 3, 4, 5, 6, 7, 8, 9, 10? You're overwriting array contents with a and b, which are both indices. It only appears to work because you're using the special case array where a[i] == i. The author's version on the other hand is actually correct, but yours can be fixed too.
>>
>>68827590
yeah mine doesn't work if it's more than 10 numbers but I rewrote it now.

 static int[] Reverse(int[] numbers)
{

for (int index = 0; index < numbers.Length; index++)
{
int a = index + 1;
int b = numbers.Length - index;

numbers[index] = b;
numbers[numbers.Length - 1 - index] = a;

}

return numbers;
}
>>
>>68827588
>So you're doing vandalism regularly and have found this to be true?
I've never edited Wikipedia or had the desire to, I've just seen it
>Saying "but humans have biases" implies there's some elements of the system that aren't perfect
No it implies humans aren't perfect you fucking autist
So far you're ticking all the "snivelling nerd" boxes so you're not setting a good example
>>
>>68827620
now make it generic.
>>
>>68827387
>>68827387
>should I try to understand the authors solution?
Yes.

>Do people use the way he does it often?
It doesn't matter. You should be able to read and understand other people's code, especially when it's that trivial.

>output for both is correct = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Your solution is nonsensical, and work purely by coincidence.
>>
>>68827620
You should start looking for a new hobby...
>>
If you can't do division in SQL you don't know SQL, and you shouldn't pretend that you do.
>>
>>68827801
I use a wrapper for postgres so i never have to touch it directly. DB shit is one of the few programming-related things i have zero interest in.
>>
Floating point fuckery is tripping me up. Anyone see why the value diff would become NaN?
    
double oldval = centroids[i];
double newval = ncentroids[i];

ncentroids[i] = 0;
centroids[i] = newval;

float t = (oldval - newval);
t = t * t; // (this makes sure the difference is positive, so no need to worry about that)
atomicAdd(diff, t);
>>
>>68827853
>DB shit is one of the few programming-related things i have zero interest in.
Databases aren't very interesting, but I think they get an unnecessary amount of hate just because people don't take them seriously, so they don't learn them properly, and as such just find them a mess.

It's not *that* hard, but it's also not something that you can just learn in an afternoon when you want to get on with your project. Better to spend a few evenings just learning properly.
>>
>>68827863
check your inputs
any float operation with NaN as an input also results in a NaN
>>
>>68827620
That's not the only problem. You're not reversing the array, you are overwriting it. At no point does your code actually read the values in the original array, you straight-up overwrite them with the values you calculate in a and b.

What does your code output for the input 1 2 3 1 2 3 1 2 3 1 2 3? It most certainly won't be the reverse of that array.
>>
>>68827863
>Anyone see why the value diff would become NaN?
Probably because some elements of your array are garbage.
>>
>>68827876
>you can just learn in an afternoon
Elixir and ecto made it pretty easy, then again, they handle 90% of the work for you. Can't imagine actually do that shit raw.
>>
>>68827883

Thanks for the explanation I actually get it now, I'll try doing it again.
>>
>>68827912
Hey it's interesting that you use Elixir and Ecto, I will encounter Elixir at uni very soon.

What editor do you use for Elixir, and what do you think of it?
>>
>>68827863
>
// (this makes sure the difference is positive, so no need to worry about that)

Use fabs().
>>
>>68827926
VS Code & Vim, both linters and plugins are good.
As for the language, it's a mixed bag of mostly good, some bad.
+best dynamic lang by far with an emphasis on FP
+Phoenix, their poster-child web framework is really nice
+Ecto is a dream for handling DB shit for you
+Erlang interop is great as you'd expect, and i've never once thought about performance issues because of it
+mix (it's package manager / build system) is great
-Syntax is kind of nasty at times, especially with phoenix's embedded HTML DSL, compared to D's Diet Templates or Elm
-Error messages can be sort of cryptic to the point of having to re-compile just to get the actual issue
And that's my ~4 months or so with it so far, so like I said, mostly good. Haven't don't much non web-shit with it though. But elixirC was pretty straight forward when i messed with it briefly.
>>
>>68828001
>embedded HTML DSL,
disregard that, it's just a macro, was mixing thoughts with D.
>>
>>68828001
Sounds promising. I've been looking out for a web framework that I'd actually enjoy using and I think phoenix might be it, when I get that far.
>>
>>68826959
That worked, thanks! However I don't manage to capture numbers higher than 9, how do I scan a multi char int like 666?
>>
>>68820951
How do I do 8.8 fixed point arithmetic in C?

Let's say I have byte x representing position,
and byte dx representing subposition.

Do I just increment dx until it overflows then add 1 to x?
What if I want to go the other way? (decrement dx and subtract from x?)
>>
>>68828099
ieee 754
>>
>>68828108
why are you giving me a standard for floating point numbers when I ask for fixed point arithmetic?
>>
>>68828099
>How do I do 8.8 fixed point arithmetic in C?
just use normal ints
>>
>>68827878
>>68827902
Figured it out. Wasn't because of an error in that code or in the code to calculate the values of the inputs, it was because I was just not accessing all parts of the input array, leaving those values uninitialized.

>>68827940
I've actually gotta square them though. The comment was more because in a drunken haze I'd gotten confused and needed reassurance squared numbers were always positive.
>>
>>68828091
I tried
            Scanner scanner = new Scanner(input).useDelimiter("[^0-9]*");
scanner.next();
i1 = Integer.parseInt(scanner.next("[0-9]*"));

but if the scanned string is asdf123asdf456asdf it return 1 as the first int, 2 as the second and so on.
>>
>>68828077
You can also incorporate Elm with it, as I have, for front-end, it's pretty nice. But I'd say just use Phoenix by itself for a bit to get a feel for it. As for Elm you have to use phoenix-channels for pubsub stuff. And there's some kind of bug on the mix side & using webpack to compile elm which fails on certain packages like Phoenix-Channels, so I had to manually clone and add it to my src folder.
>>
>>68828157
>You can also incorporate Elm with it
Exactly what I was thinking.
>>
int64 dotproduct (int32 *x, int32 *y, int32 N)
{
int32 xx, yy, k;
int64 sum = 0;
for(k = 0; k < N; k++)
{
xx = *x++;
yy = *y++;
}
return sum;
}


What does xx = *x++; and yy = *y++; do?
>>
>>68828271
It's the same as these.
xx = *x; x += 1;

yy = *y; y += 1;
>>
>>68828271
Increments that value of what x points to and sets xx to the result
>>
I'm graduating in a week with a degree in MIS and 2 years of experience interning at a helpdesk (+some database shit, but noone gives a fuck) and no job offers. Is there anything I can do in the 3 week window around christmas to make myself attractive to employers, or do I just need to go wage slave at a help desk for another few years before moving onto a better job?
>>
>>68827876
>so they don't learn them properly
Very true. I know a guy who kept using folders and txt files in addition to his DB for keeping some metadata. Turns out it was slow as well, tons of directory listings going on.
>>
>>68828271
It extracts the current values pointed to by x and y and moves the pointers forward.
>>
>>68827876
Where should I learn mysql from?
>>
File: 1534925792092.jpg (44 KB, 420x440)
44 KB
44 KB JPG
I'm doing data analysis assignment for a third day in row, several hours a day. My wage better be in 6000€/month range when all is said and degree done.
>>
>>68828271
Wait, won't this return 0?
>>
>>68821897
>not mmap'ing the file into memory and letting the OS page up data as required
>>
>>68828589
How much is 6000 rupees in human money?
>>
>>68822895
>Are functions case sensitive in assembly?
they fucking better be
>>
>>68828641
6832 burger coins/ month
>>
>>68823274
it might not have the exact names.
they could just be scanning a directory for all entries ending with .c
>>
>>68828640
That's what I did, retard, but I don't want to modify the file. Also, I scraped that function, Picky Priscilla.
>>
>>68828653
Hmmm, burgers
>>
>>68828589
nobody cares
>>
>>68826118
you want your fucking editor to automatically make files you edit executable whenever they happen to start with a shebang? because you're too fucking lazy to chmod +x a file?
>>
>>68828629
yes it will
and those intermediate xx and yy variables are unnecessary anyways
all it really needs is
sum += (*x++) * (*y++)
>>
>>68828722
>Are you too fucking lazy to do x? Y is the bane of of civilization
stfu, retard. Why do you even use a computer? You only need cuneiform, reeds, and clay tablets, worthless pussy faggot.
>>
>>68828559
I don't really know of a good source, I learned it in school. Probably a book or just a website? Surely there must be plenty of good content out there.
>>
>get invited to job interview
>know that there might be tricky questions, so memorize the code for fizzbuzz
>time of the interview comes
>everything is going smoothly, I hit all the diversity quotas, get along with the HR well
By the way have you ever heard of the Pish-Posh test?
>start sweating profusely
N-no
>hands me a laminated paper with the task on it
>Make the program print out every whole number between 1 and 100, but make it print Pish if it ends with a 3, Posh if it ends with a 5 and Pish posh if it's 35 instead
>only studied for fizzbuzz so my knowledge is worthless
>apologise and ask if I can just send them the solution via email
>they say yes
>forget to send the email

I almost didn't get the job, sheesh
>>
What's the idea behind "constexpr should not be virtual"?
If it's doesn't make sense since virtual is runtime operation, then why they remove it in C++20?
>>
>>68828678
if you mmap'd it, the line is already in memory ( or will be whenever you bother accessing information in the mapped memory region). if you mmap'd the file with PROT_READ and not PROT_WRITE so you can't fuck it up like an asshole, you're already done.
>>
>>68828768
>fell for the vim meme
>doesn't into emacs
>is mad because extending his editor is hard
didn't realize I was in a ylyl thread
>>
File: projection.jpg (10 KB, 400x272)
10 KB
10 KB JPG
>>68828776
>I'm a beginner
I know what I'm doing.
>>
>>68828804
if you weren't worthless you wouldn't have be begging on 4th channel
>>
File: mtgp.jpg (417 KB, 1600x1064)
417 KB
417 KB JPG
>>68828796
I hope you didn't strain yourself with that pitiful display of mental gymnastics.
>>
>>68828812
>asking for advice
>begging
Okay, retard, thanks for your useless input. I bet your parents are proud.
>>
>>68828417
>using folders and txt files in addition to his DB for keeping some metadata
How does that even work, wut
>>
File: 1536410196291.png (35 KB, 264x274)
35 KB
35 KB PNG
Review my trivial disjoint sets.
https://gitlab.com/9898287/algods/blob/master/source/dsets.d
>>
>>68820951
Any dutch stonerbros here know if there's a way to get info from all coffeeshops in the country? With info I mean at least the name and address. Coordinates would be a nice plus.
>>
>>68828872
That's an odd facial hair style choice for an npc.
>>
>>68828826
it wouldn't be so bad if the fucking string.h didn't spoonfeed you everything you needed to know
#include <stdio.h>
#include <string.h>

char * target = "hello retard";

int main(){
size_t badtouch = strcspn( target, " " );
printf( "durrrr : %d\n", (int)badtouch );
char buffer[ 1024 ] ;
memcpy( buffer, target, badtouch );
buffer[ badtouch ] = 0;
printf( "hurrrr : %s\n", buffer );
}

there. go turn in something you took no effort to learn and be shit forever
>>68828826
is this you too?
>retard, retard, retard
if you're going to be an insulting beggar that doesn't know how to modify their programming environment, at least be amusing when you go to insult someone
>>
>>68828872
>what exactly is the difference between a hash-set and table?
>>
>>68828887
Kaaskop here but not a stoner. You could try to query Google Maps for coffeeshops.
>>
>>68828964
I finished my function, it's already polished. DELET that disgusting shit.

Pussy, cunt faggot with bad taste and style. Go back to lelddit.
>>
>>68828859
He just had the txt files stored with the same names as the relevant data. And then he parsed it out.

So the code would want the metadata and the process that gets it just takes the relevant file path, removes the extension, appends ".txt", loads and parses the txt file and gives back the metadata in a dictionary.
I don't understand why it was made this way it was tacked on after the DB was involved I'm told.
>>
>>68828977
Hash tables are dictionaries
https://nim-lang.org/docs/tables.html
Hash sets are sets
https://nim-lang.org/docs/manual.html#types-set-type
>>
>>68829008
better, but if you're going to use the reddit meme, don't do it while violating the reddit spacing meme
6/10
>>
>>68828894
>That's an odd facial hair style choice for an npc.

if( person instanceof Jew ) {
System.out.println( simpleBalancedParanthesis() );
}
>>
>>68829031
>too stupid understand the reason for spacing
>le lelddit space maymay XD
Neck yourself, waterhead.
>>
>>68829025
ah so associative arrays and a List(?)
>>
>>68820974
Theoretically yeah. When I was a TA in high school I would just look for keywords in answers and mark them based on that, but otherwise it's a terrible idea unless you want to do a second round of grading after the preliminary grading.
>>
>>68829031
>>68829060
Guys please remain civilized
>>
>>68829060
better again. you should just wait until you're actually mad to insult people. your insults improve nicely.
>>
>>68829071
Yes.
>>
>>68829077
>your insults improve nicely
That's funny you say that, your mother tells me the same about my thrusts.
>>
>>68820974
What if the answer is correct, but doesn't use correct terminology?
>>
File: 1530228569426.png (20 KB, 105x143)
20 KB
20 KB PNG
>start studying VBA
>spend 5 hours trying to use an autistic combination of Left and Mid to find patterns it text
>it finally works
>mfw finding out Like exists 5 minutes later
>>
>>68820974
Now you know why American profs ask multiple choice questions
>>
>>68829153
>start studying VBA
Could have just said this with your picture
>>
>>68829204
But I need this at work. Half the shit here is written in that
>>
>>68829221
Stop working
>>
Will the compiler optimize the sqrt() command to not run it each time the comparison is made ?
Language is C btw.
bool is_prime(unsigned n)
{
for (unsigned d = 2; d <= sqrt((float) n); d++) {
if (n % d == 0)
return false;
}
return true;
}
>>
>>68829239
>Will the compiler
Why are you asking us? If you don't think it will, don't do it, or test it and find out.
>>
>>68829239
/g/ is not your personal compiler.
>>
>>68829239
Might as well just save it to a variable
>>
>>68829239
>Will the compiler optimize the sqrt() command to not run it each time the comparison is made ?
If sqrt() is marked pure, yes.
>>
>>68829261
Well yeah, compilers know how computers work
>>
>>68828653
Good luck getting half that, this is a meme degree
>>
>>68829273
Jokes on you I'm gonna be a SAP developer
>>
>>68829287
Please delete this before my mom sees it, thank you
>>
>>68829297
the pun compelled me to speak it
>>
>>68829317
thank you but my mom saw it anyway and dabbed on me
>>
File: 1482929854428.png (121 KB, 483x359)
121 KB
121 KB PNG
>>68829329
rip
please find attached a picture of a crying anime girl
i hope this alleviates your burden
>>
>>68829001
Maps API is the jewiest shit ever. The JS API only gives you 1 request to show a map and then you have to pay. Also not every shop has the type "cannabis winkel". Some just say bar.
>>
>>68829239
>>68829253
>>68829261
>>68829262
>>68829267
>>68829271
I tested it with the time command and performance was better when i was computing sqrt() before the loop with another variable.
>>
>>68829369
(Using GNU GCC with default settings)
>>
>>68829239
Retard, just do d*d <= n
>>
>>68829368
>Maps API is the jewiest shit
It's Google.
What about scraping: http://www.allewietshops.nl/ (first page on Google)
>>
>>68829387
I also just checked and yes multiplication is faster than sqrt.
>>
>>68829398
Never tried it before but I guess it's an option.
>>
>>68829381
Might as well be using -O0 then.
>>
File: Capture.jpg (167 KB, 893x768)
167 KB
167 KB JPG
>>68829398
>>68829425
I might be able to work with this.
>>
File: 1543013753337.jpg (52 KB, 888x568)
52 KB
52 KB JPG
C brainlet here, I have about 1200 32-bit ints to sort; what are some quick, easy, and go to go sorts? No bully pls.
>>
>>68829663
is that miru?
>>
>>68829674
idk
>>
>>68829635
>>68829663
Wow, your bot AI is spot on
>>
>>68829239
https://godbolt.org/z/aORMCa
Did you mean this?
Take a guess at which is better.

Both gcc and clang call sqrtf in a loop for your code at O2 but it wouldn't when you pull it out from the loop test.
gcc is less obvious about it from the asm (4 jumps deep between the calls, i question how this is efficient but gcc probably knows much better than me).

The situation changes when the sqrt function body is known to the compiler most likely.
>>
>>68829663
man 3 qsort
>>
>>68829663
Radix sort
>>
>>68829687
lolwut
>>
>>68829663
It's a trivial amount of data. Any sort that isn't bongo sort or the like.
qsort.
>>
>>68829663
1200 isn't a lot. Just use the standard library qsort.
>>
File: wtf.png (11 KB, 400x400)
11 KB
11 KB PNG
Java is such a shitty, inelegant language. Is this the language of the code monkeys?
>>
>>68829979
>>68829979
>>68829979
New



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.