[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 329
Thread images: 35

File: Izzy_y_Tentomon_2.jpg (29KB, 480x360px) Image search: [Google]
Izzy_y_Tentomon_2.jpg
29KB, 480x360px
What are you working on, /g/?

Old thread: >>58681139
>>
>>58685041
Learning 6502.
Thank you for posting an anime image.
>>
File: jump tables.png (20KB, 416x267px) Image search: [Google]
jump tables.png
20KB, 416x267px
>>58685041
Made instructions smaller using new Jump Tables™ technology.
>>
File: 2017-01-27-205034_485x580_scrot.png (26KB, 485x580px) Image search: [Google]
2017-01-27-205034_485x580_scrot.png
26KB, 485x580px
am I hacking yet
>>
>>58685090
want a job?
>>
Is it me or is lisp not scary.
I read C or C++ code and I feel scared by it, but lisp makes it feel childish in a way and is not scary.
>>
I'm doing this:
|
|
V
>>58684549
>>
>>58685096
sign me the fuck up my mom says I'm the next steve jobs
>>
Is this a good place to find an open source project to help with? I'm having a hard time getting a job because I didn't take an internship while in college, and internships only seem to want current college students. I'm thinking I'll work on a portfolio but I don't have any striking ideas for a project.

Sorry if this is a stupid question.
>>
>>58685039
Import the data to a db as it is right now first, then worry about moving it around. It'll be much easier than doing it mid-transition.
>>
>>58685117
write a text editor
write a graphical user interface for a command line tool you use often
write a window manager
write a terminal emulator

there you go you have a strong starting portfolio
>>
File: solution.png (13KB, 518x323px) Image search: [Google]
solution.png
13KB, 518x323px
I've only been learning Java for 4 days now, but I came across an exercise I had some real trouble with.

>Create a program that calculates the sum 1+2+3+…+n where n is a number entered by the user.

System.out.print("Until what? ");
int userInput = Integer.parseInt(reader.nextLine());
int iteration = 0;
int sum = 0;

while (userInput > iteration) {
sum += iteration + 1;
iteration++;
System.out.println(sum);
}


This is how I solved it, but I'm not even sure why it works. I wrote out the mathematical operations it performs and it does what it's supposed to, but I don't know why. Why does that + 1 work when it's absent from the official solution?
>>
>>58685123
I'm not sure how I can do what I want to do in SQL. I'd have to make the table in the format I want, then what? I guess I could insert into the table each column at a time for each tree id#, but I need to study up on some sql-fu
>>
>>58685143
>not using recursion
>>
>>58685143
Your
iteration
is always equal to 0. You never change it to anything. Substitute
iteration
in your code with 0 and you'll see why.
>>
>>58685143
Read up on gauss. you don't need loops at all:

http://mathcentral.uregina.ca/qq/database/qq.02.06/jo1.html
>>
>>58685117
>>58685137
ps if you can fix a few bugs in the linux kernel, HMs will be slobbing all over your nob in literally 14 seconds
>>
>>58685179
m8...
>>
>>58685171
>>58685181
I'm following a course guide, I'm sure it'll touch on that later.

>>58685179
But isn't
iteration++
adding +1 on each iteration of the loop? 0+1 -> 1+1, 2+1, etc
>>
>>58685179
This is wrong. He wrote iteration++
>>
>>58685159
Do it on strings now if you don't know what's in the data.

Create a table with n string fields.

Export the data as csv. There's a script on http://stackoverflow.com/a/1860269/3105260 that you can use to help you with that.

Use COPY https://www.postgresql.org/docs/9.2/static/sql-copy.html to import it.
>>
>>58685206
The +1 works because you have:
while (userInput > iteration)


and the official answer has

while(number <= limit)


notice that you have < and they have <=. This means that yours will stop just short of the number where iteration == userInput. However, because you have the +1 there, it will add whatever userInput is to sum.
>>
>>58685195
>>58685206
>>58685213
Fuck it, I'm going to sleep.
>>
>>58685233
Thanks, thats good advice. But I still need to make their database look good. I need to make it... RELATIONAL
>>
>>58685248
I hope you mean forever
>>
>>58685248
every minute you're not practicing is another minute a pajeet takes another potential job from you
>>
does php count?
>>
>>58685255
That's the next step, yes. But it'll be easier to do inside your db, once you figure out what the data actually means.
>>
>>58685137
Thanks for the advice.

These ideas all sound boring as fuck but I guess that's what I get for not getting an internship in college. At some point you just have to man up and do some stuff that is boring as fuck.

I'm offering my minimal java, c++, and python experience to anybody who wants it, though.
>>
>>58685143
println(userInput * (userInput + 1) / 2 )
>>
File: bravo?.png (193KB, 1884x875px) Image search: [Google]
bravo?.png
193KB, 1884x875px
>>58683039
>>
>>58685304
well what kind of ideas aren't boring in your opinion?
>>
Lads I know C, C++, Java, Scala, Haskell, and JavaScript. What should I learn next?
>>
>>58685304
Those are boring?
Man, once you learn how terminal emulators work you'll change that opinion.
>>
>>58685308
Yeah I played around with that after reading:
>>58685181

I didn't know how involved math was with programming before starting to learn it. The purpose of the exercise was to make sure the reader understood += and counting iterations,

>Hint: Create the program using the while statement. Use a helper variable in your program to remember how many times the block has been executed. Use also another helper variable to store the sum. During each execution add the value of the helper variable that counts the executions to the variable in which you should collect the sum.
>>
>>58685335
>lads
try again
>>
>>58685359
Attack helicopters, I know C, C++, Java, Scala, Haskell, and JavaScript. What should I learn next?
>>
>>58685335
Now something esoteric
Factor
>>
>>58685364
brainfuck
6502 assembly
>>
>>58685317
I suppose that's the problem with my viewpoint. If I had any ideas which weren't boring, I would be doing them, wouldn't I?

I imagine I'll have more fun in an actual job because I'll be working with a team and I'll be making money. It's hard to self-motivate, though. I'm sure I sound like a baby.
>>
>>58685304
If you think that text editors are boring, you haven't used Vim.
If you think that window managers are boring, you haven't used a tiling one.
If you think that terminal emulators are boring, you don't know what these two words stand for.

Also there's >>58685191
>>
>>58685041
I wrote this userscript:
https://greasyfork.org/en/scripts/10096-general-url-cleaner
>>
>>58685315
That many files visible.
Is your memory that bad?
>>
>>58685315
Read from stdin, not argv.
>>
File: CBpxF32WEAAFVUm.png (442KB, 600x900px) Image search: [Google]
CBpxF32WEAAFVUm.png
442KB, 600x900px
Know what, I fucking give up on C++.

Its a dying language nobody fucking cares enough about to learn how to maintain it.

Tell me a new programming language that seems to have a bright future that I should learn.
>>
>>58685509
Rust
>>
>>58685315
Why is the c++ one wrong?
>>
>>58685509

mate if you can't pick up the simplest programming language you won't be able to program with anything else
>>
File: smuggy.png (222KB, 1000x963px) Image search: [Google]
smuggy.png
222KB, 1000x963px
>>
>>58685509
Idris
>>
>>58685534
istream& operator>> (istream& is, signed char* s);
gets called on
int8_t a; std::cin >> a;
which reads into a char. It doesn't parse the input as a number, just reads a char. Why? Because
typedef signed char int8_t;
in <cstdint>. int8_t is really a character type that just looks like an integer.
>>
>>58685538
Im not dropping it because its hard, Im dropping it because the only way to develop on it is if you have Linux, and its use is pretty specific and inflexible.

If people can't fucking make developing for it work on Windows, why the fuck should I care about it?
>>
>>58685335
A scripting language.
>>
>>58685509
C++
>>
>>58685509
Rust
>>
>>58685590
https://www.visualstudio.com/vs/cplusplus/
>>
>>58685590
???
C++ is one of the few languages that you can actually use on Windows.
>>
File: 1368858831232.png (171KB, 346x297px) Image search: [Google]
1368858831232.png
171KB, 346x297px
>>58685590

google cygwin
>>
>>58685590
>If people can't fucking make developing for it work on Windows, why the fuck should I care about it?

Lolno, it's the other way around. C/C++ are languages Windows is written in, they are system programming languages. It depends on the platform how a they behave. It's just that Microsoft and your operating systems are both terrible, and you should feel bad that you are paying so much for an OS that isn't even conformant to the first C standard.
>>
poorfag here looking for a copy of extreme programming explained 2nd edition by Kent Beck. no luck so far :(
>>
>>58685590
If you can't even do the simple task of setting up a C or C++ dev environment on Windows you're never gonna be able to learn to program.
>>
>>58685587
wow
>>
>>58685672
What you say doesn't mean shit unless you have clang working perfectly on windows.

If not, fuck off.
I want to learn a language not set up 2000 fucking libraries.
>>
>>58685315

your check_prime() function isn't very comprehensive
>>
>>58685692
sudo apt install build-essential
>>
>>58685737
Wasn't mine
>>
>>58685692
I have msvc, gcc and clang setup and working just fine.
>>
>>58685064
What do you learn 6502 for?
>>
>>58685692
Why not use this microsoft creation? https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

>>58685756
GCC does not support windows.
>>
>>58685509
Java, Python
>>
>>58685766
>GCC does not support windows.
Yes it does.
https://gcc.gnu.org/install/specific.html
>>
Why does every programming language apparently have a multitasking OS embedded in them?

Instead of making 1 program do everything well, people reinvent Linux in their languages and try to do threading inside them

I still remember when HTTP servers were actually a program that accepted connections and started ANOTHER program, feeding people's requests into it and serving its output as HTTP response

Today faggots do a bullshit HTTP.listen(port) oneliner "servers" in node and go as if that was even close to being as robust as a real server
>>
>>58685810
>Why does every programming language apparently have a multitasking OS embedded in them?
They don't.
>I still remember when HTTP servers were actually a program that accepted connections and started ANOTHER program, feeding people's requests into it and serving its output as HTTP response
Too much overhead.
When you're serving millions of connections even a few bytes or a few extra cycles adds up.
>>
>>58685810
>1 program do everything
How do you want to do everything without reimplementing Linux?
>>
>>58685080
Looks interesting? Is it on GitHub™?
>>
>>58685810
>Why does every programming language apparently have a multitasking OS embedded in them?

I wish. No OS is truly programmable in the same way a programming language is.

What I really want is a way to execute functions as if they were processes. No binaries or commands or any such bullshit. Just function calls. I'd write up a function that'd scrape some website for example, and it'd bring the information to me on a nice little window.

Why can't things be good dpt
>>
>>58685315
Sift the Two's and Sift the Three's,
The Sieve of Eratosthenes.
When the multiples sublime,
The numbers that remain are Prime.
>>
>>58685850
Not yet, though I'll give you a copy of the source if you want.
>>
how do i choose pivot?
>>
>>58685883
>What I really want is a way to execute functions as if they were processes.
>No binaries or commands or any such bullshit. Just function calls.
You'd have no persistent state and you'd have to reimplement everything from scratch every time (essentially write your own program-as-OS)
>>
>>58685335
So you've made your way through the fodder, maybe you should get stuck into a decent language.

C#.
>>
>>58685934
>You'd have no persistent state and you'd have to reimplement everything from scratch every time

... Why? Pretty sure functions can save files
>>
>>58685335
Racket
>>
>>58685509
C++.
>>
>>58685590
Are you fucking retarded or something? Have you not heard of Visual C++ or something?
>>
>>58685315
Who's in the wrong here?
>>
File: Screenshot_2017-01-27_21-49-42.png (121KB, 1007x890px) Image search: [Google]
Screenshot_2017-01-27_21-49-42.png
121KB, 1007x890px
Now this is autism
>>
>>58685590
So these are the people bashing C and C++.
>>
File: aut.jpg (92KB, 480x315px) Image search: [Google]
aut.jpg
92KB, 480x315px
>>58686049
>>
>>58685590

Download this:
http://tdm-gcc.tdragon.net/
>>
>>58685587
This is why C++ needs a fucking byte datatype already.
>>
File: 1481512059324.png (300KB, 520x800px) Image search: [Google]
1481512059324.png
300KB, 520x800px
>when people are more concerned with following "principles" and "practices" and doubling down on their OOPthink than writing good code
>>
>>58685883
Literally all of that is possible. You're just retarded.
>>
>>58686084

>byte datatype
unsigned char
>>
>>58685883
You mean Lisp machines?
>>
>>58686123

yeah that's some pathetic shit

especially if you are a hobbyist. you shouldn't give a flying fuck. the whole point is to do things differently/orignally
>>
>>58686139
What would that fix in this situation? For
uint8_t
instead
istream& operator>> (istream& is, unsigned char* s);
would have been called.
>>
>>58686164
It's not even about trying something new, it's about not writing worse code because it aligns more with what your Java professor or design pattern book told you.
>>
File: 20170127_221424.jpg (2MB, 2880x2160px) Image search: [Google]
20170127_221424.jpg
2MB, 2880x2160px
>>58685041
why my front panel gets so dusty
>>
>>58686139
$ cat main.cxx 
#include <iostream>

int main()
{
uint8_t x = 97;
std::cout << x << '\n';
}
$ g++ main.cxx
$ ./a.out
a

As I said, C++ really needs a byte datatype, because it doesn't have one.
>>
>>58686190
>sideways
i fokin h8 my life
>>
>>58686197
how about (int)x my dude?
>>
>>58686197

#define byte unsinged char
>>
>>58686167

Well, after a quick test, I suppose not. But the problem is with the iostream functions, not the type. The signed char and unsigned char types are C++'s byte type. For all typical operations on them, they are just integers. But since a character is an 8-bit integer as well, iostreams are overloaded for chars differently.

Although it begs the question why you are using 8-bit integers for this.
>>
>>58686228
>>58686243
What an echo chamber
>>
>>58686257
?
>>
>>58686243
You don't get it do you, you fucking retard?
Explain to me HOW your stupid little fucking define is going to solve the problem in >>58686197

>>58686228
Absolutely retarded and ugly. Why the fuck would I have to cast a byte to an int to fucking print it as a byte?
>>
>>58686048
> Ada has better understanding of the c data types than c++
Hard to say
>>
>>58686267
function overloading, since unsigned char is treated as an ascii character.
>>
>>58686197

What C++ needs is a stream manipulator for printing and reading chars as regular integers. The fact of the matter, however, is that char is the byte type. It accepts arithmetic operations just like any other integer type, and it is represented as exactly one byte, for however big a byte is on the system.
>>
>>58686251
>But the problem is with the iostream functions, not the type.
It's not iostreams problem, and it's not the datatypes problem.
The problem is that C++ has no byte datatype (and I mean literally "byte", that would be the name of the type).
If C++ had a byte datatype, then any function that accepts bytes and chars can easily distinguish between them instead of using chars for bytes like a fucking retard, and printing chars when you're supposed to be printing byte sized integers.

This C++ retardation is one of the reasons I abandoned streams in my kernel and just implemented kprintf, and everything was infinitely better after that.
>>
>>58686267
>Absolutely retarded and ugly. Why the fuck would I have to cast a byte to an int to fucking print it as a byte?

chico...

if it's in std::out then it's just 1s and 0s

if you want to print it you should printf it
>>
>>58686282
>since unsigned char is treated as an ascii character.
Exactly, that's the fucking problem here. C++ has no byte datatype so people have to use fucking chars as bytes, and causes problems like this.

>>58686290
No, this is retarded.
It's a whole lot better and solves more problems to just simply introduce a byte type.
Yes, char supports arithmetic operations, and char gets abused as the byte type. It's not a fucking byte, it's a char and it gets interpreted as a fucking char because it IS a char, hence the fucking name.
All C++ needs to do is introduce a byte type that supports the same operations as char except it participates in operator overloading and is interpreted as a byte sized integer.

Having a stream manipulator to interpret a char as a byte is the same as just casting to an integer, and it's retarded and ugly.
>>
>>58686251
>iostream functions
iostream does define functions.
The problem is in istream's operator>> and ostream's operator<<. The type system should be used to help the programmer, not the other way around. Make a unsigned char a unsigned char, and uint8_t an int8_t, seperate types. Let them be implicitly cast to each other. Done, and seems like with no compatibility issues.

>>58686290
Yes, the whole io library is kidna retarded.
>>
>>58686326
std::cout is formatted you retard.
>>
>>58686190
>>58686202
what does this have to do with programming
>>
>>58686333
*iostream doesn't define
>>
>>58686339
He is right tho.
It's all 1s and 0s.
>>
>>58686370
Yes. Formatted 1s and 0s
What the hell is your point? everything on computers is 1s and 0s
>>
>>58686339
rude
>>
>>58686386
It was an attempt of humour.
>>
File: 1440103376422.png (222KB, 381x341px) Image search: [Google]
1440103376422.png
222KB, 381x341px
>nominal types
>>
File: gskldhgdfhlkgd.png (84KB, 235x250px) Image search: [Google]
gskldhgdfhlkgd.png
84KB, 235x250px
>rookie dev working at startup
>get put on newest project while senior dev stays with old project
>basic idea is to have the slimmest database possible and use S3 for storing damn near all content
>and get something working within 2 months
>mfw I get it working and the system works perfectly in most cases but completely falls apart in others

I am 3 months in and it looks like I will have to do a second redesign of the backend storage system.
>>
>>58686437
Does not seem like a good idea.
>>
>>58686339

format yourself my nigga
>>
File: 1404399358132.png (170KB, 490x355px) Image search: [Google]
1404399358132.png
170KB, 490x355px
>>58686458

yeah I am basically blundering into shit at this point. I have no design docs to go off of so anything they ask I do it the way I think it is or interpret what they say in meetings for how the logic should work on the backend.

it's bitten me in the ass because my bosses logic is different from mine.

I broke down in tears today because my backend wasn't finished, I got tasked to finish a sub project dealing with front end content and my designer kept bitching about a UI I never finished because I got retasked mid way through.
>>
>>58686328

Here is the problem with your argument...

C++ has been around for almost 32 years, and C for 47. They're pretty goddamn old, and there's convention for a lot of things. The convention used in nearly every standard library function and every commonly used system library (POSIX, Win32, etc...) is this: unsigned char is the byte type. Every codebase already in existence has used the unsigned char type without a problem.

No one wants to change the types they're using in their programs just because you felt the need to cout a single byte. By the way, you're using the wrong types here. You don't use an 8-bit integer just because you want to save space. It's going to take up an entire register any way you slice it, and if it goes on the stack, you're probably going to be rounding up the amount of memory used due to alignment issues. Bytes are not for general arithmetic.
>>
File: 2017-01-27-234534_637x658_scrot.png (18KB, 637x658px) Image search: [Google]
2017-01-27-234534_637x658_scrot.png
18KB, 637x658px
can I have a job now
>>
>>58686530
lmao finish the job you were hired to do u pussy
>>
Should I ever take php seriously
>>
>>58686576
The next version of the C++ standard comes out this year. They seem to generally not mind having multiple ways to do things.

>Win32
>A byte (8 bits).
>This type is declared in WinDef.h as follows:
>
typedef unsigned char BYTE;


POSIX is not a system library.
>>
>>58686275
Ada has three (3) different versions of C's char specifically for this purpose.
>>
File: 7095238893_5000f6e57d_b.jpg (175KB, 1024x680px) Image search: [Google]
7095238893_5000f6e57d_b.jpg
175KB, 1024x680px
>>58686606
>>
>>58686576
>Bytes are not for general arithmetic.

Not on an 8-bit processor.
>>
>>58686649

On an 8-bit processor, is it likely that you will be using cout a lot?
>>
>>58686667
No, but working function overloading could be useful.
>>
>>58686606
unless you're inheriting legacy code with some SERIOUS domain-specific library support and an inside look at the previous maintainer's mind, no.

Use a modern language. [insert Python/ruby/Node/GO/asm argument here]
>>
>>58686606
Just google "PHP: a fractal of baddesign", read it and take it to your heart.
>>
>>58686600

I will it just sucks knowing that what I thought was a good design turned out to be such a fragile piece of crap that I will have to redesign it.
>>
>>58686649
>C++
>8-bit processor
You are going to have some custom compiler, aren't you?
Short type is most likely to be bound to 8 bits.
>>
>>58686800
Let's look at arduino and avr. The compiler is gcc and shorts are 16 bits long.
>>
>>58686800

int and short are required by standard to be at least 16 bits in size.
>>
File: 0d2.jpg (20KB, 600x601px) Image search: [Google]
0d2.jpg
20KB, 600x601px
>>58685883
Your post is dumb, and you should feel dumb.
>>
Am I shitposting right now?
>>
File: the m word.png (16KB, 1278x236px) Image search: [Google]
the m word.png
16KB, 1278x236px
>>58685934
>>
Oh hey, here's a simple way to appease Anon...

struct printable_byte { int8_t value; };
struct printable_ubyte { uint8_t value; };


Now go forth and write some istream/ostream operators on top of those and leave the standards committee alone.
>>
>>58687587
Do you honestly believe this is a good solution?

The ONLY good solution is introducing a byte type. Everything else is complete garbage and needs to fuck off.
>>
/dpt/ is dead
>>
File: 5b54e83afe5e37abaa08b28761a34749.png (374KB, 630x1000px) Image search: [Google]
5b54e83afe5e37abaa08b28761a34749.png
374KB, 630x1000px
Does anyone have that image which compares to programming languages?
It was posted on /g/ in the past 2 days. I forgot which two languages were on there, but it said something like

It was a one sided comparison with the good language getting stuff like "Very Well Documented"
>>
File: C vs OOP.png (12KB, 767x360px) Image search: [Google]
C vs OOP.png
12KB, 767x360px
>>58687766
probably not the one you wanted
thank you for the anime image tho
>>
File: 2042244_1000.jpg (120KB, 1000x651px) Image search: [Google]
2042244_1000.jpg
120KB, 1000x651px
How do i develop my app with webhooks? I mean i can't set them to my local machine.

https://core.telegram.org/bots/api#setwebhook

Remotely developing on server seems pretty dumb to me, and doing it without debugging eyes-shut on local machine too.
>>
>>58687701

You have a use case specific to your needs, that isn't really needed on a large enough scale to merit it being added to the language. Therefore, defining a type yourself that has the operations you need is the best solution.

A struct that contains just a single integral type is going to be as big as that integral type, and will be passed around in the registers. You can define operators over the structs for basic arithmetic, and make iostream overloads to get them printable. You can cram that shit in a header library and never have to face the problem again, and no one will have to hear your bitching again.
>>
>>58687806
>I mean i can't set them to my local machine.
why

>Remotely developing on server seems pretty dumb to me
why
>>
>>58687838
We shouldn't bother the C++ community about it, since they have enough trouble implementing the standard already.
>>
File: 1460298670001.jpg (5KB, 370x334px) Image search: [Google]
1460298670001.jpg
5KB, 370x334px
Good evening, dpt.
Today I have a question regarding file I/O in C.

Is there any library for bash/zsh/fish for C or C++?

What I mean is: I want to call stuff like:
#include <bash.h>
//some bash command like
int func(void){
return bash(lsblk -l | grep "/media" | cut -c 1-4);


Now keep in mind that I want C/C++ to emulate the bash command because I do not want to sacrifice my performance here. I know bash is very slow.

Sorry but I am new and please get used to me and my stupid questions, I'll be around for a while.
>>
>>58688073
I know that's not a file I/O but I want to emulate simple bash commands such as
echo "hald_enable=YES" >> /etc/rc.d
>>
File: 1485587125333.jpg (5KB, 282x147px) Image search: [Google]
1485587125333.jpg
5KB, 282x147px
>C fags are still triggered by C++
Just kill yourselves, niggers.
>>
File: 1480831989197.jpg (25KB, 480x634px) Image search: [Google]
1480831989197.jpg
25KB, 480x634px
>>58688105
I love both C and C++
>>
>>58687838
>that isn't really needed on a large enough scale to merit it being added to the language.
And yet nullptr and nullptr_t got added, and they solve pretty much the exact same kind of problem, but for null pointers.
If nullptr(_t) got added, then I see no reason for them not to add byte.
>>
File: 560629853582.jpg (29KB, 600x456px) Image search: [Google]
560629853582.jpg
29KB, 600x456px
>>58688119
As expected from a retarded bratfag.
You can't like more than one language.
>>
File: 14806977129963.png (439KB, 720x720px) Image search: [Google]
14806977129963.png
439KB, 720x720px
>using languages
>>
>>58688073
>>58688099
So your asking if someone has ported the entire bash script into c?
Well bash was written in c...

So your asking if someone has a FASTER version of the entire bash script writtin in c?
Thats dumb.

So your asking how do you call that specific bash function in c?
google it u fuck tard.
the first link from
"can i call bash funcitons in c?"
answerd this.

4chan is going out of buissness, stop wasting what few server dollars they have left with ur stupidity.
>>
>
>>
>>58688073
That should be simple enough to do.
Not the emulation I mean. Pass it to actual bash like a sane person.

If you're using bash, you shouldn't be caring about performance at all.
>>
so why do you guys have php?
>inb4 slow
php7 isn't really

I'm honestly curious, I work as a webdev, and we do 99% of our shit in php, so I grew rather fond of it
everything is just so easy
>>
>>58688073
why not just do
output = system("sh -command-");
>>
>>58688165
>>58688187
I searched for it before and I do not want to call bash, I want to know if there is any bash library available for C or C++.

I want my program to easily perform bash operation such as "click to disable sleep on lid close" [goes to ssh config and edits the conf file] without depending on actual bash.

Like a bash wrapper
>>
>>58688166
What does this expression convey, weebs? I'm genuinely curious.
>>
how do I become a useful little code monkey that gets paid in bananas and nuts?
>>
>>58688204
>they want a wrapper that increases performance
its ok guys, its a troll.

there are free online CS101 video classes.
>>
>>58688206
she's on the spectrum for sure
>>
>>58688204
eh well most likely not without system()
in the end all bash does is run different programs in a specific order
you could do the same, by running system("-whatever-");, and it should have the exact same effect as a bash script, albeit without the scripting support
I'm not really sure about output piping either though

>>58688211
...they never said that in their post
you bully
>>
>>58688217
>they
>>>/r/ibbit
>>
>>58688211
I'm not trolling. Vala (afaik) is like a C wrapper too, it generates pure C.

>>58688217
hmm thanks, I will have to research further
>>
guys there is this guy who makes tutorials on OOP programming and he keeps saying "protect my data"

I'm a noob myself but somehow this triggers me. I dont know why
>>
>>58688179

Read PHP: A Fractal of Bad Design.

>>58688204

Bash is not an embedded language, it is a shell language, and it is not entirely appropriate to just start launching off other processes to solve your problems from a C program.
>>
>>58688226
>he
>she
>they
why do you even care
I'm trying to help someone while being polite
does it trigger your autism, because we're on 4chan
and fuck you man, I don't even use reddit
i absolutely hate the design of that page

>>58688233
ye no prob buddy

>>58688236
>starts with the toolbox analogy
oh boi it's good already
and by that I mean it's shit
>>
>>58688217
>I do not want to sacrifice my performance here. I know bash is very slow.
>Like a bash wrapper.
Put the pieces together.

I sometimes jump the gun, and confuse unintentional absolute incompetence with intentional absolute incompetence.

I figure if they werent trolling us and trying to waste out time. they would google around, and watch a few introductory classes.
>>
>>58688260
>trying to waste out time
What's your hurry?
>>
>>58688248
but you do
don't lie. at least not to yourself
>>
This is just for fun, not homework.

Function attempts to create an array of all numbers between a and b (and and b inclusive)
Then sum together the number of 1s in the binary representation of all numbers in the array.

This keeps returning the sum+1 and I'm stumped, it must be something stupid.
int rangeBitCount(int a, int b) {

std::vector<int> v;
int sum = 0;
while (a <= b) { //push ints into vector
v.push_back(a);
++a;
}

for (int i=0; i < sizeof(v); ++i) {

int val = v[i];
int mask = 0x01;

for (int j=0; j < 3; ++j) {
if(val&mask)
++sum;
mask=mask<<1;
}
}
return sum;
}
>>
>>58688279
>This is just for fun, not homework.
yeah, sure. thanks for telling us
>>
>>58688236
>>58688248
okay yeah this is a terrible list of bullshit
>PHP takes vast amounts of inspiration from other languages, yet still manages to be incomprehensible to anyone who knows those languages. (int) looks like C, but int doesn’t exist.
except int does exist in php, at least any version used on 99% of servers

>Unlike (literally!) every other language with a similar operator, ?: is left associative.
huh?
what?
this is just simply wrong, as I use this all the time

literally only correct argument in this whole thing is "== doesn't check for type"

>>58688260
wrappers are usually created out of convinence, not for speed

>>58688274
no I don't, you complete fucking retard
I hate the fact that fuckfaces like you don't use trips, so that I can't outright filter your stupid ass
>>
>>58688248

>toolbox analogy
It's a fairly valid analogy. Anything PHP can do, another language can do better. The web dev language du jour is Node.js anyways. PHP really is only for maintaining old ass shit.
>>
>>58688279
constraints on the numbers are a<= b <= 10
that's why the inner loop is size 3, max binary representation is 111
>>
>>58688285
>node.js
and here I thought we might have a meaningful conversation
sorry for making that assumption
>>
>>58688284
>no I don't, you complete fucking retard
Please prove this you fucking retard.
>>
>>58688297
why would I
why don't you use a trip instead
>>
>>58688300
So basically you're admitting that you're a plebbitor then.
>>
File: 1460112359742.jpg (156KB, 430x720px) Image search: [Google]
1460112359742.jpg
156KB, 430x720px
>>58688236
Ruby senpai, if bash is written in C, does it mean it _can_ be ported or embedded to C as a library?
I'm honestly not trolling, I'm just new to all this.
>>
>>58685107
Not just you. It's pretty easy to parse mentally. The only part that may be hard is if you have some fucking disgusting macro or something like this:
(let ((let '`(let ((let ',let))
,let)))
`(let ((let ',let)) ,let))

All joking aside, for the most part, it tends to get out of the way (unless you hate parens :-).
>>
>>58688307
no, I'm simply pointing out that I have nothing to prove to a person asking me to prove something on the internet
isn't the whole idea of privacy and not having to show everything, even if you're clear beloved by spergs like you
>>
does bresenham work on isometric diamond tiles?
>>
>>58688318
bash, the program is written in C
all it does is run system programs
so when you say "mkdir X"
it looks in /usr/bin/ for mkdir, then /usr/share/bin/ ....etc
then pipes the output into the terminal
bash, the scripting language (.sh files), are just a list of commands that bash (the program) will run, depending on the scenario.
>>
>>58688318
https://www.nostarch.com/tlpi
>>
>>58688318
If if it could, it will NOT make it faster.
>>
>>58688293

JavaScript is a slightly less shitty language than PHP. Everything that sucks about JavaScript is more or less true in PHP, but PHP has additional parts that suck about it.

>>58688318

You could theoretically find a way to take part of bash and export a bash_eval function to execute complex commands within an embedded interpreter without launching off a new bash process. In practice, this idea is retarded.
>>
>>58688324
I met many retarded people in my years on this site but you easily made it into the top 10 with this
>>
>>58688357
>Everything that sucks about JavaScript is more or less true in PHP, but PHP has additional parts that suck about it.
Eeeeeeeeeeeeh. Let's agree to disagree.


>>58688361
ye sure whatever go play with your dragon dildo
>>
>>58688283
I just know people come on here a lot asking for homework help. This is more just a fun exercise.
>>
>>58685171
>using recursion in a language that doesn't use TCO
>>
File: 1476306634495.gif (993KB, 490x375px) Image search: [Google]
1476306634495.gif
993KB, 490x375px
>>58688341
Ah, that clears up so much.
Thank you anon

static void _mkdir(const char *dir) {
char tmp[256];
char *p = NULL;
size_t len;

snprintf(tmp, sizeof(tmp),"%s",dir);
len = strlen(tmp);
if(tmp[len - 1] == '/')
tmp[len - 1] = 0;
for(p = tmp + 1; *p; p++)
if(*p == '/') {
*p = 0;
mkdir(tmp, S_IRWXU);
*p = '/';
}
mkdir(tmp, S_IRWXU);
}
>>
>>58688388
You are a troll
>>
>>58685335
How to manage a team of Pajeets.
>>
>>58688341

Bash can do a titch more than launch programs. It can also create pipes and redirects, and execute if statements and for/while loops. It has a few commands that are built in, rather than being executables.

There would be a use for embedding Bash, rather than simply fork/execing shit. It's just that this is a dumb idea in general.
>>
>>58688388
I don't really get why you posted this code

>>58688431
> It can also create pipes and redirects, and execute if statements and for/while loops.
>>58688341
>then pipes the output into the terminal
>bash, the scripting language (.sh files), are just a list of commands that bash (the program) will run, depending on the scenario.
so basically what I said

>It has a few commands that are built in, rather than being executables.
ah, I don't really use shells for the most part, so I wouldn't know about this I guess
>>
>>58688455

>pipes the output into the terminal
What you neglected to mention was its ability to pipe the output of one program into the input of another, or into a file.
>>
>>58685143
use a for loop instead of a while loop
>>
>>58687587
http://clhs.lisp.se/Body/f_rd_by.htm
>>
>>58688105
The only good language is Lisp.
>>
>>58688105
>Object-oriented programming is an exceptionally bad idea which could only have originated in California.
t. Dijkstra.
>>
https://benchmarksgame.alioth.debian.org/u64q/csharp.html
Doesn't look good for C#.

Can microsoft shills explain?
>>
>>58689221
why would you want an """""explanation""""" from shills?
even if we for a second assume that a legitimate reason exists (which it doesn't), why do you think their explanation would be of any value?
>>
What open source projects are you working on?
>>
>>58686328
>REEEEEEEEE

Aaaahahahahahaha oh my god anon. This is really important to you isn't it? I'm havig a blast reading your neckbeard overreactions.
>>
>>58686049
>everything is syntactic sugar. The only way to increase efficiency is to create higher level abstractions
I can't believe they let people like this design languages. You don't need more syntax in order to create deeper abstractions.
>>
>>58689290
I'm learning C/C++ and I want to create a desktop environment based on Qt framework.
>>
>>58689307
Well I'm glad that you found it humorous. At least I achieved something.
>>
>>58689310
What is the programming language?
>>
>>58686049
>if I just add another function call it will be faster!
>is your search slow? Clearly it's that this datastructures needs more indirection.
>look at my templates. They make everything so fast!
>>but your program is slow
>it's because it's complicated!!
>>
>>58689276
Jesus Christ you are such a dense autist. He wants an explanation, and since anyone who comes forth and justifies any decision relating to C# is going to be called a shill, he does it first.

Or, alternativelly, he feels there is no justification possible and is being smug and saying "what now, shills?"

You dense piece of shit. Get out more and learn to communicate with other normies.
>>
Is it okay to have both PyQt4 and 5 installed?
Won't they conflict? or do I need to do some tweaking?
>>
>>58689221
These times are unacceptable in both cases. I don't see why C# would bother you.
>>
>>58689406
>He wants an explanation
any explanation from a shill is by definition not a an explanation.
>anyone who comes forth and justifies any decision relating to C# is going to be called a shill, he does it first.
this is blatantly false. he didn't call someone a shill, he asked microsoft shills to give him an """"explanation""""
>Or, alternativelly, he feels there is no justification possible
why did he literally ask for one then?
>being smug and saying "what now, shills?"
being smug requires not outing yourself as a retard in the very beginning of your post.
>Get out more and learn to communicate
why exactly would I want to do that?
>with other normies.
with your kind you mean?
>>
>>58689378
I don't know, but it doesn't matter.
>>
>>58689413

you can have both installed. I read it somewhere in the Qt documentation 2 days ago I remember.
>>
>>58689494
Thanks.
>>
guys I need the code monkey starter kit
>>
>>58689502

here I found the line

>PyQt5 can be installed alongside PyQt4 using the same Python interpreter without any problems so long as they are built with the same version of SIP.
>>
>>58689505
i believe they have something like that on reddit
>>
def LUdecomp(a): 
n = len(a)
for k in range(0,n-1):
for i in range(k+1,n):
if a[i,k) != 0.0:
lam = a [i,k]/a[k,k]
a[i,k+1:n] = a[i,k+1:n] - lam*a[k,k+1:n]
a[i,k] = lam
return a


Wtf is [x,y) supposed to mean??
>>
>>58689631
probably a typo unless that's some obscure feature I don't know.
>>
Are there any performance-related drawbacks to using a lot of global variables? Just the risk of clogging up the cache, right?
>>
>>58689650
Use global variables when appropriate. Don't try to force a global piece of state to be passed all over for dogmatic reasons.
>>
>>58689631
In math [0,1) means 0 inclusive to 1 exclusive right?
I don't quite remember. But it was something like that. Maybe it's significant?
>>
>>58689687

a[i,k] is slicing the list a from index i to index k-1
>>
>>58689732

i mean a[i:k] im retarded
>>
>>58689510
Hm.. I've having some problems.
I'm using Py 3.5
I have PyQt 5.7 sucessfully installed at running fine.
I've tried installing PyQt4 from here (http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4) and although it works, it seems buggy, when I run the .py file, the window automatically disappears.
PyQt5 also stopped working, the error it gives me is something related to SIP.

Any ideas?
>>
>>58689631

tupels as list indices? huh
>>
>>58689687
yes
>>
I'm a java pajeet and i'm trying to learn c++.
I want to target linux, osx and windows.

Should i avoid boost or qt?
If yes, why?
>>
>>58689881
C++ is shit.
>>
This is basic c++ classes stuff, but something eludes me.

I have a basic summing function for complex numbers:
Complex sum(Complex z){
Complex r;
r.real=real+z.real;
r.imaginary=imaginary+z.imaginary;
return r;
}


Yet when I try to declare a new variable as the sum of two pre-existing ones, I doesn't want to work:
//NOT WORKING
Complex z3=z1.sum(z2);

//WORKING
Complex z3;
z3=z1.sum(z2);


Why?
>>
>>58689892
Oh well, if /g/ says so.

Should i try C? Rust? Go?

Are the last two relevant?
>>
>>58689898
wtf is the point of the method though? The object you're calling it with has nothing to do with the method, it's basically calling a copyconstructor through another object? Dafuq
>>
>>58689964
This guy's right
It should be a static method or something
>>
>>58689964
>>58689987
that's not what he asked about
>>
>>58689964
>>58689987
It's a class assignment, I know it's a stupid method and overloading the + operator would be easier, but I gotta get this shit to work...

Complex z3( z1.sum(z2) )

Doesn't work either :c
>>
>>58689898
I'm not C++ expert but from what I remember the first one uses copy constructor, and the second one uses assignment operator. Did you override any of these?
Also what exactly is not working? What is the error?
>>
>>58690011
this works for me though
>>
>>58688322
I love parenthesis, I think it makes it better.
But I understand they're there for meta programming purposes.
>>
>>58690011
also nevermind on this>>58689964, I misread your code :33
>>
For some strange reason, all of my calls to glCreateShader in a separate class/file are causing a segfault. Here's what I'm doing...

GLuint sh3_glprogram::Compile(GLenum type)
{
GLint status; // Used to check compilation status
GLuint id; // ID of this shader

std::ifstream source; // Handle to the shader program source
std::string fname; // Name of the file we want to open
std::vector<GLchar> errorLog; // Error log

if(type == GL_VERTEX_SHADER)
{
id = glCreateShader(type); // Generate a shader ID
fname = "data/shaders/" + programName + ".vert";

source.open(fname);

while(!source.eof())
source >> vertSource;

const GLchar* const* sourcec = (const GLchar* const*)vertSource.c_str(); // What the fuck?
glShaderSource(id, 1, sourcec, 0);
glCompileShader(id);

}


I do have a valid GL context active, as I can clear the screen and set a colour. I'm on Windows using GLEW compiled with mingw-w64 if that's any help.
>>
>>58690126
what language, you fucking retard?
>>
>>58690185
C++ you fucking retard are you blind?
>>
>>58685107
I guess you're only starting with lisp and don't really know much about it. Things can appear pretty scary in the same way that C is scary (which means fuck all because C and C++ aren't even that scary if you know what you are doing)
>>
>>58685261
Friendly reminder for all of /g/ that only shitty programmers get replaced by pajeet. This is why practice is important.
>>
>>58690185
This is joke right? What language does it look like to you, Pajeet? Hint: it's not Java.
>>
>>58690194
how the fuck is one supposed to conclude that? maybe it's some toy language you made yourself which just has C++ like syntax
>>58690208
>java
it looks pretty shitty but not that shitty
>>
>>58690126
I foegot to mention it's crashing on the id = .... assignment line.
>>
>>58690214
Fuck off troll
>>
>>58690220
which one exactly? there's multiple lines which fit your stupid """""description"""""
>>
>>58690228
Nah, it's a legit post. how about you fuck off instead?
>>
>>58690077
There is more to it than meets the eye (as with most things), and if you're working with Common Lisp anyway, you can change how the reader reads code. Let Over Lambda goes into more detail about it:
http://letoverlambda.com/index.cl/guest/chap4.html
>>
>>58690214
>std::
>ifstream
>g++
>mingw

Jesus Christ you're a fucking idiot.
>>
>>58690232
Uhh, the one that calls glCreateShader and assigns the return value to id like I literally said
>>
>>58690185
10/10 quality post
>>
>>58690232
please fuck off
>>
Can I use Bash to modify a list of IP addresses to replace only last digit of each IP?
For example, if there's an IP like 192.168.1.30, I want the script to find the last digit of the IP (or just the digit after last dot on each line), in this case 30, and replace it this way:

>192.168.1.30 (before)
>192.168.1.
>192.168.1.1-192.168.1.255 (after)

If not with Bash, can Perl do it? I'm running MinGW and I've Perl too installed separately, I'm not running a Linux OS though so I cannot use GNU-only stuff, for now at least.
>>
>>58688187
Only sane response to a daft question.
>>
>>58690244
>std::
>ifstream
how is this relevant? are you implying you can't have the exact same "names" in another language?
>g++
so a compiler which isn't even related to C++ somehow becomes C++ if it's renamed to g++? nope...
>>
>>58690264
Please stop posting
>>
>>58690254
probably could do it with sed
>>
>>58690249
yes, there are multiple lines which fit this
>>58690253
please slit your throat
>>
>>58690270
yeah, don't point out where i got something """"wrong"""" or anything. keep it up, "mate"
>>
>>58690220
>I foegot to mention it's crashing on the id = .... assignment line.
>id = .... assignment line.
>id = glCreateShader(type);

>>58690276
Please kill yourself
>>
guys... I just converted my compiler to being a top tier C++ compiler! i just renamed it to g++ it's fucken epic
>>
>>58690295
why are you being so rude? if you want help then make your stupid questions more specific
>>
Why are you fags getting so mad hahaha just turn your computers off and go to bed LMAO
>>
>>58690264
>how is this relevant? are you implying you can't have the exact same "names" in another language?
Of course you can. But would I bother with a meme language for serious work?

>so a compiler which isn't even related to C++ somehow becomes C++ if it's renamed to g++? nope
http://www.cprogramming.com/g++.html
>>
>>58685883
>He doesn't own a Lisp machine
Sad!
>>
>>58690254
input=192.168.1.30
echo ${input%.*}.1-${input%.*}.255


I wouldn't do this with bash.
>>
>>58690276
There is one call to glCreateShader...

>>58690295
Yes, the variable id is being assigned by a call to glCreateShader as is the way specified on the official OpenGL wiki...
>>
>>58690324
>But would I bother with a meme language for serious work?
you are already """"using"""" one though
>your retarded link
how the fuck does this change the obvious fact that something doesn't magically become a c++ compiler if it's renamed to g++?
>>
>>58690326
https://github.com/froggey/Mezzano
>>
>>58690272
This one? http://sed.sourceforge.net/sed1line.txt
How do I make the temp variable though? for the part of the IP before last digit I mean, the script will need it in order to generate the output after "-" (like "192.168.1."+"255" in the example from before).
>>
>>58690336
Nope, i see at least two. Maybe you could learn to read your own fucking source code?
>>
for fuck's sake
>>
>>58690354
Those two lines never get executed, the peogram has already thrown the sefgfault by then.... Plus nothing is being assigned there??

>how the fuck does this change the obvious fact that something doesn't magically become a c++ compiler if it's renamed to g++?
This has to be a troll.
>>
>>58690288
>be a programmer
>write an elaborate complex language that looks exactly like C++
>write an entire big standard library for it that looks exactly like that of C++
>write an opengl wrapper that looks exacly like native openGL
>rename all your compilers to mirror names of C++ compilers
>after years of work on this, remind yourself that you're actually a newbie and need to ask /g/ for help on this simple openGL program
>post on /dpt/ not telling anyone about your language, because it didn't cross your mind that people may mistake it for C++ (why would they??)
seems legitimate
>>
File: 1362281898217.png (104KB, 320x287px) Image search: [Google]
1362281898217.png
104KB, 320x287px
Please be polite to one another, you stupid nerds.
>>
Is there a vim expert in the thread? I want to yank each line matching a certain pattern into a register. Doing :g/pattern/y overwrites the register each time, leaving me with the last line that matches the pattern instead of all of the line that match. Any idea on how I could use :g to add to the register?
(I know I could just do :r !grep pattern file but I want to use registers)
>>
>>58690346
Should already be included in your installation
relevant info:
https://stackoverflow.com/questions/12694562/sed-how-to-replace-a-character-within-a-matched-pattern-using-ampersand
>>
>>58690377
yeah, sure. at least one of them obviously gets executed, assuming you can actually read the fucking language you're trying to write in.
>This has to be a troll.
so if I rename my compiler to g++ it will somehow gain the ability to compile c++ code? do you guarantee this?
>>
Can I have conditional replaces?
Let's say, given some /^([a-z])([a-z]).*/ pattern, I want to replace first group with [A-Z], and the second group with [z-a].
>>
File: makes you THINK.png (27KB, 802x635px) Image search: [Google]
makes you THINK.png
27KB, 802x635px
No matter how much I try, can't escape the callback hell. How cancer does this look?
>>
>>58690387
http://stackoverflow.com/a/380864/5459498
took me literally 10 seconds of googling
>>
>>58690418
Already tried this. Naming registers with :g//y doesn't work.
>>
>>58690404
I think you're mistaken on what I'm asking here. The glCreateShader() function is causing te segmentation violation in this translation unit. If I call it in the same function as my window initialisation it works. All other GL calls work in the compile function though (like glClearColor() etc)
>>
>>58690417
literally unreadable
>>
>>58690404
>so if I rename my compiler to g++ it will somehow gain the ability to compile c++ code? do you guarantee this
g++ is VERY obviously referring to the C++ compiler thay is part of gcc..
>>
>>58690424
No you fucking retard. This is blatantly impossible.
>>
>>58690417
That's the nature of js design.
>>
>>58690435
in what way is it fucking obvious? maybe to him it's obvious, but he didn't state or even imply that it's even remotely related to either C++ or gcc.
>>
>>58690335
This kinda helps, now I gotta figure how to make it repeat that for all lines without hardcoding the variable's value.

>>58690390
The same problem like above still remains though.
In reference to that example (apple1), if I don't know the "apple" part, can I still do that sort of mass-replacement with sed?
>>
File: 1478095411950.jpg (31KB, 1420x930px) Image search: [Google]
1478095411950.jpg
31KB, 1420x930px
>>58690417

Welcome to JavaScript™.
>>
File: 20161205_003637.jpg (2MB, 2193x2988px) Image search: [Google]
20161205_003637.jpg
2MB, 2193x2988px
>>58690438
>>
>>58690339
I suspect that the joke is that having changed his compiler's name to g++, when he enters 'g++' on the command line, what is actually called is gcc in C++ (rather than his compiler.)
>>
>>58690126
Do you call the function from a separate thread?
>>
>>58690422
Have you tried this:
http://vim.wikia.com/wiki/Copy_search_matches#Copy_matches_or_lines
>>
New thread:

>>58690487
>>58690487
>>58690487
>>
>>58690480
Nah this is all on the main thread. I open the window in main(), and then try to call this but it fails. All my other gl calls work and I can clear a colour.
>>
>>58690483
No I did not. Thanks for the input.
It's not great though, I wish there was something that integrated better with vim.
>>
>>58690464
With a wildcard, yeah. It's just regex.
>>
>>58685041
>learned java for two semesters and hated it, almost switched majors because how shit it is
>then took a class on python and found it retarded, didn't really feel like a real programming language but rather more like a toy to teach students syntax
>now trying a course on C
>my love for programming has been brought back
>I remember now why I got into this
>>
>>58690464
There are many ways of doing this, including looping over the lines read by 'read'. The simplest is probably awk, but here's a version with sed:

echo 192.168.1.30 | sed "s/^\(.*\)\.[0-9]\+$/\1.1-\1.255/"


I still wouldn't do this with bash.
>>
>>58690561
Did you know that you can learn any language you like if you do the reading at home?
>>
>>58689881
If you want to make GUI's then Qt is the easiest choice for C++. It's bloated though but it's the most fully featured library.

You can look at all the boost libraries available to see if you want to try that.

C will be a little tedious for much. Plus you can always use C++ as C with a standard library.

Rust and Go seem nice but I don't know how relevant they are.

Just keep going with C++ I guess.
>>
>>58690711
Sorry, new to all this (programming), and am only a sophomore.
I guess I could just study for myself and look up every language under the sun but that's obviously not a wise decision for a number of reasons.
>>
>>58690735
If Qt is bloat then what is a good GUI library for C++ that's not bloated?
>>
>>58690515
>>58690565
Well, I still haven't figured how to use this kek but I found a guide about arrays, I'm trying with IFS now.
>>
>>58690789
That's the last question that will be answerable in the universe. Native GUIs for X11, WinAPI, and macOS are the only sure things. You can look into some of the libraries below that might be a little less bloated but it would be better to pick up Qt and just start programming and gaining experience with C++.

wxWidgets, GTK+ (with GTK-MM?), FLTK, Tk (with a C++ wrapper?), the JUCE stuff, CEGUI, and those are the ones I know of that seem okay
>>
Found a way:
file=list.txt
IFS='.'
while read -r aaa bbb ccc ddd
do
printf "%s" $aaa
printf "."
printf "%s" $bbb
printf "."
printf "%s" $ccc
printf ".1-"
printf "%s" $aaa
printf "."
printf "%s" $bbb
printf "."
printf "%s" $ccc
printf ".255"
printf "\n"
done < "$file"
read


Banzai!
Thanks everyone for the other suggestions too.
>>
>>58691230
Please don't do that. Literally copy and paste this code into your terminal:

cat MY_FILENAME_HERE | sed "s/^\(.*\)\.[0-9]\+\$/\1.1-\1.255/"
>>
>>58691262
oh thanks, this is definitely more clean, I managed to learn some stuff about arrays today though kek.
>>
>>58691329
No worries. Also just FYI, you aren't using arrays in your code.
>>
>>58691358
True but I got mixed in other stuff too while searching informations about IFS.
I was using this guide as reference by the way:
https://bash.cyberciti.biz/guide/$IFS
>>
>>58690417
How about this - https://github.com/Reactive-Extensions/RxJS
>>
what's the most anime language?
Thread posts: 329
Thread images: 35


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.