[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 42
File: 1452014855458.png (857 KB, 1620x1577) Image search: [Google]
1452014855458.png
857 KB, 1620x1577
What are you working on, /g/?
>>
stop posting paedophile images
>>
Why was the other thread deleted?
>>
Why the fuck did the other thread get deleted?
Fucking normalfag mods.
>>
>>52414607
We don't want our UK friends being arrested.

>>52414606
If that's what you think when you see that image, then I've got some news for you.
>>
>>52414607
Non-nude anime pictures are apparently NSFW because one anon reported it.
>>
>>52414593
>tfw you've been so desensitized by all the trap threads that you think umaru is kinda okay

>>52414607
>lewd
>posted before the bump limit
>>
>>52414593
How does ebina have such massive boobs if she is just a schooler?
>>
>>52414628
You ever been to a school mate?
>>
File: uuuu.png (381 KB, 640x865) Image search: [Google]
uuuu.png
381 KB, 640x865
How is this NSFW, /dpt/?
>>
>Be gradstudent.
>Send project progress update email to adviser.
>He pulls my code from GitHub and makes a week of progress in a few minutes including making existing code more elegant.
>He doesn't even program in this language regularly.

How do I git gud /dpt/? Is it just experience or should I be studying specific resources etc.
>>
>>52414607
>2016
>getting triggered
lurk moar faggot
>>
>>52414650
those kinds of tits on a slim frame are super rare and are usually only seen in slightly older women
>>
>>52414650
I did, none of the cunts had such huge racks at her age
>>
>>52414615
>>52414620
>>52414622
>>52414625
>>52414628
>>52414657
Well...you guys should grow out of your cartoons anyway.
>>
>>52414676
It's art, not cartoons.
>>
>>52414682
this post is """"""""art"""""""", not shitposting
>>
>>52414676
I grew out of cartoons
I then grew out of movies
Then I realised cartoons and memes control the world
>>
Why the fuck is android so extremely fucking anal about making navigation drawers.
WHY.
>>
When rendering Juila set, how do you achieve antialiasing without rendering at a bigger resolution and downscaling?
>>
File: julia-noaa.png (127 KB, 800x983) Image search: [Google]
julia-noaa.png
127 KB, 800x983
>>52414743
Ah, forgot the picture.

When rendering Juila set, how do you achieve antialiasing without rendering at a bigger resolution and downscaling?
>>
File: julia-stillnoaa.png (302 KB, 800x983) Image search: [Google]
julia-stillnoaa.png
302 KB, 800x983
>>52414763
And here's my attempt at cheap antialiasing. Obviously it's not doing what I wanted it to do but the effect is still nice, I think.
>>
>>52414743
Depends on how you are rendering it. If you are using opengl or something, it's pretty easy to add msaa to your render.
>>
>>52414775
I don't think you understand the question fully.
>>
>>52414782
What do you mean by antialiasing? Because it apparently isn't actually what you mean. Your attempt looks like you want to blur to a gradient between the different colors, instead of a hard border? That is not antialiasing.
>>
>>52414722
>android
botnet
>>
File: noaa-aa.png (1 KB, 114x43) Image search: [Google]
noaa-aa.png
1 KB, 114x43
>>52414796
By anti-aliasing, I mean making picture on the left look like picture on the right.

I'm using those terms as they are defined on
https://en.wikipedia.org/wiki/Anti-aliasing
https://en.wikipedia.org/wiki/Aliasing
>>
>>52414829
what are you using to render it?
>>
>>52414829
There will be a method to do it, based on the library you are using to render it. It's easy to do if you are rendering in OpenGL, even software rendering mode.
>>
>>52414850
It's just a bitmap... No matter how you display the bitmap on the screen it looks the same.

I generate bitmap by iterating f(z) = z^2 + 0.279, with color depending on the amount of iterations it takes for abs(z) to exceed 10000.
>>
>>52414877
>No matter how you display the bitmap on the screen it looks the same.
What are you using to display the bitmap then?
>>
>>52414877
Noone can help you right now, we don't even know what fucking LANGUAGE you are using to draw it.

Saying it's just a bitmap is as helpful as saying it just runs on a computer.
>>
File: wew.png (155 KB, 943x1160) Image search: [Google]
wew.png
155 KB, 943x1160
>>52414904
My question is not related to programming languages. It's a theoretical question related to rendering Julia set.
It's C# if you really care to know. I also wrote it in C long before, and I outputted pictures to BMP and opened them in image editor.

>>52414892
I write the bitmap to file and open it using Windows Image Viewer. Here's how it looks.
>>
>>52414877
generate the bitmap using multiple samples per pixel and take the average of those
>>
>>52414943
>My question is not related to programming languages. It's a theoretical question related to rendering Julia set.

Pls explain how antialiasing a bitmap of the Julia set is any different to antialiasing any other image or video?
>>
>>52414943
D M I T R I
M
I
T
R
I
>>
File: loli.webm (3 MB, 852x480) Image search: [Google]
loli.webm
3 MB, 852x480
Ask your much beloved programming literate anything !

>>52414593
Thank you for umaru-chan, the best himouto.
>>
>>52414955
That would be
>rendering at a bigger resolution and downscaling
and it's exactly the thing I'm trying to avoid because it would take longer to render.

>>52414960
You don't really antialias images and videos. At least to my knowledge. OpenGL antialiases edges of polygons when rendering a 3D scene. If you just have an image of same dimensions as both input and output, that's more along the line of post processing, and it looks hideous.
Because I have way more than just a bitmap as input - I control the algorithm that produces that bitmap, I might be able to produce much better looking antialiasing effect for cheap.

>>52414967
Andrey.
>>
>>52415015
do you even know what anti-aliasing is fgt? without more samples you will just get a shitty blur at best
>>
File: julia-aa.png (185 KB, 800x983) Image search: [Google]
julia-aa.png
185 KB, 800x983
Here's how properly anti-aliased (by downscaling) picture looks. It's pretty but it takes4x as long to render, sadly.

>>52415068
Got any evidence to back that up?
>>
>>52415072
if you have a bitmap you should be able to pass that to opengl pretty easily and get the hardware to antialias it
>>
>>52415072
>Got any evidence to back that up?
what the fuck

and you can just focus on the parts that have high contrast, you don't have to render the entire thing at a larger size
>>
File: julia-noaa2.png (185 KB, 800x983) Image search: [Google]
julia-noaa2.png
185 KB, 800x983
>>52415083
Do you think hardware will be able to turn this into >>52415072?
>>
>>52415072
>Got any evidence to back that up?
you said it yourself:
>If you just have an image of same dimensions as both input and output, that's more along the line of post processing, and it looks hideous.
>>
File: julia-noaa2.png (123 KB, 800x983) Image search: [Google]
julia-noaa2.png
123 KB, 800x983
>>52415096
Uh oh. Wrong picture. Here's non-antialiased.

>>52415098
>Because I have way more than just a bitmap as input - I control the algorithm that produces that bitmap, I might be able to produce much better looking antialiasing effect for cheap.
>>
>>52415096
>can hardware do AA
>>
>>52415015
Sorry, I had my terminology wrong before. I actually meant FXAA, not MSAA. MSAA works with the whole 3D scene, but FXAA works on just the 2D image.
>>
>>52415112
It can't do that.
You're clueless, anon.
Please. Don't participate in discussions about stuff you don't know.
>>
>>52415107
so focus on just the parts that look like shit, sample those several times, and sample the more plain areas fewer times
>>
Anyone here familiar with Java Script?

I've got classes coming up and might ask for help. No I'm not going to ask you to do it for me, just assistance if I can't seem to get something to work properly.
>>
>>52415116
>but FXAA works on just the 2D image.
But it also looks really bad so I don't think I want it at all. Consider the picture in >>52415107; those white dots all over the place. They won't go anywhere.
>>
>>52414603
>Haskell
dpt plz
>>
File: juliaaa.png (148 KB, 800x983) Image search: [Google]
juliaaa.png
148 KB, 800x983
>>
Hello, any C# person here who is willing to help me?
I've started doing some C# stuff, and as I'm reading book there are a few examples with IEnumerable<T> ICollection<T> and stuff like that. My question is why should I use that when i can just do something like that?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestConsoleApplication
{
class Program
{
static void Main(string[] args)
{
Person osobaA = new Person("kiki", 25);
Person osobaB = new Person("hbt", 22);
Person osobaC = new Person("cuck", 24);
Person osobaD = new Person("carl", 22);

Persons osobe = new Persons();
osobe.ListOfPersons.Add(osobaA);
osobe.ListOfPersons.Add(osobaB);
osobe.ListOfPersons.Add(osobaC);
osobe.ListOfPersons.Add(osobaD);

foreach(Person p in osobe.ListOfPersons)
{
Console.WriteLine("Name: {0}, Year: {1}", p.Name, p.Year);
}
}
}

public class Persons
{
public List<Person> ListOfPersons;

public Persons()
{
ListOfPersons = new List<Person>();
}
}

public class Person
{
public string Name;
public int Year;

public Person(string name, int year)
{
Name = name;
Year = year;
}
}
}
>>
How much faster is this program

#include <stdio.h>

main(){
char *point;
point = "Hello World!\n";
printf(point);
}


compared to this one

#include <stdio.h>

main(){
printf("Hello World!\n");
}


and how do I measure that?
>>
>>52415237
Sorry if its bad code. I just tried to do simplest as possible so please if somebody can explain that. Thanks
>>
>>52415240
They would be completely equivalent.
Any compiler would optimise out temporaries.
>>
>>52415240
depends on your compiler settings anon
>>
>>52415237
If you have a function that you're going to give to someone else, say
public void doSomethingWithList(List<int> arg)

That person can only send List<int> to that function.

If you give him
public void doSomethingWithList(IEnumerable<int> arg)

he will be able to send anything that functions like a list to that function, without having to convert it to list first.
>>
>>52415240
Most likely the same, compile to assembler to find out. For gcc it's -S flag, and for visual studio it's an option in project settings UI.
>>
Is my use of the goes-to operator correct here?
main :: IO ()
f :: Integer -> Integer
g :: Integer -> String

f x | x != 0 = x ----------> 0
| otherwise = 0

g x = show (f(x))

main = putStrLn (g(2.9))
>>
>>52414698
mfw I realized this too
>>
>>52414593
Prettynewfriend here, I have a little problem.
I have been learning programming for some months now, and the problem I have is that I'm way too curious about different languages, I just can't concentrate on one...
I know this is kinda stupid, you can't have everything, but I was looking for a language with this features to learn well and use for little projects:
-It has to be suited for math and calculations, I'm doing phisycs, I would love to know programming also as a professionale skill,
-It shouldn't be a pain to do other things,
-Preferably functional, I find functional funny, or multi-paradigm,
-It should be high level but with the possibility to tune the performance (least important requirement).
>>
>>52415339
nim
>>
>>52414661
practice m8. Improve on your advisor's code and some new stuff
>>
>>52415339
>I find functional funny
>I would love to know programming also as a professionale skill
one or the other

I'd go with python since you're doing physics. Also how have you avoided learning at least matlab?
>>
>>52415281
Hmm if I understand what you're saying. If i had more Classes with some Lists in it and one function that takes (IEnumerable<T> arg) as argument. I could send any Class with Lists that implements IEnumerable? Am I right or I didn't get it well.
>>
File: pou.png (548 KB, 609x884) Image search: [Google]
pou.png
548 KB, 609x884
Quick, what was the last programming-related book you read?
>>
>>52415437
your mums pornstar profile on redtube
>>
>>52415437
I'm partway through reading the dragon book.
>>
cooool, I rolled a random image generator!

Also, hi /dpt/

Just had class today and also lost 1 so I'm a bit disappointed. Glad to be here with you all.
>>
>>52415480
How do I unsubscribe from your blog?
>>
>>52415459
What's the dragon book? Can I learn everything I need from that one book or will I need to know something prior to opening it?
>>
>>52415492
>What's the dragon book?
Just google it.
>Can I learn everything I need from that one book or will I need to know something prior to opening it?
You will need intermediate CS/Programming knowledge.
>>
>>52415491
>Comes on the internet for the echo effect

>>>>>/fit/
>>
>>52415436
For example, there is List<int> and LinkedList<int> clases in C. You can send only an object of the former type to fist function, but you can send an object of either of two types to latter function.

public void doSomethingWithList(List<int> arg){ ... }

doSomethingWithList(new List<int>{ ... }); // ok
doSomethingWithList(new LinkedList<int>{ ... }); // won't compile

public void doSomethingWithList(IEnumerable<int> arg){ ... }

doSomethingWithList(new List<int>{ ... }); // ok
doSomethingWithList(new LinkedList<int>{ ... }); // ok
>>
File: 1452463402297.jpg (51 KB, 242x320) Image search: [Google]
1452463402297.jpg
51 KB, 242x320
>>52415502
Did you even read my post?
>>
>>52415537
Don't be coming on my blog just to talk crap. Gtho.
>>
File: k39Ptv1.jpg (175 KB, 1024x732) Image search: [Google]
k39Ptv1.jpg
175 KB, 1024x732
>Supervisor comes over asking why I'm not using the data structure he designed
>Points out that I broke his 23 column table into 4 tables
>Complains that now he has to make joins to fetch data
>Ask why I didn't follow his "diagram"
>mfw during the entire thing
>>
>>52415592
Excessively fragmenting data for the sake of "normalisation" is a sickness. Unless there was >50% unused or redundant fields I'd have hit you until you put it back.
>>
>>52415437
Currently reading Eloquent JavaScript.
>>
>>52415592
see this:
>>52415624
>>
>>52415237
IEnumerable allows you to use foreach syntax and it doesn't require the whole collection to be stored in memory.
>>
>>52415674
But I used foreach now without IEnumerable no?
>>
>>52415437
the legendary sicp. i am a 10x programmer now.
>>
>>52415684
Yes because List itself impements IEnumerable... A List represents the whole collection stored in memory while an IEnumerable has yet to be enumerated into a List using .ToList()
>>
>>52415783
Ohhhh, so if I would put lets say an array in Class and wanted to do foreach. I would have to implement IEnumerable, right?
>>
>>52415662
>>52415624
I don't think having the address, the costumer and all the other data of an order on the same table is good.
>>
>>52415809
Well off the top of my head Array also implements IEnumerable, so it should work without your class implementing IEnumerable :)
>>
>>52415924
Oh well... Thanks tho I think I'm kinda getting what you tried to said anyway
>>
Hi guys,

I have a design question

So I'm working on a random image generator and I want to get the design figured out first but I'm wondering exactly what makes the image generated random.

Am I supposed to make a buffered image write pixel data to it and just save it as some particular image file extension? Meaning, do I just make the program write random ints for pixel color or is it something else?

I could probably do the former but I'm not sure if that's what it means when it says random image generator.
>>
File: D_Programming_Language_logo.png (232 KB, 1000x758) Image search: [Google]
D_Programming_Language_logo.png
232 KB, 1000x758
>>52415437
tdpl
>>
>>52415404
>one or the other
:(
Is this true?
Anyway, I'm kinda familiar with both Python and MATLAB, but not so much and I don't consider the latter, because I would prefer my language of choice to be general purpose
>>
>>52415364
How is it?
>>
>>52415834
You are correct. That is fucking horseshit.
Normalization exists for a reason.
The reason is that people constantly fail to do it and then realize their mistake when it's too late.

Also: Oh no, joins! Does he complain about indexed fields as well, since he obviously hates things DBMS' are designed to be very fast and good at?
>>
>>52414986
What animu is this?
>>
>>52415997
I just looked at D today, and it just looks too good to be true. What's the catch?
>>
>>52416589
can't tell, it's illegal in usa.
>>
>>52415592
>>52415834
Gotta learn to communicate, anon.

Similar situation happened to me, and I took the time to explain some basic database design and the long-term benefits of properly designing your shit.

That being said, you should have made the tables, and then created a view that pulls the data how he wants it.

Don't do what the retard says, just give him what he wants in a better way.
>>
https://codeshare.io/ju9Cl
hello
>>
>>52416696
- Compilation errors for templates look pretty ugly.
- The documentation of certain templates is pretty awful at times (map returns type MapResult, both tell you that it's "lazy", neither the function nor the type have documented how to eagerly get the data out of it apart from iterating over it) - it's easy, but it's not well documented.
- Everything is either a static or a dynamic array (hash maps are just associative arrays as well), other generic containers are awful to use (and I don't think anyone actually does tbqh)
- Only a single proprietary implementation (dmd) that's up-to-date, GDC and LDC lag behind quite significantly
- dmd is fast as fuck but the optimization is awful
- GDC and LDC are pretty slow, but optimize quite well
- GUI toolkit bindings are old

Other than that I don't see too many problems.
>>
>>52416696
small userbase, although there are bindings for pretty much everything
small things change slightly every now and again so you can generally expect every compiler except DMD to be a bit out of date (this is less true now than it once was - a rough time frame for this is that 3-4 y/o info might be out of date, but within that it's probably fine)

these two problems mean that it's harder to google help for it because you might find slightly outdated info, or if you're using D bindings to a non-D library you won't really find any tutorials

These are the two worst things I've found with D, and you can pretty much get help with anything on the website, so they're both pretty minor
>>
>>52415834
>I don't think having the address, the costumer and all the other data of an order on the same table is good.
So mention to your supervisor that you think you should change it. Try to convince him of the practical benefits, and why they will outweigh the cons. If he doesn't agree then don't do it, he's the boss. Good software does not get written by every autist on the project changing things to whatever they feel is "good" without asking anyone else.
>>
>>52415293
Depends on what you've defined
(---------->)
as
>>
>>52416778
>somebody's adding typos to my D comments
why?
>>
>>52416906
I have no idea, I was the one asking about D.
>>
File: kbd.png (34 KB, 1073x313) Image search: [Google]
kbd.png
34 KB, 1073x313
Sup
>>
File: thatsdisgusting.jpg (75 KB, 450x450) Image search: [Google]
thatsdisgusting.jpg
75 KB, 450x450
>>52416940
>>
>>52414593
>me sets up some bash script to display apache errors as desktop notifications
>have error inside tight loop
>apache doesn't stop on first error
>mfw get thousands of notifications
>machine locks up
thanks PHP
>>
File: ss1.png (108 KB, 960x827) Image search: [Google]
ss1.png
108 KB, 960x827
>>52414593

http://codeshare.io/4chan
>>
>casually writing some comfy D in the comfy codeshare
>suddenly realise it's after midnight
fuck
>suddenly realise it's friday
neat
>>
File: 4abjq0u.png (61 KB, 1668x766) Image search: [Google]
4abjq0u.png
61 KB, 1668x766
>>52416778
>>
>>52417094
Where are you, Polynesia?
>>
>>52417130
straya m8
>>
File: 1345314515647.jpg (14 KB, 251x241) Image search: [Google]
1345314515647.jpg
14 KB, 251x241
>Having fun writing code
>Someone comes in and deletes the whole thing

This is why we can't have nice things.
>>
how do i check in c if all conditions in 4 "if" are true?
if a=TRUE
//do something
else if b=TRUE
//do something
else if c=TRUE
//do something
else if d=TRUE
//do something

what is the best way to check if they are all true?
>>
>>52417233
if (a && b && c && d) {

} else {

}
>>
File: 1451818343001.gif (301 KB, 136x240) Image search: [Google]
1451818343001.gif
301 KB, 136x240
>>52417233
How about conditional operators &&
>>
>>52417199
>Someone comes in and deletes the whole thing
it's only ok when you do it right?
you fucking kike faggot
>>
>>52414593
Please no more pedophile images. At least make it something to do with programming.
>>
>>52417155
>casually browsing 4chan
>takes 2 minutes to open pictures
>good thing i have 100/100kbit broadband
>watch some porn
>get fined for girls in porn having too small tits
>mail from ISP "you're out of data, purchase another 500MB for 30AUD"
>killed by dropbear
straya m8
>>
>>52417199
there's always that one sadcase who's got nothing better to do and probably doesn't know how to program anyway
>>
>>52417233
else if (b && c && d)
//do something


but you'd have to put it first, because if c=TRUE, then that statement wouldn't be reached.
>>
>>52417233
Doesn't C have the AND validation? Like:

IF ((a == true) && (b == true) && (c == true) && (d == true))

IDK if that's the best way, it's been a while since I dont program in C. Hope it helps.
>>
>>52417246
they're called logical operators
>>
>>52417233
if (a+b+c+d == 4)
printf("ayylmao\n");
>>
>>52417253
>>52417199
I saved most of it. Some sandniggers keep removing it though.
>>
File: lmao.png (68 KB, 808x503) Image search: [Google]
lmao.png
68 KB, 808x503
>(in computer science we start at 0)
>>
>>52417263
oh, forgot the a, anyway.
>>
>>52417233
I don't know which language you use, but = is most likely assignment, == is checking.

(a = FALSE) would be a true statement, because FALSE can be assigned to a.
>>
>>52417275
what if i want to use an array?
>>
>>52417276
what do you have against sand niggers?
they work for microsoft.
>>
>>52416940
That's an odd layout, why is the position of the symbols all changed?
>>
>>52417278
educate yourself pleb
>WHY START AT 0
http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF

by professor dijkstra
>>
>>52417487
It being a good idea to start arrays at 0 doesn't make it okay to say the general statement "in cs we start at 0" like nigger there are languages that fucking don't lmao
>>
  Random rand = new Random();
StringBuilder sb = new StringBuilder();
int length = rand.Next(3,12);
for(int i = 1; i <= length; i++)
{
int nextChar = rand.Next(1,13);
if(nextChar <= 5)
{
int randomValue = rand.Next(97,122);
char randomLower = (char)randomValue;
sb.Append(randomLower);
}
else if(nextChar >= 10)
{

}
else
{
int randomValue = rand.Next(65,90);
char randomUpper = (char)randomValue;
sb.Append(randomUpper);
}
}
return sb.ToString();


Less shit way to achieve the same outcome?
>>
>>52417278
>Intro to CS
>Big O
>Asian af (I can tell by the grammar)
How horrifying.
>>
>>52417516
woops, line missing
    else if(nextChar >= 10)
{
sb.Append(rand.Next(1,9));
}
>>
>>52417514
what language doesn't start at 0? html?
>>
>>52417545
lua and (i'm pretty sure) matlab
>>
>>52417516
Random rand = new Random();
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= rand.Next(3, 12); i++) {
if (rand.Next(1, 13) <= 5) {
sb.Append((char)(rand.Next(97, 122)));
} else {
sb.Append((char)(rand.Next(65, 90)));
}
}
return sb.ToString();
>>
>>52417530
Nah, it's a woman.

>>52417545
Don't think html has arrays, lol. Lua starts at 1 for whatever fucking reason. Even if every language started at 0, it's pure autism to say "in COMPUTER SCIENCE arrays start at 0" when you should just be saying "in most environments where algorithms are implemented, arrays start at 0"
>>
>>52417545
Matlab / Octave
Probably other Math shit too
>>
>>52417534
Random rand = new Random();
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= rand.Next(3, 12); i++) {
if (rand.Next(1, 13) <= 5) {
sb.Append((char)(rand.Next(97, 122)));
else if(nextChar >= 10) {
sb.Append(rand.Next(1,9));
} else {
sb.Append((char)(rand.Next(65, 90)));
}
}
return sb.ToString();
>>
>>52416742
I did explain the long-term design benefits. But he was adamant.

This person doesn't understand UML or even concept of classes. On top of that, I'm the one who has to deal with the data from these tables.

When he said "I'm going to have to use joins to fetch data" he's actually saying "YOU are going to have to use joins to fetch data".
>>
>>52417565
Eh, realised I was pasting some old shit version that didn't have any of my controls in it or anything.

        private string DoGenerateRandom()
{
Random rand = new Random();
StringBuilder sb = new StringBuilder();

int lower = Convert.ToInt32(rngRandLength.LowerValue);
int upper = Convert.ToInt32(rngRandLength.UpperValue);
int length = rand.Next(lower, upper);
for(int i = 1; i <= length; i++)
{
int nextChar;

if (swtNum.IsChecked == true) nextChar = rand.Next(1, 13);
else nextChar = rand.Next(1, 10);

if(nextChar <= 5)
{
char randomLower = (char)rand.Next(97, 122);
sb.Append(randomLower);
}
else if(nextChar <= 10 && nextChar >= 5)
{
char randomUpper = (char)rand.Next(65, 90);
sb.Append(randomUpper);
}
else
{
sb.Append(rand.Next(1,9));
}
}
Clipboard.SetText(sb.ToString());
DoFadeAnim(lblCopied);
return sb.ToString();
}


It seems like an awfully longwinded way to achieve a relatively simple outcome.
>>
Python IRC bot capable of understanding everyday usage of language. Lots of regexes. AMA
>>
>>52417573
Again, why didn't you just make a view and show him that?
>>
File: sh.png (579 KB, 1600x2160) Image search: [Google]
sh.png
579 KB, 1600x2160
How do native random functions work?
>>
>>52417629
Why did you even bother?
Why not just jam IBM's Watson API into your code and save a whole bunch of time and energy?
>>
>>52417642
https://en.wikipedia.org/wiki/List_of_random_number_generators
>>
>>52417629
>python
probably takes a few hours to make a response
>>
>>52417630
He's not going to use it. He never does selections. I'm not really trying to antagonize him, he literally doesn't do anything with the data.
>>
>>52417439
For programming reasons. It was more bonkers originally. Even the numbers were shuffled.
>>
>>52417642
I guess that they generally exploit the perceived randomness of primes and use the system clock.
>>
>>52417664
I measured. It takes 0.118 seconds to receive a message, running on the same computer, and takes 0.098 to reply. (Lag was 0.088 and 0.067 respectively)
>>
>>52417642
C# uses the system clock as a seed and stores it wherever you declare it, then you just request a random number from the seed using one of the three different methods (Next, NextBytes, NextDouble).

I assume the algorithm is around somewhere, I haven't looked really.
>>
>>52417656
Kind of a programming exercise for me.
>>
>>52417805
How'd you do it? Give me the broadest stroke explanation.
>>
>>52417825
It's a modular bot, so lifecycle is as follows:
>__name__ == "__main__"
>read config.cfg or if empty create stub for editing
>get all .py files in the modules subfolder as modules in a list using pkgutil(probably gonna switch to imp soon because pkgutil sucks)
>connect to irc server (freenode) via irclib
>authenticate to nickserv
>join channels
>listen for commands
>if a command is found in a channel message send server connection, event, and session info to its respective function
>ctrl+c by owner or crash(fairly frequently)
>>
>>52417900
I meant what do your functions do and how do they do what they do?

I understand how you set it up, but what can the bot actually do?
>>
File: oppai.png (48 KB, 224x203) Image search: [Google]
oppai.png
48 KB, 224x203
>>52414628
nigger you ever been outside?
There was this one girl in my high school with literally boobies twice as big as Ebinas and she was not over weight but skinny even.
>>
>>52417925
Not much at the moment, can say stuff and whatnot. I'm planning on making more modules but it's mainly bugfixing at the moment.
>>
>mfw americucks don't 0 index storeys

https://en.wikipedia.org/wiki/Storey#Numbering
>>
File: 20160114_093059.jpg (2 MB, 2976x2976) Image search: [Google]
20160114_093059.jpg
2 MB, 2976x2976
Gonna put Ubuntu on this and stick it behind my tv with a 500gb hdd so I can put Kodi and some movies then plug it into my nexus so I can browse my movies on my tv?
>>
>>52418126
No, I'm not going to put Ubuntu on it for you.
>>
>>52418144

The reason I put question mark is I wasn't sure if the nexus could read my hard drive through micro usb
>>
>>52418228
>>>/g/sqt/
>>
>>52418379
>/g/sqt/
Don't link to that gay forced thread, anon.
>>
>>52418447
Well he's more likely to get an answer there than he is here.

In my old code monkey position, everyone came to me with stupid IT problems, because I used the computer all the time I was apparently the authority on all IT related issues.

Pretty annoying.
>>
>>52418001
Yeah, that was my sis. She was wearing F's by junior year. She is a G now. Yeah, she cleans them in her sink, which is right next to mine. I had to know, they are massive.
>>
>>52418588
pics or it didn't happen.
>>
File: underwater.jpg (913 KB, 1278x4993) Image search: [Google]
underwater.jpg
913 KB, 1278x4993
>>52418588
>>
>>52417545
Fortran, Algol, Cobol, PL/I, Pascal, Ada
>>
>>52418771
Fuck I love that thread.
>>
File: 1449024422826.jpg (67 KB, 614x1024) Image search: [Google]
1449024422826.jpg
67 KB, 614x1024
>>52418771
I love you, I've never seen this before.
>>
>>52418771
w... what
>>
>>52418771
I feel like this could be given a /dpt/ meme filename.
>>
right now im deciding on whether i want to focus on perl, python, or ruby. Ive been building a website for shits and giggles with php and want to try a remake the site with all those other languages.

So far ruby seems exactly like oop php
>>
>>52418975
Why would you learn 4 languages that fit the same domain? Branch out. Learn one of them, a functional language, a systems language, etc.
>>
How can I do this:

three CSV files:

>person.csv:
personID,personName


>job.csv
jobID,jobName


>person_job.csv
personID,jobID


my dataset is shit (fuck whoever made it), and some of the personIDs in the `person_job.csv` do not exist in `person.csv`. So what I need to do is remove the rows in `person_job.csv` where the `personID` does not exist in `person.csv`.

HOW TF DO I DO THIS?
>>
>>52419026
ive only ever used php and wanted to see what else was out there.

Figured it was better to learn by experience than trying to decipher rhetoric from all the flame wars about ruby on rails and Phython.
>>
>>52419071
SQLite, pass in data.

Join, spit out data.
>>
>>52419071
Make a set or list of person ids.

Make a dict of personID, jobID. Only add personID's if they're present in the list you made before.

Print out data from the dict.
>>
>>52419071
if excel is easier, just do a VLOOKUP (might be quicker for this case).
>>
>>52419186
I'm on OS X. Does Numbers have that?
>>
>>52418588
>tfw siblings all have FF and I'm stuck with B cups

a-at least I don't get back pains
>>
>>52419203
"More than a handful is a waste anyway"
-- a clever man

Also nobody is interested in the size of your manboobs, senpai.
>>
>>52419199
there's autocomplete you kow.
>>
>>52419212
I don't agree, bigger ones feel nicer to snuggle up to and bone
>>
>>52419199
>>52419216
Why are there so many mac fags on /g/? Plsgo with your cancer
>>
>>52419257
woah 2009 flash backs
>>
>>52419257
winfags are worse, trust me
>>
>>52419257
>writing a python script just to join 3 CSV
>being this autistic
at least you could've suggested using PANDAS to do it.
>>
>>52419243
We like loli here, senpai. It's in /g/'s roots.
Also decapitation.
>>
>>52419271
>implying mac is technology
just plsgo

>>52419278
>implying windows is technology
you too
>>
>>52419168
Okay help me along here, I'm really shit at thinking this stuff out.

I now have two arrays:

an array (called people) of personIDs which exist in person.csv, and an array (called people_job) of personIDs which are in person_job.csv.

Basically now I need to subtract one array from the other to get the difference...le
>>
>>52419257
At least the mac botnet isn't as bad as the windows botnet.
>>
>>52419341
This really isn't the way do to it with a script.

I'd really recommend the VLOOKUP way.
>>
This is a simple batch, but does anyone see anything that could go horribly wrong?

@echo off

sc stop wuauserv

del /q "C:\Windows\SoftwareDistribution\DataStore\*.*"
del /q "C:\Windows\SoftwareDistribution\Download\*.*"

sc start wuauserv
>>
>>52419368
yeah but I've already made a little bit of progress and I don't know how to use VLOOKUP to be honest with you senpai.

I've now discovered what the 'ghost' personIDs are, now I will work on removing them from the CSV.
>>
>>52418771

what the fuck did I just read?
>>
>>52419293
Yeah ever since visiting /g/ a lot more I feel much better rooting for them in the 4cc next cup. /a/ is my home board but I never realized before just how much overlap /a/ actually has with /g/.

So I've dabbled in C, C++, C# which is where I started and have the most knowledge, and some Python and I finally decided on learning Java just because I think it has the best fit for my capabilities as a programmer and my development environment. I'm too stupid and don't have enough of a math background to take advantage of manual pointers right now to create my own data structures, I also hate solving problems by using the stack in clever ways, so pretty much I'm saying I'm a terrible programmer.

Right now I'm reading Thinking in Java 4th Edition and I'm learning a lot. Am I making a mistake by picking a language based on my current limitations? My goal with programming is to use it as an outlet to make things. My current fetish right now is making text based/UI based games with complex gameplay structure but nonexistent to very little graphics.
>>
does anyone have any experience with git subtree? I want to use it but without my git log being cluttered with merge commit messages.
>>
Java a shit
>>
>>52419341
What languages do you know?
>>
>>52419426
Not him, but there's no reason to learn Java if you are already familiar with C#.
>>
>>52419341
in shit pseudo code....
for index, id in people_job:
found = false
for index, exists_id in people:
if id==exists_id:
found = true
break
if not found:
print "Person id {id} at {index}, not found"

>>
File: 1220341780828.png (332 KB, 640x480) Image search: [Google]
1220341780828.png
332 KB, 640x480
idk if its because ive had informal training or just havent pushed myself in the right ways but I feel like my knowledge in programming hasn't passed beginner level.

I understand different datatypes and common expressions like if and foreach(etc).

but when it comes to actually understanding the applications of OOP outside of 3d programs I get so confused. Like OOP is easy to understand with video games but when it comes to datasheets and websites i just cant comprehend it.
>>
>>52419625
I dev on linux mainly now. I could use Monodevelop I guess but the workflow is all fucked up plus I think Java is easier to develop with cross platform. At least that's the reason I've been looking for a different language than C#. I don't like being tied to windows and visual studio. I know you "could" use a different workflow but it just feels like there isn't a point to it if that's what you are doing.
>>
>>52418975
Of the three, Python is by far the most widely used in general, although Ruby probably still has the edge in web dev due to Rails. Perl is basically dead at this point.
>>
Guys, what is the best way to Learn C for complete noob?

I need to for MCU projects.
>>
>>52419742
>perl is basically dead at this point
Which sucks cause out of all the ones ive tried i actually enjoyed perl the most.

Havent tried python yet but it looks super easy.
>>
>>52419726
I used Monodevelop a few years ago and I still have nightmares. I'm not sure if it made any progression.
If you like the C# syntax, Java might be good for you. Personally, I hate it.
Python is an interesting language to learn. It has lots of bindings like PyGame, NumPy, OpenCV.
[shill]I also like Go.[/shill]
>>
If I upload a somewhat racist project to github will they remove it?
>>
>>52419771
C Programming: A Modern Approach
>>
>>52419843
Nah, they're very open minded.
>>
>>52419690
Do a bit of light reading on the MVC kind of setup. Basically you can treat the user interface and backend as two objects. Now delete your post before the functional herbs start shitposting
>>
>>52419796
I don't even know if using a game engine would really help me. Right now the most I want to make is literally spriteless 2d games (in the sense that there is no animations, just 2d textures) so I don't even need something that updates on a consistent 30 frame basis. The entire thing could be event handled.
>>
>>52419855
insert eggplant picture here
>>
Building my own website from scratch
Using web.py because I like the flexibility it offers, and I am already very familiar with python
I've implemented php interpretation by feeding the code to my systems php and catching the output, it works rather well actually.
>>
Working on a iOS bug in this webapp:

http://raskie.com/#on-notice

Also working on a JSON web service with Elixir. I've got some interesting plans for it, but it's tough going, as there's a fair amount of conflicting info in some of the examples and tutorials out there right now.

But I suppose that's the same for all languages.
>>
>>52419726
>mono
>.NET Core
>ASP.NET vNext
>JetBrains Project Rider

Resistance is futile.
>>
>>52419867
ill definately check it out.
>>
>>52419690
>Like OOP is easy to understand with video games but when it comes to datasheets and websites i just cant comprehend it.
Because OOP is constantly abused because it's what's taught at Universities. It's actual use cases are far smaller than what most academics think.

It's a great paradigm for video games, the concepts map well. Also good for ADTs where the data abstraction it offers comes in handy. Outside of that and a couple more examples I can't think of off the top of my head OOP should not be used.

So, it's not your fault. If unis taught students how to write structured imperative code and behavioral functional code well you wouldn't have this problem.
>>
What programming suites do you guys use?
>>
File: 1428433220648.jpg (96 KB, 531x471) Image search: [Google]
1428433220648.jpg
96 KB, 531x471
>>52416940
>all that random bullshit and caps lock is not ctrl
>>
>>52420020
A black one with a solid red tie.
>>
>>52420020
i don't program i'm just here to shitpost
>>
File: 1390790180781.png (77 KB, 606x539) Image search: [Google]
1390790180781.png
77 KB, 606x539
>>52420039
>>52420041

Noice, top bants
>>
>>52419257
go back to writing youtube comments pls
>>
irc.rizon.net
#DPT

JOIN YOU AUTISTIC FUCKS
>>
File: drracket-example.png (150 KB, 1688x1052) Image search: [Google]
drracket-example.png
150 KB, 1688x1052
>>52420020
DrRacket is pretty comfy.
For C / Python I use vim for small stuff and the JetBrains products for big projects.
>>
Can I decompile a C++ dll file (with just one class) built with a specific SDK if I have the same SDK?
>>
>>52420128
go back to sucking dick pls
>>
>>52415557
>what a comeback
>dont
>>
>>52420216
what a comeback from a 9 year old
>>
>>52420131
>2016
>IRC
>>
>>52420277
lol we're still using an imageboard and that's a fuck old invention
>>
>>52420260
If you wanted a comeback you should look at your mother's chin
>>
>>52420277
>not using IRC, BBS's, and list-servs to avoid normies
>>
>>52420277
IRC is great, its where all the people who aren't normies hide.
>>
>>52420289
image boards are way better for conversations than tumblr or shitter.
>>
>>52420328
how does that relate to the conversation
>>
>>52420340
its stupid to discredit "older" things just cause their old.
>>
>>52420387
>their old
smdh
>>
I want to be able to make good android apps.
I know Python pretty good, and I did a course on codecademy for Java. I'm currently doing training courses on developer.android.com but it's hard to follow along since I didn't really get much out of the codecademy course for Java. What are some online resources or something that'll help me get good with Java?
>>
https://codeshare.io/ju9Cl
>>
>>52420459
move to india
>>
>>52420512
That's not really an option for me since I'm broke.
>>
>>52420387
>their
they're*
>>
>>52420459
code academy is such a scam.

but if youre into learning by yourself just get a book on the language or subject youre interested in.

Java books are a dime a dozen.
>>
>>52420557
it's not a scam it's just a meme
>>
>>52420557
It's good if you know nothing about programming it's a place to get started.

Any particular books that are worth the read?
>>
if you ever need a list of available texts by language or subject focus, there's a github project to organize free books.
Everything from dpt meme tier to recent college texts
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md
>>
>>52420604
my college java class book was java 6 illuminated.
id recomend it but its probably outdated by now. look for an updated version
Thread replies: 255
Thread images: 42

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.