[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: 321
Thread images: 24

File: 1485438720022.png (423KB, 720x720px) Image search: [Google]
1485438720022.png
423KB, 720x720px
Old thread: >>59790848

What are you working on /g/?
>>
>>59794995
Coding my own init.
>>
>>59794970
>>Anyone working on the Google Code Jam qualification round problems?
>pls insert link
https://code.google.com/codejam/contest/3264486/dashboard
>>
File: ayano.png (257KB, 614x1469px) Image search: [Google]
ayano.png
257KB, 614x1469px
First for C

>>59794995
Thank you for anime picture
>>
>>59795013
谢谢
>>
>>59795013
Google confirmed for dumbs.
Use a convoluted explanation when a simple math definition would have been more simple to read and understand.
>>
>>59795030
it's a tradition for all programming contests you doofus
>>
nth for too late for an nth post but still making one
>>
lisp is mostly useless outside of academia
>>
>>59795042
Yes and it's totally dumb.
And by the way their problem is fucking easy.
Dumb problem for dumb audience.
>>
>>59795056
>their problem
I mean, it's qualification round, and there's more than one problem buddy.
>>
>>59795072
But I see the targeted audience.
>>
Anyone here has any experience creating plugins for cordova using plugman?
The IDE part is the one annoying me, specially on iOS, since the files are no part of a project, they need to be added onto a project, and then edited and add more stuff, finally you move them into the plugin folder.

Any easier way to do this?
>>
repost from last thread.

>My Program is a basic/retarded version of Pokemon Go.
>Program In C++ Goes through an array of Pokemon Names
>Randomly Chooses 1
>Assigns this to another String Variable
> I am Here
> Using this String Variable, Go to an API/Website and search for a string that is equal to the string variable
>Print out the "imageURL" variable next to it which contains a picture of the Pokemon
>Print this out to local Web Page
>Press Pokeball and Go back to C++ Program to determine if Caught or not

so should I be doing everything in Javascript or Python as opposed to C++ here?
>>
>>59795101
It'd be easier to do everything in JS senpai. Like extremely easier.
>>
>>59794833
Well, that makes things easier than what I was thinking.
It's worth noting that you don't actually have to leave your language of choice to do this, but it would probably be a lot simpler to just do the whole thing in Javascript.
>>
>>59795085
You're delusional if you think the target audience is dumb people. They're looking to sift through all the problem solvers and find the best of them to hire them.
Google solve abstract problems with abstract solutions and they're using this Code Jam (and have been for 15 years) to scout for those people that can solve these problems.
>>
>>59795013
Anybody done A or D? I found the other two easy but I'm stuck on these.
>>
>>59795030
>implying real world problems aren't convoluted as hell
>implying reducing them to clear algo/math definitions isn't a very important skill
>>
>>59795135
Just started. You just need 25 points to qualify right?
What's the bonus to getting more points?
>>
>>59795134
Ho I see why the level of google coders is worse each year.
>>
>GCC 7 WHEN
>>
>>59795153
Literally delusional.
>>
>>59795166
it's out already, isn't it?
>>
>>59795101
honestly would be way easier for you in Java or C#.
>>
Non-pure functional languages are shit
>>
>>59795151
The satisfaction of solving a challenge.
>>
>>59795192
no FP is pure
>>
>>59795177
oh shit did I miss that somehow?
>>
>>59795194
The satisfaction of doing nothing useful? Of making something literally thousands of other people are also making?
>>
>>59795194
Hmmm, I'm a busy guy, think I'll get my 25 points and dip til later rounds.
>>
>>59795207
https://gcc.gnu.org/ml/gcc/2017-03/msg00066.html

it's almost there
>>
Why do people use hackerrank, topcoder, etc.? Their presence on your resume indicates only that you have zero imagination and creativity.
>>
>>59795232
so they can feel better about themselves
>>
>>59795211
You're right it's probably better to spend my time making posts like this instead of thinking critically and doing something that has any semblance of a reward.
>>
>>59795004
You mean you are writing your own /sbin/init to pass to the kernel with the init= parameter? That's cool I played around with doing that a few years ago writing a simple init in Haskell it was a pretty fun toy project. Are you doing it as just a fun project or are you hoping to make something serious that could be used by others?
>>
>>59795232
Why do people play videogames?
>>
>>59795166
but GCC 6 is still hardmasked
sys-devel/gcc (6.3.0) **6.3.0
>>
File: hr.png (88KB, 900x663px) Image search: [Google]
hr.png
88KB, 900x663px
>>59795232
>>59795238
In case you had any doubts about how useful hackerrank is for making hiring decisions
>>
>>59795260
>tfw my friend is from jagiellonian uni and is something like top 10 in java
>>
File: carlos.png (272KB, 560x560px) Image search: [Google]
carlos.png
272KB, 560x560px
>>59795260
>Czech Tech
>>
>>59795271
>top 10 in java
Damning with very faint praise there, anon. Some friend you are.
>>
>>59795287
We don't talk about it, Anon.
>>
>>59795287
>lmao java a shit!
>>
>>59794995
Would you rather program a desktop program in D and have to use a wrapper like GtkD, or just program in C++ to use QT?
>>
>>59795319
c++
>>
>>59795319
I would rather use imgui.
>>
>>59795319
Qt is basically java, so D
>>
>>59795316
Yes, and?
>>
>>59795319
I'd rather a language that's not dead, so neither?
>>
>>59795316
Do toilets trouble you?
>>
>>59795375
Desktop app in which lightweight and high performance is needed. What other compiled languages have a good GUI library that is widely supported?

>>59795348
But QT is one of the most supported.
>>
>>59795420
doesn't matter, java. java is shit. go kill yourself. real men use x86 assembly and LISP. go back to india pajeet.
>>
>>59795420
CL
Java
>>
>>59795439
>LISP
Confirmed unemployed 17 year old.

>>59795420
C#/VB.
>>
File: wassup.jpg (41KB, 500x500px) Image search: [Google]
wassup.jpg
41KB, 500x500px
>>59794995
Passing by to say I'm really enjoying JavaScript. It has some great features and writing good code is pretty easy.
>>
C#
trying to identify each char in
myString
including each space. is there such a thing as
' '
?
>>
>>59795444
Nice integers but it has to be both light weight and high performance so I don't think Java will be good.

>>59795461
Are you serious?
And it has to work on Linux.
>>
I have to make a file system and functions to operate it in C in my Operating Systems class, I was just wondering if anyone had a ballpark of how long it will take.

The last project I had which was a linux shell with piping and redirection didn't take nearly as long as I thought, but this one seems like it might be a pain in the ass.
>>
Is it against convention to have an empty for loop?

/* loops over a vector until it finds a nonzero number 
* vector is 0 0 0 0 0 1 2 5 2 0 0 2 4 0 0 */
unsigned int i = 0;
for(; vector[i] == 0; i++) {}
//i is now 5
>>
>>59795241
>Are you doing it as just a fun project or are you hoping to make something serious that could be used by others?
I am doing it seriously, but I designed it to please me.
>>
>>59795499
I was being a cheeky cunt on the c#/VB.

Jokes aside, java will work like dogshit most of the time.

And also what should it do and define how fast you want it, because if you want it to go absurdly fast the answer is go as low level as you humanly can, now if it goes slow is because you're dumb.
>>
>>59795420
>Desktop app in which lightweight and high performance is needed.
Anon it's worth considering if you should write a daemon which handles the high performance stuff and have a GUI that presents the information to the user.
In that case you can choose whatever you find most convenient for the GUI without impacting the rest of the application. Because I wouldn't want to have to deal with a GUI thread in my high performance situation if I could avoid it.
>>
>>59795521
remove you programmer badge right this fucking instant
nobody will violate our convention
>>
>>59795521
Make it print nigger.
>>
>>59795499
https://benchmarksgame.alioth.debian.org/u64q/lisp.html
Java is significantly faster than CL

https://benchmarksgame.alioth.debian.org/u64q/csharp.html
Java is roughly the same performance wise as C# (java is a little faster)
>>
>>59795521
There tends to be better ways to do this. This is fairly cooky but to be fair it's just a linear search. Most linear search function are just this except they're inside a function. Now I would question why you're not doing that. It's certainly more clear to call a dedicated linear search function and get an index back then it is to just have odd looking for loops spread throughout the code. Even if they're quite obvious.
>>
How am I supposed to solve that google code jam problem A?

Is there an algorithm for figuring out the minimum number of flips or is it just plain bruteforce?
I was just planning on finding the lowest number after 1 million attempts at random flipping.
>>
>>59795135
A is piss easy, just don't think hard about it
>>
>>59795610
Seriously? It's too hard for you?
>>
>>59795610
This method may give you a solution, but it doesn't guarantee the lowest number of flips and may not even find a solution.

What is your plan for the impossible cases? Just say it's impossible if you don't find a flipping order that works?
>>
>>59795577
>benchmarksgame
We've been over this. Doesn't tell you anything significant about real world use because figuratively none of the solutions outside the C solutions are written as you would normally write code in the language.
And even in the case of C they're a very odd style.

What they're really testing is how effectively you can write low level code in these high level languages. And with that in mind you must realize that for a larger codebase where you can't realistically convert all the code to low level code the story is very different.
>>
>>59795635
I don't understand why anyone would need something like this outside of pure fantasy.
>>
File: zxczxc.png (407KB, 504x485px) Image search: [Google]
zxczxc.png
407KB, 504x485px
>>59795610
>I was just planning on finding the lowest number after 1 million attempts at random flipping.
>>
>>59795685
>I don't understand why anyone would need something like this outside of pure fantasy.
I haven't looked at this specifically but a lot of programming challenges are actually just for computer scientists. It's not for actual software engineering. It's rare to be given a problem with a very narrow set of inputs and outputs if it's not already an established algorithm.
>>
>>59795669
But my language does well on it and yours doesn't!
>>
>>59795135

My idea for D is a rule based dfs for the maximum.
>tfw on vacation and only have a phone
>>
type side =
| Blank
| Happy
;;

let iter_range f start length =
let rec loop start = function
| 0 -> ()
| length ->
f start;
loop (succ start) (pred length) in
loop start length
;;

let flip = function
| Blank -> Happy
| Happy -> Blank
;;

let row_of_string s =
let l = String.length s in
Array.init
l
(fun i ->
match s.[i] with
| '-' -> Blank
| '+' -> Happy
| c -> failwith (Printf.sprintf "unexped side %C" c))
;;

let solve s k =
let row = row_of_string s in
let lim = Array.length row in
let rec loop count i =
let count =
match row.(i) with
| Blank ->
iter_range (fun i -> row.(i) <- flip row.(i)) i k;
succ count
| Happy -> count in
if i = lim - k then
count
else
loop count (succ i) in
let count = loop 0 0 in
let rec is_happy i =
if i < lim then
match row.(i) with
| Blank -> false
| Happy -> is_happy (succ i)
else
true in
if is_happy (lim - k) then
Some count
else
None
;;

let get_line ic =
let line = input_line ic in
Scanf.Scanning.from_string line
;;

let treat oc ic =
let ib = get_line ic in
Scanf.bscanf
ib "%d"
(fun count ->
let rec loop i =
if i = count then
()
else
let ib = get_line ic in
let result = Scanf.bscanf ib "%s %d" (fun s k -> solve s k) in
let result =
match result with
| None -> "IMPOSSIBLE"
| Some count -> string_of_int count in
let i = succ i in
Printf.fprintf oc "Case #%d: %s\n" i result;
loop i in
loop 0)
;;

let main () = treat stdout stdin;;

let () = main ();;
>>
>>59795849
>ending functions with ;;
Only in OCancer
>>
>>59795877
You can remove them. It will work.
>>
>>59795881
>You can remove them. It will work.
>>
>>59795257
hardmasked?

>>59795231
Also, what exactly are they even adding in the more recent versions? Have they fixed the logic bugs in their optimizer yet? Last I've seen GCC still generates garbage code under circumstances I haven't quite found a pattern to yet.
>>
>>59795877
Code monkey post.
>>
what's better?

A
// if node is null
if (!node)
return NULL;


or

B
//if node is null
if (!node)
return node;
>>
>>59795996
Depends on the context.
>>
>>59796005
what you mean? isn't it the same?
node *foo(node *a, node *b)
{
node *temp = a;

if (!a) {
return a;
}

while (temp->next) {
temp = temp->next;
}

temp->next = b;
return a;
}
>>
>>59795577
I wouldn't call that significant, except for k-nucleotide maybe.
>>
Data Type Ranges
char: -128 to 127
schar: -128 to 127
uchar: 0 to 255
short: -32768 to 32767
ushort: 0 to 65535
int: -2147483648 to 2147483647
uint: 0 to 4294967295
long: -9223372036854775808 to 9223372036854775807
float: 0.000000 to 340282346638528859811704183484516925440.000000
double: 2.22507e-308 to 1.79769e+308


how the hell do floats and doubles get that enormous???? they get way bigger than integers can get. 1.79769e+308 is 1.7.. * 10^308 right? i got these from limits.h and float.h
>>
>>59796083
they're imprecise
they can't store every integer between those two numbers, e.g.

100000000100 and 100000000000 would be indistinguishable
>>
>>59796050
>foo
What's a foo?
>>
Openstack which requires a lot of Python, Puppet, Chef and Ansible. As well, working on DPDK. Processing line rate 40G in a VM is not easy.
>>
>>59796106
The nemesis of a bar.
>>
>>59796103
ok, i thought that something was fishy when i saw that. thanks
>>
>>59795996
>one line
always
if (!node) return NULL;
>>
>>59796106
doesn't matter. it's irrelevant here. i changed the names
>>
>>59796106
foo is from the 1970s programming meme fubar meaning fucked up beyond all recognition
>>
I'm a Java scrub, yeah hate on me but I need some review on my code.

I was just writing a fibonacci sequence in Java and I was able to implement a positive sequence using negative iteration inside the for loop parameter.

Where
for (l = 31)
is just replace '31' with any number for how long you want the sequence. So say you wanted a sequence of 30 numbers in fibonacci put 31, obvs haha but here's the code:

class Fibonacci {

static int a = 0;
static int b = 1;

static int l;
static int f;


static void fibCalc() {

for (l = 31; l > 0; l--) {

f = a + b;
b = a;
a = f;

System.out.println(a);

}

}

public static void main(String[] args) {

fibCalc();

}
}


I'm fucking confused by my own code, how is this working? I had an idea but never expected it to work. Any peer reviews?
>>
>>59796145

That term was believed to be coined in WW2.
>>
>>59796083
floating point basically stores its value in scientific notation. something like (integer part)*2^(exponent). that makes it imprecise, too.

I don't think float should have a minimum value of 0 by the way. you might want to double-check that number.
>>
>>59796154
Nevermind it's because l is not included in the fucking iteration haha what a dickhead
>>
>>59796177
>
In the calculation****

I'm the biggest spastic on this planet
>>
>>59796174
i just printf'd FLT_MIN with %f so it should be what it is
>>
>>59796174
>>59796225
there's a different one for float negative max
>>
File: floating-point-fig3.jpg (16KB, 413x275px) Image search: [Google]
floating-point-fig3.jpg
16KB, 413x275px
>>59795849
Is this your solution anon?
I don't understand ocaml but I'm curious of what the nature of this solution is.
>>
>>59794995
I bought a book to learn java and I'm doing fine so far
I never coded or programmed anything but so far everything seems okay
>>
File: polbooks_fr.png (152KB, 780x382px) Image search: [Google]
polbooks_fr.png
152KB, 780x382px
>>59794995
how would you guys start with trying to program something like the data visualizer used here:

?
I thought about making something that behaves similarly to the one above in a 3D engine like unity, and feeding it the data with a json file or an xml. is it reasonable? or are there easier/faster ways?i dont mind the lenguage/environment, i just want to get
>>
>>59796235
i don't think there's a constant for it, just double checked. when i do 1-FLT_MAX i just get a segmentation fault
>>
File: 1491251161919.png (440KB, 645x1260px) Image search: [Google]
1491251161919.png
440KB, 645x1260px
>>59796304
oh shit forgot link
https://pastebin.com/xPHSchLJ
>>
>>59796322
you can probably just do
-FLT_MAX
>>
is javascript good for beginners?
>>
>>59796465
JavaScript is good for nobody.
>>
>>59796469
fuck
i just wanted to make some vidya
>>
>>59796478
go with c
>>
>>59796478
C++
>>
>>59796478
>>>/v/
>>
what personal project / challenge took your skills to the next level? or at least was the catalyst for a huge jump in your ability?
>>
>>59795241
hello pleb
>>
>>59796546

Just doing something new will help with that, so start dabbling. I did image processing, interpreters, some audio processing, etc.
>>
>>59796478
aggydaggy dot com friend :)
Start out with Java and LibGDX desu.
>>
>>59796546
The catalyst is always your own determination Anon. Now go get em.
>>
Any ideas for C large? 10^18 is a huge limit :(
>>
>>59796546
audio processing
>>
>>59796546
Machine learning
>>
>>59796304
I don't know if it's still in fashion, but I always like d3.js for this kind of thing.
>>
File: 1483347539835.png (240KB, 640x360px) Image search: [Google]
1483347539835.png
240KB, 640x360px
start /wait batchfile.bat


>START
>Start a program, command or batch script (opens in a new window.)

>Options:
>/W or /WAIT Start application and wait for it to terminate.
>(for an internal cmd command or a batch file this runs CMD /K)

>CMD
>Start a new CMD shell and (optionally) run a command/executable program.

>Options:
>/K Run Command and then return to the CMD prompt.

>return to the CMD prompt.
Just why? This is fucking up my whole script because I need the second batch file to fuck off after the command stops running and return to the main batch. I cannot run those commands within the same batch/window.
Is there a way around this? I tried exit and goto :eof but the result is the same, the second batch won't close itself.
>>
Can one of you fa/g/s explain this syntax to me?

[ head | tail ] = [ 1, 2, 3 ]


I specifically want to know what the fuck that pipe is doing. I understand how pattern matching works in principal so don't bother going into that, this is purely a question of syntax
>>
tfw stuck
>>
>>59797124
>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.
for real tho! we all know that feeling of being stuck.
>>
>>59796727
I got the 10^3 set.
My approach wasn't good enough for the 10^6 so I'm working on that now.
>>
>>59797062
start /wait cmd /c secondscript.bat

This works, nvm.
>>
grep 'Apache httpd' -B 3 results2.txt | grep -v "2.0.48" >> tmp.txt
>>
>>59797095
[1,2,3]
is syntactic sugar for
1:2:3:[]
or with explicit parentheses
1:(2:(3:[]))
. The pipe thing is not on operator but a constructor, and it binds 1 to head and
(2:(3:[]))
to
tail[/tail]
>>
>>59796083
>schar
What
>>
>>59797095
its special elixir / erlang syntax to separate the first element and the rest and put em in variables, so head will be 1, and tail will be [2,3]
>>
>>59797254
>>59797286
Thanks anons
>>
>>59797341
<3
>>
Would anyone be interesting in telling me if I'm doing anything wrong in the conventions or format of my code?

I've pretty much just been coding to get stuff to work this whole time and not really caring about how it looks, so I'd like to know if I'm doing anything really heinously wrong.

I'll post an example if someone's interested.
>>
REM variable to get the current working directory path.
SET curdir=%~dp0

FOR something IN (%curdir%subdir\subsubdir) DO (
stuff
)


The directory path's syntax isn't accepted.
I tried all these:
(%curdir%subdir\subsubdir)
('%curdir%subdir\subsubdir)
("%curdir%subdir\subsubdir")
"%curdir%subdir\subsubdir"
(*\subdir\subsubdir)

All give the same error except last one who just seems to do nothing at all, meanwhile (*) with nothing else works as intended.
Do I need to exclude the % symbols? I don't know how to do it in this case though, since it's for the variable.
>>
File: AppDifficulties.png (170KB, 1393x845px) Image search: [Google]
AppDifficulties.png
170KB, 1393x845px
>>59794995
Can someone please help me quickly debug an android app?

https://pastebin.com/vemYfTFs

I'm sort of learning Java at the same time. I'm not completely new to programming, I know quite a few scripting languages. But this is my first time with something like java.

I only 40% know what i'm doing.

--------------------------
Basically my app compiles without error, but as soon as it launches it quickly prints a few lines of text and then exits. (crash I think)

I think somehow I'm messing up either the LocationListener or the fusedLocationProviderApi.requestLocationUpdates(mGoogleApiClient, locationRequest, this);

I've tried both implementing LocationListener in my main class, and overriding the method

and i've tried initializing a listener object of type LocationListener and defining the methods in the new object

No matter what I do, I can't seem to get this to work

What am I doing wrong?
>>
>>59797489
The red underlined bits are just permission warnings which don't apply because I put:
    <uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>

<uses-feature android:name="android.hardware.location.gps" />

in my manifesto
>>
File: Muh Hardcores.png (24KB, 911x183px) Image search: [Google]
Muh Hardcores.png
24KB, 911x183px
>>59794995
>What are you working on
Today I wrote someting in machinecode
>>
>>59797561
what does it do
>>
>>59797489
bruh stacktrace
>>
>>59797593
an excel sheet with some hexcode
>>
Anyone know why the JDK is installing as JRE?

At the start of install, it says jdk in the filepath, then it changes to jre.

I can't find the jdk anywhere.
>>
I want to make an script that downloads a web page (rigth-cick save page as) and click a button in that same page.
How do I do it? I know the basics of programming, but I have no idea how to make the program interact with the browser

I am using firefox btw
>>
>>59797630
Go ahead and disregard this.
>>
>>59797622
But what is the program supposed to do?
>>
>>59797593
Imagine 6 leds and a button.One led is on. With every butonpress the the light goes left or right changing directions at the ends. The button is debounced in software to prevent multiple moves on one press.
>>
What is man supposed to use when here's just no good statically typed and compiled language.
>sml
no good implementaion
>ocaml
sml with shitty syntax, also does not support native threads
>lisp
too verbose, also static typing not standardized
>c
decent but manual memory management is annoying in prototyping phase
>sepples
cluster fuck that no sane person would touch
>d
can't decide if it wants to have gc or no
>rust
better stay away from it because it attract lot of crazy hipsters
> any jvm/clr lang
requires huge vm
>go
Rob Pike is faggot, also no macros
>>
How would I be able to retrieve member variables when using the command pattern? (C++)

Should I have multiple virtual executes with different return types, or would that be a incorrect usage of the pattern?
>>
>>59797753
On a microcontroller?
>>
>>59797836
make your own if youre unhappy with your choices.
>>
I have a cousin and he wants to do programming but he also needs to go through college.
he doesn't want to be in college with a shit degree so he asked me if there was a college course/degree that had programming in it.
does computer science/engineering have anything to do with programming or is it just a meme?
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
is there a way in .net to save data to the application itself? like without needing a separate file?
>>
>>59797905
CS is a meme.
Electrical engineering with a self taught language is good advice though.
>>
>>59797917
Do you mean like... A variable?
>>
>>59797917
what do you even mean

the application is created and destroyed when it runs and quits
>>
>>59797928
what does one do in CS though?
I always tought anything with "engineering" on it was abouth mechanical parts and MASSIVE CALCULUS AND MATH
I teached myself javascript and C# but I never went to college.
>>
>>59796244
Try to debug it anon.
>>
>>59797881
jea, an AT89S2051
>>
>>59797860
don't try to shoehorn java patterns into c++
>>
>>59797928
As someone who did this. I can recommend. CS is incredibly easy, even the theoretical side of it. Now I have more skills than your average CS kid and can easily get into more advanced (and well-paying) low-level software dev positions. It also helps to learn a HDL.
>>
>>59797932
>>59797948
whoops could have been more clear. i want the data to persist through a restart.

something like:
>get input from user
>save to something
>next time user opens the applications or restarts the input stays

like settings without having to save to a flat file
>>
>>59797974
It's possible to save data in a ".exe", but you really do not want to do that anon.
>>
>>59797974
you just want a file but for it to be handled easily
>>
>>59797949
>what does one do in CS though?
Theory and a little bit of programming.
Most post-grads are incompetent programmers because they never do any self-study beyond.
Software engineers are a dime a dozen.
Electrical engineers who can program are infinitely more valuable. And if he really loves programming he can take it a step further with his own board designs.
>>
>>59797988
not him

holy shit that's a great idea
>>
>>59797974
So let's say you had this thing.
What would distinguish it from a file?
>>
>>59797964
command pattern is literally in the gang of four design pattern book, how is it not a c++ pattern
>>
>>59798014
Because C++ has first class functions and so the pattern is so trivial that you might as well just forget it.
>>
>>59797988
>>59797989
>>59798006
it's more a curiosity thing. Saving to the exe is more along the lines of what i was thinking, but wasn't sure if there was some kind of crazy function built into .net for it. I already have everything working just fine with a flat file, but was just thinking of different ways it could have been done
>>
>>59797988
how would you even do that. sounds like it would break the runtime or something
>>
>>59798084
It's how GTA V functions.
>>
>>59798014
that book is long time obsolete
>>
>>59797993
is there anything anyone trying to do programming should do?
eletrical/computer engineering are good choices then huh?
>>
>>59797928
Most CS degrees are a meme. I feel the value of them depends on where you got it from.
>>
>>59798175
the value of a cs degree is in the piece of paper that keeps your resume being tossed into the bin immediately
>>
>>59798166
code/study on your own
>>
>>59798111
how so
>>
>>59795101

So I decided to drop the idea of grabbing all of my images from the API using the program and instead was thinking about writing the image URL directly to HTML using C/C++.

So now:

>get string of Pokemon like "Charmander"
>use "fstream" to write to HTML file directly and change the <img src= "charmander_url">
>Open the URL in c program to open local web page of charmander.

now is there a way to do this without doing if statements for all 151 pokemon, cause that's the only way I can think of.


ofstream output

if(random_pokemon == "Charmander")
{

output << charmander_URL << endl;

}

any ideas?
>>
>>59798166
>trying to do programming should do?
Learn a couple languages youd be competent talking about in detail with someone. Work your way up with quality NOT quantity github projects you're interested in, for both experience and portfilio material.

And study in a specialty that interests you, like AI,robotics,embedded systems etc. Depends on what kind of job youre looking for
>>
>>59798217
you need to get back to the basics before you attempt doing what you're trying to do
>>
>>59798200
>>59798226
but I need to go through a college course or else everybody will think I'm an unexperienced piece of shit(I'm not american and this is how things are here).
I'm self learning java and I'm doing pretty well but everyone here is an IT illiterate so I need a big paper that says "I CAN MAKE COMPUTER STUFF" or else I won't get a job
is there ANY college course I could take that would better my understandigs of programming and computer STUFF or should I just go hard on github?
>>
>>59798014
I'm amazed that book hasn't made it to same list as mein kampf and the quran yet.
>>
>>59798237
CS or CE, or whatever the blanket degree is in your country. Just look into what degree is required for your type of job. People do get offers straight from their githubs, but its rare, so be safer with the degree
>>
>>59798232
what am i doing wrong?
>>
>>59798217
Store your name/URL pairs in a map and replace the code you posted with
ofstream output
output << myMap.at(random_pokemon)
>>
>>59798341
Everything.

See
>>59798431
There is also the option of having random_pokemon ("Charmander") be used to generate the url, as such you save the main parts of the url (example, pokemon.com/POKEMONNAMEHERE/image.png) and just have a return value of url post formating. Unsure how what you're using formats strings, but it should be a way of having a escaping.
>>
Precedence climbing or Pratt parsing?
>>
>>59796083
>how the hell do floats and doubles get that enormous????
It's in the name - floating decimal point.
It moves around as you get bigger/smaller, hence you get less precision the bigger/smaller the number gets (you have the most precision in the -1 to +1 range).
>>
THREE HOURS OF PAIN TO FIND OUT I MISHANDLED THE STRING'S NULL TERMINATOR


AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>>
>>59798836
C cuck
>>
>>59798836
>>59798843
valguard and static analysis would have told you this in 10minutes
>>
File: yNzO8k4.jpg (41KB, 640x360px) Image search: [Google]
yNzO8k4.jpg
41KB, 640x360px
rem print current path
echo %~dp0

C:\

cd /d subdir\subdir
rem print current path which is supposed to be C:\subdir\subdir\
echo %~dp0

C:\

JUST BATCH MY SHIT UP
>>
>>59798866
a language with proper string type wouldn't have wasted you those 10 minutes in the first place
>>
>>59799019
You can always make your own string struct in C if you're too incapable of including \0 at the end of your strings.
>>
>>59799019
Wrong. A "proper string type" would be even more error-prone since it's even less likely to actually update the string length whenever the string is modified.
>>
     char* line = "This-is-a-test";
char* ptrBegin;
char* ptrEnd;
char* endOfString = &line[strlen(line)];

ptrBegin = line;
ptrEnd = endOfString;
char buffer[strlen(line)+1];

while(ptrBegin != endOfString)
{
int i=0;
int j=1;
do
{
buffer[i] = ptrBegin[i];
++i;
}
while(&ptrBegin[i] != (ptrEnd+1));

buffer[i-j] = '\0';
int var = identifierLex(buffer);

if (var == 0){
--ptrEnd;
}
else{
printf("TKN_identifier, %s\n",buffer);
ptrBegin = ptrEnd+1;
ptrEnd = endOfString; //reset endPtr
}
}


PS C:\Users\JP\Desktop\testProject> .\testProject.exe
TKN_identifier, This
TKN_identifier, is
TKN_identifier, a
TKN_identifier, test
PS C:\Users\JP\Desktop\testProject>


My tokenizer finally works, but my program is crashing, most likely because I'm fucking something up in memory, can anyone spot the issue? I can't think straight anymore.
>>
>>59799074
?????????
>>
>>59799097
Do you use cl to compile?
>>
>>59799128
Is cl an IDE? Because I'm using dev-c++
>>
>>59799158
No I'm talking about the C/C++ compiler that come with VS.
>>
>>59799125
String buffers are typically zero-initialized, so that any string that is not too long is guaranteed to be null-terminated.
>>
Null-terminated strings were a mistake.
>>
>>59799169
That's usually referred to as MSVC. Calling it CL is confusing because it literally just stands for "compile and link" which adequately describes almost all modern compilers for any language.
>>
>>59799198
Why not add 0 at the end of your string?
>>
>>59799228
If I type msvc, nothing happen. If I type cl, I can compile C code. SO to call (like CALL in asm) I use cl and not msvc, so it's called cl.
>>
>>59799229
Generally you should. However, that's an extra step to do that one might forget, so zero-initializing string buffers is a useful failsafe.
>>
>>59799240
That's actually nothing like "call in asm" because you're using an interpreted language. It's like saying typing in URLs is "like call in asm".
>>
>>59799215
Programmers who don't write test cases and asserts were a mistake. Too many times now a days when I look at C code whether it be in big projects, tutorials, or examples I see valuable return information often flat out ignored and then these programmers end up having bugs because they ignores failures or assumed a function did exactly what they wanted when in reality it may have only done a portion.
>>
Anybody here have experience cross-compiling for busybox?
>>
>>59799198
Or they have real arrays that actually know their length
>>
>>59799198
??????
>>
>>59799245
No. If you want safety don't use C. C is for speed not safety.

>I don't think C gets enough credit. Sure, C doesn't love you. C isn't
>about love - C is about thrills. C hangs around in the bad part of
>town. C knows all the gang signs. C has a motorcycle, and wears the
>leathers everywhere, and never wears a helmet, because that would mess
>up C's punked-out hair. C likes to give cops the finger and grin and
>speed away. Mention that you'd like something, and C will pretend to
>ignore you; the next day, C will bring you one, no questions asked, and
>toss it to you with a you-know-you-want-me smirk that makes your heart
>race. Where did C get it? "It fell off a truck", C says, putting away
>the boltcutters. You start to feel like C doesn't know the meaning of
>"private" or "protected": what C wants, C takes. This excites you. C
>knows how to get you anything but safety. C will give you anything but
>commitment

>In the end, you'll leave C, not because you want something better, but
>because you can't handle the intensity. C says "I'm gonna live fast,
>die young, and leave a good-looking corpse", but you know that C can
>never die, not so long as C is still the fastest thing on the road".

> - Igor Nikolskiy
>>
>>59799258
It's exactly the same ID. You're an idiot STFU. Don't argue, it's useless you're stupid.
>>
>>59799292
That's the dumbest thing I ever read.
>>
>>59799292
I like getting dom'd by C.
>>
So you need at least 25 points to qualify for the code jam?
Is that all, or do you also have to be below a certain rank?
>>
To a lot of people, C is a dead language, and ${lang} is the language of the future, for ever-changing transient values of ${lang}. The reality of the situation is that all other languages today directly or indirectly sit on top of the Posix API and the NUL-terminated string of C.

When your Java, Python, Ruby, or Haskell program opens a file, its runtime environment passes the filename as a NUL-terminated string to open(3), and when it resolves queue.acm.org to an IP number, it passes the host name as a NUL-terminated string to getaddrinfo(3). As long as you keep doing that, you retain all the advantages when running your programs on a PDP/11, and all of the disadvantages if you run them on anything else.

I could write a straw man API proposal here, suggest representations, operations, and error-handling strategies, and I am quite certain that it would be a perfectly good waste of a nice afternoon. Experience shows that such proposals go nowhere because backwards compatibility with the PDP/11 and the finite number of programs written are much more important than the ability to write the potentially infinite number of programs in the future in an efficient and secure way.

Thus, the costs of the Ken, Dennis, and Brian decision will keep accumulating, like the dust that over the centuries has almost buried the monuments of ancient Rome.
>>
>>59799292
Rust is for Safety and Speed!
>>
>>59799352
Rust is like a maglev train, fast and safe but pretty fucking inconvenient when you need to go somewhere where there's no rail.
>>
>>59799352
>2017
>believing that naive GC is good GC

millenium kids are so cute
>>
>>59799388
Rust doesn't have a GC.

>>59799382
Luckily the rails nearly cover everything these days.
>>
>>59799292
I'm genuinely embarrassed for whoever wrote that
>>
>>59799399
>>59799407
That's the moment when I realized I'm too far ahead of you. You are not able to understand what I wrote. That's sad. And no I won't enlighten you.
>>
File: 1420221860425.jpg (29KB, 353x350px) Image search: [Google]
1420221860425.jpg
29KB, 353x350px
>>59799420
>You're just too dumb to understand why I can't use C
>>
>>59799279
You can write functions to support that in C. Having it included automatically as part of the array structure though is too much memory overhead for a systems language.

>>59799291
With "proper strings" the length is stored separately and you'd need to manually update it ever time the string is modified. That's way easier to screw up than ASCIIZ strings.

>>59799292
You shouldn't worry about safety unless your program is handling sensitive data in an insecure environment. Otherwise it's basically premature optimization.

>>59799308
No, it's not. There is no "cl" function provided by the Windows API. If you're saying all cases of "invoking behavior by name", is "like call in asm", then you'd have to consider URLs and shell scripting to be "like call in asm" as well.
>>
>>59799399
>runtime reference counting isn't GC
nice meme
>>
>>59799429
>With "proper strings" the length is stored separately and you'd need to manually update it ever time the string is modified.
Yeah, in shitty languages with no abstraction like C.
>>
The worst thing that ever happened to C was letting too much behavior to be undefined and left up to the compiler. GCC in particular has a very good history of literally breaking programs if you let it do to much to your code because of this abuse.
>>
>>59799429
>With "proper strings" the length is stored separately and you'd need to manually update it ever time the string is modified. That's way easier to screw up than ASCIIZ strings.

??????
is your idea of strings just a struct with char pointer and a size_t field you ape?
>>
>>59799441
You're supposed to use single ownership (which has zero cost) as much as possible in Rust. Reference counting is saved for only if it's absolutely necessary, you basically never see it.
>>
>>59799429
>too much memory overhead
>ignoring the countless cycles to mearly count elements in a list
>ignoring that everyone passes a length to a function of they are also passing an array
Kys
>>
>>59799429
>No, it's not. There is no "cl" function provided by the Windows API. If you're saying all cases of "invoking behavior by name", is "like call in asm", then you'd have to consider URLs and shell scripting to be "like call in asm" as well.
I asked you to not argue about that filthy idiot. You're stupid, deal with it.
>>
>>59799445
And you can provide the abstraction by only modifying strings through certain functions. Other languages force you do to things that way and don't give you a choice.
>>
>>59799441
RC is completely optional in Rust you fucking idiot and unless you define something to use a RC it's not going to and apply rules akin to RAII which isn't GC.
>>
>>59799472
Since it's that easy why were you acting like it's a big problem?
>>
>>59799454
Java, the world's safest language, defines a String as a char array, an int offset, and an int size.

It also has stuff like hash values and serial versions but that's for Object bullshit.
>>
File: 1466544326223.jpg (32KB, 557x612px) Image search: [Google]
1466544326223.jpg
32KB, 557x612px
>>59799512
>Java, the world's safest language
>>
>>59799512
Does Java force you to manually update the size every time you modify the string?
>>
>>59799530
No, it just makes a new String object when you change it.
>>
>>59799530
You can't update a String. They are immutable objects anon. offset and size are defined on initialization of the string and left.

and offset is mainly in place to allow reuse of subsets of a char array for when you split strings.
>>
>>59799541
So what was your point?
>>
>>59799551
That it doesn't make you manually update the size...
>>
>>59799551
Are you trying to say you can't do abstractions in C?
>>
>>59799550
an abstracted string you can
>>
>>59799454
How would you implement strings then? The only plausible string implementations are:

null terminated char arrays
>greatest inherent safety
>length lookup is O(size)
>element n lookup is O(1)

non-terminated arrays with length stored separately
>poor inherent safety
>length lookup is O(1)
>element n lookup is O(1)

linked list of characters
>effectively null terminated (albeit with a NULL pointer rather than a NUL character)
>length lookup is O(n), but slower than with ASCIIZ
>element n lookup is O(n)
>insertion at the end guaranteed to require a malloc call
>only real advantage is that it allows easier insertion/deletion in the middle

>>59799458
>Rust doesn't have a GC
>well actually it does, you just don't have to use it very often
That's like saying C doesn't have undefined behavior since it's possible to write programs without it

>>59799459
>I think I'm smarter than Dennis Ritchie: the post

>>59799464
>the person who sees through my ridiculous statements is "stupid"
>>
>>59799581
Not in Java unless you reimplement your own String type. You literally can not touch the backing char array period unless you dive into unsafe usage of Java's reflection system.
>>
>>59799600
Rust doesn't have a GC. Its standard library has reference counted smart pointers.

If Rust has a GC then so does C++.
>>
>>59799604
what a shit language, why did people ever start using it
>>
>>59799600
>That's like saying C doesn't have undefined behavior since it's possible to write programs without it


It's literally optional. If you are a mongrel and want reference counting because you can't into ownership rules then you are welcomed to do so.
>>
Python 3
Let's say I have this code.
load_data()
if tempname in database:
database[tempname] = database[tempname] + tempvalue
else:
database[tempname] = tempvalue
save_data()

load data function
def load_data():
global database
with open(namedata, "rb") as datafile: #namedata is the path file in a string
try:
database = pickle.load(datafile)
except EOFError:
database = {}

save data function
    with open(namedata, "wb") as datafile:
pickle.dump(database,datafile)
del database

now the problem is, when executed the first code, it gives me this error.
in save_data
pickle.dump(database,datafile)
UnboundLocalError: local variable 'database' referenced before assignment

what to do?
Also does anyone use Pascal? is it comfy?
>>
how many problems should one be able to solve in project euler?
>>
>>59799648
about tree fiddy
>>
>>59799475
I wasn't, I'm just saying that array + length representation is inherently less safe than ASCIIZ

>>59799512
>worlds safest language
>so safe that every java applet you run has to be manually authorized in control panel

>>59799541
That's really not good for performance.

>>59799566
You can, but immutable strings are not a good or useful abstraction.

>>59799559
A function in C can also provide that solution, without the heap allocation overhead of destroying and creating a new a string.
>>
>>59799648
6 trillion
>>
>>59799600
Best solution:

null terminated char arrays with length stored.

Remains compatible with C's standard library while giving you the benefit of having length defined ahead of time for whatever reason.

Since you are a good boy programmer you should also abstract away changes to this string so that any updates update the entire structure as a whole and not a single piece leading to bugs.
>>
I graduate HS this year with shit grades because I spent my time programming, but good enough to get into a state college.

Been programming java for a couple years, recently learned lisp.

Planning on taking CS but everyone here says it's a fucking meme. What do?
>>
>>59799613
I never denied that C++ has GC.

>>59799625
>It's literally optional
So is UB in C.
>>
>>59799600
>I think I'm smarter than Dennis Ritchie: the post
I'm smarter than you because I'm not using fallacies they teach you in 3rd grade. Anyway, I don't think the goal of C was for embedded systems, it was to be simple to implement and ubiquitous.
>>
>>59799672
False equivalence. UB is opt-out in C, reference counting is opt-in in Rust and is really part of the library and not the language.
>>
>>59799663
>Creating an entire struct or, god forbid, object just to hold the length of an array
It takes an incredibly trivial amount of time to count a string in any language, to the point where this is literally not worth the effort.
>>
>program was due 18 hours ago
h-heh maybe the professor won't notice
>>
>rust
Is it possible to go from a &[T] to a Box<[T]>, making a copy of the data, without going via a Vec<T> and copying twice?
>>
>>59799694
Are you trying to defend C by saying that making the programmer's life a tiny bit easier is worth losing a lot of performance? Hahahahaha.
>>
>>59799634
you're beyond salvation
>>
>>59799724
>rust
>>
>>59799726
Only Rust shills think C is entirely about performance. I mean, seriously, just look at printf - having to parse strings at runtime just to print an integer? If their only concern was performance, they'd use macro constants or enums to indicate format parameters, or just have a dedicated "print decimal integer" function. C's main point is simplicity, not performance.
>>
>>59799726
If you don't think creating an entire struct for strings just to get rid of an O(n) operation that you won't even be running that frequently is a good idea, then you're beyond saving.
>>
File: 1459965454255.gif (1001KB, 640x480px) Image search: [Google]
1459965454255.gif
1001KB, 640x480px
>>59799780
>>59799826
>>
File: legit.gif (1MB, 260x173px) Image search: [Google]
legit.gif
1MB, 260x173px
>>59799691
>UB is opt-out in C

UB in C and GC in Rust are just as optional as each other, if you know what you are doing then neither is forced upon you.

But to imply that a feature doesn't exist because you don't choose to use it is madness.
Do you claim that C doesn't have a bstring library because you've never used it?
>>
File: 1489862824177.jpg (130KB, 1280x720px) Image search: [Google]
1489862824177.jpg
130KB, 1280x720px
>>59796546
I started wearing leggings instead of the classic striped stockings. my skills increased dramatically
>>
>>59798431
what are "Maps" in C?
>>
>>59799844
So you're saying that Rust does have GC but it doesn't matter. Why bring it up as if it's a negative, then?
>>
>>59799694
t. someone who thinks ASCII is the only string encoding in the world still.
>>
i wrote a bot to play a game for me and want to make a video about it, but i don't want to get caught. what do?
>>
Complete newbie here, I want to implement a search function in a student records program, I'm reading from a file that's sorted like this:

******
name
id
others
******
name
id
others
******

I want to search either by name or id.

Any hints?, or what knowledge of what do I need to do this?
>>
>>59799865
That code is C++, not C.

>>59799880
Variable-length encodings are brain-damaged.
>>
>>59799880
>I have a special use case, so we should replace ALL use cases with it!
>>
>>59799941
>UTF-8 is brain damaging
>Ken Thompson and Rob Pike are brain damaged

Yeah okay.
>>
>>59799869
Nobody is saying anything is important, the only point being made is that >>59799399 is wrong.

Having GC in and of itself isn't a bad thing, assuming you never HAVE to use it and it is completely optional.
If certain features rely on the GC, then the GC is no longer completely optional, unless you also disregard all those features too.

If you have to mention all these caveats when making a general statement, maybe consider that the statement is at best misleading, if not flat out lying.
>>
>>59799694
kik
>>
>>59799951
This is exactly why so many C programs are broken pieces of shit, you think everyone can read/write english and then your programs blow up when it reachs the other 90% of the world.
>>
>>59799941
This is what Java does to people.
>>
>>59799973
Have many times do you need to be told before you get it ingrained in your brain that the GC in Rust is purely optional and only used if you fucking require it because you are too incapable of designing your shitty program around ownership.
>>
>>59799941
I know but are maps available in C? I'm doing the project in both languages.
>>
>>59800020
No, C is not for productivity.
>>
>>59800038
so am I stuck with setting all of the strings to if statements and writing to HTML?
>>
>>59799676
This guy gets it.
>>
I'm learning C++ as my first language (college course), it didn't get too much in detail, and we weren't taught OOP yet, do I just dive in C++?, or do I switch to python, considering that I'm interested-ish in Machine learning, however I feel like C++ is really powerful and would serve me good too. Also, which of the two are needed more in freelance work?
>>
>>59799966
UTF-32 is better than UTF-8.
>>
>>59800020
They're not available as a standard library feature, but they're really just a key-value store so it's not too hard to implement, and you might be able to find a library that provides an implementation for you.
>>
>>59800015
So either Rust is full of redundant features it doesn't actually need, or you're too stupid to understand it isn't "purely optional" under certain use cases.

Nobody is struggling to understand anything about the GC being optional, you just have a broken understanding of "optional".
>>
>>59800073
They're both good for different situations.
>>
>>59799634
When do you call your save function first? My first guess is that you call pickle.dump(database,datafile) before database is initialized with an initial call to load_data. Either that or in your save function your aliasing the name database.
>>
>>59800073
>>59800078
Also, even UTF-32 is still variable length in a sense. Glyphs can be made up of more than one code point.
>>
>>59800073
>Not defaulting to the preferred encoding scheme for over half of the planet

Why tho?
>>
>>59800077
No you have a broken understanding of optional.

The whole point of including RC was to enable shitty programmers who are coming from GC languages to have an easy way to handle their dynamically allocated data since most of them, like you, are mongrels who can't understand the simplest concepts such as borrowing.
>>
>>59800093
UTF-32 is fixed length by definition at 4 bytes each.
UTF-8 is variable from 1-4 bytes
UTF-16 is variable from 2 or 4 bytes
>>
who /codejam/ here

Solved A-C, is it worth tackling D my lads? Is it extremely hard? Kinda tired and 5 hours remain
>>
>>59800139
In order to handle UTF-32 100% you still need to treat it as variable-length.
>>
>>59800103
If a part of the appeal to a language is that it's easy to work with if you already know language X, then disregarding that the easy transition only holds if you also use GC is a pretty important thing to consider.

C++ has raw pointers, you're never really meant to use them, but it has raw pointers.

Would you try to tell someone that C++ does not have raw pointers, since they are "evil" and you don't __need__ to use them?
>>
>>59800103
If borrowing is so simple, why don't you describe it a single sentence?
>>
>>59800093
Sorry, I meant grapheme.
>>
>>59800163
Are you a toddler?
>>
>>59800157
The C++ standard library uses raw pointers.
Rust's standard library does not use RC at any point.
>>
>>59800180
How is that relevant?
>>
>>59799694
>Defends adding a byte to your data structure to indicate an end
>Rejects adding a word to a data structure to give shall performance improvement
>Ignores structs word align to maximize performance and not space
Really making me think
>>
New thread:

>>59800214
>>59800214
>>59800214
>>
http://harmful.cat-v.org/standards/

UTF-8 is the only good string encoding standard.
>>
>>59800163
It's literally borrowing ownership from something temporarily. Until ownership is returned you can't do anything to the original, you can only work through references.
>>
>>59800198
The rust equivalent to raw pointers in unsafe{}
Rust RC is equivalent to std::shared_ptr
Nice fucking strawman.
>>
>>59800067
Learning C++ first will make you a better programmer later than learning Python first IMO. But you can (and should) learn both at the same time, both are tools that are useful in there own ways. For Python, since you haven't really programmed before, check out "Python For Kids" (I know, what a name), and "Automate The Boring Stuff With Python".

After you read both of those, Python has some great ML libraries w/ tutorials. TensorFlow, PyTorch, Scikit-learn are all good ML libraries, and 'data manipulation' libraries are also good to look into like pandas.
>>
>>59800224
>le harmful maymay

The opinion of an underage frogposter on technology matters more than theirs.
>>
>>59800224
>cat-v
Opinion discarded.
>>
>>59800084
the first guess, with load_data the database variabe should be declared right?
>>
>>59800303
It isn't initialized until the first call to load_data()
>>
>>59799097
How is it crashing and where?
>>
>>59799600
>null terminated char arrays
>>greatest inherent safety
What the fuck are you talking about?
Thread posts: 321
Thread images: 24


[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.