Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 1.95 MB, 1618x1308, hidamari_dpt_waifu2x_traps.png [View same] [iqdb] [saucenao] [google] [report]
62636264 No.62636264 [Reply] [Original] [archived.moe] [rbt]

Old thread: >>62630793

What are you working on, /g/?

>> No.62636277

first for javascript

>> No.62636278

>>62636264
daily reminder that trap is gay and managed language is the future.

>> No.62636281

>>62636278
It's okay I'm gay too

>> No.62636285

>>62636278
no u

>> No.62636329
File: 10 KB, 849x127, 2017-09-26--1506497960_849x127_scrot.png [View same] [iqdb] [saucenao] [google] [report]
62636329

wow despite the incredible power of inheritance and polymorphism im still not allowed to have any data thats not GLIBOBJECTS and c++ types in my freaking icon buttons so theres no way to do anything without using B*LLSHIT

>> No.62636335

EVERYTYPE OF DATA HAS TO BE A VIEWABLE TYPE FOR A TREE VIEW YOU CANT PUT DATA IN THE TREE VIEW MEMBERS EXCEPT FOR JUST HIDING A TREE VIEW COLUMN AND PRETENDING ITS A ACTUAL DATA AAAA

>> No.62636410
File: 34 KB, 630x380, 22008316.jpg [View same] [iqdb] [saucenao] [google] [report]
62636410

>>62636278
Say that to my face nigger

>> No.62636598

>>62636278
managed meaning bytecode or just GCd?

>> No.62636628
File: 62 KB, 1186x362, 2017-09-26--1506501234_1186x362_scrot.png [View same] [iqdb] [saucenao] [google] [report]
62636628

HAHAHAHAHAAH

>> No.62636641

>>62636628
lulululululul

>> No.62636646

>>62636628
owo wats dis?

>> No.62636755
File: 290 KB, 276x475, 1502332026149.gif [View same] [iqdb] [saucenao] [google] [report]
62636755

I wanna do all my vector math on the GPU, what's stopping me from doing all my model view matrix calculations in the vertex shader?
I don't want to switch to c++ just to use glm.

>> No.62636787

>>62636755
>what's stopping me from doing all my model view matrix calculations in the vertex shader
Nothing, but it's extremely wasteful, as you'll be calculating the same shit over and over for each vertex.

>> No.62636837

>>62636264
Making a game engine. It's getting pretty scary, and I'm trying to keep it to the minimal.

https://pastebin.com/rVNyPB4b

>> No.62636852

>>62636755
>I don't want to switch to c++ just to use glm
Just use linmath, or kazmath, or make your own shit. For 2D stuff you only need 8 functions or so.

void *dgMatIdentity(DgMat4 m); // builds identity matrix
void *dgMatScale(DgMat4 m, float x, float y, float z); // builds scale matrix
void *dgMatTranslate(DgMat4 m, float x, float y, float z); // builds translation matrix
void *dgMatRotateX(DgMat4 m, float angle); // builds X rotation matrix
void *dgMatRotateY(DgMat4 m, float angle); // builds Y rotation matrix
void *dgMatRotateZ(DgMat4 m, float angle); // builds Z rotation matrix
void *dgMatCopy(DgMat4 dst, const DgMat4 src); // copies source matrix to destination matrix
void *dgMatApply(DgMat4 dst, const DgMat4 effect, const DgMat4 src); // applies effect matrix to source matrix

>> No.62636863

>>62636837
>DG_AUDIO_FORMAT_PCM_F32_LE
But why? 16-bit PCM is all you need, unless you're mixing shit.

>> No.62636870

>>62636837
>https://pastebin.com/rVNyPB4b
What libraries are you working off from?

>> No.62636875

>>62636863
>unless you're mixing shit
How can you not mix shit? Are you literally playing one sound at a time? What about music?

>> No.62636876

>>62636787
What if I have a separate program with a frag shader that stores the calculation results in the framebuffer object only once as packed pixel data which I read back into numeric arrays?

>> No.62636887

>>62636875
the human ear can't hear more than 16 bits

>> No.62636897

>>62636870
Everything audio is libsoundio
https://github.com/andrewrk/libsoundio
Graphics is OpenGL ES 2.0
Windowing and events are GLFW3
Threads are tinycthread
GUI will be (for now not implemented) a Nuklear wrapper.

I dropped linmath when I thought it was causing a bug but it turns it wasn't, oh well, one less dependency.

>> No.62636904

>>62636887
so 2 bytes? and 16 bit per second or milisecond?

>> No.62636909
File: 174 KB, 500x500, PLEASE_DO_NOT.png [View same] [iqdb] [saucenao] [google] [report]
62636909

>>62636876

>> No.62636929

>>62636875
A comment notes that this is how it was stored on the disk. There is no reason to store music that way.
Floating point is useful in mixing because it doesn't clip if you mix two large samples together (but you still need to normalise it).

>>62636887
As stupid as this comment is supposed to sound, you really don't need more dynamic range than 16 bits gives you.

>> No.62636940

>>62636904
Sample is either any integer or a float/double
Frame is most of the time 2 samples (stereo)
Framerate is 22050/44010 per second

>>62636929
>There is no reason to store music that way.
Well, if you store the same way you process it, there's no need to convert it. And I am veeeeeeeeery lazy.

>> No.62636957

>>62636876
OpenGL has compute shaders, you know.
But really, you'll be wasting more time uploading data to the GPU than you would save.

>> No.62636968

>>62636897
that looks like a pain to work with. why not use SDL?

>> No.62636979

>>62636897
>Graphics is OpenGL ES 2.0
Is there some reason you're limiting yourself to this?
I'm using GLES2 for a wayland compositor, and it's pretty annoying how much shit is missing.

>> No.62637008
File: 20 KB, 543x600, 1504944161003.gif [View same] [iqdb] [saucenao] [google] [report]
62637008

>program with C++ one time
>diagnosed with AIDS

>> No.62637015

>>62636940
>And I am veeeeeeeeery lazy
Yeah, it sure is a difficult function to write.
void f32_to_i16(size_t n, float *f32, int16_t *i16)
{
for (size_t i = 0; i < n; ++i) {
i16[i] = f32[i] * INT16_MAX;
}
}

>> No.62637026

>>62636979
not him but it's still pretty common on mobile. webgl is similar to it too.
>it's pretty annoying how much shit is missing
like what?

>> No.62637032

>>62637008
That's what happens when you sleep around

>> No.62637036

>>62637015
I just realised I wrote that function going in the wrong direction.
It's still trivial, though.
void i16_to_f32(size_t n, int16_t *i16, float *f32)
{
for (size_t i = 0; i < n; ++i) {
f32[i] = (float)i16[i] / INT16_MAX;
}
}

>> No.62637047

>>62636979
>Is there some reason you're limiting yourself to this?
I'm a brainlet. When there's a smaller API there's a smaller chance you will do something in a different way than it should have been done if it was coded by an experienced professional. Also, a little bit more portability (iOS, Android, wasm), a little bit easier learning curve for anybody who would be interested in joining me in this little project, a little easier to implement some wrappers / software fallback if there's no OpenGL there (xbox?, wasm) and other perks for using a tinier library. Oh, and there's also GLESv3 when you want to upgrade.

>>62636968
Laugh all you want, but I want to make an alternative to all other modern game engines out there, because they're ALL written in C++/C#. I myself can fathom the complexity of C++ because as I've already said, I'm a brainlet.

>>62637015
It's not that it's so hard, it's just that there are so many more much more important things I have to do before this engine becomes even remotely usable. If it ain't broken, don't fix it. Format support is non-critical.

>> No.62637060 [DELETED] 

Hamburgers or tacos?

>> No.62637065 [DELETED] 

>>62637060
yes

>> No.62637069 [DELETED] 

>>62637060
Sissy cum

>> No.62637070 [DELETED] 

>>62637060
Hamburgers. Tacos are too hard, they hurt my mouth.

>> No.62637073 [DELETED] 

>>62637060
I have never eaten a taco in my entire life. Hamburgers I guess.

>> No.62637084

>>62637026
>like what?
Standard GLES2 doesn't even have geometry shaders or VAOs.
I also remember it missing a lot of little convenience functions (like glOrtho).
I ended up pulling in a crapload of extensions, because all I'm targeting was GNU/Linux with Mesa.

>> No.62637099 [DELETED] 

>>62637060
tacos are really bad
burritos though is like eating pure human food, its warm gooey protein goodness just the perfect food

>> No.62637104 [DELETED] 

>>62637060
i hate hard shell tacos. hamburgers are tastier when freshly cooked. burritos are comfy to just pull out of the fridge for a quick meal.

>> No.62637107 [DELETED] 

>>62637070
What are soft tacos

>> No.62637113 [DELETED] 

>>62637070
Brush your damn teeth, nigger

>> No.62637116

>>62637084
the fuck you need geometry shaders for a wayland compositor
glOrtho is deprecated as fuck

>> No.62637131

Im using c++ with windows form. One thing I cant seem to figure out is how to get access to a controls children.
Anyone know how to do this.

>> No.62637138

>>62637131
Jesus christ, take your pedo shit to /b/

>> No.62637144

fuckkk this how do i sue gnime for lost tieme

>> No.62637146

>>62637116
Actually, we don't use geometry shaders, but I just remember it being interesting that they were missing.
>glOrtho is deprecated as fuck
Yes, I know. At the time, it forced us to use trivial shaders, but now what we're doing is ever-so-slightly more advanced, so glOrtho wouldn't have worked.

>> No.62637170

I miss !WiNdowsNME - I always wonder if he ever finished that tribes rpg.

>> No.62637208

>>62637047
SDL is a framework library, not an engine. It's written in C and works perfectly fine with an app written in C.
Unless you have a specific need for more development freedom you should look into it, it might make things easier for you. SDL. SDL doesn't restrict you much anyways.

You can use SDL to build your enigne.

To make sure, you're just building a custom engine for spefici game(s), or is this for a unity/unreal competitor?

>> No.62637232
File: 383 KB, 680x875, 1501697260800.png [View same] [iqdb] [saucenao] [google] [report]
62637232

>/dpt/ told me that C++ is shit
>go in for job interview
>they ask me about my experience with C++
>I tell them that it's a Pajeet-tier language for niggers
>they ask me to leave the building

>> No.62637248

>>62637232
>talking about meme in real life
> in real life
you deserve it anon

>> No.62637261

>>62637208
No, as I've said, I want to make an alternative to all C++/C# engines out there. There's Corange, but it seems to have been abandoned.
I want to make as simple as I can. I don't want to bring huge dependencies that I will barely utilize.
I'm writing a game at the same time too, as a proof-of-concept for my engine.

>> No.62637275

>>62637138
Is there something wrong with what I said?

>> No.62637289
File: 174 KB, 416x396, kHruzBM.png [View same] [iqdb] [saucenao] [google] [report]
62637289

>>62637232
>/dpt/ told me that JS is shit
>go in for job interview
>they ask me about my experience with JS
>I tell them that it's a kiddie-tier language for moronic hipsters
>they ask me to leave the building

>> No.62637291

>>62636329
I gave up on gtkmm when trying to deal with it's list/tree bullshit too.
I fucking hate GUI libraries, they're all trash.

>> No.62637293

>>62637232
why does C++ have to suck?

>> No.62637313

>>62637047
fair enough good luck

>> No.62637325

>>62637275
you want access to children

>> No.62637443

>>62637261
well cheer to you for attempting a new alternative game engine.

>> No.62637465

>>62637261
Just use SDL. AAA studios use SDL. There's literally no reason not to use SDL.

>> No.62637489

can you really say its your own game engine if you don't write your own compiler to compile it?

>> No.62637516

>>62636837
Actually looks fucking great, man I love C

>> No.62637529

>>62637489
wut compiler and game engine is 2 separate entity.
it's like "can you really say its your own program if you don't write your own compiler to compile it?"
the phrase "your own program" can also be subtituted by "your own compiler"

>> No.62637531

>>62637489
this is why I transferred the copyright of my game engine to the FSF

>> No.62637732

>>62637289
now in this case. you did the right thing

>> No.62637854

>>62637232
There was one guy who got interviewed at our place.
>interview
>Lead: "So we mainly use C++ and Javascript. A bit of Java and C# here and there. There is also one project in pure C"
>Guy: "Wow"
>"?"
>"I am kinda disappointed in your company but ok"
>"Umm, ok, here you go. make this thing, you have 4 weeks"
>4 weeks later
Literally never wrote a single line of code. He spent 4 weeks writing in his blog and toying with his opensource pet projects in (I kid you not) Haskell. Boss was mad af but we had a good laugh

>> No.62637918

>>62637854
all talk no code. typical

>> No.62637920

>>62637854
Wow, that sucks. Did they fire you?

>> No.62637945

>>62637489
https://www.youtube.com/watch?v=7s664NsLeFM

>> No.62637948
File: 72 KB, 500x500, 1417853279781.jpg [View same] [iqdb] [saucenao] [google] [report]
62637948

>>cout << hex << 1234;

Are you shitting me, Bjarne?

>> No.62637954

>>62637948
pretty comfy desu

>> No.62638000

>>62637948
>>cout << showbase << hex << 1234;

Oh god, it gets worse. This is the ugliest syntax I've ever seen. This is an abuse of operators.

>> No.62638010

>>62638000
functional languages are worse

>> No.62638013

>>62638000
Agreed. Streams are the worst abuse of operator overloading in the standard library.

Arithmetic types, containers and iterators use it tastefully.

>> No.62638029

If this is 2D array [,] then what is this [][]?

>> No.62638034

>>62638010
Yeah, but he goes on for hundreds of pages about the importance of consistency, then all of a sudden he throws a bunch of magic iostream syntax at you.

>> No.62638037

>>62638029
C#? Jagged array/array of array.

>> No.62638060

>>62638034
Bjarne's a fag and C++ is anything but consistent.

>> No.62638064

>>62637948
cout << reinterpret_cast<int*>(1234);

Are you shitting me, Bjarne?

>> No.62638196
File: 45 KB, 400x356, Trivium.jpg [View same] [iqdb] [saucenao] [google] [report]
62638196

XBF

yet another attempt at systematizing general knowledge

logic, grammar, rhetoric
->
arithmos, chronos, topos
->
astronomy et al
->
dialectics

>> No.62638224
File: 1.18 MB, 1523x947, out.gif [View same] [iqdb] [saucenao] [google] [report]
62638224

I'm a pretty disorganized person and I generally have like 100 windows open so I often find myself spending seconds looking through the alt-tab list. I guess this issue could be mitigated by using a multiple desktops but that would require organizing effort on my part anyway. So I wanted to be able to press a certain key combination and enter a string to switch to a given program based on its title. This is basically a bash script using wmctrl but with some extras which makes it faster for me to use and more suitable to my needs.

>> No.62638247

>>62636264
Boring stuff for work, exporting some DB data into CSVs for management to use in their Google Sheets.

Did I mention I'm the only backend developer in this 100% IT company that also makes the Android app and the web frontend? Somehow it works out, without me even working much, but I don't understand how.

>> No.62638288

>>62638224
nice app there anon

>> No.62638399

>>62638037
But it's the same thing

>> No.62638486

>>62638399
Not in C#, which is the only language I'm aware of which uses [,] syntax.

>> No.62638489

>>62638224
nice one anon

>> No.62638540

>>62637948
Just use printf lmao

>> No.62638661

>>62638224
source code when tho

>> No.62638700
File: 10 KB, 334x229, 1480386749808.png [View same] [iqdb] [saucenao] [google] [report]
62638700

>Want to print 1 << 16
cout << 1 << 16 << endl;
>Prints 116
WTF, i hate c++

>> No.62638719

>>62638540
at that point you are using C and you might just as well write the whole thing in C.

>> No.62638756

>>62638700
>want to print string
>1 and 16 is int
>WHY SHIT NOT WORKING THE WAY I WANT IT TO WORK

>> No.62638760

>>62638719
But anon, that's the point. C++ gives you std::string, hashtables built in, advanced template fuckery and some other stuff, it's pure garbage if you try to use the real "features".

>> No.62638761

>>62638700
cout << (1 << 16) << endl;
Wow that was hard

I agree that the stream syntax is retarded though

>> No.62638764

>>62638700
>what are parens

>> No.62638775

>>62638764
Unecessary if you didn't go overboard with operator overloading

>> No.62638780

>>62638760
>hashtables
use a library
>template
why do you want to make unreadable code?

>> No.62638809

>have sepples class
>first few weeks go to getting visual studio installed for everyone
>check schedule
>last class (in 9 months)
>"loops, conditional statements"
What the fuck is wrong with these people?

>> No.62638826

>>62638780
Sure, but it's comfy to have it natively. You can do more advanced stuff at compiletime, that's useful.

>> No.62638837

>>62638700
Did you try std::cout?

>> No.62638846

>>62638700
printf("%d << %d", 1, 16);

>> No.62638900

>>62638846
not sepples though

>> No.62638917

>>62637529
It was bait you fag.

>> No.62638918

>>62638700
cout << "1 << 16" << endl;

>> No.62638943

>>62638837
>>62638846
>>62638918
It should print 65536

>> No.62638965

>>62636278

Feminine penis isnt gay

>> No.62638974

>>62636278
currently writing a managed OS that runs on top of Windows/.NET

>> No.62638980

Why aren't exceptions inferred as part of the method signature? Like a mix of automatic type deduction with exception checking.
void Foo() throws FooException;
void Bar()
{
Foo();
} // compiler infers throws clause

void Baz() throws FooException
{
Bar();
}

>> No.62638996

>>62638974
Just like make an ASIC that's a hardware implementation of the JVM and write a managed OS in Java on top of bare metal.

>> No.62639024

>>62638980
Aren't they?

>> No.62639030

>>62638996
Don't give AMD any ideas

>> No.62639035

>>62639024
In Java, you must explicitly write the throws clause for checked exceptions. I don't know of other languages with exception checking.

>> No.62639071
File: 43 KB, 554x439, 1427959443.jpg [View same] [iqdb] [saucenao] [google] [report]
62639071

>>62636278
not if it's an exception trap

>> No.62639097
File: 345 KB, 633x720, 1506432289658.png [View same] [iqdb] [saucenao] [google] [report]
62639097

Employed Haskell programmer here

>> No.62639106

>>62639097
please stop posting this in every thread

or at least post cute female(male) pictures

>> No.62639117

>>62638980
>Why aren't exceptions inferred as part of the method signature?
http://www.gotw.ca/publications/mill22.htm

>> No.62639118
File: 44 KB, 636x616, 1474325315193.jpg [View same] [iqdb] [saucenao] [google] [report]
62639118

>>62639106

>> No.62639211

I know this is a really basic question, but I'm just beginning to learn C# and I have a question. How do I write a chunk of code, place it within something (this is why I'm asking here, because I don't know the name of what I want) I'm trying to move an image and scale it down using variables but I don't want to paste in the same code over and over.

>> No.62639225

>>62638700
Did you try not using sepples?

>> No.62639241

>>62639211
its called a function, senpai
or method in C# because everything is oop

>> No.62639277

>>62639097
>Haskell programmer employed at McDonalds here

ftfy

>> No.62639280

So in c# when i have for example
var poop = 123;
which is int and then i can do poop.toString() to convert it to string.
Is there some way to make my own methods like toString()? So for example i will be to do
poop.toPee();

>> No.62639325

>>62639117
Sepples exception specification is broken along with the rest of its exception model. I don't see your point.

>> No.62639326

>>62639280
Extension methods may be what you're looking for

>> No.62639333

>>62639280
For your own classes, easily. That's called a method and it's basic as fuck.
For other classes, use extension methods.

>> No.62639357
File: 104 KB, 720x900, 1468819751709.jpg [View same] [iqdb] [saucenao] [google] [report]
62639357

for i=0,10^6:
#do some necessary stuff
...
#func on other_array with bounds [0, N]
if (0 < i)
func(other_array[i-1])
endif
endfor


For any compiled language, any decent compiler will optimize this so that the first iteration is unrolled, and there is no conditional jump every single iteration, right?

Or do I have to mess up the readability by unrolling manually?

>> No.62639389

Why doesn't /g/ just write its own C++ compiler?

>> No.62639403

>>62639389
Great idea, anon! Let's write it in Haskell.

>> No.62639413
File: 14 KB, 580x522, do while pari zero.png [View same] [iqdb] [saucenao] [google] [report]
62639413

First homeworks,
I'm using this thing with no examples of syntax or any sourcers.

How do I make it read either "yes" or "no"?

>> No.62639432

>>62639413
>>/sqt/

>> No.62639439

>>62639432
S-sorry

>> No.62639445

>>62639413
(string == yes or string == no)
false: output try again and path back to string name
true: path down to your T/F cell and check which of yes or no it was

ALSO
0%2 is still 0

>> No.62639496

>>62639445
Request is to examine if the number is even, uneven or zero.

Also can you be more clear?
I have no idea how to write this shit.

>> No.62639524

>>62639496
if you only want to accept literally yes or no as answers, check whether the string is (yes or no)

if the string is not one of those two tell the user to type the proper response and go back to read the response again

if the string is one of those then you can go ahead and check string==yes→input new number and string==no→finish

>> No.62639558
File: 12 KB, 615x374, Untitled.png [View same] [iqdb] [saucenao] [google] [report]
62639558

>>62639524
>if you only want to accept literally yes or no as answers
Exactly.

>if the string is one of those then you can go ahead and check string==yes→input new number and string==no→finish
Yeah I can wrap my mind around the logic,
I just have no idea how to write it.

>> No.62639662

>>62639558
if it does not support "or" you could always check if it is equal to yes first.
it true, the user typed yes
If false, check if it is equal to no

if true, the user typed no,
if false, the user needs to type again

>> No.62639712

>>62639662
>if it does not support "or"
I don't think it does for string values.

Again I don't know how to write any of that, I don't even know the fucking syntax.
It's not even taking the string value because it expects an int value.

>> No.62639716

Have a week to learn SQL and Spark SQL
How fucked am I?
And, more importantly, what book should I read for it?

>> No.62639834

>>62639716
You're fucked. You should have started earlier.

Basic SQL is not hard to grasp, but understanding the concepts beyond the most simple SELECT * FROM table WHERE condition statement takes some effort.

>> No.62639837

>>62639716
I would read the postgres documentation to learn sql. And then the sparksql documentation to learn spark sql.

>> No.62639864

>>62639716
if you need to know stuff about database design, diagrams, normal forms, and anything SQL beyond joins/selects/inserts
then yeah you are so fucked

>> No.62639880

>>62639834
fug i still remember learning all that shit about JOIN LEFTs and JOIN RIGHTs and subqueries for motherfucking queryception
no wonder i started with cutting during that period

>> No.62639894

>>62639880
>JOIN LEFT
never going to make it

>> No.62639949

>>62638900
Good.
>>62638943
printf("%d", 1 << 16);

>> No.62639964

>>62639716
manga guide to databases

>> No.62639966

>>62639834
>>62639837
>>62639864
Basically I went to a job interview telling them I already knew SQL and I got an internship of sorts
Only reason I got an internship in the first place is that my dad knows the boss
It could be good for me if I can look good on the job, but if I appear to be as inept as I actually am I will be exposed as a fraud who doesn't actually have a degree
So I guess I've got to come up with a good reason why I can't take the job
Also I might have more than a week, maybe 2-3

>> No.62639980

>>62638809
colleges are no longer a educational service, they are something to make you resume look good by adding a 3.something GPA. Check out grade inflation for a bitter reality pill.

>> No.62640000

What do you think of GO? Is it better than python for backend?

>> No.62640007

>>62640000
Go more like No

>> No.62640008

>>62638809
I have trouble believing that anon unless that is like one of the very first courses in intro to CS10000000001 or something

>> No.62640012

>>62640000
It's painfully simplistic and tedious to write but also doesn't really have anything stupid or dealbreaking in it. No generics is the worst part.

>> No.62640024

>>62638809
can't do loops until you've explored TMP senpai

>> No.62640108

So what about wasm lads? What it can be useful for cryptomining?

>> No.62640126

>>62640108
of course, you'll just get the same miner but no blocking potential and some performance boost. Don't use wasm.

>> No.62640154

>>62639966
>if I appear to be as inept as I actually am I will be exposed as a fraud who doesn't actually have a degree

What the fuck? That's literally a crime.

>> No.62640155

Write a function that checks if a given character is a vowel.

It should take one argument, a char, and return a value of type bool, int, or any other type that can be cast to bool.
The return value when cast to bool must either equal true for all vowel inputs and false for all consonant inputs, or vice versa (e.g. false for all vowel inputs and true for all consonant inputs)

The following characters are vowels: A, E, I, O, U.

The function must return correct (as specified above) out data for both uppercase and lowercase letters.

The function must only use bitwise operations. The function that uses the fewest bitwise operations wins.

>> No.62640173

>>62640154
If being inept was a crime, everyone in this thread would be in jail

>> No.62640176

>>62640012
Having no generics is the best part.
It avoids unnecessary complexity and improve execution speed. Also, there is almost no use case that a generic might be better than a simpler implementation.

>> No.62640177

>>62640173
I mean it looks like she's implying that she told these people she actually has a bachelor's degree, as in, actual fraud.

>> No.62640189

>>62640155
vowel.isVowel();


Closed source, sorry

>> No.62640212

>>62640000
Gigantic binaries, offers no advantages over C, can't link with C libraries like sepples or Rust can.

>> No.62640224
File: 29 KB, 1872x1360, 1479603112358.png [View same] [iqdb] [saucenao] [google] [report]
62640224

>>62640155
For reference.

>> No.62640239

>>62640177
That can't be it since he has to submit a copy of it along with paper work so he would be found out anyway.
So he would actually have to make a fake one.

>> No.62640249

>>62640154
Also that
I don't think I risk anything criminally but it would be bad in terms of my relationship with my family
Probably not worth the risk
Should just learn something and try applying without claiming I have a degree

>> No.62640254

>>62640000
>is it better than python for backend
>backend
This is so vague I'm ready to say you're not gonna produce good software regardless of which tools you choose and what assistance you get.

>> No.62640282

>>62640239
I don't think I would have to give any proof of that as the employer is a friend of my father and he'd probably take me on in good faith
Anyway yeah, the more I think about it the less it seems like a good idea
Gotta find a way to say I can't or don't want to do it even though I currently have nothing better to do

>> No.62640296

>>62640189
>bitwise

>> No.62640308

>>62640296
>Write a function that checks if a given character is a vowel

>> No.62640325

>>62640189
Your function doesn't take one argument, a char, so it violates the specifications.

>> No.62640332

>>62640325
>not using UFCS in 2017

>> No.62640340

>>62640155
>only use bitwise operations
>the function with the fewest bitwise operations wins
I'm all for arbitrary challenges but don't make it pointless.

>> No.62640353

>>62640332
which languages have ufcs?

>> No.62640408

>>62640340
You're only supposed to use bitwise operations for the actual comparison. if statements, return statements, etc are fine, but shit like
if c < 'a' {c += 'a'-'A'};
return (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');

Is just pointless and stupid.

>> No.62640519

fn dummy(a: &String, b: &String, c: i32) -> &String {
if c < 0 {
return a;
}
else {
return b;
}
}

>compile error
>this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a` or `b`
>rustlets WILL defend this
I don't mind jumping through some of Rust's hoops when they actually make sense, but surely the compiler could've figured out that the reference is returned to the same scope it was brought from, so it remains valid if it was valid in the first place. Why can't SJWs into compiler programming?

>> No.62640616

>>62640519
Because the rust compiler just outputs code of conducts.

>> No.62640673

>>62640519
the borrowchecker is Rust's worst component

>> No.62640769

>>62640000
It's a decent middle ground between C/C++ and VM/interpreter/JIT compiler garbage. No generics though.

>> No.62640787

>>62640108
Web applications almost on par with native ones in performance.

>> No.62640830

>>62640519
Don't ever return references. It will save you many headaches.

>> No.62640890

>>62640830
>Don't ever return references.
What exactly does one gain from following your advice in this case? Do you have to blindly follow weird dogmas to distract yourself from how poorly designed Rust is?

>> No.62640891

>>62640830
references are stupid anyway, I want pointers

>> No.62640952

>>62640890
The compiler is shit at detecting implicit lifetimes. You have to write a bunch of mojo to make it not shit itself with error messages. Personally, I just think it's not worth the effort and only returning owned instances works for almost anything.

>> No.62640971

>>62640952
>The compiler is shit
>it's not worth the effort and only returning owned instances works for almost anything
So basically:
>you have to blindly follow weird dogmas to distract yourself from how poorly designed Rust is

>> No.62640983

>>62640891
References are just pointers, that can't be null (the compiler may optimise this to a move or copy, if needed).

>> No.62640985
File: 11 KB, 238x212, you.jpg [View same] [iqdb] [saucenao] [google] [report]
62640985

>>62640952
so this is the power of rust

>> No.62641019
File: 314 KB, 960x1234, 6164.jpg [View same] [iqdb] [saucenao] [google] [report]
62641019

Working on a cyberpunk imageboard, 4kev.org

>> No.62641024

>>62640983
wrong

>> No.62641056

>>62640971
>>62640985
The language is basically unfinished. 1.0 is a lie born out of butthurt about new languages like Go and Swift seeing some adoption. Unless you are prepared to work around the deficiencies, wait 5 years or so before starting anything meaningful in Rust.

>> No.62641209

why should I ever use an enum? anyone have excellent examples of what enums are good for?

>> No.62641225

>>62641056
Yeah, everything's using nightly anyway. Might as well be pre-1.0.

>> No.62641227

>>62641209
A limited number of descriptive options for pretty much anything, like days in a week, or status effects in an RPG.

>> No.62641238

>>62640155
Are shifts acceptable?

>> No.62641242

>>62641227
why does an enum help in that situation?

I am a newb and appreciate the info

>> No.62641259

>>62639357
why not just compile and read the assembly

>> No.62641332

>>62641259
assembly 2 complex 4 me

>> No.62641337

>>62641332
baka

>> No.62641353

>>62641238
Yes.

>> No.62641380

>>62641332
use some program that lets you view the source and matching asm.

>> No.62641386

I want to make a game using SFML. What language should i use? I was trying to start with RUST using smfl-rust. but that piece of shit don't even compile

inb4 C. I want to learn something new

>> No.62641404
File: 23 KB, 500x500, shortcuty.png [View same] [iqdb] [saucenao] [google] [report]
62641404

so recently I got a web dev job and I would like to build a shortcut to make my work faster and more efficient
during some projects I have to open new .html files every 10 minutes.. these files are in a folder with a "random"-id so I have always to go back to the main folder and then go back to the html file, then I open the file with my editor

in the office we use windows 8, maybe some of you guys know how to build such a shortcut, I have an idea that could be done in python but I would like to see if it is possible just with windows tools

>> No.62641439

>>62640155
Are && and ! acceptable?

>> No.62641457

>>62641386
C++ then. Isn't SFML C++ anyway?

>>62641404
Your editor should be able to do that. Stuff like denite on neovim or helm on emacs.

>> No.62641478

How do I git really gud at javascript

>> No.62641489

>>62641386
SFML is native to C++, other stuff is just bindings that may or may not work properly so I'd say go with C++.

>> No.62641499

>>62636264
Company I am at now is laying off all their contractors in 2 weeks. I have been sending out my resume everywhere, but my Github is barren. What's quick easy project idea I can scrape together in about 4 weeks time?

Trying to go the data science angle in terms of a career. I know Python and basic R, scikit-learn, pandas, numpy etc...

>> No.62641545

>>62638996
It's already been done in ARM
https://en.wikipedia.org/wiki/Jazelle

>> No.62641626

>>62640155
Here's my submission. Must run on an x86, MIPS or other architecture where shifts are taken modulo 32.

char not_vowel(char c) {
return c & 'A' ^ 'A' | 4292836829UL >> c & 1;
}

>> No.62641684

What are some good website with varied exercises and/or projects? Or is project euler still the best?

>> No.62641707

>>62641439
Yes.

>> No.62641715 [DELETED] 
File: 4 KB, 633x683, digital clock numbers.png [View same] [iqdb] [saucenao] [google] [report]
62641715

>>62636264
Anyone care to review my code for me? Also any idea how I can make the numbers look better? 1 in particular looks awful, everything else is just "okay".

http://dpaste.com/1Q6CMVG

Also does anyone know why the fuck 4chan suddenly won't let me post code? If I try using tags, my post won't go through and i keep getting a connection error. I had the same problem last night, but some other anon copy pasted my code from dpaste and he could post it just fine. I tried from my phone using data and it also gives a connection error if I try posting code.

>> No.62641716

>>62641684
>not coming up with your own projects
>not already knowing what you want to do with your programming skills
You will never make, just quit programming.

>> No.62641741

>>62641716
I'm not considering programming languages as a dumb tool, anon.

>> No.62641781
File: 4 KB, 633x683, digital clock numbers.png [View same] [iqdb] [saucenao] [google] [report]
62641781

>>62636264
Anyone want to take a look at my code for me? What should I have done differently? Also how can I make the numbers look better?

Dpaste because 4chin refuses to let me post code: http://dpaste.com/1Q6CMVG

>> No.62641815

>>62641781
>define
>int numbers[] instead of int *numbers, size_t size
>no return in main
>data arrasys not static const
>and worst of all, C

>> No.62641859
File: 7 KB, 218x231, IMG_1494.png [View same] [iqdb] [saucenao] [google] [report]
62641859

>>62641815
>C is bad
Objectively wrong.
>static const
Yeah I should've done that
>no return in main
It's implied. Also what's wrong with using define? I thought magic numbers were bad or whatever

>> No.62641876

>>62640155
>>62641626
Also a (possibly non-competing) VAX-tier solution in x86 asm.
vowel:
bt [.tab], cx
salc
ret
.tab: db "\0\0\0\0\0\0\0\0DA\4\0DA\4\0"

>> No.62641883

>>62641626
How does it work?

>> No.62641893

>>62640519
fn dummy(a: &'a String, b: &'a String, c: i32) -> &'a String

>> No.62641895
File: 111 KB, 640x640, Thinking_Face_Emoji.png [View same] [iqdb] [saucenao] [google] [report]
62641895

So /g/ I need some help. I have to write a python program using a recursion to remove all Q's from a input. This works fine but I was told it is not recursive by a friend of mine. Please advise on how I can do this please. Thanks /g/ bros

muh code:

def no_q(S):
if S ==(''):
return('')

else:
return S.replace("Q", "")

>> No.62641930

>>62641893
If Rust had type inference this example would be trivial, but it doesn't. The only time it allows you to elide lifetimes in signatures is when the lifetime can be figured out only from the signature (usually when there is one input reference and one output reference). It isn't specific to lifetimes.

>> No.62641931

>>62641883
BT moves the CX'th (ECX = __fastcall argument 1) bit in the bitstring at .tab to the carry flag.
SALC is an undocumented instruction that sets AL to 255 if the carry flag is set, else 0.

>> No.62641943

>>62641895
is this bait

>> No.62641955

>>62641943
no. I am trying to learn python.

>> No.62641961

>>62641931
Did you reply to the wrong post?

>> No.62641963

>>62641893
>b-b-b-but you can manually fix it
Doesn't change the fact that Rust fails at the simplest things, and "muh safety" doesn't work as an excuse in this instance, and many others.

>> No.62641973

>>62641955
ask your friend what is recursion

>> No.62641990

>>62641973
I did, but he couldn't really explain it well.

>> No.62642012

class HydrocarbonDutyCalculator(object)

>> No.62642079

>>62641781
The numbers would look better if you padded them all one char on the left side.

As for the code, I would consider using a bitmask instead. So instead of storing 7 integers, store them all in an unsigned char. You can then define the numbers as an enum and use that instead.
You should also consider how you would print multiple numbers at the same time (so they get next to each other).
Then make a string to 7segment function.
Usually, with a hardware 7segment display, you have 7 wires and a multiplexer so you can turn the different displays on one by one.
By making your software emulation close to this, it is easier to test on a real system.

>> No.62642103

>>62641963
The Rust developers made the choice not to infer function signatures from function definitions. I don't agree with this choice, but it means that you have to provide some lifetimes explicitly.

The lifetimes could be inferred in several different ways:
fn dummy(a: &'a String, b: &'b String) -> &'a String
fn dummy(a: &'a String, b: &'b String) -> &'b String
fn dummy(a: &'a String, b: &'a String) -> &'a String

Only the third works with your definition, but different definitions might want the first or second. So the compiler can't in good faith pick one of them without knowing the definition.

>> No.62642114

>>62641990
what about google?

the first result should hint you that you need to call the function inside itself.

>> No.62642131

>>62636863
>his game doesn't create its own music as it goes
fucking plebs don't even know how to program

>> No.62642139

>>62637291
>all trash.
well yeah, because they don't settle for just rendering a GUI; they also shoehorn their own threads, file access functions, networking api, even their own fucking integer types

>> No.62642153

>>62642103
>The Rust developers made the choice not to infer function signatures from function definitions. I don't agree with this choice
I'm kinda on the fence about it. Being able to take a look at the code and know how the function should be called instead of having to look at the documentation is great IMHO.

>> No.62642173

>>62642153
Type annotations would obviously still be allowed. And it's not a technical limitation because within function definitions there is full type inference.

>> No.62642193

>>62641961
Christ, I thought it was a reply to my other post.
The C one works in two steps:
- Because all vowel have the first and seventh bit set (1000001 = 65 = 'A'), first they are masked off and then they are bitwise compared for not equal. If any bit is invalid, the result is nonzero.
- Assuming the previous result is zero, it is now the time to check that it is actually a vowel. Since the first five bits choose the relevant letter of the alphabet, the unsigned long constant has a 1 as the Nth bit if the ASCII character 64 | N (and 96 | N) is not a vowel, and 0 otherwise. As I assume we are working on a machine where 32-bit shifts are taken modulo 32, the (c & 31)'th bit of the constant is selected.

After posting that I realized there is a smaller constant with the same property: 2861181064UL.

>> No.62642230

>>62641781
Get your shit together with the data arrays, do it like (random values)
numbers[0] = 0x8F; //1110111
numbers[1] = 0x44; //0010010
etc
then dump it in a header file called numbers.h

>> No.62642250
File: 1.14 MB, 1000x1399, Touhous 181.png [View same] [iqdb] [saucenao] [google] [report]
62642250

>manually rolling a 64bit bit mask
aaaaaAAAAAAAAA

>> No.62642274

>>62642250
Write the bits, big endian style.
Group them by fours.
Pattern => hex digit.
Was that so hard?

>> No.62642284

>>62642103
I don't understand why this is an issue at all. Either way the reference will be returned back to the scope from which the function was called, so why can't the compiler simply restrict the returned reference to that scope by default? It doesn't involve any complex inference.

>> No.62642289

>>62642193
So, a lookup table. I tried to make one, but it gives a positive result for 'Q'. It doesn't use a lookup table, but it's slower.

>> No.62642295

>>62642173
>Type annotations would obviously still be allowed.
Yeah but Rust has a tendency to force you to do The Right Thing© and force you to go through extra steps if you don't want to abide.
I can't think of a way they could have made obligatory type annotations the default and removing them optional besides adding an ugly compiler argument.

>> No.62642311

>>62642284
I think they're actually working on fixing that, check out their RFC repos.

>> No.62642317

>>62642250
>cirnopost
good post

>> No.62642323

>>62642284
Because one of the lifetimes might end before the other. Without annotations, there's no way to tell which lifetime the result is associated with. If the "most general" is always inferred, that would just get in the way and you'd complain about that instead.

>> No.62642390

>>62642323
>i didn't understand what you said, but actually i did, but you don't actually want what you say you want
You seem to be schizophrenic. Are all Rust users like that?

>> No.62642409

>>62641209
in C/C++ they're great for generating integer constants at compile time and you can use them for array indices or in switch statements

>> No.62642420
File: 5 KB, 400x400, tegaki.png [View same] [iqdb] [saucenao] [google] [report]
62642420

>>62642390
>the reference will be returned back to the scope from which the function was called, so why can't the compiler simply restrict the returned reference to that scope by default?
Because lifetimes are different from scope. It sounds to me like you are asking for C to always be inferred, which isn't necessarily correct.

>> No.62642444

>>62642420
>Because lifetimes are different from scope.
I don't see how this is an argument. The scope has a lifetime associated with it.

>It sounds to me like you are asking for C to always be inferred, which isn't necessarily correct.
It will always be correct because the reference will be valid at least in the calling scope. It would be a perfectly sensible and useful default behavior (to allow the reference to be used locally).

>> No.62642477

>>62642193
Thanks, dude.

>> No.62642492

>>62642444
>It would be a perfectly sensible and useful default behavior
Maybe.

>> No.62642496
File: 99 KB, 2000x2000, ss.png [View same] [iqdb] [saucenao] [google] [report]
62642496

Made a polygon function and I was playing around with multiplying the cos and sin values, can someone explain to a brainlet like me why multiplying the i in the cos(i) and sin(i) variables turned a regular 5-sided polygon into this star shape?

var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");

ctx.fillRect(0, 0, canvas.width, canvas.height)

function polygon(context, cx, cy, xradius, yradius, sides) {
var x, y;

context.beginPath();

for(var i = 0; i <= 2 * Math.PI; i += Math.PI/sides*2) {
x = xradius * Math.cos(i * 7);
y = yradius * Math.sin(i * 3);

context.lineTo(x + cx, y + cy);
}
}

polygon(ctx, canvas.width/2, canvas.height/2, 500, 500, 5);
ctx.fillStyle = "#fff";
ctx.fill();

>> No.62642525

>>62641781

/* Print numbers like a digital clock, using 7 segments. */

#include <stdio.h>

#define TOP 64
#define TLEFT 32
#define CENTER 16
#define TRIGHT 8
#define BLEFT 4
#define BOT 2
#define BRIGHT 1

void digit(int dig) {
static const char repr[16] = {
~CENTER, /* 0 */
TRIGHT | BRIGHT, /* 1 */
~TLEFT & ~BRIGHT, /* 2 */
~TLEFT & ~BLEFT, /* 3 */
TRIGHT | CENTER | TLEFT | BRIGHT,
/* 4 */
~TRIGHT & ~BLEFT, /* 5 */
~TRIGHT, /* 6 */
TOP | TRIGHT | BRIGHT,
/* 7 */
~0, /* 8 */
~BLEFT, /* 9 */
~BOT, /* A */
~TOP & ~TRIGHT, /* B */
~CENTER & ~TRIGHT & ~BRIGHT,
/* C */
~TOP & ~TLEFT, /* D */
~TRIGHT & ~BRIGHT, /* E */
~TRIGHT & ~BOT & ~BRIGHT
/* F */
};

char pattern = repr[dig];

printf(" %c\n%c%c%c\n%c%c%c\n",
pattern & TOP ? '_' : ' ',
pattern & TLEFT ? '|' : ' ',
pattern & CENTER ? '_' : ' ',
pattern & TRIGHT ? '|' : ' ',
pattern & BLEFT ? '|' : ' ',
pattern & BOT ? '_' : ' ',
pattern & BRIGHT ? '|' : ' ');
}

int main() {
for( int i = 0 ; i < 16 ; i++, putchar('\n') )
digit(i);
}

>> No.62642536
File: 149 KB, 1426x760, poststxt.jpg [View same] [iqdb] [saucenao] [google] [report]
62642536

>>62636264
I'm trying to make a greentext generating AI. I already have a script that exctracts all posts from some boards I have chosen.

How do I RNN with TensorFlow?

>> No.62642554

>>62642536
just make a markov chain stupid

>> No.62642565

>>62642496
Something to do with math, we're not very good at math here.

>> No.62642582

>>62642554
The thing is I'm doing that because I'm writing my bachelor thesis about neural networks, so this has to be a neural network, too

>> No.62642610

>>62642582
lol you can get a bachelor just from making something like that?
glad I didnt go to school

>> No.62642635

>>62642610
The greentext generator is just practice, the bachelor thesis is about automotive stuff.

>> No.62642723

>>62642496
Neat. It loops 5 points as before as 5 divides neither 7 and 3, but in a different order. I.e, the lines are drawn across the body of star. You know, like when you draw a star like that yourself.

>> No.62642890
File: 134 KB, 2000x2000, ee.png [View same] [iqdb] [saucenao] [google] [report]
62642890

>>62642723
Thanks, just occurred to me to I should use stroke instead of fill to get a better look at what's going on.

>> No.62642904

>>62642890
Note also that there are 5 (< 7) unique y values but only 3 unique x values

>> No.62642926

>>62636264

Total newbie here, I enrolled to a edX course on Complete Beginner’s Python (3). It’s a Microsoft course, code is saved in azure notebooks and for the coding itself jupyter is utilised. I don’t know if this even matters at such low levels as mine.

Can someone please explain why I’m getting a syntax error on my code? I just can’t see any other way to do it, and I am sure it previously worked.

You are free to roast me, the course forum is simply too slow to answer.

>> No.62642941

>>62642926
well you don't have anything so i don't know why youre getting a syntax error

>> No.62642946
File: 745 KB, 2531x1694, DC83F0D5-5A8E-40E2-BB01-C94997B1DB17.jpg [View same] [iqdb] [saucenao] [google] [report]
62642946

>>62642926

Forgot the pic.

>> No.62643026

>>62642492
fn dummy<'a>(a: &'a String, b: &'a String, c: i32) -> &'a String {
if c < 0 {a} else {b}
}

fn main() {
let s1 = String::from("foo");

{
let s2 = String::from("bar");
println!("{}", dummy(&s1, &s2, 1));
}
}


Why does this even work? Doesn't s2 have a different lifetime from s1?

>> No.62643074

>>62643026
Subtyping. If 'a is contained within 'b, a Foo<'b> can be used as a Foo<'a>.

>> No.62643111

>>62643026
imagine taking all the worst aspects of C++ and making them non-deterministic because of the autistic compile-time borrow checker.

>> No.62643132

>>62643111
its kind of impressive how rust manages to be even more of a clusterfuck than modern c++
>inb4 that one template screenshot

>> No.62643136

>>62643111
It's literally more deterministic just fugly and complicated.

>> No.62643140

>>62643026
s1 lives at least as long as s2, so using them both within s2's scope is fine.

>> No.62643142

>>62643074
>Subtyping
It looks more like type intersection to me. So it basically does the thing I said it should be doing by default... if they already have this implemented, it only makes it more perplexing that they force you to type it all out.

>> No.62643156

>>62643142
No, it's subtyping.

>> No.62643169

>>62643132
>rust manages to be even more of a clusterfuck than modern c++
>>62643111
>imagine taking all the worst aspects of C++ and making them non-deterministic because of the autistic compile-time borrow checker.
I'm hating it so far, but it doesn't even come close to C++ levels of incoherence.

>> No.62643176

>>62643026
in Haskell this is just
dummy a b c = if c < 0 then a else b
main = do
let s1 = "foo"
s2 = "bar"
putStrLn (dummy s1 s2 1)

>> No.62643192

>bjarne clearly got drunk when creating C++ and mixed up the meanings of try and catch
>no one has told him in 40 years

>> No.62643210

>>62643156
>it's subtyping.
That makes no sense. A subtype is more constraining than the type it's based on, but with your subtype analogy, the narrower (i.e. more constraining) lifetime of 'a is a supertype of the wider lifetime of s1.

>> No.62643220

>>62643192
never gonna catch bjarne tryna catch his tries anon

>> No.62643228

>>62643210
that instance of s1

>> No.62643230

>>62643176
>m-m-m-muh haskell
Talk to me when you can make a simple Pacman game without clumsily emulating mutability.

>> No.62643232

>>62643192

What?

>> No.62643240

>>62642946
post the whole script

>> No.62643245

>>62643228
Huh? What you're saying is that the less constraining lifetime is a subtype of the more constraining lifetime, which makes no sense, because a subtype is supposed to be more constraining than its supertype.

>> No.62643253

Why the FUCK do you need so much memory safety?

>> No.62643256

>>62643230
>simple Pacman game
Why don't you come back with a real project and not your toy vidya shit?
>b-but emulating mutability
yeah and C programmers are "emulating GC"

neck yourself

>> No.62643260

>>62643210
This is just a misunderstanding of subtyping. If A is a subtype of B you can use an A where a B is expected, that's all. It has nothing to with language like "more constraining" or similar.

>> No.62643269

>>62643230
>clumsily emulating mutability.
haskell has the bar syntax right?
thing | a = a
So why should it need to emulate mutability when it has a much better alternative?

>> No.62643288
File: 103 KB, 1424x1072, mpv-shot0031.jpg [View same] [iqdb] [saucenao] [google] [report]
62643288

>>62636264
I have this code which parses some arguments using argp and fills an array with file names (non-option arguments) passed to the program.
parse_args populates args.file_list and increments args.file_count every time a non-option argument is encountered.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libeternity/args.h>
#include <libeternity/util.h>

int main(int argc, char **argv)
{
int file_list_size = argc * sizeof(char*);
struct args args;
args.count = argc;
args.silent = args.verbose = 0;
args.output_file = "-";
args.file_count = 0;
args.file_list = safe_malloc(file_list_size);
memset(args.file_list, 0, file_list_size);

int rv;
rv = parse_args(argc, argv, &args);

if (rv == -1)
{
et_cleanup(&args);
return EXIT_FAILURE;
}

et_cleanup(&args);
return EXIT_SUCCESS;
}


This works fine, but from an API perspective it is a little confusing. I would like to have a function int build_file_list(char**) while keeping it separate from the argument parser.
How can I do this?

>> No.62643309

>>62643253
because pajeets and drunks and halfassed implementations are bad things that cruft hard. You can't argue against safety.

>> No.62643312

>>62643269
what does this have to do with mutability

>> No.62643327

>>62636264
I'm writing a small java program which takes a number in form of a string and converts it in binary
Then it displays a barcode with the ones in black and the 0 in white

I having trouble with the gui though
I have 6 JPanels from javax.swing.* and when i change their background color to display the barcode nothing changes

>> No.62643328

>>62643232
Try blocks catch thrown exceptions and catch blocks try to handle them.

>> No.62643365

>>62643253
Have you ever worked with threads and shared memory in C? It's a real pain because you have to worry about instruction reordering. Having a memory safe API with references, ownership, etc. lets the compiler optimize without having to talk about undefined behaviour. It also means you have more documentation in the code itself.

>> No.62643398
File: 56 KB, 399x600, shimakaze-kun4.jpg [View same] [iqdb] [saucenao] [google] [report]
62643398

Can I write OpenGL 2.1 compliant code using only the modern pipeline (no display lists, immediate mode, etc.) and have it work on environments that only support forward compatible 3.2 and onward?
Will I have trouble using my GLSL 1.20 shaders on modern graphics drivers?

>> No.62643404

>>62643398
qt picture

>> No.62643426

>>62638247
ssshh....it's all magic anon

>> No.62643450

>>62642946
>msg_two is not defined
I think msg_two is not defined, do you have a definition of the msg_two variable?

>> No.62643504

>>62643398
>Can I write OpenGL
No because you are dumb sepples poster.
>using only the modern pipeline
Yes opengl 2 supports shaders.
>Will I have trouble using my GLSL 1.20 shaders on modern graphics drivers?
Unlikely because the graphics cards needs to support opengl2 for compatibility or most software would just stop working. They might provide the support trought some kind of emulation but it should still work.
Then again these big corporations don't give shit about compatibility...
fuck opengl

>> No.62643561

>>62643312
Do you know what the bar syntax is?

>> No.62643562

How to use he assembly language? Please help me write t this one if ok.

result1 = 3(x-y)+(x-y)(x+Y)
x = 3000h
y= 1000h

>> No.62643593

>>62643561
it's a conditional

>> No.62643607
File: 662 KB, 940x590, d died.png [View same] [iqdb] [saucenao] [google] [report]
62643607

>>62643562
jmp loo
poo

>> No.62643631

>>62643593
No in the functional realm it's a way to do mutability without mutability. Instead of modifying the variable, each change it just returns a new version of the updated one.

>> No.62643718

>>62643607
help

>> No.62643724

Who chapel here?

>> No.62643732

>>62643718
show bob and vagen i help sir

>> No.62643733

>>62643718
fuck off pajeet

>> No.62643752

>>62643724
N I M
I
M

>> No.62643753
File: 152 KB, 849x458, 1505598794880.gif [View same] [iqdb] [saucenao] [google] [report]
62643753

Is it worth it?

>> No.62643759
File: 20 KB, 478x207, Screenshot from 2017-09-27 22-25-40.png [View same] [iqdb] [saucenao] [google] [report]
62643759

learning
it's getting less elegant with every new spec page

>> No.62643762

>>62643562
start off by learning algebra

>> No.62643764

>>62643752
take your python shit and shove it up your ass

>> No.62643774

>>62643759
>>62643759
*learning python

>> No.62643781

>>62643759
learn Haskell instead

>> No.62643788

>>62643764
rude, desu

>> No.62643798
File: 41 KB, 640x480, 1502349739231.jpg [View same] [iqdb] [saucenao] [google] [report]
62643798

threadly reminder that only fags don't use lisp

>> No.62643806

i'm trying to learn C++ by porting some codes i made in C, so i know many C libraries are compatible but is it ok to use them in C++? in short, can i treat files in C++ the same way i do with C or doing it is bad practice?

>> No.62643809

>>62643798
Yeah, I can see worst girl saying this

>> No.62643820

>>62643806
yes, programming in sepples is considered bad practice

>> No.62643829

>>62643781
lol fuck off
>>62643752
shit, this is what I've been thinking of creating, except it doesn't have my idea of powerful constant expressions, where you can load and embed a file at compile time
It also doesn't impose naming restrictions I would like:
var variablesAreAllCamelCase
CONSTANT_EXPRESSIONS_ARE_UPPERCASE
TypeNamesAreCamelCase

>> No.62643854

>>62643829
>you can load and embed a file at compile time
but why

>> No.62643870

>>62643854
one file executables
so easy to distribute

>> No.62643885

Has anyone ever implemented all the 7 layers of the OSI stack at the same time in a microcontroller? A web server that deals with ethernet directly. Something like https://wwwhome.ewi.utwente.nl/~ptdeboer/ham/avreth/, but more sophisticated.

>> No.62643899

>>62643829
use C

>> No.62643927

>>62643899
I do. But I want to create my own language too. Something like a statically typed python with inferred typing, powerful constant expressions, no multiline-strings and comments, in/inout function argument qualifiers instead of pointers/passing by values and all the other ideas I like

>> No.62643978

>>62643829
Template Haskell.

>> No.62644019

>>62643978
>Template Haskell.
Ain't touching that shit. C, Go, Lua and Python is my shit

>> No.62644041

>>62644019
Your loss

>> No.62644130

>>62644041
>your loss

>> No.62644138

>apply for software dev internship as 4th year uni student
>HR emails me saying they've "identified a candidate whos work experience more closely match our needs for this position."


if i had work experience i wouldnt be applying to internships you dumb cunt raaaaaaaaaaaaaaaaaaaaaaaaaaa

>> No.62644156
File: 745 KB, 1500x1500, 4No99XO.jpg [View same] [iqdb] [saucenao] [google] [report]
62644156

>>62636264

Sorry to bug you /dpt/

Looking to get employable sooner than later, have minimal programming knowledge (can't really say skills). No real goal in mind, just don't want to be NEET at this point.

So I keep browsing udemy because that shit's always "on sale," this course claims to get you to an employable junior/ entry level of SQL in a MONTH. And he's sure to mention that those jobs start at like US$70k.

Does that make any sense? Does the time you need to put in really line up with industry demand like that? Or is he just exaggerating to sell his little course? It seems too good to be true. It has good reviews though some mention it doesn't quite get you all the way there. I have a friend who went from meteorology to evening classes at a community college and now has a solid gig bug tracking SQL code with no other programming work/ internship experience.

It's this one. Sorry, I hope it doesn't seem like I'm shilling for the site or course.
https://www.udemy com/the-complete-oracle-sql-certification-course/

>> No.62644171

>>62644156
sql people do make lots of money but getting an sql job is fucking hard unless you have daddy level connections

>> No.62644178

>>62644156
your best bet is to apply to a grocery store's third shift and learn programming in your off time. Save up neetbux to live for a few years and go from there.

t. currently on the neetbux part of the master plan

>> No.62644189

new thread, though
>>62644176

>> No.62644299

>>62644156
>Includes:
>9.5 hours on-demand video
>2 Articles
No, that's a horrible deal. Get a decent book from libgen.io, or watch some video lectures from a US university (don't remember which one, but there is one that has some published, I think khanacademy has some too)

>> No.62644332

>>62643759
what's with that fucking indent size

>> No.62644587

>>62643288
Please respond.

>> No.62644725

>>62644156
Take advantage of the 3 months of free Pluralsight instead

>> No.62645978

>>62638661
see
>>62645657

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action