[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: 33

What are you working on, /g/?

Old thread: >>59893949

Reminder that Pythons make good reptiles, but poor programming languages.
>>
>>59897927
it's a pain in the ass to recompile all the time, i just need the repl. python's a lot better than i expected for it
>>
Listening to some screencasts... Is there somewhere I could get the screencast in pic related without paying for a subscription?
>>
File: opinion.png (49KB, 309x251px) Image search: [Google]
opinion.png
49KB, 309x251px
>programming your computer
>not treating it as a disposable appliance like a car
>>
what's so bad about python?
>>
>>59898046
Pythons can be finicky feeders
>>
Hey does LLVM on windows still have to hijack the VS standard libraries or does it come with its own implementation now
>>
>>59898046
It's slow. Good if you want to pretend it's 1963 though.
>>
>>59898091
If it relies on third party libraries then portable dynamic linking is impossible.
>>
>>59898046
it's unusable for many applications because of the awfully slow performance. as for the language itself it has a lot of bad design decisions. it ignores a lot of modern PLT. it's made by one guy which is not a good thing when it comes to programming languages. the big languages like java, C++, C are designed by industry-leading experts from billion-dollar companies
>>
File: languages3.png (17KB, 522x384px) Image search: [Google]
languages3.png
17KB, 522x384px
>>59898046
>>
>>59898046
It's not Lisp.
>>
>>59898094
You could use Lisp, which isn't nearly as crippled as Python.
>>
The thread is being derailed by LISP faggots.

ABORT
>>
>>59898185
Come now, everyone needs a little paren action in their lives.
>>
>>59898174
Lisp is too different from other programming languages though. You really can't use it effectively until you're able to think about programming on an abstract level. Python is good for engineers and the like because it's basically the same as pseudocode.
>>
>>59898259
>You really can't use it effectively until you're able to think about programming on an abstract level
This is a good thing.
>>
>>59898259
This is meaningless.
>>
I tried picking up lisp but it just didn't seem practical

Like it was this cute sort of esoteric academic pile of convolutions and yeah I can imagine it being fascinating from an almost artistic standpoint but as a straight-up engineering tool? It seems like it'd be way too hard to practically parse and reason about the programs you make. Interesting for some strains of academia, but little else.
>>
>>59898046
i'm just now starting using it but i think python's good for prototyping. like, you flesh out the algorithm you're implementing or w/e in python, and then implement it in C or something when you have it working. that's what i'm gonna be using it for at least
>>
>>59898027
>not treating your computer like a samurai katana
>>
>>59897975
>What are you working on, /g/?
A cellular automata that generates mazes: https://gist.github.com/elbingobonito/5d83b921dd0a6bdeb1d4a63a85ff40f6
>>
Getting a syntax error before the period '.' right after end. I can't see it. Any help?

-module(barrier).
-export([start/1, server/1]).

server(Running) ->
receive
{Pid, done} ->
Pid ! {self(), ok},
if Running == 1 ->
Pid ! {self(), continue};
true ->
server(Running-1);
{Pid, how_many_running} ->
Pid ! {self(), number_running_is, Running},
server(Running)
end.

start(Running) ->
spawn(barrier, server, Running).
>>
>>59898344
What language is this?
>>
>>59898368
Erlang.
>>
>>59897975
I miss my Ball Python :(
>>
>>59898368
What he said >>59898373
>>
>>59898375
sorry man

balls are bros
>>
>>59898416
Hell yea man, my snake was fucking great. Extremely friendly at all times, and always ate when I fed her.
I sold her because I needed to get a bigger tank, and the heat pad added a lot of heat to my room. I also rarely played with her.

I am going to get another ball down the line when I have more space, and money.
>>
after this semester I want to read some books about programming but preferably just about general concepts/interesting stuff and not about a specific language. What are some most reads for programmers?
>>
>>59898344
>>59898399
I don't use Erlang, but do you need an 'end' for your 'if'?
>>
>>59898468
You're right. Brb let me fix that.
>>
>>59898462
SICP
>>
How should I generate a list of typos for a word? What type of algorithm?

Is there a list of common grammar mistakes anywhere? I'd like to automatically change things like "relief" into "releif", in addition to typos.,

>>59898462
https://www.amazon.com/TCP-Illustrated-Vol-Addison-Wesley-Professional/dp/0201633469/
>>
Sorry for bad english
well I got this JS function for increasing font size on website by clicking button (and similar one for decreasing):
function sizeUp(){
var s = document.getElementsByTagName("BODY")[0];
var sty = window.getComputedStyle(s, null).getPropertyValue('font-size');
var sty2 = window.getComputedStyle(s, null).getPropertyValue('background-color');
var fs = parseFloat(sty);
var fSize = fs + 1;
//s.style.fontSize = fSize + "px";
s.setAttribute("style", "font-size: "+fSize+"px !important; background-color: "+ sty2 +" !important;");
for(j = 1; j <7; j++){
for(i = 0; i < document.getElementsByTagName("h"+j).length; i++){
var s2 = document.getElementsByTagName("h"+j)[i];
var sty2 = window.getComputedStyle(s2, null).getPropertyValue('font-size');
var fs2 = parseFloat(sty2);
var fSize2 = fs2 + 1;
s2.style.fontSize = fSize2 + "px";
}
}
for(k = 1; document.getElementsByTagName("p").length; k++){
var p = document.getElementsByTagName("p")[k];
var sty2 = window.getComputedStyle(p, null).getPropertyValue('font-size');
var fs2 = parseFloat(sty2);
var fSize2 = fs2 + 1;
p.style.fontSize = fSize2 + "px";
}
}

Now obviously, when user changes subpages font size goes back to default.
Could you give tips how to do this so that chosen font size would remain after changing subpages?
Important thing is to do it using only JS no php or database.
I think I should create another function:
1. functions runs when user clicks <a> tag
2. save font size to site preference or something
3. get font size from site preference
4. set last font size

Am I going right about this? shoud I create another function (onLoad) beetween points 2 and 3?
I would apreciate any directions on this
>>
>>59898109
Well C was designed by just one guy. Also, C++ turned into a big mess because all the industries wanted to put all their favorite features in until it became the cluster fuck it is today.
>>
>>59898046

Nothing...most of the people on /g/ are 2nd year CS majors (don't listen to them)
>>
>>59898595
shit i'm a 2nd year CS major as well, i'm fucking struggling lmao
>>
>>59898561
You should use something like PHP to store the font size in a session variable, javascript is meant to be client side so it's page-to-page code. If you really need to though, you could try saving it within a cookie and pull it from there, but there's the problem of people who disable cookies or something.
>>
>>59898503
Just use an algorithm like edit distance (https://en.wikipedia.org/wiki/Edit_distance) to find which words have a small edit distance.
>>
You make a poor reptile and poor programming languages.

Checkmate atheist.
>>
>>59898046

Pretty much nothing. Other languages are faster:

https://attractivechaos.github.io/plb/

But it depends on exactly what you are doing. Also, most of the bottlenecks that would effect the user have nothing to do with these benchmarks. Facebook used php (garbage tier language by /g/ standards) they kept using it until they were one of the largest sources of data crunching per day on the planet, and even then they just edited and made their own faster version of php as a response.

It's like most things on /g/, tribal and highly related to clique like culture...if it's not part of "the culture" then it's just a meme and pointless to use. Yet so many of these faggots keep using Windows...

Even with those benchmarks, the ease of use and simpleness of Python beats out those other languages.

ITT: unless you are writing guidance systems or work for NASA/Space X it doesn't matter
>>
>>59898672
That benchmark is incomplete: it doesn't include Rust.
>>
>>59898745
t. mozilla evangelist
>>
>>59898672
> Not using static typing
>>
>>59898972
Strong static typing is a meme and weak static typing is worthless
>>
>>59898561
same poster
k should start with 0 in last loop
>>
>>59897975
Wow! What a handsome boy!
>>
File: Selection_001.png (48KB, 995x628px) Image search: [Google]
Selection_001.png
48KB, 995x628px
Debugging a memory leak in a haskell program - normally the memory profiler has worked well for me, but now it's just showing the memory being used by PINNED. There aren't many results when you search this, though some suggest it could be related to bytestrings. I only use bytestrings once, and when commented out the problem continues, so if it is bytestrings it's in a library I'm using. How can I work out what's causing this?
>>
>>59899183
1gb of garbage per second
>>
File: heap.png (19KB, 736x196px) Image search: [Google]
heap.png
19KB, 736x196px
for my current assignment, we just have to take a heapsort, and have it print out after each time it makes a sorting pass.. so that the printf output looks like a triangle.

printing out the final sort is easy, but im kind of hung up on this specific part :\

https://pastebin.com/CDyzJABQ
>>
>>59899183
>Debugging a memory leak in a haskell program
b-but isn't hasklel the magic bullet to fix all your programming woes
>>
CLion is using 200% of my CPU, is this normal?
>>
>>59899238
do in-order traversal, printing each element you come across
>>
>>59899183
Isn't haskell garbage-collected?
>>
>>59899183
Never mind, I managed to isolate it. Should be able to fix it pretty quickly tomorrow.

>>59899202
I don't know if this is a shitpost or retardation desu

>>59899259
Memory leaks can be a bit easier to get in haskell due to lazy evaluation, generally pretty easy to fix once you find it.

>>59899442
Yes, it's generally caused by something not being evaluated
>>
>>59899279
>200% of my CPU
what
>>
File: 1474532762434.jpg (108KB, 850x791px) Image search: [Google]
1474532762434.jpg
108KB, 850x791px
>>59897975
Trying to build a computer (a type theory) that computes the truth of all propositions.
>>
File: MaximaChanZukerberg.jpg (16KB, 320x320px) Image search: [Google]
MaximaChanZukerberg.jpg
16KB, 320x320px
>>59897975
You have been visited by the goddess of computer programming.
Say I love "Al hail Chan Zukerberg Family" to drink potion of success or ignore to end up dying as NEET.
>>
>>59899774
Jews getting ready to infiltrate China I see.
>>
>>59899774
I don't know why you're replying to posts like you're me.
>>
File: 1458588190310.jpg (37KB, 348x342px) Image search: [Google]
1458588190310.jpg
37KB, 348x342px
>>59899183
Why are you still using an unsound language in the year 2017?
>>
So I've been accepted into a PhD program... I just have to not fuck up finishing up my master's degree.
>>
This is not your homework help desk, get the fuck out, nigger trash.
>>
>>59899879
you're a special kind of retard, aren't ya
>>
>>59899944
How high is your autism?
>>
>>59899954
sometimes the truth is hard to understand.
>>
>had a coding interview in C++
>had to replace the \ character with a +
>strings such as "\" will be come a "+"
>didn't know the best way of dealing with a \ character in C++ since it acts like an escape character
>told them that the string would need an extra \ or some other way to make that \ character fuck shit up

was I wrong in saying this? Is there a better way of dealing with an escape character like \ in a C++ string?
>>
>>59899965
>had a coding interview in C++
>had to replace the \ character with a +
>strings such as "\" will be come a "+"
>didn't know the best way of dealing with a \ character in C++ since it acts like an escape character
>told them that the string would need an extra \ or some other way to make that \ character fuck shit up
What are you going to mean by this?
>>
>>59899986
Please answer the question.
>>
>>59899986
Aaaaaa! Please don't eat me!
>>
>>59900010

already answered senpai I was just generally curious as to what a best approach is for dealing with a \ character in a string
>>
>>59900042
Who were you quoting in that post?
>>
>>59898561
>>>/g//wdg/
>>
File: 2017-04-15-021519_703x868_scrot.png (43KB, 703x868px) Image search: [Google]
2017-04-15-021519_703x868_scrot.png
43KB, 703x868px
I wrote this script to download images from Danbooru.

https://pastebin.com/DMW9WVaU

Haven't used it in a while, but needed it again and remembered that I'm quite proud of it, all you need is BeautifulSoup and Requests.

https://pypi.python.org/pypi/beautifulsoup4
https://pypi.python.org/pypi/requests
>>
>>59900071
>p*thon
Worthless garbage.
>>
>>59900080
Rewrite that script in C please, I dare you.
>>
>>59900089
What are you even babbling about now? Who said "C"?
>>
>>59899986
>strings such as "\"

You are confusing the representation of a string with the string. "\" is a valid string, but it's not a valid representation of a string. When they say that the string "\" should become "+" they mean that the string represented by "\\" should become "+".
>>
>>59900116

if this is true then at the very least the code I implemented is correct. I basically stated my code assumes and strings passed to it would have \\ as \ doesn't work.

I just didn't know if that was a good enough assumption when finishing my code.

thanks mate.
>>
>>59900138
Why the hell do you space your posts like that, redditor?
>>
>>59900153
Bet you're that same autist from /qa/ who complained about that being "reddit spacing".
>>
>>59900153

autism

like seriously

autism

that's the only reason I do spaces

like this
>>
>>59900071
>importing different modules on the same line
>no if __name__ == "__main__": block
>no functions

You wrote a shell script in Python, which is what a lot of people do but isn't really right.

Also don't use + to concatenate strings, it's slower than %s. So instead of "base_url = base_url + "+" + tag" you should write "base_url = "%s+%s" % (base_url, tag)". + is okay if there's only one string concatenation going on (e.g. a = b + c) but for multiple it's slow because it allocates a new string at each step (e.g. a = b + c + d is actually doing a1 = b + c; a = a1 + d).

Lastly, instead of doing open followed by an explicit close, a with statement is common practice. The with statement will ensure the file handle is closed even if an exception is raised. So instead of:
image = open(filename, "wb")
image.write(raw_data.content)
image.close()

Consider this:
with open(filename, "wb") as image:
image.write(raw_data.content)


No .close() is necessary, leaving the with block in any way (even if image.write raises an exception) will invoke .close(). It's basically shorthand for:
try:
image = open(filename, "wb")
image.write(raw_data.content)
finally:
image.close()
>>
>>59900164
>/qa/
So basically you're admitting that you're a redditor then.

>>59900173
I didn't even bother to read your post, because I already know it's fucking stupid. Piss off.
>>
Guys, should I finish lyhgc first and then Programming in haskell 2nd ed?

Also what's a good book to get into C++ usage for UE4?
>>
@59900181
>Also what's a good book to get into C++ usage for UE4?
Ask on >>>/v/
Or on >>>/vg/
>>
>>59900179
>I didn't even bother to read your post, because I already know it's fucking stupid. Piss off.

why are so le upset friend XD?
>>
>>59900222
If you weren't fresh off the boat from rabbit you might have been aware.
>>
>>59900178
>Python
Stopped reading right there. Fuck off to >>>/g/wdg/
>>
>>59900178
Thanks for the advice, especially the last part using a with statement.
>>
File: 1487935569956-0.png (402KB, 598x1021px) Image search: [Google]
1487935569956-0.png
402KB, 598x1021px
>>59900178
Not the guy you're replying to, but that's a good post, anon.
>>
>>59900210
do they even give a damn about video game programming? it seems like all /v/ does it get angry at each other
>>
>>59900261
Sure.
>>59900265
>anime
Your posts are bad and you should stop posting.
>>
>>59900181
>>>/vg/agdg

but they'll probably tell you to use blueprints. supposedly the C++ support in UE4 is pretty broken
>>
>>59900280
That was a trick, but now I have confirmed that you are indeed a plebbitor from /v/.
You should return to your home board.
>>
File: 1453573095747.jpg (17KB, 210x210px) Image search: [Google]
1453573095747.jpg
17KB, 210x210px
>>59900285
Rude much?
>>
>>59900321
Stop trying to justify your mental illness
>>
>>59900290
>>59900300
fuck, then what's a good C++ game engine?
I guess I could go learn C# if it's similar enough to Java then

>>59900300
but i browse /int/ ;_;
>>
@59900333
>i browse /int/
Yes, I can clearly see that by your retardation.
>>>/int/
>>>/b/
>>
File: 1454745212653.png (47KB, 331x286px) Image search: [Google]
1454745212653.png
47KB, 331x286px
>>59900290
>supposedly the C++ support in UE4 is pretty broken
Isn't the damn engine programmed in C++?

>>59900333
Make your own with SDL/SFML and OpenGL.

>>59900332
You might be rude, but I still love you anon-kun~
>>
File: 1457542350417.jpg (33KB, 294x405px) Image search: [Google]
1457542350417.jpg
33KB, 294x405px
>>59900362
That wasn't even me. I'm having trouble hiding my mental deformity so I pretend to be multiple people.
>>
>>59900285
>>59900332
Wow, now I don't like you because you're an anime-hating normalfag, idc if you gave me advice.
>>
>>59899742
Here's my attempt.
10 INPUT A$
20 PRINT "YES"
30 GOTO 10
40 END
>>
>>59900333
all the off-the-shelf commercial game engines are unironically shit. any self-respecting game dev studio will have their own in-house engine. i'd suggest you learn graphics programming and make your own engine. it's actually not that hard since you don't have to support all kinds of different use cases like the commercial engines and you're free to make drastic changes from version to version or from game to game
>>
>>59900411
Well, any good books to get started with on this?
>>
File: 1397117351614.png (176KB, 441x421px) Image search: [Google]
1397117351614.png
176KB, 441x421px
>>59900383
It works!
>>
>>59900425
OpenGL SuperBible.
Game Engine Architecture.
>>
>>59900425
http://www.gameenginebook.com/
>>
File: 1489067290431.jpg (47KB, 437x501px) Image search: [Google]
1489067290431.jpg
47KB, 437x501px
>>59900475
>>59900480
I can feel my soul going already, but thanks, will report if results are conclusive
>>
>>59900512
It'll take you about 12-14 weeks to make a fully functioning 3d game engine.
>>
>>59900528
You're just setting him up for some exciting depression later.
>>
>>59900512
>>59900528
this but you'll learn a ton of useful stuff and become better at programming
>>
File: 1489839450329.png (64KB, 216x422px) Image search: [Google]
1489839450329.png
64KB, 216x422px
>>59900528
I will do my best
>>
Can anyone show me a type signature which can cause a type checker to loop indefinitely?
>>
What could possibly be the reason when I run my program normally in terminal I get a segfault but if I run it in gdb or valgrind no segfault occurs?
>>
>>59900578
Most type systems prevent this, but it's certainly possibly in C++ (without a template limit) or Haskell with UndecidableInstances
>>
>>59900747
A data race, valgrind slows your program down thus making it less likely to happen.
>>
>>59900954
Can't be, there's only one thread running at all times
>>
>>59899285
got it figured out =)
>>
>>59900747
Segfaults are when you're lucky
>>
>>59900578
I don't use Turing complete type systems
>>
File: 1409519933871.jpg (10KB, 375x375px) Image search: [Google]
1409519933871.jpg
10KB, 375x375px
seq.append(seq.pop(0))
>>
>>59900512
Don't forget real-time collision detection.
Just understand its abook you reference. The only thing you should read is all the chapters up the the math and geometry primer. But not necessarily immediately.
The spacial partitioning chapter has some more general applications too.
>>
>>59900411
Arguably yes. But fact is that most who make games don't have big requirements. For these people they tend to lack in the level authoring department more than anywhere else.
This makes making your own engine very appropriate as you can structure the world format to fit your design and make your own editor quite easily that has been made with your game in mind.

But it's not always a time win. Even for experienced programmers.
>>59900362
>isn't the damn engine programmed in C++?
Yes. But they don't design their engine for people like you to fiddle with it. They've built their engine around having the interface that isn't C++. The blueprints and editor stuff. When you dig down into the UE4 source it's very unwieldy and documentation is lacking so that doesn't help. You can start reading the source, it's on github, you will quickly understand that it's a waste of time for someone not working at a game studio that has many employees where a few can focus on developing features for the rest of the team.
>>
Are there any decent programs for unironically drawing diagrams? Kinda like UML diagrams but less autistic, just to sketch a high level overview of the components of a project.
>>
>>59901476
kek
>>
>>59901729
>They've built their engine around having the interface that isn't C++
I can understand providing GUI tools and scripting languages to interface with the engine, but shouldn't they have a good C++ interface for those who need it?

>>59901749
Try LibreOffice Draw or whatever the MS Office equivalent is called.
>>
>>59901778
It's not necessarily the case that it's a bad interface. It's just involved because they aim to have the GUI be a priority. You could easily write a good C++ interface if you disregard the gui completely but to have them work in tandem is much harder. It takes more understanding to get somewhere.
>>
Trying to understand Wayland.

How the fuck do I:
Set the application's icon (In X: set _NET_WM_ICON)
Handle Window Manager quit events (in X: Set WM_PROTOCOLS/WM_DELETE_WINDOW and handle it in my event loop)
>>
>>59901749
draw.io
>>
>>59897975
>use C# forever
>have to program in Python now
C# syntax is so nice that programming in any other language feels like cancer.
>>
What's the syntax for making auto-disposing objects in C# again? Something like

using (Class c as Class) {
...
} // c is disposed of here
>>
>>59902355
microshill pls
>>
>>59902365
enjoy your @properties and
def foo(bar: type) -> ForSomeReasonVoidIsNotAType
>>
Can you do optimizations on llvm IR?
Why is there no linux distribution that distributes every package compiled into llvm IR which then gets complied locally with optimizations into the final binary yet
>>
>>59902373
void is None
>>
>>59902360
Using statements require a class implement IDisposable.
Syntax is
using(Foo foo = new Foo())
using(Bar bar = new Bar()) {
//do shit
}
>>
>>59902392
nice industry standards you got there senpai
>>
>>59902404
who cares?
>>
>>59902398
Thanks senpai.
>>
>>59902404
>babby's first concept that gets called a slightly different way in a different language
>>
>>59897975
Working on a Restaurant App for my final.
Currently in the works of writing an asp web service which will mine Google Places of all restaurants in a given location and radius, and populate my database.
>>
Newb here, can somebody explains to my why "if variable" works in python. ie.

x = 5
if x:
print "Hello"
else:
print "Olleh"

will print Hello. Same goes if x is non empty tuple, list etc. Why is non-empty object considered as True?
>>
>>59902592
You wouldn't have this problem if you used real language like C.
>>
>>59902592
https://docs.python.org/3/library/stdtypes.html#truth-value-testing
>>
>>59902625
This is incredibly stupid. So basically "if" is not only a logical statement but also a way to test is something is non-zero, non-empty or otherwise NaN.
>>
template <class T>
class tmp_ptr {

public:
tmp_ptr ();
tmp_ptr (T *ptr);
tmp_ptr (const tmp_ptr<T> &&other);
~tmp_ptr ();

tmp_ptr &operator = (const tmp_ptr<T> &&other);
T *release ();

private:
tmp_ptr (const tmp_ptr &);
tmp_ptr &operator = (const tmp_ptr &);
T *_ptr;

};

template <class T>
inline tmp_ptr<T>::tmp_ptr () : _ptr (NULL) {}

template <class T>
inline tmp_ptr<T>::tmp_ptr (T *ptr) : _ptr (ptr) {}

template <class T>
inline tmp_ptr<T>::tmp_ptr (const tmp_ptr<T> &&other)
: _ptr (other.release) {}

template <class T>
inline tmp_ptr<T>::~tmp_ptr () {
delete _ptr;
}

template <class T>
inline tmp_ptr<T> &tmp_ptr<T>::operator = (const tmp_ptr<T> &&other) {
_ptr = other.release;
}

template <class T>
inline T *tmp_ptr<T>::release () {
T *p (_ptr);
_ptr = NULL;
return p;
}
>>
>>59902661
That's how it works in pretty much any language. 0 is considered false, any other value is considered true. Empty lists etc. being false is specific to python but definitely useful.
>>
>>59902616
Same would happen in C, nincompoop
>>
>>59902693
no 0 is false and anything else is true. Python has containers and empty string and other stuff that can also be false.
>>
>>59902703
Empty containers are the equivalent of a NULL pointer. An empty C string would be '\0'.
>>
Will majoring in CS help me get a better problem solving mindset?
>>
>>59902728
empty != null
>>
>>59902816
That's why I said equivalent. Most objects in python are immutable anyway, so they might as well be null.
>>
>>59902688
Hideous
>>
>>59902884
Why?
>>
>>59902903
All the bloat
>>
>>59902941
Where?
>>
>>59902963
template <class T>
inline [type] tmp_ptr<T>::[function] ... {}
>>
>>59903003
What is the problem?
>>
I'm trying to count the number of different solutions in a sudoku using backtracking in python, but I'm stuck. I can make a program that solves a sudoku, but I don't know how to make it count more than one solution. My sudoku solving function looks like this :
def solve(sudoku):
if (full(sudoku)==[]):
return True #If the sudoku doesn't have more empty spaces, it's solved
row=full(sudoku)[0] #The full function returns the coordinates of the empty spaces in the sudoku
column=full(sudoku)[1]
for i in range (1,10):
if canputnumber(sudoku,row,column,i):
sudoku[row][column]=i
if solve(sudoku):
return True #Recursivity
sudoku[row][column]=0 #backtracking
return False
>>
>>59903012
Boilerplate
>>
>>59903040
Yes it's C++.
>>
>>59903047
C++ really is an awful language
>>
anyone have the images of flow charts showing the logic of if/else, for, foreach, enum, etc...
trying to teach my nephews but i can't find them anywhere now
>>
>>59898046
nothing as long as you know when you should use it, it's actually slow but you can have it do very heavy shit if you use binded stuff or libraries written in Chyton, if you write heavy computation algorithms in "pure" python you are obviously doing it wrong and calling it a shit language is idiotic, but this thread is full of retards
>>
>>59903003
>>59903040
that particular boilerplate is entirely optional. he could have just written everything in the class definition and done away with the inline and template declarations and explicit scoping and it would have compiled down to the same thing

>>59903075
this is a pretty bad example on which to base your judgments. of course there are prettier languages out there, but there are things i sorely miss from C++ when working in any other language. especially now that it's a shitload better than it used to be thanks to C++11/14/17
>>
>>59903169
That isn't the only example on which to base my judgements, but if it were, it's perfectly sufficient to conclude C++ is awful
>>
>>59897975
I'm learning to write native applications using Windows API, and making a simple text editor in the process. Some things you just can't do with sepples standard library alone.

But now i'm unsure if i should be using std:: at all, or prefer the win API for things that are available in both. Like opening, reading and writing files, for instance.
>>
>>59903259
Use as many things from the standard library as possible, use WinAPI only when necessary (so mostly just the UI and event pump).
>>
Wiping a partition so I can do a fresh install.

 dd if=/dev/zero of=/dev/sdX bs=1M 


How long should this take? Partition is roughly 440GB in capacity
>>
>>59903298
shit, wrong thread
>>
>>59903274
Any reason for this?

I'm assume the windows implementation of the standard library is built on top of the win api, so wouldn't it makes sense to just skip the middle layer?
>>
>>59897975
it's not summing up the right number, what am i doing wrong?
tried using int before, but i think i was overflowing the ints.

/*
Project Euler Problem 2
=======================

Each new term in the Fibonacci sequence is generated by adding the
previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

Find the sum of all the even-valued terms in the sequence which do not
exceed four million.
*/

#include <stdio.h>

double fibbonacci(){

double a = 1;
double b = 2;
double c;
double d;

double sumcount = 0;

for (int i = 0; i < 4000000; ++i)
{
/* code */
c = a + b;
if(c % 2 == 0){
sumcount += c ;
}
else {

}

a = b;
b = c;

}

printf("%f\n", sumcount);
return sumcount;
}

int main(int argc, char const *argv[])
{
fibbonacci();

return 0;
}
>>
>>59903181
how arrogant. think what you want, but if you took the time to learn more about it, you might find that despite its flaws it has many considerable strengths. or perhaps at the very least that describing it as simply "awful" is more than a bit naive
>>
>>59903383
I get it, you aren't aware of alternatives
>>
>>59903340
You're calculating the first 4000000 fibonacci numbers, not numbers below 4000000. The correct solution will not overflow an int. And if it did, you should use a long long rather than double.
>>
>>59899183
Text pins memory too &c.
>>
>>59903325
You're right. The standard libraries are built on top of OS APIs however by using the standard library you're getting portability.
You can write the core of your editor as a set of functions/classes that are built on top of the standard library, and only use WinAPI bits for the UI/msg pump and this way, if you ever wanted to port your native application to another platform, all you would have to do is just do these two things.
Another reason is that WinAPI is old, ugly and shittily designed, it's not something you want to work with.
>>
File: Sat Apr 15 14:41:27 CEST 2017.png (1MB, 1920x1080px) Image search: [Google]
Sat Apr 15 14:41:27 CEST 2017.png
1MB, 1920x1080px
what is a idea that would make me a billionaire and requires less than a weekend worth of work?
im counting on you /g/ dont let me down
>>
>>59903512
It's not the idea itself but the social aspect of it which you'd clearly fail at.
>>
>>59903512
turn to God
so you can inherit Heaven
be a joint-heir with Christ
then you'll be truly rich
billions or dollars will be comparatively nothing to you
>>
>>59903512
wallpaper pls
>>
>>59903447
ah thanks, rookie mistake in logic
>>
>>59903530
i think i understand what you mean

>>59903543
i am indeed Catholic

>>59903554
https://archive.nyafuu.org/w/thread/1995767/#q1997117
>>
>>59903446
i am. i use some of them where applicable, and i'm sure i'll learn and use more as time goes on. each has its place, including C++. i wouldn't go so far as to call any of them "awful", because that sounds petty to me. if i'm going to criticize something made by communities of academics and software engineers i'd prefer to do my research and have something tangible to say, rather than shallowly talk shit
>>
>>59903492
So using the native API should make for a nominally more efficient executable?

It's not like stl is all that pretty either.

But you make a good point about portability. Maybe i should write both implementations. Might be a good exercise in structuring my code for easy modularization.
>>
>>59903694
>So using the native API should make for a nominally more efficient executable?
The calls themselves probably have no overhead whatsoever however there's gonna be some C++ overhead when you create stack objects for streams and what not but the penalty is negligible anyway.
>>
>>59903259
Avoid the standard library at all costs. Roll your own shit. the standard library often forms your code in a problematic way.
>>
>>59903512
Should this idea be legal?
>>
>>59903727
Now it's one voice for and one voice against.
>>
>>59903731
preferably, not necessarily
>>
>>59903781
To elaborate:
The standard library (especially the template library) has a lot of features that constrain you to their methods. Same with windows. But where you use the winAPI is rather limited. It's designed to be abstracted away and you can easily do so. The standard library is built for you to use the exact interface they have and is very clunky to abstract away if you try.

It's also heavily templetized which impacts compile times significantly, makes debugging much harder and it has a lot of quirks and requirements. I'm sure someone that dedicates themselves to understanding the standard library well can work effectively and avoid issues. But for most people it's going to be easier to use your own helper library because implementing these basic features the standard provides is trivial and you will know exactly how to deal with it.
It's not easy to explain all this concisely.
If you watch this:
https://www.youtube.com/watch?v=ZQ5_u8Lgvyk
You will have a better understanding of how API hinders and helps you. You can then apply yourself and see where you have the pros and cons.
>>
>>59899913
What's your thesis about
>>
How do i load data into specific row in mysql table?
I want to load data from txt file which has only one word in every row but mysql table has 4.
if i use normal load it will add txt file in 1st row of table but i want it in 2nd
>>
>>59903953
This is a point to consider. Thanks for your input.
>>
Another /dpt/ devolves into /agdg/ shit.

Why do you guys even come here.
>>
>>59903989
There's a few exceptions to this. Don't try to roll your own random number generator. The standards Mersenne Twister (mt19937, great name) is very effective and overall very good. And you just get back some bytes really, it got a very well defined boundary.
>>
File: 1491843307258.jpg (25KB, 800x609px) Image search: [Google]
1491843307258.jpg
25KB, 800x609px
>>59898152
>python doesn't have fast development
??????????
>>
Is this ok, or should I use memcpy()?
(arr is a buffer, guaranteed to have enough space allocated)
void LevelObject::serialize(uint8_t * arr) {
*(uint32_t *)(arr) = id;
*(uint8_t *)(arr + 4) = type;
*(uint16_t *)(arr + 5) = x; /* Unaligned! */
*(uint16_t *)(arr + 7) = y;
*(uint16_t *)(arr + 9) = w;
*(uint16_t *)(arr + 11) = h;
}
>>
If Python's so shit, how come Google uses it extensively?

>in b4 le xd google is shit xdddd
They're still the company with the largest scalability demands and therefore probably the most performance-conscious of any of the big 4
>>
>>59904063
google started on it just like yt, but they are running away from it desu

>also faggots works in yt and google, maybe that is the best reason why they use it
>>
>>59903512
suck 10,000,000 dicks at $100 each

or 50,000,000 dicks at $20 each
>>
>>59904034
What id /agdg/
>>
>>59904124
>>>/vg/agdg
He's being very hyperbolic though.
>>
>>59904146
What's wrong with amateur game development?
Seems like an excellent subject for a general programming thread.

I come here mostly to rubberduck. Sometimes i get very helpful replies.
>>
>>59904082
>suck 10,000,000 dicks
>less than a weekend
>>
>>59904181
I think he's referring to posts like these.
>>59901729
>>59901778
>>59901859
They're not really about programming they're about library choices. But there's so much shitposting here normally I don't see why he would bother complaining about this.
>>
>>59904194
If there's anyone who could do it, it's >>59903512
>>
>>59904043
You should probably make a custom class that handles this shit for you. Something like this - https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html
>>
>>59904215
But library choice is an important part of programming.
>>
>>59904302
No.
>>
>>59899913
My condolences.
>>
does anyone know a lightweight OCR library? my use case is pretty simple
>scraping text from high quality screenshots, so no handwritten text or distortions
>small amounts of text, single sentence typically
>>
>>59902381
Because nobody cared enough to do that yet. It's no different than distributing Java programs.
>>
>>59904430
Tesseract OCR
>>
>>59904520
tesseract would do but the problem is it is fucking huge and way overkill for the relatively simple problem im trying to solve
>>
Compilers should optimize away functions that have return type unit or void (in the C sense).
>>
>>59904745
???
>>
>>59904759
Such functions serve no purpose and cannot do anything.
>>
>>59904785
Are you sure?
static void no_purpose(u8 *ptr)
{
*ptr = 5;
}

int main(void)
{
u8 value = 0;
no_purpose(&value);
fprintf(stdout, "%u\n", value);
return 0;
}
>>
>>59904797
u n s a f e
>>
what is good about lambda expressions in c++? that shit is too confusing
>>
>>59904797
That's not a function, it's a monstrosity.
>>
>>59904834
Nothing, they serve only to prolong a dying language
>>
>>59904834
Nothing. Bjarne just needed add them because sepples wasn't bloated enough.
>>
>>59904834
std::thread(isRunning, [](){
std::cout << "KEK" << std::endl;
});
>>
>>59904797
You took the functional programming bait. Anon, i am disappoint.
>>
>>59904863
ftw, originally it said KEK instead of KEK
>>
>>59904834
They're nice for locally defining callback functions.
>>
>>59904745
Compilers should optimize away all functions, because they incurr no side-effects (thus are indistinguishable from no-ops).
>>
>>59904834
Lambda expressions are the basis of all good languages
>>
>>59904934
They do, it's called code generation
>>
>>59904935
Why?
>>
>>59904985
What do you mean "why"?
>>
File: uh.png (49KB, 878x415px) Image search: [Google]
uh.png
49KB, 878x415px
hmm
>>
>>59904985
They make for the basis of a good standard library. Functions that take other functions as argument can generalize a lot more of the standard boilerplate hacking that people in less developed languages have to do every time they want to write something.

Even C has qsort.
>>
File: 1470527145585.png (402KB, 588x598px) Image search: [Google]
1470527145585.png
402KB, 588x598px
>>59897975
>mfw pronouncing Python like "pieth-en"
>mfw pronouncing C# as "C hash"
>mfw pronouncing Fortran like "four train"
>mfw pronouncing R like a pirate
>mfw pronouncing Java as "shit"
>>
>>59905057
this raises many questions.
>>
What is the best way to learn C hash if I am already a C++ artisan?
>>
>>59898016
>destroy all software
I don't know but I'm interested too, if you find something please let us know
>>
>>59905580
You learn Java, then you just memorize the C hash keywords.
>>
>>59905707
What is the best way to learn Java if I am already a C++ artisan?
>>
>>59905580
delete all the <>s and ::s and #s from your code
>>
>>59905443
>mfw pronouncing R like a pirate
how am I supposed to pronounce R then?
>>
>>59900071
That's some ugly ass code
>>
>>59905443
Pajton, Seeheshtag, fourchan, arrr
>>
File: Capture.jpg (33KB, 441x286px) Image search: [Google]
Capture.jpg
33KB, 441x286px
right now I have this code which lets me "comment" a selection of text in a rich text box

the problem is it doesn't save properties of the text, so if I were to comment one selection and then comment another selection the first would no longer be green

anyone have a suggestion to improve this
>>
what is a good quick reference guide for c++? I'm too lazy to read the 1400 pages of bjarne's book
>>
>>59906100
Practical Common Lisp
>>
>>59906100
cppreference.com
>>
>>59906095
instructions unclear.
>>
>>59906100
>too lazy to read
EVERYONE should read Stroustrup-sama and Alexandrescu-sama EVERYDAY
>>
>>59906187
i wonder if their books are any better than their garbage languages
>>
What's a good way to convert a string of numbers to actual numbers? I have an assignment where I need to convert a user input hex byte, that would be a string, and then convert it to actual hex numbers in ASM. I tried writing a program in C to convert a string to base 10, just to see if I even knew how to do that, but got halfway through it and realized this would suck ass to do in asm.

As it's written now, it doesn't work quite right, but you get an idea of what I was trying to do. What would be a better way of doing this?
int main()
{
char input[256];
fgets(input, 256, stdin); // Read the input.

int i = 0;
while (input[i] != '\n') // Find length of string.
++i;

int str_as_num = 0;
int placeholder = 0;
--i; // For zero index counting.
int j = 0;
while (j <= i)
{
placeholder = input[j] - 48;
str_as_num += placeholder * pow(10, j);
++j;
}


printf("%d\n", str_as_num);

}
>>
>>59906349
so you want to convert F => 15 and so on?
just learn how to do it by hand (it's quite simple) and the answer should be obvious
>>
>>59906349
I don't understand, do you mean like a user inputs "AF28" (i.e. hex) and you convert that string into the (32 bit) integer representation of that (i.e. 44,840)?
>>
>>59906349
for decimal it's really easy since ascii '0'-'9' are contiguous. take the first digit, subtract '0' (0x30) from it, add to N, multiply N by the base (10), repeat until there are no more digits. then N is your result. in hex you'd basically do the same thing but with a lookup table.
I probably have an example somewhere, hold on.
>>
>deploy docker container on AWS ECS
>it has SSL certificates on it
>give access to my coworkers to pull the docker container
>they now have the SSL keys
Am I missing something? Can AWS Certificate Manager handle this?
>>
File: fixed.png (7KB, 522x384px) Image search: [Google]
fixed.png
7KB, 522x384px
>>59898152
fixed, including that sorry excuse for a triangle.
>>
>>59906624
>he thinks writing wrong code quickly is fast development
>>
>>59906349
#include <iostream>
#include <string>

using namespace std;

int main()
{
string number_string;
cin >> number_string;
int number = 0;
for(const char& c : number_string)
{
number = number * 10 + c - '0';
}
cout << number << endl;
return 0;
}
>>
>>59906624
Ruby is dead
So is Go
Python is trash.
>>
>>59906685
amazing post
>>
>>59906349
#include <cstdint>
#include <cstdio>
#include <string>
#include <cmath>

uint32_t to_hex(const std::string &input)
{
uint32_t result = 0;
std::size_t start = 0;
auto size = input.size();

// Chop off leading 0x
if (input.find("0x") == 0) {
start = 2;
}

for (std::size_t i = start; i < size; ++i) {
auto ch = input.at(i);
result *= 16;

if (islower(ch)) {
ch = toupper(ch);
}

if (ch >= '0' && ch <= '9') {
ch -= '0';
} else if (ch >= 'A' && ch <= 'Z') {
ch -= '7';
} else {
return 0;
}

result += static_cast<unsigned>(ch);
}

return result;
}

int main(int, const char **)
{
std::printf("0xA0 = %u\n", to_hex("0xA0"));
std::printf(" FF = %u\n", to_hex("FF"));
std::printf("0xCA = %u\n", to_hex("0xCA"));

return 0;
}
>>
>>59906704
.at() always does a bounds check while operator[] doesn't afaik
>>
>>59906731
So .at is for amateurs and operator[] is for professionals?
>>
>>59906731
That's correct, should have used operator[] since I'm working within known bounds.
>>
>>59906801
former crashes straight away while latter crashes after it's deployed and leaks data
>>
>>59906349
>>59906590
org 0x100
use16
mov si, 0x82 ; string location
mov bx, lookup
xor dx, dx
@@: lodsb
cmp al, 0x0d ; end of string marker
je @f
shl dx, 4
xlatb
cbw
add dx, ax
jmp @b
@@: ret
lookup:
db 0x30 dup(-1)
db 0,1,2,3,4,5,6,7,8,9
db 0x7 dup(-1)
db 0xa, 0xb, 0xc, 0xd, 0xe, 0xf
db 0x1a dup(-1)
db 0xa, 0xb, 0xc, 0xd, 0xe, 0xf
db 0x99 dup(-1)

there, I just did your homework for you. not the most space efficient but it works.
>>
>>59906921
forgot to mention: result is in dx obviously.
and you could maybe replace dup(-1) with dup(0) so you'd get less surprising results for non-hex chars.
>>
>>59906685
Yet somehow each of them more popular and widely used than all those other ones combined..
>>
>>59906650
>Thinks code written in his special needs languages automatically makes it right.
>>
>>59907158
Wrong.
>>
File: right.png (45KB, 933x785px) Image search: [Google]
right.png
45KB, 933x785px
>>59907176
uhuh...
>>
>>59907241
>completely disregards the top of the triangle
>more popular and widely used than all those other ones combined..
>>
File: kek.png (8KB, 944x257px) Image search: [Google]
kek.png
8KB, 944x257px
>>59907273
>There was never an argument about the top of the triangle
>Tries to save face for failure by changing the argument

Nobody disagrees with the top.
>>
How would you implement this thing:

You have a Player and variable number of Monsters. Each have Initiative variable to determine which one attacks first. There are rounds of fighting until each monster, or player, is dead.

But player attacks only once per round. He can choose what monster to attack.

I tried first to do it with Queue. But i realize it's not good because player can attack any monster and queue can't access elements by index nor delete it. I did it as a List of monsters and i check whether Player.Initiative > Monster.Initiative but if there are multiple monsters that have lower Init that means Player attacks multiple times per round, which is not allowed. So i invented a bool value for player isAttackPerformed and switch it to true/ per round so the player can skip its attack method.

But then i realize that step in a for loop skips a monster that should have attacked instead of player.

I have a sense i'm going down a rabbit hole and there's a much simpler solution to this

This is not homework btw, i study on my own and came to the chapter on classes and inheritance so i invented a practice task
>>
>>59907327
>getting this mad over a triangle
>>
>>59907338
I'm not sure I follow.
Basically what you want to do is that at the beginning of the round, each monster with Ini higher than player Ini should attack the player first, then let the player attack any one monster with Ini lower than the player's?
>>
>>59906624
it's called assembly, not assembler. an assembler is what "compiles" it
>>
>>59907452
1 Round = All creatures attack once, both player and monsters. After all finish, everything repeats.

Basically i need to make a list based on Initiative value and if it's monster's turn, they attack player, if it's player's turn, he gets to choose which one he attacks, never mind the initiative
>>
>>59907338
It's more of a game design question than a programming question (and I'd recommend you check out grandia).

But if you just want everyone to take a turn and then it resets as you put it just sort the array by the initiative value and evaluate the turn.

A good way to keep track of who has taken their turn is to simply store an index into an array of the monster or player that last took its turn so you can skip everything up to that point.
When the turn is over you just set the index to 0.
>>
>>59898046
It's good as long as you don't start with it as a first language.
>>
next semester i'm taking high performance computing and introduction to computer architecture. do you think either of these will be using assembly? i haven't had an assembly course yet and the descriptions are vague
>>
>>59907338
monsters = sort list of monsters by initiative
p = do binary search to find index in monsters for players turn
while(true):
roundOver = true
for m in range(len(monsters)):
if m == p:
if player.dead != false:
do player.action()
else:
roundOver = true
break
if monsters[m].dead != false:
roundOver = false
do monsters[m].action()
if roundOver:
break
>>
Just bought two courses with topics that interest me from Udemy, it's their easter sale again where everything is 15$.

The reason why I'm doing this is because I work in a "IT Consulting" firm which parametrizes the Avaloq system on different banks. It's most boring shit, but pays pretty well. However, I don't want that shit anymore so I'm learning stuff I want build a portfolio and apply for jobs in these parts.

Mostly WebDev and MachineLearning/DataMining stuff. It's so much fun actually.
>>
>>59908034
>do binary search to find index
int main()
{
return doAllTheStuff();
}
>>
guys contributing to open source is too overwhelming. there is a billion starting points
>>
File: 2017-04-15_21-28-18.png (151KB, 1280x800px) Image search: [Google]
2017-04-15_21-28-18.png
151KB, 1280x800px
Playing with emacs.
>>
Would a KDE widget that tracks user defined ebay searches be a good challenge or useful? Or just a CLI version
>>
>>59908062
You don't know how to do that?
while length of list is above 1:
divide list into two parts
check in which part the needle is
set list as the part with the needle
needle is the only item on list
>>
>>59908062
Well, I am sure there is no other way to find where to place an item in a list without binary searching for it, so I guess he is just doomed.
>>
If i have a base class Human and 2 child classes Student and Worker, and i make a List<Human> with both Human and Worker instances, how do i reach properties of child classes in it, list only recognizes properties of base class? It's C# if it makes a difference
>>
>>59908320
>with both Human and Worker instances

with both Student* and Worker instances
>>
>>59908320
It's a List<Human>. You don't have enough information to know what type the elements are more precisely than Human.
>>
>>59908320
Use casting.
>>
>>59908361
So, there's no way to do anything with properties of instances in it that are not in base class?

Damn, i thought i was really smart for thinking of this
>>
>>59908320
Can't you downcast them somehow?
I think you can do it using the "as" keyword although I've only used C# briefly.

Something like:
List<Human> humans;
Student student = humans[0] as Student;
if (student) {
// do something
}
>>
>>59908387
You could add a fold method to Human. I'm not sure of C# syntax but something like:

interface Human {
T fold<T>(Func<Student, T> student, Func<Worker, T> worker);
}

>>59908400
Blatantly unsafe.
>>
>>59908320
If you need to access properties of the child classes, you probably shouldn't be using a List<Human>. It's a list of humans - its items can do whatever humans can do.

Not familiar with C#, so the following examples will be in pseudocode.

I'm guessing you might have something like this:

for human in humans {
if human is a student {
human.goToClass()
} else if human is a worker {
human.teachClass()
}
}
}


What you'd want to do instead is take advantage of polymorphism:

for human in humans {
human.takePartInClass()
}


where takePartInClass() defines different behavior for the different types.

Another thing you can use is the Visitor Pattern.

class Visitor {
void visit(Student student) {
student.goToClass()
}
void visit(Worker worker) {
worker.teachClass()
}
}

for human in humans {
visitor.visit(human)
}
>>
>>59908456
List<Human> humans;
foreach (var human in humans)
{
var student = human as Student;
if (student != null)
{
// Do thing.
}
var worker = human as Worker;
if (worker != null)
{
// Etc.
}
}


Plenty safe.
>>
>>59908479
>Visitor Pattern
Please don't teach anti-patterns.
>>
>>59908492
>null
>>
>>59908505
You can use
human is Student
then
(Student)human
if you really want to.

It's pretty hard to fuck up either way, though.
>>
>>59908518
In the small, sure. But in the large, this style of programming leads to an unmaintainable mess.
>>
>>59908518
>>59908492
>>59908479
>>59908400
>>59908456

Guys you are overthinking this. He just needs to make abstract properties in Base class and override properties in child classes, that's how he can access them
>>
>>59908492

You could also use null conditional operator here.
>>
>>59908493
In a closed code base are there any good alternatives? Writing wrappers for each subclass sounds like a hassle.

Not saying you're wrong to hate VP. I've never used it in real life myself - just mentioned it since it is an alternative method to solve anon's problem.
>>
>>59904608
Then scale the image down and use a simple convolutional neural network made to solve MNIST.
>>
>>59908103
Pick one at random.
>>
File: 1489195286194.png (152KB, 940x1739px) Image search: [Google]
1489195286194.png
152KB, 940x1739px
Hi /g/
Please rate my prime.c!
>>
>>59908917
0/10 not written in Rust
>>
>>59908985
>not written in Rust
Well no shit Sherlock! Nobody writes rust.
>>
New thread:
>>59909028
>>59909028
>>59909028
>>
File: 1460716806606.png (207KB, 450x416px) Image search: [Google]
1460716806606.png
207KB, 450x416px
>CURRENT FUCKING YEAR
>github.com
>try uploading empty folder to my repo
>there's no option to do so in the web interface
>have to open the shell and use git
>git can't upload an empty folders either

Well, I guess sucking CoCs is a more relevant issue to the retarded faggots who maintain github's code. How fucking hard could it be to add a link for mkdir in the web interface? is there a way to create a folder from an empty file? am I missing something??
>>
>>59909043
Can't you just commit your folder with an empty file inside it and then remove the file?
And why would you need to upload empty folders anyway? That's not what git is for.
>>
>>59909043
git just doesnt support that, you need to create a file in the directory
>>
>>59909043
Try Chisel.

http://www.chiselapp.com
>>
File: man abs.png (326KB, 558x691px) Image search: [Google]
man abs.png
326KB, 558x691px
>>59909043
>create folder
>create file ".empty" or ".do_not_delete"
>continue with your work and stop making a big fuzz about non-issues
>>
>>59908917
Why the heck did you ever think you needed both p and pp?
Why the heck did you ever think you needed to define a structure for number primality in such a simple program?
Why the heck are you using long, descriptive names in some places (good job on that, btw), and one-letter variables/unnecessary abbreviations in others?
>>
>>59909084
>>59909072
From the damn web interface it still doesn't work even with a file within the damn directory (I tried with 2 files even, they're 5-6KB each). This is so stupid I could get an aneurysm just thinking about it.

>>59909103
I'll give this a try.
>>
>>59909157
You still haven't explained why you need to do this.
>>
>>59909183
Because I'm too lazy to use git from the shell when I need to upload just a folder containing a bunch of text files. There's no excuse to not allow the users to create folders from the web interface in the current fucking year, it doesn't matter how you look at it, it's plainly retarded.
>>
>>59909248
>I need to upload just a folder containing a bunch of text files
Then why the fuck did you try to add an empty directory from the command line instead of directly adding your files from the command line?
I feel like there's something very wrong with the way you're using git and you might be better off if you learned how git works in depth.
>>
>>59909311
I was simply testing whether it could be done from the git shell or not, since I saw that the web interface doesn't support it. Of course I did upload the folder with the files later.
The ones who have something very wrong with them is the github CoC suckers who can't get their priorities straight. Creating damn directors the the fucking ABC of code management, they should feel bad about this.
By the way, I created a .name file in the directory but the retarded web interface gets stuck on a white page with no error message nor anything else when I try to upload it.
Github is truly flawless platform and totally not a faggotrian garbage.
>>
Is there any better feeling than implementing an algorithm correctly using C, and not doing any allocations in it?
>>
>>59909514
I suppose it's not very surprising that nobody else here has ever had that feeling.
Thread posts: 329
Thread images: 33


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