[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: 330
Thread images: 31

File: type gibberish.png (17KB, 810x219px) Image search: [Google]
type gibberish.png
17KB, 810x219px
What are you working on, /g/?

Previous Thread: >>60536408
>>
Aw shieet, gatekeeper is back. See you in 6 hrs when we can have proper discussion, bros :^)


"meme"
>>
>>60542004
>No anime image
Shit thread.
>>
>Aw shieet
>bros :^)
>"meme"
I don't want reddit stink nearby. Fuck off.
>>>/v/
>>
I hate this web development hell. All I have to do is make a small front end for my Node.js project but I get literal anxiety about dealing with web development shit. Kill me.
>>
>>60542036
I know a guy like you from school. He doesn't shower, nobody talks to him either. He mumbles a lot. Wears New Balance sneakers.
>>
>>60542046
>web development
What the hell does that have to do with programming? Take your garbage to >>>/g/wdg/
>All I have to do is make a small front end for my Node.js project
Tell that to your retarded friends at >>>/g/wdg/
>>
File: 1460645325238.gif (1MB, 480x270px) Image search: [Google]
1460645325238.gif
1MB, 480x270px
>>60542022
What is this "gatekeeper", please no bully.
>>
>>60542073
Lel
>>
>>60542073
>it's working
>>
>>60542086
>Lel
Your kind simply isn't welcome here. Piss off.
>>>/v/
>>
>>60542099
How was school today?
>>
>>60542083
It's "le boogeyman" that all of the redditors on here seem to go on about.
>>
>>60542116
Hi gatekeeper
>>
>>60542116
>le
Your "people" aren't welcome here.
>>>/v/
>>
>>60542083
Some guy that got bored with "whom are you quoting" and is now extreme gatekeeping. I'm sure he'll get bored with that and move on to something new and equally annoying.
>>
Friendly reminder to report low quality posts.
>>
>>60542026
It is an anime image
>>
>>60542124
Why are you even here, reddit-kun?
>>
>>60542152
It truly is.
>>
>>60542173
you are delusional if you think that 90% of 4channers don't also frequent /p/lebbit. if you're sick of "normies" and rabbitors then go fuck off to 8ch or something.
>>
>>60542207
Holy shit, could you project any harder?
Piss off.
>>
>>60542173
Because I felt like it, weaboo sama
>>
>>60542216
What if he doesn't?
>>
Some shitty code to demonstrate a question I have:

def select_random(stuff,rrange):
return stuff[randrange(0,rrange)]

def select_random_c(stuff):
rrange = len(stuff)
def select_rand():
return stuff[randrange(0,rrange)]


Above is Python code to select something at random from a list. The second function is a closure where the outer function is called once to set up the environment and from then on the inner function is called.

Is select_random or select_rand going to run faster? Neither?
A)Neither because Python lists are passed to functions as references anyway and no data copying is involved. The passing integer bears 0 signficance because [reasons].
B)select_rand will be marginally faster because there's no need to pass the integer every time it is called.
C)select_rand will be faster because there's no need to pass the integer and list every time it is called.
D)Neither because internally(after interpretation/compilation) of the Python code both functions are equivalent and must be passed the same data each time when called.
E)Other - explain?
>>
>>60542216
He's not wrong tho, you have to be really dumb to limit your internet usage to 4chan and be proud of it.
>>
>>60542281
>you have to be really dumb to limit your internet usage to 4chan and be proud of it
Who are you talking about? Link?
>>
>>60542207
>the rabbit version of "normalfag"
>>>/v/
>>>/r/ibbit/
>>
>>60542285
About whoever tries to use rabbit as a stigma here.
>>
>>60542299
It is a stigma regardless of place and time. Your kind outnumbering us humans doesn't change that.
And you didn't give me a link to a direct quote of someone saying something like "limit your internet usage to 4chan and be proud of it"
>>
>>60542281
>You must be really dumb to limit yourself to not eating shit and be proud of it
You really won me over with your argument.
Reddit is fucking shit. The users are fucking shit. Keep your filth away from here.
>>
>>60542322
>Reddit is fucking shit.
Fourch*n is worse
>>
fuck I miss pre-2013 /g/
now it's reddit this, reddit that. also the autism has skyrocketed out of control.
>>
File: reddit.gif (2MB, 237x240px) Image search: [Google]
reddit.gif
2MB, 237x240px
>>60542207
I understand people are going to visit more than one board, and that is ok.
What is not ok is forcing reddit culture on our board. Call it out whenever you see it. They are rude little faggots that should lurk moar.
>>
>>60542340
Reddit gatekeeping started last month actually
>>
>>60542335
Why are you even here?

>>60542340
It was like this back then, too. It seems that the reddit fucks have gotten more "comfortable".

>>60542346
>last month
I guess you've only been here for a month, then.
>>
>>60542340
It's autistic to use internet forums.
>>
>>60542321
>>60542322
Reddit is a good news source, same goes for HN, there's no need to be autistic about.
>Your kind
Funny thing, I identify neither as r*ditor nor as 4ch*nner.
>>
>>60542362
>I'm not like le rest of them XDD
Yes you are. That is what all of the redditcucks say when called out.
Piss off.
>>
>>60542350
>Why are you even here?
It's 4chan: it's where you are free to be completely retarded and still get away with it by hiding behind the mask of "anonymity".
I'm here to raid 4chan :^)
>>
>>60542362
>Reddit is a good news source
Good. Fuck off to that shithole then.
>there's no need to be autistic about
I don't want rabbit stink nearby. Fuck off.
>I identify...
That doesn't matter. You not being human is a medical fact.
>>
/r/programming actually has some quality content. Some subreddits are decent. If you stay away from the front page and limit your exposure to a few of the less cancerous subreddits, than it's not so bad.
>>
Uhhh.....
Could it be that this faculty method is totally wrong as fuck????

static long fak(int fac){
long faculty=1;
if (fac==0){
System.out.println(faculty);
}else{
for (int i=1; i<=fac;i++){
faculty=faculty*i;
//System.out.println(faculty);
}
}
return faculty;
}
>>
>>60542372
Who are you quoting?
>>
>>60542382
They why don't you fuck off to those places, then?
>>
>>60542374
>""raid""
>:^)
>>>/v/

>>60542382
>/r/programming actually has some quality content
That's great. Fuck off to /r/programming then.
>>
>>60542388
Your intent.
>>
>>60542395
My intent never said this
>>
>>60542389
>>60542392
Nah. You can't ban me either. I'll continue to post in /dpt/ for as long as I like. I've been using 4chan since 2007.
>>
>>60542392
>>>>/v/
But that's not reddit. Do you want me to let go of Fourch*n or no?
>>
>>60542362
Reddit is cancer and you should fuck off back to there, inbreed.
>>
>>60542411
>I've been using 4chan since 2007.
That doesn't matter. Subhumans aren't welcome here.
>>>/r/abbit/

>>60542415
>>>/v/ is a subreddit. So that's where you and your kind belongs.
>>
>>60542335
Do yourself a favor and leave then.
>>
>>60542372
> I have my whole identity built around an internet site with amusing pictures
Sucks to be you.
>>60542378
> Fuck off
> Fuck off
Make me :^)
>>
>>60542427
If /v/ is a subreddit, so is /gee/
>>
>:^)
>>>/v/
>>
>>60542411
Just because you've been "on" /b/ for LE CRA-Z RANDUM ANONAMOOSE LULZ for a while, it doesn't mean that you know shit about the rest of 4chan, or even how a fucking community works.
>>
File: redditfrog.jpg (22KB, 300x300px) Image search: [Google]
redditfrog.jpg
22KB, 300x300px
>>60542428
No
>>
>>60542427
Why did you link me to /r/ - Requests?
>>
@
If you're going to act like a fucking redditor, go to fucking reddit.
>>
>>60542418
>inbreed
Hmm, I'm going to report this to your English teacher, Jimmy
>>
File: lolisdom.webm (3MB, 1280x720px) Image search: [Google]
lolisdom.webm
3MB, 1280x720px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

>>60542275
You should use
random.choice(L)
to randomly pick an element

You don't return select_rand() in the second procedure.

>>60542275
>Is select_random or select_rand going to run faster? Neither?
depends the implementation.

The main difference is that the closure doesn't read the arguments from the stack.

>>60542275
>D)Neither because internally(after interpretation/compilation) of the Python code both functions are equivalent and must be passed the same data each time when called.
There are not equivalent

select_random
  2           0 LOAD_FAST                0 (stuff)
2 LOAD_GLOBAL 0 (randrange)
4 LOAD_CONST 1 (0)
6 LOAD_FAST 1 (rrange)
8 CALL_FUNCTION 2
10 BINARY_SUBSCR
12 RETURN_VALUE


The closure from select_random_c
  7           0 LOAD_DEREF               1 (stuff)
2 LOAD_GLOBAL 0 (randrange)
4 LOAD_CONST 1 (0)
6 LOAD_DEREF 0 (rrange)
8 CALL_FUNCTION 2
10 BINARY_SUBSCR
12 RETURN_VALUE



As you can see here, the difference is how stuff and rrange are fetch (LOAD_FAST vs LOAD_DEREF)

>>60542004
Please next time use an anime image.
>>
>>60542460
It looks like you are trying to link to a post. To link to a post you type two '>' characters followed by the post you would like to link to.
>>
File: Inbreed.png (24KB, 857x275px) Image search: [Google]
Inbreed.png
24KB, 857x275px
>>60542464
>>
>>60542491
>It looks like you are trying to link to a post.
Yes, it "looks" like it. But that's not the case.
>>
>>60542493
Looks fake. Fuck off shill.
>>
File: 1464443212695.jpg (50KB, 736x724px) Image search: [Google]
1464443212695.jpg
50KB, 736x724px
>>60542472
Why haven't you killed yourself already?
>>
>>60542491
Do not tell the trash anything. They just need to go shitpost somewhere else.
>>
>>60542493
> verb
It's time to go back to school, m8.
>>
File: HlVvKMQ.jpg (47KB, 1024x845px) Image search: [Google]
HlVvKMQ.jpg
47KB, 1024x845px
Trying to implement neural network with javascript-python machine learning AI. Using google API for this, not even memeing
>>
>>60542493
>verb
but you used it as a noun. Is English not your first language?
>>
>HlVvKMQ.jpg
>neural network
>machine """"learning"""" """"AI""""
>memeing
So basically you're admitting that you're a redditor then.
>>>/v/
>>
>>60542493
Little Jimmy, I am definitely calling your English teacher, he's going to demote you back to year 5.
>>
i made a python program (or well 4 of them) that md5 hashes all of the files in my porn folder, puts the hashes into a list, checks for duplicate files, then deletes the duplicate files.
python is fun. i thought this would be harder.
>>
>>60542533
Who are you talking to?
>>
>>60542511
Your retardation of the English language is not my problem, dumbass. You just need to fuck off back to your nigger echo chamber.

>>/reddit/
>>
>>60542523
I can write a front end using Angular JS for you too. I have a team for agile development framework :^)
>>
>>60542541
>Your retardation of the English language
PAJEET MY SON
>>
>>60542535
>Python
>hard
lel

>>60542541
>nigger echo chamber
>>/pol/
>>
>A*gular *S
>agile """development""" framework
>:^)
I don't want reddit stink nearby. Fuck off.
>>>/v/

>>60542553
>lel
>incorrect linking
>>>/r/abbit/
>>
>>60542543
Nice. What development platform does your team rock with?
>>
File: 2017-05-23-110043_995x622_scrot.png (37KB, 995x622px) Image search: [Google]
2017-05-23-110043_995x622_scrot.png
37KB, 995x622px
>>60542275
>>60542472
pic

>>60542512
Please, don't bully.
>>
>>60542563
Who do you want to fuck off? Who are you talking to?
Also what is /r/abbit? Why are you trying to link me to /r/ - Requests?
>>
>"""development""" platform
>rock with
>>>/r/abbit/
>>>/g/wdg/
>>
>>60542584
Are you okay?
>>
>>60542582
It's depends, mostly windows 10 with atom editor (for short and quick ninja style editing) or Visual Studio for real work :D
>>
>>60542275
the real answer here is that if you're genuinely that concerned about performance, don't use Python. micro-optimization of this degree would be questionable even with a much faster language/in a relatively high-performance context. with Python, it's beyond pointless
>>
>>60542593
Why do you even care?
>>
>come to g
>want to discuss problems and solutions to problems
>get into the dpt thread
>two analautists are shitflinging their spermencrusted diarrhea and damage all the equipment.

Why?
Can't you go shove your sexual orientation down each other's throat somewhere else?
Like in you basement?
>>
>>60542597
> windows 10
> atom editor
> ninja style editing
> Visual Studio
>>>/r/abbit/
>>
>ribbit spacing the '>'
>>>/r/abbit/
Nice try.
>>
>>60542606
>"""micro-optimization"""
>high-performance
>Python
>language
why don't you fuck off back to rabbit?
>>>/r/abbit
>>
>>60542597
Nice, dude. I wish we could collaborate together but I don't think it'll work out.
>>
>>60542609
>come to g
>to discuss problems and solutions to problems
You have to go back to >>>/r/abbit/, newfriend.
>>
>>60542609
>g
>>
I rate your github/bitbucket/whatever on 10.
>>
>>60542621
Who are you talking to?
>>
>>60542632
>>>>/r/abbit/,
>,
Of course a redditard would deny being in reddit.
Fuck off.
>>
I am writing a web front end to my iOS app that uses iOS cloud api. Should I try dart?
>>
>web
>app
Not programming related.
Discuss that on >>>/g/wdg/
>>
Object oriented Database Management tool in Java. Seems pretty fun
>>
>>60542631
>collaborate together
where the fuck do you think you are? this is 4CHAN. We are the edgy social outcasts of society. Especially on /dpt/ we use REAL programming languages such as Lisp and C and text editors such as Emacs. We don't "work together" like communists. Go back to your nigger-hole.
>>>/r/abbit
>>
>We are the edgy social outcasts of society.
>>>/r/ibbit/
>>
>>60542662
What are you using for connection? JDBC, JPA or something else?
>>
>>60542648
Dart is nice, however I just get the work done with node.js, super comfy. It's very scalable and fault tolerant
>>
>>60542663
Replying to shitpost is still shitposting.
>>
>Dart is nice
>node.js
>""comfy""
Your kind isn't welcome here.
>>>/g/wdg/
>>
>Peak autism spree
>>
>>60542677
Do you have any suggestions?
>>
>>60542698
JDBC is probably easiest to learn. It's also built-in library (java.sql/javax.sql) so you don't need to mess with maven or whatever.
>>
>>60542736
Can you link me a project as an example? I don't quite know how I should approach this
>>
I really enjoy VSCode.
>>
How can I use Electron based desktop apps?
>>
>Electron
>apps
Nope. Wrong thread.
You and your kind should use >>>/g/wdg/
>>
>finished 2nd year of CS
>absolutely hate this shit
>too late to turn back

man

i fell for the meme
>>
>>60542790
>meme
>>>/v/
>>
>>60542790
Do you just like app/game development?
>>
>>60542819
>app/game development
Sorry, but that doesn't belong here.
Discuss it on >>>/g/wdg/ and >>>/vg/agdg/
>>
>see /dpt/ roll
>flappy bird clone
Fuck that shit. Truly a meme roll
>>
>>60542819
Not him but I like game development. But you really need to reach the low bare metal level of the systems for good games. Hence you need CS
>>
>>60542829
>taking that shit seriously
>>
>>60542790
>study something you dislike for years in order to become a wage slave
what could have gone wrong with this
>>
>>60542829
>meme
>>>/v/
>>
>>60542819
No it's not like I was one of the people who was like "haha i want to make videogames xD"

>>60542839
I was just supposed to go to college so here I am, picked it on a whim pretty much


It wouldn't be that bad but at this point a lot of weeding out seems to be done and the only people left all program for fun and have a bunch of projects they do and stuff.

Meanwhile I only program for assignments and it's pretty obvious when you look at my code vs their code. It's depressing really.

Like my only goal when writing something (and I only do that for homework) is "does it satisfy the requirements set for the assignment and does it compile"
>>
Give me a quick rundown on Unity Game Engine
>>
>>60542868
>>>/v/
>>
>>60542663
:(
>>
>>60542863
>Meanwhile I only program for assignments
You don't belong here then. Go whine in some other thread.
>>
>>60542868
Around 2010, when Unity started gaining traction, the only real alternative to it was Epic's UDK. UDK was basically a fork of Unreal Tournament 3 ; there was some middleware and tools upgrades over UT3's modding SDK, but having used both, it was still limited in scope - nothing near what UE4 is today. The licensing terms made it impossible for indie or amateurs to work with - 25% of gross revenue, almost as much as a digital retailer would make. Epic was mostly focusing on big-time developers at the time. So Unity became the engine of the indie wave, while the recent UE4 still carries the reputation of UDK - hard, poorly documented, dedicated to shooters, etc.

Aside from history, Unity is still leading in terms of platform support, the JS/C# combination seems more attractive to indies than the C++/Blueprint combination, Unity runs on lower hardware, etc. It's the most popular engine
>>
>>60542868
Unity isn't really a game engine; ppl like myself got attracted to it because, ~10 years ago, we had to build our engine or framework based on XNA, Ogre, etc. When mobile became a thing, close to nobody had experience with objective-c and XCode environment, or android dev... And Unity managed to offer a way for you to publish on those platforms while developing in your usual C# code. For them, insta profit, that was what every indie/hobby guy was looking for and in no time Unity became most popular porting platform.

That's what it is, nobody wanted to waste money porting code for each platform and Unity became a super automated platform for game code porting and in no time they gated the whole indie/hobby game dev market.

But, for actual game development, it is a terrible system, it's no game engine. You have to build all your game systems and editor tools before you even think of creating any kind of meaningful gameplay. Since the first Unity user batch was ok with that because we were used to create our own systems and just wanted the porting power Unity has, Unity managed to profit expanding their multiplatform porting mechanisms (20+ platforms nowadays), while the userbase focused on actually building the tools supposed to be in the 'engine' to begin with.
Eventually when a member of the community started something with demand, like GUI toolset or the 2D engine, they'd hire the person and incorporate the system into the official Unity engine; but they've never focused on developing an usable development environment really.
The 'game engine features' Unity has today, they have paid for third party solutions to integrate it for them.
>>
>>60542772
i am really amazed of how many electron apps have already been released. web 2.0 truly rocketed software production, a production that is now going back to desktop.
>>
>>60542384
>long
>==0
>not *=
>shit bracket notation
yes it's wrong.
>>
>>60542903
I personally was very suprised when I met Unreal Engine after many years of Unity, it is very complete engine focused on efficient gameplay development with tons of feature complete tools... But lacking Unity's portability power so many C# fanatics are still stuck to the Unity limitations because of laziness and fear of the new (UE4). Instead of investing time to become proficient on a feature complete game engine, they prefer to rant on Unity forums and wait years on end until Unity devs decide to add to the 'engine' something they need.
>>
>>60542772
with bootstrap
>>
>>60542472
Interesting to see, thanks. It looks like you actually went and analyzed the program for me, but I hope you recognized a couple of mistakes I made there. For example, I didn't finish the closure function by writing "return select_rand".

May I ask what exactly you used to get that information(the runtime(I assume))?

>>60542606
I'm dealing with existing applications'(like Maya and Blender's) scripting API and I'm not a bad enough dude to hack my way in with a language that can provide speed, so Python is the only option as far as I know.

>>60542577
Thanks. Pretty ashamed, I should know how to do this myself. Or, I guess it wasn't all that bad to ask because I didn't just want to know literally which was faster, but whether using a closure to set up an environment like that serves as a speed increase or not+why. It might depend on the types of data being passed, but from your test it looks like it actually doesn't.
>>
>>60542911
>electron apps
>web
>>>/g/wdg/
Fuck off. Your kind doesn't belong here.
>>
>>60542868
The Good...
Unity is a class engine, its pure simplicity and it runs on unbelievable low hardware.
The Componentized nature of C# / Mono makes coding a breeze, feels easier than UE4 BP/C++ & UDK UC/kismet.
Its possible to learn on/off at weekends away from the large-screen battle station.
Overall the dev life-cycle feels shorter too, its easier to package up games with a much smaller footprint.
Well suited to rapid development or quick cutesy monkey / doggy / cat games and prototypes etc...


The Bad...
Doesn't look anything as good as UE4. If you're doing PC development then even UDK kills it!
The physics system doesn't come close either, even UDK can destroy it.
Where are the editors for materials, particles, anims etc? To compensate you'll need more Asset Packs & Plugins.
There are free assets, but they aren't as useful as the freebies from Epic.
The community here is better as it was with UDK (just a personal view).
Less transparency in the licensing. Need to fully consider the implications of end of Perpetual Licensing (March 2017).
>>
>>60542940
>>60542903
thanks
>>
File: 1495469399317.jpg (200KB, 400x1150px) Image search: [Google]
1495469399317.jpg
200KB, 400x1150px
Which engine is better for a simple multiplayer FPS?
>>
>>60542968
please do not melt cirno
>>
>>60542927
i am using ipython which has some nice features

To view the generated bytecode, use the dis package from the standard library

import dis
dis.dis(f)


>>60542939
Why? electron is for developing desktop apps.

some great examples

https://www.gitkraken.com/
https://hyper.is/
https://foozzi.github.io/Hardinfo/
http://code.rpgify.com/

This is not webdev at all.
>>
>>60542790
>tfw i fell for the meme too
should have went with chemistry.
>>
>>60542983
>web""""dev""""
>apps
Not programming related.
Discuss it on >>>/g/wdg/

>>60543043
>meme
>>>/v/
>>
>>60542868
games made with it run like shit for no good reason and it's responsible for the massive wave of absolute garbage games you may have noticed flooding the independent games market

>Instead of investing time to become proficient on a feature complete game engine, they prefer to rant on Unity forums and wait years on end until Unity devs decide to add to the 'engine' something they need.
yeah, or god forbid becoming proficient at game development in general so you're not limited by the features of your engine. but Unity is by far the most guilty of excessive coddling to the point that the indie market is full of people who don't know how to stand on their own two feet. it's got a low floor and a low ceiling to match. technical innovation is about the last thing you'll see out of a Unity "developer"
>>
>>60543082
oops meant to quote
>>60542916
for that second bit
>>
Someone explain me everything that is in it. I am intermediate C++ programmer.
[SerializableAttribute]
[ComVisibleAttribute(true)]
public ref class String sealed : IComparable, ICloneable, IConvertible,
IEnumerable, IComparable<String^>, IEnumerable<wchar_t>, IEquatable<String^>

The above is System.String class from .NET framework.
>>
>>60542927
i wasn't saying you shouldn't use Python. if it's a good tool for the job (or if it's your only choice), then by all means, you should use it. but if it's really a good tool for the job, then it's a given that performance is not your highest priority, and you won't be doing yourself any favors by obsessing over it
>>
>>60543082
So you are implying making own game engine is better than wasting time on third party commercial unity
>>
>>60543176
i'm saying that investing in a genuine competence in game development will leave you better off even if you opt to use a commercial engine (though i still wouldn't recommend Unity in that case)
>>
File: mazeTextFile.jpg (22KB, 251x206px) Image search: [Google]
mazeTextFile.jpg
22KB, 251x206px
I'm trying to read a text file in Java but I got some problems.
When ever it gets to the second while loop it quits and prints out "null". The text file I'm using is pic.
public Maze(java.io.Reader fileInput) throws IOException
{
int lineBuffer;
BufferedReader reader = new BufferedReader(fileInput);
String line;

//Read through file first to get rows and columns.
while ((line = reader.readLine()) != null)
{
// process the line
rows++;
cols = 0;
//cols = line.length(); // always the size of the last line in the file
}

//Get every character and put in an array and hashtable.
while((lineBuffer=reader.read())!= -1)
{
for(int i = 0; i<rows; i++)
{
for(int j = 0; j<cols; j++)
{
mazeData[i][j] = (char)lineBuffer;
mazeTable.put(new Position(i,j), Integer.toString(lineBuffer));
}
}
}
}

public void printMaze()
{
System.out.println(Arrays.deepToString(mazeData));
}

And the main file:
public class mazeMain
{
public static void main(String[] args) throws IOException
{
BufferedReader r = new BufferedReader(new FileReader("maze.txt"));
Maze mazeTest = new Maze(r);
mazeTest.printMaze();
}
}
>>
Thinking about quitting my first graduate job (only been there a few months), would it look better to just leave this off my resume?
>>
>>60543265
No, just blame your employer for everything.
>>
>>60542968
Write your own. Totally underrated and not as hard as people make it out to be.
You're making a game (or multiple) and your "engine" is just the common/reusable parts of these games.
This way, your "engine" is perfectly in tune with what you want to do and you're not working against the design philosophy of an unrelated system.

See also: Handmade Hero
>>
I find it funny how theres so many threads about what to learn and how to learn programming. I just walked into a library in middle school and taught myself everything.
>>
I have a quick question /g/
I'm planning to build a tetris like terminal game (or something similar), I'm planning to use a squared space on the terminal using a bidimensional array
a[x][x]. The problem I'm faceing is that I have to simule motion aka changes in the printed bidimensional array, but on a standard .out file you have to execute it to everytime to see changes.
I'm looking for something which could solve that problem; libraries or somerhing, I have seen that xterm helps but I don't info on the topic
>>
>>60542916
I may switch to Unreal Engine, though being a shepard of programming, Im more use to building my own games from the ground up. You write what you need and I understand my own code more than using someone else's engine.
>>
>>60543309
>not as hard as people make it out to be.
yes it is

>>60543309
>Handmade Hero
in development for 2,5 years now and still unplayable
>>
>>60543082
I wouldnt recommend Unity to anyone pass the basics. When I was making a procedural program in it, the fact that you have to move everything render wise to the main thread instantly killed my motivation. Unity only scales in performance with the engine it's on, so you move to anything 2010 or earlier in CPU and GPU power, without control of Unity's own code and thread, you're shit out of luck.
>>
>>60542914
so... you are just autistic.
Alright.
>>
>>60543148
Figure it out by yourself. Go google it and learn it.
>>
>>60543314
wow ur so good

On the real though, I learned without books and no internet access by breaking shit and fixing it.
There are/were practically no (/good) programming courses available. I've started 3 courses and dropped out when I got bored of fixing other people's/teacher's shit.
Didn't stop me from getting (and keeping, sorry pajeet) a programming job.
>>
>>60543327
https://www.wikiwand.com/en/Ncurses
>>
Beginner question here.
I want to make my first Android app with Java and was wondering if there was an alternative to Android Studio or if it's still the best IDE for deving for android?
>>
>>60543409
Thanks
>>
>>60543287
That sounds like a solid strategy.
>>
>>60543352
yeah, one of my biggest concerns with Unity is that the moment you want to do something that isn't in the somewhat narrow set of things its pipeline was designed around, it turns into an uphill battle. you have to resort to hacky behavior to get Unity to perform anything like it really should in a lot of cases, as using its renderer idiomatically does not scale. unfortunately most Unity devs don't know how to do this (or are unaware because they only test on high-end machines, or don't care), and as a result most Unity games run at a fraction of the framerate they would in another (*especially* tailor-made) engine, even at minimum settings
>>
File: shoal.png (4MB, 1920x1080px) Image search: [Google]
shoal.png
4MB, 1920x1080px
Anyone here employed as a programmer? How's your work life balance?

Do you often work more than a standard 40-hour week?
>>
>>60543729
I'm a full-time programmer, I work like 7-8 hours a day and 4-5 out them I spend reading stuff on the internets, I've never worked more than 40 hours a week. But I've got an impression my company is an exception in this regard.
>>
>>60543729
A good chunk of my job is programming, but I don't just program. Anyway, I usually "work from home" at least one day a week. Most days I show up 1-2 hours late and leave at 3PM anyway. Over 30 paid days off last year.

I rarely work more than 36 hours or so. The only exceptions would be if I'm at a conference, or driving to do technical presales to a client.
>>
>>60544102
What is the context of your job? Corporate, mid-sized company, or start up?
>>
>>60544189
None of those. It's a small, well-established company.
>>
>>60543825
>I work like 7-8 hours a day and 4-5 out them I spend reading stuff on the internets
How do you still have this job?
>>
>>60544313
You don't question your programmers if you only have one of them. People fear us.
>>
>>60544313
I'm good at simulating, I do some work after all and I work here long enough to be the only one who knows his way around many old parts of our codebase, so firing me won't do my company any good, at least in the short run.
>>60544410
I'm not the only one tho, there are like 200 programmers in the company, 5 in my project alone.
>>
>>60544437
enterprise was a mistake
>>
>>60544437
>there are like 200 programmers in the company
Then there's the opposite problem, they have so many nobody even knows you work there. You could literally get away with murder as you don't exist.
>>
File: did_nothing_today.jpg (63KB, 500x500px) Image search: [Google]
did_nothing_today.jpg
63KB, 500x500px
>>60544448
It's not a bad place to settle down for good once you hit 30 t b h, I still can play with Rust and Idris in my free time.
>>
>>60544458
>You could literally get away with murder as you don't exist.
Hmm, thanks for the idea anon. I always hated that one guy from accounting.
>>
File: 0207.cobol_4B6BBE64.jpg (79KB, 770x335px) Image search: [Google]
0207.cobol_4B6BBE64.jpg
79KB, 770x335px
In what language all the COBOL legacy code will be or is written now ?
>>
anyone need help? i am quite good a programming.
>>
>>60544565
Java.
>>
>>60544585
>>>/stackoverflow/
>>
Today I got some meteor js meme project pending as a personal hobby
And to fix a fucking program that made a former coworker, he's utterly dumb and I just don't want to make it from scratch.
>>
>>60544585
I have no problems doing programming stuff. I only have an issue at the moment because I have to do web dev stuff.

Save me from web dev hell.

>>60544565
Any functional programming language. They're all retarded and useless except some idiots still insist on using them in stupid ass places so we'll need legacy coders for years to come.

>>60544595
Idiot, Java is popular as hell.
>>
>>60544604
i want to help our great community
>>
>>60544609
Popular != Good, just look at PHP
>>
>>60544625
How the fuck will you need to find legacy coders for a programming language if there's literally millions of them running around on the streets?
>>
>>60544565
https://youtu.be/uKG0IEyeZb0
>>
>>60544609
webdev is life
>>
Any TensorFlow wizards here? Working on checking for duplicate sentences but I suck

I have a tensor X = tf.placeholder(tf.float32, [None, 100, 200]) of word embeddings

I have a big-ass matrix where each index consists of a sentence worth of these tensors of word embeddings

I want to feed from this matrix into this tensor for a 1d convolution then compute the cosine similarity between each sentence and the one following it

How do I feed from this matrix? How can I do something like compute cosine similarity for every two lines in a tensor?
>>
why aren't you learning the most patrician programming language right now, /dpt/?
>>
>>60544663
Webdev makes me want to die

https://stackoverflow.com/questions/34572697/how-to-reuse-routes-in-ember-2
>>
is there any problem in targeting luajit code (not bytecode, regular code) for a prototype programming language?

Seems like it would be extremely fast, extremely small, extremely portable basically for free.

I have downloaded so many books on compilation I can't possibly read them all in 2017 lol
>>
>>60544682
Looks fucked up enough to be interesting, what language?
>>60544704
Why not C? Targeting Lua is too easy to be a challenge.
>>
>>60544693
Woah there. I never said anything about some shitty frameworks. I said that *webdev* is life.
It's like if you said that C is good, and I replied "but linux kernel is poorly written" (random example).
>>
>>60544731
>C
>jit
k tard
>>
>>60544733
The alternatives are worse though.

Tell me how would you make a reusable multi page form?

My parameters are that I need a form split up into multiple steps with native browser back/forward support that I can reuse any amount of times but is also modular so that I can change things around.

I need this because we need to let people order the same thing from a variety of different locations with completely different layouts with all of them being user friendly as hell since we're targeting all age groups.
>>
>>60544682
looks like trash desu
>>
>>60544731
>Looks fucked up enough to be interesting, what language?
Hoon, the language behind urbit project. its like the synthesis of functional and imperative style. the underlying structure is simple like lisp, but the human interface is syntax heavy. Its hard to get into, but everyone who uses it agrees its a serious joy to use. the only problem is there's basically no real reason to use it right now unless you believe in the project
>>
>>60544704
>is there any problem in targeting luajit code (not bytecode, regular code) for a prototype programming language?
no. in fact, moonscript does this
>>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#define N 100000
int main()
{
clock_t t = clock();
int i, j, a[N+1];
for (a[1]=0, i=2; i<=N; i++) a[i]=1;
for (i=2; i<= N/2; i++)
for (j=2; j<=N/i; j++)a[i*j]=0;
t = clock() - t;
printf ("%f seconds\n",t/CLOCKS_PER_SEC);
return 0;
}


Sieve of E takes 0 seconds to complete. Is your algo any better?
>>
>>60544870
Haxe does it too
https://haxe.org/documentation/introduction/compiler-targets.html
>>
Why do I hate webdev so fucking much
>>
>>60544913
>>60544870
cool

>>60544731
right now i just want to have fun, not have an hard challenge
if it makes any difference i'm writing the compiler in C
>>
>>60544935
>>>/g/wdg/
>>
>>60544871
dont use clock for benchmarking, use queryperformancecounter or clock_gettime
>>
>>60542004
is there still a free "non-trial" version of Visual Studio?

This 30-day trial thing gets me every fucking time.

>open VS today
>NEED CD KEY EXIT
>>
>>60544871
> Sieve of E takes 0 seconds to complete.
So, infinite performance?
>>
>>60545036
>CD KEY
>CD
>>
>>60545036
What the fuck. Literally just register and you get it for free you fucking tool.
>>
File: 1486403872071.png (174KB, 962x543px) Image search: [Google]
1486403872071.png
174KB, 962x543px
>>60545036
>Visual Studio?
>>
>>60545036
visual studio community 2017
>>
>>60545047
lol I just figured that out.
>>
>>60545036
>>60545042
>>60545047
>>60545063
>>60545106
I asked earlier but got ignored. Is Visual Studio the best option for Android deving?
Never done it but want to start right now but a friend told me that VS is heavy as fuck. (he's a newbie too)
>>
File: 1493157041639.jpg (23KB, 250x250px) Image search: [Google]
1493157041639.jpg
23KB, 250x250px
>time for documentation
>>
>>60545133
>He doesn't let his sjw project collaborators do the documentation for him
>>
>>60543258
use the fuckin' debugger
>>
>>60545129
How do you want to Androiddev exactly? C#?
>>
>>60542384
>>60543361
He's right man. The brackets are really pajeet tier..
>>
>>60545157
Nah Java.
>>
>>60545129
>Is Visual Studio the best option for Android deving?
Yes, assuming that you're wanting to use C# with Xamarin.

VS is heavy, but for good reason. It's a full-featured IDE that has a million bells and whistles, many of them extremely useful once you learn how to use it as a tool.
>>
>>60545192
Then don't use Visual Studio. Use Java tools.

Have you researched anything at all? VS is 10/10 for many languages, but Java isn't one of them.
>>
I prefer

if (cond)
{
}
else if (cond)
{
}
[/cond]
>>
>>60544787
Sounds pretty straightforward.
In agnular for example, you make a parametrized (modular) service, that you can then inject into multiple controllers, and use it with different layouts in templates. Your requirement is exactly the reason why services exist in angular.
>inb4 angular is shit
I'm not defending it, just giving an example.
>>
>>60545241
(cond) ? :
desu
>>
>>60545201
>>60545219
No I'm just starting to search for tools and options. I'm planning on making a simple app with some CRUD options and a nice GUI. But like I said, I'm total newbie with the matter.
>>
I want to become a wage cuck so I want to learn the Spring framework for java, but I have no idea where to start. What do I need to learn to get a job? Can someone recommend me some resources, maybe some book?
>>
>>60545264
I'm actually surprized that ? : exists in Java.
Considering they left out GOTO's and macros.
>>
>>60545332
>Considering they left out trash
well even the worst do right sometimes.
>>
will my runescape bot land me a dev job?

it's quite a good bot
>>
>>60545346
I bet you like Go. Faggot.
>>
How many of you nigs are using laptop, and which one is it?
>>
>>60545251
Angular was the first thing I looked into. I liked the typescript and such, but man the folder structure looked like pure hell to deal with.
Does it get better?
>>
>>60543347
>in development for 2,5 years now and still unplayable
It's only an hour of coding (with explanations, significantly slowing things down) per episode and he has taken weeks off.
Actual real work put in is maybe 10 weeks.
>>
>>60545378
t430 with t420's keyboard.
>>
>>60545369
you should stop gambling then.
>>
>>60545380
Well, I mainly work with angular 1. I don't really know angular 2 that well, so I'm not the one to talk.
But the folder structure as proposed in the official guides is arbitrary. Just a guideline to keep things organized.
As far as the framework is concerned you can put everything in one file.
>>
>>60545378
surface pro 3
don't worry i'm not a microshill, i installed ubuntu gnome
>>
File: 1491609437117.jpg (111KB, 608x800px) Image search: [Google]
1491609437117.jpg
111KB, 608x800px
In what setting are promises and futures expected to be used, anyway?

http://www.cplusplus.com/reference/future/promise/


Like if you want to compute something async and don't need the result right-away?
>>
>>60545378
Dell latitude e6410
Really decent machine. However, I'm considering offloading my data to my Datacenter and reinstalling but this time, instead of Arch, go for archbang. Maybe.
Not too certain!

I want an OpenRC environment that uses Pacman. I've gotten used to it. It's nice and plain, commands are simple. As well as pacaur
>>
>>60545264
not useful for conditionals that require statements
>>
>>60545378
>implying we go places and need a laptop
>>
>>60545378
Dell Latitude e6440, docked with 3 monitors at the office.

It's a good laptop, although I wish the built-in screen had a higher resolution.
>>
>>60545005
?? use the tsc for benchmarking
>>
>>60542681
>Node.js
>fault tolerant
>only one event loop, that can be blocked by anything
>dynamically typed language
>a typo is a runtime error
>>
>>60545465
>surface pro 3
>ubuntu gnome
>not shill
kekkerino mein kampfuccino
>>
>>60545378
Cheap Lenovo Ideapad.
>>
File: stoned-guy.jpg (24KB, 555x555px) Image search: [Google]
stoned-guy.jpg
24KB, 555x555px
>>60545529
>he uses event loops
>>
What does /dpt/ think of testing/TDD?
>>
>>60545637
Name a more efficient way of passing async events into/out of a state machine.
>>
>>60545638
Putting the cart before the horse.
>>
If im working a project with another person but I only want it to be available to only us is github still the best?
>>
>>60545638
>testing
Occasionally useful, but overall a poor replacement for a powerful type system.
>TDD
Type-Driving Development is good.
>>
>>60545729
bitbucket private projects are free, unlike github's
>>
Exceptions, like many OOP features, are pretty much attempts to shoehorn end-user documentation into the implementation process. Throwing is a 100% necessary feature, but instead of throwing exceptions, one should throw members of a single global error code enum, and document the meaning of each number in the readme or a similar place.

Catching a thrown datum is also a really useless feature. "Recoverable errors" don't really exist; if a circumstance is "recoverable," and the recovery code works as intended, then there is no error. Exceptions, or rather error codes in the case we're now discussing, should be an end-user feature; if you intend to catch an error, the end user will never see it, and therefore you should not be throwing it. Just improve your flow control tbqfhfamalamadingdong
>>
>>60545660
>he uses async events
>>
>>60545833
>he has never programed anything sophisticated
>>
>he doesn't move onto new programming language after writing fizzbuzz
>>
>>60545756
>testing
>Occasionally useful,
>Muh type theory masturbation
Less useful than JavaScript
>>
>>60545906
Found a Ruby code artisan.
>>
Speaking of async and js, suppose I have n async function1 calls, how do I call another function2 after every function1 finished executing?
>>
>>60545865
>he thinks programming anything sophisticated involves async events
>>
>>60545501
Dell boyz ww@ yeeeyeee
>>
>>60545916
Found the FP code barista
>>
>>60545906
>Occasionally useful
Indeed. It's never useful.
>>
>>60546090
May be for everyday fizzbuzz scripts
>>
>>60546050
>he thinks it doesn't
>>
>>60544631
There were a huge number of Cobol programmers back in the day. The numbers dropped when the popularity wasn't enough to sustain it's deprecated qualities.
>>
>>60546044
Promise.all()
>>
>>60545756
>Type-Driving Development is good.
Which you can't really do in a self-contradictory type system.
>>
>>60546141
> self-contradictory type system.
Explain.
>>
>>60545547
>kekkerino mein kampfuccino
>>>/v/

>>60545906
>Muh
>>>/v/
>>
>>60546118
Right, promises. Forgot about them. Thanks
>>
>>60546167
Every type has a value in Idris, which means that a proposition and its negation are both true (for any proposition).
>>
File: hqdefault.jpg (12KB, 480x360px) Image search: [Google]
hqdefault.jpg
12KB, 480x360px
>>60546101
>between the two of us, he's the one who can find the time in his day to respond punctually to 4chan replies while the adults in the room actually work on sophisticated synchronous command line code
>>
>>60546212
>he blocks while waiting for replies
>can't even program and respond concurrently
>>
>>60546202
> Every type has a value in Idris
Source? This doesn't make sense for a DT language, even Haskell has uninhabitable types.
>>
>>60546279
>doesn't understand that asynchronous isn't always concurrent
>>
>>60546291
Why would you ever write blocking async code? That defeats the whole purpose.
>>
>>60546290
>Source?
It has functions of type a -> b, it has unrestricted recursion. That's all you really need.
>This doesn't make sense for a DT language
It makes sense for any language, you could simply add contradictory axioms to a language and all types will be inhabited.
>even Haskell has uninhabitable types
I'm pretty sure it has bottom as a value of every type.
>>
>>60542004
Halp /g/ :
IBM employer told me java is faster than C++. He said they tested it. how can i prove him wrong ?
>>
>>60546401
i meant employee.
>>
>>60546401
Use Ocaml you tool.
>>
>>60546401
You can't figure it out on your own? Google some fucking stats. Benchmark some code yourself. Send him screencaps.
>>
>>60546401
>IBM
>credible
>>
rate my code
module Monad.Either (EitherT(..), fromMaybe, liftEither) where

newtype EitherT m a b = EitherT { runEitherT :: m (Either a b) }

instance Monad m => Monad (EitherT m a) where
return = EitherT . return . Right

x >>= f = EitherT $ runEitherT $ do
xres <- runEitherT x

case xres of
Right xval -> runEitherT $ f xval
Left xerr -> return xres

instance Monad m => Applicative (EitherT m a) where
pure = return

f <*> x = EitherT $ runEitherT $ do
fres <- runEitherT f
xres <- runEitherT x

case fres of
Left ferr -> return fres
Right fval -> case xres of
Left xerr -> return xres
Right xval -> return $ fval xval

instance Monad m => Functor (EitherT m a) where
fmap f x = EitherT $ runEitherT $ do
xres <- runEitherT x

case xres of
Right xval -> return $ f xval
Left xerr -> return xres

instance MonadTrans (EitherT a) where
lift x = EitherT $ runEitherT $ do
xres <- x
return xres

fromMaybe :: Maybe a -> b -> Either a b
fromMaybe (Just a) _ = Right a
fromMaybe Nothing err = Left err

liftEither :: Monad m => Either a b -> EitherT m a b
liftEither = EitherT . return
>>
>>60546401
Java CAN be faster than C++ in specific situations, particularly if the C++ hasn't been microoptimized for the routine. Similarly, Xamarin CAN be faster than native Java apps on Android in some situations due to JIT wizardry.

Everything is relative, and varies wildly depending on the situation. Arguing about any language's speed is nonsense without specifying exact constraints and goals.
>>
>>60546489
If you can't state general things, how are you ever going to be useful?
>>
>>60546489
have you ever used a java program in practice though?
eclipse is extremely slow because the jit doesn't compile the GUI code until you first use the given submenu
>>
>>60546511
>jit doesn't compile the GUI code until you first use the given submenu
Why would anyone ever think this is a good idea?
>>
>>60546500
I would clarify whether someone is actually saying that "Java is generally faster than C++ in any given situation", because I have trouble believing that someone would make that claim.

In technical fields, general statements can be misleading at worst, and downright useless at best, because without context or constraints, the statement is likely meaningless.

>>60546511
I'm not advocating for Java in any capacity, but there's situations in which any programming language can come out "faster" than other languages due to quirks and implementations, again, depending on exact context.
>>
>>60546575
>In technical fields, general statements can be misleading at worst, and downright useless at best, because without context or constraints, the statement is likely meaningless.
I hope you realize that this general statement is itself meaningless.
>>
>>60546599
>can be
>likely
Yeah, I'm not really making a strong assertion as to any particulars, but at least I clarified the generality of the intent.

Contrast this to saying:
>Java is faster than C++
>>
>>60546630
A statement without strong assertions isn't something I would even consider taking seriously.
>>
>>60546599
Only because it was taken out of context. Which proves the point.
>>
>>60546649
You can't take something out of context while linking to the full post (which is the context).
>>
I'm using mongoDB and need to do something like this:
Suppose I have a set of documents like
{_id:x to:y from:z }

How do I make an aggregation timeline stage where the documents are unwrapped in something like:
{_id:x address:y}
{_id:x address:z}
>>
>>60546575
>in any given situation
This is exactly where your insufferable autism is speaking. LITERALLY NO ONE means "without exceptions" when they make a general statement.
>>
>>60546860
>LITERALLY NO ONE means "without exceptions"
I do. "in the general case" is exactly what "without exceptions" means.
>>
>>60546890
If you really think "Java is faster than C++" implies "there is not a single case in which C++ is faster than Java", which you are implying, you're autistic beyond use.
>>
File: 1492176027172.png (6KB, 195x259px) Image search: [Google]
1492176027172.png
6KB, 195x259px
>tfw writing idiomatic code
>>
>>60546860
>LITERALLY NO ONE means "without exceptions" when they make a general statement.
Not true; it's amazing how wrong some people are. I'd would ask for clarification.
>Do you mean that in the general sense, or...?
>>
>>60546913
I didn't say anything about "Java", I just corrected "LITERALLY NO ONE means..."
>>
File: NSlsyrD.png (875KB, 1353x976px) Image search: [Google]
NSlsyrD.png
875KB, 1353x976px
>>60545811
Exceptions, an OOP feature? wtf, exceptions predate OOP by a long time.

>>60545729
Free git hosting

https://github.com/
https://notabug.org/
https://bitbucket.org/
https://gitgud.io/
https://gitla.in/
https://gitlab.com/
https://git.zxq.co/

>>60545638
proven to be better by empirical studies.
>>
https://github.com/chaosbot/chaos
Already commited /dpt/?
>>
>>60546914
I already miss idiomatic rust hour.
>>
>>60546974
That's the context
>>
>>60546991
>proven to be better by empirical studies.
Something which can't prove the absence of bugs is trash and no ""empirical studies"" can possibly change this.
>>
>>60546948
It's just not a sensible thing to assume. Generally *per definition* doesn't mean "in every single case".
>>
In amd64, when talking about the REX byte, what does "This 1-bit value is an extension to the MODRM.reg field", "This 1-bit value is an extension to the SIB.index field." and "This 1-bit value is an extension to the MODRM.rm field or the SIB.base field" mean?
I have a REX byte like 01001101 and I don't understand what MODRM has to do with it since the following byte is just a regular opcode.
>>
>>60547037
>amd64
Stopped reading right there.
>>
>>60547095
I wish I was working with MIPS but nobody runs MIPS.
>>
>>60547026
>Generally *per definition* doesn't mean "in every single case".
Irrelevant, considering they just said
>Java is faster than C++
rather than
>Java is generally faster than C++
and I would even question this.

>Java can be faster than C++ in many situations
would be the most accurate representation of the intent, I believe.
>>
>>60546993
>d*mocracy
No. Fuck off.
>>
>>60547136
>they
What did she mean by this?
>>
>>60547136
Conversations 101 surely learns is that any general statement is like generally.
>>
>>60546998
Here's your fix:
#![feature(i128_type, conservative_impl_trait)]

use std::borrow::Cow;
use std::fmt;

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
struct FizzBuzz(u128);

impl From<FizzBuzz> for Cow<'static, str> {
fn from(f: FizzBuzz) -> Self {
match (f.0 % 3, f.0 % 5) {
(0, 0) => "FizzBuzz".into(),
(0, _) => "Fizz".into(),
(_, 0) => "Buzz".into(),
_ => format!("{}", f.0).into()
}
}
}

impl fmt::Display for FizzBuzz {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Cow::from(*self))
}
}

impl Iterator for FizzBuzz {
type Item = FizzBuzz;

fn next(&mut self) -> Option<Self::Item> {
self.0 += 1;
Some(*self)
}
}

fn fizzbuzz() -> impl Iterator<Item=FizzBuzz> {
FizzBuzz(0).take(100)
}

fn main() {
for fb in fizzbuzz() {
println!("{}", fb);
}
}
>>
>>60547189
Fixed broken Code highlighting:
#![feature(i128_type, conservative_impl_trait)]

use std::borrow::Cow;
use std::fmt;

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
struct FizzBuzz(u128);

impl From<FizzBuzz> for Cow<'static, str> { //'
fn from(f: FizzBuzz) -> Self {
match (f.0 % 3, f.0 % 5) {
(0, 0) => "FizzBuzz".into(),
(0, _) => "Fizz".into(),
(_, 0) => "Buzz".into(),
_ => format!("{}", f.0).into()
}
}
}

impl fmt::Display for FizzBuzz {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Cow::from(*self))
}
}

impl Iterator for FizzBuzz {
type Item = FizzBuzz;

fn next(&mut self) -> Option<Self::Item> {
self.0 += 1;
Some(*self)
}
}

fn fizzbuzz() -> impl Iterator<Item=FizzBuzz> {
FizzBuzz(0).take(100)
}

fn main() {
for fb in fizzbuzz() {
println!("{}", fb);
}
}
>>
>>60547189
phew, thanks senpai.
>>
Why?
>>
>>60547343
why not?
>>
>>60547362
It feels wrong.
>>
>>60547370
why?
>>
New anime thread when?
>>
>>60547438
No anime please
>>
>>60547462
Why would you say that? It's mean.
>>
new
>>60547482
>>60547482
>>60547482
>>
>>60547037
When you wanna access r8-r15 you need one more bit (since it's double the amount of registers), and this applies in all addressing modes - regular modrm, the base and index registers in sib, etc.
>>
>>60547514
Thanks. I think I get it now. Assembly is really hard to learn on your own.
>>
>>60543314
>Memorizing all the syntax of a language like a complete autist
>Knows how to program

Lol kiddo.
Thread posts: 330
Thread images: 31


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