[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: 28
File: solution.png (14 KB, 851x330) Image search: [Google]
solution.png
14 KB, 851x330
PRIME FIZZBUZZ V2: CONTINUED INCOMPETENCE EDITION
{ f(x) | x <- [1,100] } where f(x) = {
| "Fizz", prime(x) ∧ (x % 3 = 0)
| "Buzz", prime(x) ∧ (x % 5 = 0)
| "FizzBuzz", prime(x) ∧ (x % 15 = 0)
| string(x), otherwise
}
prime(x) determines if x is prime

syntax simplified for retards

>i don't understand
Don't call us, we'll call you

Previous thread >>54832945
>>
>>54838244
>ever checking prime(x) ∧ (x % 15 = 0)
>checking 3 and 5 on every iteration instead of just printing them at the start
retard
>>
>>54838244
Fuck off with this aborted meme faggot, changing the braces doesn't make it better, and it's shit anyway, just stop stop stop and stop!
>>
>>54838244
Ok, what are percentages doing there, why is this shit a fucking SET{} ffs and more broadly wtf? How are strings math?
>>
>>54838275
"No."
>>
>fucking spergs arguing about useless fucking labels "hurr you're not allowed to call it OOP if there are some parts that aren't """"100% pure OOP"""""
>>
ITT: Haskell users fail to understand mathematics
>>
>>54838323
yep FP fags are fucking delusional, they think they're so smart and competent when they're in fact stupid for not realizing how shit FP is
>>
>>54838338
Sh-Shut UP you NERD.
>>
>>54838323
What does Haskell have to do with anything?

>>54838338
Haskell =/= FP
>>
I remember when trolls used to put effort into their posts.
>>
>>54838323
I think the anons who reacted to this shitty OPcode and brought in Haskell did it precisely because they didn't know Haskell enough to recognize that it wasn't Haskell, but maybe you'd like to pretend like you're not awfully retarded?
>>
>>54838383
it's as shitty as haskell code though
>>
>>54838402
>no u
>>
Why is it that in C/C++ declarations go in a .h file and definitions go in a .c file? Why shouldn't you put both in one file?
>>
>>54838434
Because you don't need the function to be defined ahead-of-time to use it, the linker will make everything work in the end.

Though, yes, the C/C++ way of doing things is horrible compared to a proper module system.
>>
>>54838434
#include
, that's why. Nothing's stopping you from including a .c file tho, it's just that it doesn't allow separate compilation. Look it up.
>>
File: Untitled.png (82 KB, 1365x472) Image search: [Google]
Untitled.png
82 KB, 1365x472
How am I supposed to use this in python?
My POST data usually looks like
payload = {'username':'derp','password':'123456'}

Please, someone give me an example of how to post on /g/ using python.
>>
>>54838480
you know you're not allowed to auto post on 4chan right
>>
Help a python newbie here
Exercice:
- if a 0 is found in a list include the adjacent elements
- however, if the element next to 0 is another 0 include all the elements until a 1 appears
- print the new list formed
- your program should check the cases where a 0 is found at the last position of the list

example:
lst = [1,0,1,1,0,0,1,1,1,0]

1º case: your_list = [1,0,1] because ([1,0,1,-,-,-,-,-,-,-])
2º case: your_list = [1,0,0,1] because ([-,-,-,1,0,0,1,-,-,-])
3º case: your_list = [1,0,1] because ([1,-,-,-,-,-,-,-,1,0])


my solution:


def solve(lst):

my_list = []
for i in range(len(lst)):
if (lst[i] == 0 and lst[i+1] == 1):
my_list.append(i-1)
my_list.append(i)
my_list.append(i+1)
print my_list
else:
if (i ==len(lst)-1):
if (lst[i] == 0 and lst[0] == 1):
my_list.append(i-1)
my_list.append(i)
my_list.append(0)
print my_list



any help please?
>>
if i have a list of numbers
nums = [45,3,5,2,1]

but I'm trying to sort

nums.sort(cmp=lambda x, y: cmp((x+y), (y+x)))


what is the x and y in this?
>>
>>54838509
How do mobile applications do it?
>>
>>54838509
I'm not going to auto-post.
>>
>>54838325
>I do Multiparadigm and would prefer to call it OOP
I find this a rather striking contrast to FP people. They do the opposite. They discriminate heavily because they're confident in their programming paradigm. Post a (clearly non FP) procedure and claim it's functional here. See what happens.

Same generally doesn't happen with OOP. People don't complain that you're not encapsulating your data because they know it's a shit paradigm.
>>54838387
>>54838299
>if it's overwhelmingly or primarily based on OOP you could label it as OOP
Sounds more like it has large chunks of OOP or is 'mostly OOP'. Depends. But either of those are far more descriptive and accurate than 'it's OOP' as you point to you accessing a public variable from a singleton class declared at global scope. Which I don't object to your doing. But I don't think it's OOP.

Go ask someone who you trust about this.
>>54838397
Fair enough. They wasn't my understanding of FP. I don't do it on principle so it never occurred to me really. But I've been told you're allowed to modify input for some reason. Doesn't matter, I yield that I don't know FP that well aside from how my code breaks the rules sometimes. I understand why I think FP is nice but I thought that was a digression you made or something.
>>
>>54838535
anonymous members.

you're using lambdas and you don't know what they are?
>>
>>54838537
>>54838543
there's a 4chan API
>>
>>54838554
It's read-only.
>>
>>54838320
>useless fucking labels
>and he argues why things are OOP not Multiparadigm
Again, OOP fags trying to steal the glory from real paradigms. Go write yourself a gf or some shit. I'l enjoy the thought of you attempting to have relations with your imaginary representation for data.
>>
>>54838579
kill yourself you insufferable sperg
>>
>>54838545
>People don't complain that you're not encapsulating your data because they know it's a shit paradigm.

>You don't force yourself to use every aspect of a thing as much as you can, all the time, so it's shit.

LOL
>>
>>54838434
No good reason anymore. But there's so much stuff that relies on it that you do it anyway.

You could put everything in any type of files and include that. Assuming the compiler would try to read regardless of extension.
>>
>>54838602
His word was "because", not "so".
>>
File: Untitled.png (72 KB, 829x463) Image search: [Google]
Untitled.png
72 KB, 829x463
>>54838537
I've looked at the source code for a few of them, they scrape the captcha, it's not all that hard.
(me >>54838480) I just have never used multiform-data? I don't know how. What I've tried so far doesn't really work.
I can scrape the captcha, though
>>
>>54838605
And the logical implication is the same, faggot.
>>
>>54838434
you only need header files for things that are exposed as "interfaces" so that you can include the header from other files
>>
>>54838626
>>
>>54838602
Well the reason you don't is because it's flawed. Well, I suppose it's not really 'flawed'. You can do it its just incredibly inconvenient or slow.. How are you not understanding this anon?

It's like you're disagreeing just for the heck of it.
It's almost like you're just pretending to be retarded or something.
>>
>>54838622
>(A => B) <=> (B => A)
Ah yes.
>>
>>54838639
It's almost like your understanding of how OOP can be used is fundamentally flawed.
>>
>>54838592
>kys
>you're too correct and I can't argue yet I'm heavily invested in this discussion so I feel obligated to make a non-reply as if I'm taking a stance because I'd feel like a quitter if I don't.
When you accept that you're a pathetic flawed human being who (somehow) thought computers can deal with objects sensibly everything becomes so much simpler anon.
>>
>>54838639
yeah everyone except you is disagreeing with you just for the heck of it... keep believing that and keep wasting your time on this inane argument
>>
>>54838686
we've been over this countless times

you're a clueless arrogant idiot
>>
>>54838307
1) Mod
2) How are numbers maths?

>>54838275
Makes it more obvious it is mathematics
>>
>>54838660
Soo give me an example of how OOP (neatly) solves a problematic message structure? Where you need to pass a message up the structure rather than down at the leaves.

Preferably one of your own. Ignoring more pressing issues (when doing multiparadigm and involving OOP) it's my biggest concern and is why I find it pointless to do OOP even if it had the predictability it claims.
>>
File: 1464481493203.jpg (10 KB, 250x230) Image search: [Google]
1464481493203.jpg
10 KB, 250x230
today I learned to comment code instead of deleting it.
>>
>>54838758
return message;
>>
>>54838713
See >>54838686

>>54838693
I'm posting on 4chan because I like it. It's as much wasted here and now as if I wasn't having the argument.
Regardless I somehow doubt someone would just go down to throwing insults with no substance over and over if that's what they did. If they find it enjoyable power to them I say.
>>
>>54838801
kys
>>
>>54838799
>tfw storing 10+ comment blocks containing previous implementations below your code
I'm happy I can avoid searching comment blocks in atom though. It'd be a real pain.
>>
>>54838800

the absolute madman.
>>
>>54838758
messageReceiver.passMessage(message);
>>
File: 1231231231.jpg (2 KB, 125x92) Image search: [Google]
1231231231.jpg
2 KB, 125x92
>>54838800
>statement based language
>>
>>54838528
>>54838528
HALP
>>
>>54838820
Now we're just getting spammy but this post:
>>54838686
Accurately responds to the message you just sent. I'd consider reading it if you want a good estimate of my response.
>>
>>54838735
1) then write mod like everyone else thank you
2) There is a nontrivial thing called number theory? How do strings have any property worth a mathematical analysis? They are meant for human consumption in programming, and they're a trivial arbitrary concept, unlike numbers which are simple yet fundamental and powerful. How is using strings not absolutely uncharacteristic of abstract mathematic and proper to computer programming?
>>
>>54838874
stay delusional
>>
>>54838890
>In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set called an alphabet.
>>
File: aQ8W3xw_700b_v2.jpg (1 MB, 700x8246) Image search: [Google]
aQ8W3xw_700b_v2.jpg
1 MB, 700x8246
is this anyhow acurate?
>>
>>54838890
1) % is more concise
2) Any structure is a mathematical structure
>>
>>54838841
public String message(String message){
return message;
}
>>
>>54838984
let id x = x

id <message>
>>
>assembly isn't portable
Then how come rollercoaster tycoon works on any computer that meets minimum specs, even modern computers?
>>
>>54839028
backwards comparability & multiple sources
>>
>>54839037
Explain
>>
>>54839028
it works on x86, not on other architectures
>>
>>54838998
the code that i wrote with String message, return message is totally useless. There is no point in return, since in returning the message you have to put in the message. You are basically writing message twice, i was trolling you
>>
>>54839046
Most architectures only expand the instruction list (and sometimes deprecate very few instructions) & it was likely written multiple times

>>54839064
that's what id does
returns what it's given
>>
>>54839062
So if I were to write a program for the i386 processor, I would work on even an i7, yes?
>>
>>54839091
i think so yes

but it wouldn't work on e.g. ARM
>>
File: 1.jpg (23 KB, 310x324) Image search: [Google]
1.jpg
23 KB, 310x324
>>54839083
whats the point of that? I dont understand anon. Why return something you already know?
>>
>>54839091
Yes.
>>
/g/, what algorithm would you use to curve an image so that it fits an existing, background image?

I'm writing a program to put a logo onto a glass bottle (yes, this is coursework). How can I curve the edges so that it looks like it wraps around the bottle, rather than just being flat?
>>
>>54839188
useful when working with higher order functions (functions that take functions as parameters)
>>
>>54839254
fragment shader in opengl

model the curved surface and read the texture coordinates according to how the image is mapped to the surface
>>
>>54838528
You need to figure out what the question is asking before you can program it. It's kind of ill-defined.

In my understanding, it's saying something like... go through the input list, if you find a 0, then start a new sublist with that 0 and the immediately adjacent elements. For each of those immediately adjacent elements, if it's also a 0, then keep adding elements in that direction to the sublist until you either reach a 1 or (if there are no 1s in the input list) you've wrapped around such that the sublist is the entire input list. Then output that sublist, and skip to the next element you haven't yet considered, or if there are none, terminate.

Which means:

list = [1,0,1,1,0,0,1,1,1,0]
results are
[1,0,1]
[1,0,0,1]
[1,0,1]
as given

list = [0,0,5,1,0,1]
results are
[1,0,0,5,1]
[1,0,1]

list = [0,0,0,1,0,0]
result is
[1,0,0,0,0,0,1]

list = [0,0,0]
result is
[0,0,0]

Etc.

If that understanding is correct, that should tell you something about how to structure the solution and what you're currently doing wrong.
>>
>>54839259
Oh i see now, iv never dealt with high order functions. Thx for explaining
>>
>>54839180
>>54839230
Awesome, were there architectures with major changes/removing a lot of older instructions or will any older processor be guaranteed to be compatible with a newer one.
>>
>>54839312
For instance, map /fmap can be used (this is specifically for lists, it works with other functors) to transform every element in a list

map (+1) [2,3,4,5] = [3,4,5,6]
map (*2) [2,3,4,5] = [4,6,8,10]
map (%3) [2,3,4,5] = [2,0,1,2]

map id preserves the structure
map id [2,3,4,5] = [2,3,4,5]
so if you're writing something that can be mapped, you want map id x = x
>>
>>54839310
>list = [1,0,1,1,0,0,1,1,1,0]
>results are
>[1,0,1]
>[1,0,0,1]
>[1,0,1]
>as given
thats correct


>list = [0,0,5,1,0,1]
>results are
>[1,0,0,5,1]
>[1,0,1]
No. the list only have zeros and ones. in the case of [0,0,5,1,0,1] it would be [1,0,1]

>list = [0,0,0,1,0,0]
>result is
>[1,0,0,0,0,0,1]
no result here.
you only want to add elements to the sublist if the 0 is surrounded by ones


sorry about the confusion
>>
>>54838244
>still no solution
yet further proof that /dpt/ is now full of retards
>>
>>54839472
for (int i = 1; i <= 100; i++)
{
var x = combinations.Where(n => i % n.Item1 == 0);

if (x.Count() == 0)
Console.Write(i);
else
Console.Write(string.Join("",x.Select(e => e.Item2)));

Console.Write(Environment.NewLine);
}


>>
>>54839419
>no, the list only have zeros and ones
Making an assumption like that will bite you in the ass one day unless the language you're working in can enforce it. Python cannot. Accommodating elements that are neither 0 nor 1 is easy given the exercise spec anyway.

>in the cast of [0,0,5,1,0,1] it would be [1,0,1]
No, it would be as I stated it originally. Consider the first element, which is a 0. The left adjacent is 1, so stop there. The right adjacent is 0, so keep expanding right until you hit a 1 or you have to stop because no 1s are to be found. Thus, [1,0,0,5,1].

>you only want to add elements to the sublist if the 0 is surrounded by ones
That's not how you specified the exercise. If a 0 has another 0 adjacent to it, you need to include further elements in that direction until you hit a 1.
>>
>>54839534
For the last fucking time, read the god damn problem description
>>
>>54839472
public static String fizzbuzz(int yourNumber){
String fizzbuzz = "";
if(yourNumber % 3 == 0){fizzbuzz = "fizz";}
if(yourNumber % 5 == 0){fizzbuzz += "buzz";}
return fizzbuzz;
}
>>
>>54839584
What's the problem description?
>>
>>54838244
Hey guys I made the bestestest OOP FizzBUzz
#include <iostream>
#include <cstdlib>
#include <vector>

using namespace std;

class FizzBuzz {

private:
bool isDivByThree;
bool isDivByFive;
int n;

public:

FizzBuzz(int n) : isDivByThree{!(n%3)}, isDivByFive{!(n%5)}, n{n} {};

bool getIsDivByThree() { return isDivByThree; }
bool getIsDivByFive() { return isDivByFive; }
int getN() { return n; }

};

ostream &operator<<(ostream &os, FizzBuzz fb) {
bool divThree = fb.getIsDivByThree();
bool divFive = fb.getIsDivByFive();
int n = fb.getN();
if (divThree && divFive) {
os << n << " " << "FizzBuzz" << endl;
return os;
} else if (divFive) {
os << n << " " << "Buzz" << endl;
return os;
} else if (divThree) {
os << n << " " << "Fizz" << endl;
return os;
}
os << n << endl;
return os;
}

int main() {
cout << "Enter range: ";
int r;
cin >> r;
cout << r << endl;

vector<FizzBuzz> oopisgreat;

for (int i = 1; i <= r; i++) {
oopisgreat.push_back(FizzBuzz(i));
}

for (vector<FizzBuzz>::iterator it = oopisgreat.begin(); it != oopisgreat.end(); ++it) {
cout << *it;
}


return 0;

}


What do you think?
>>
>>54839584
For the last fucking time, suck my dick
>>
>>54839627
see this >>54839613
why are you doing so much extra shit?
>>
>>54839627
>using namespace std
kys
>>
File: 091256129.jpg (40 KB, 695x427) Image search: [Google]
091256129.jpg
40 KB, 695x427
>>54839643
Are you fucking gay or something? No, faggot
>>
File: 1463361237440.jpg (3 MB, 2109x2109) Image search: [Google]
1463361237440.jpg
3 MB, 2109x2109
>>54839661
<pic related
kek'd did someone really ask this?
>>
>>54839660
this is an epic meme and I really hope it never ends
>>54839658
why not? it's a shit exercise and I was bored, wanted to make it as unnecessarily OOP as possible

I think my next attempt will even have inheritance and templates
what else could I put in there?
>>
>>54838799
Maybe one day you can learn about source control.
>>
File: 1438314435385.png (179 KB, 405x406) Image search: [Google]
1438314435385.png
179 KB, 405x406
>>54839699
inheritance and an interface. Make separate classes for fizz and buzz.
>>
>>54839699
>implying 'using namespace std' isn't the epic meme
>>
>>54839661

The answer is obviously MAX_BUF.
>>
>>54839755
GTP, please save us from this hell and implement a solution to OP
>>
>>54838244
What the fuck do they want? Forward slash means nothing afaik. do they want name/.extension ? cause I can't have that sort of filename in linux
>>
>>54839763
What is even the OP's question?

A solution to what?
>>
>>54839749
actually, your massive autism is the epic meme
>>
File: 1461901336094.jpg (8 KB, 236x236) Image search: [Google]
1461901336094.jpg
8 KB, 236x236
>>54839763
But i did give you you a solution you a
bitch. Look at it!
>>54839613
>>
>>54839791
>he says, typing 'using namespace std' in his code
>>
>>54839776
for numbers 1 through 100:
if the number is prime and a multiple of 3, print "fizz"
if the number is prime and a multiple of 5, print "buzz"
if the number is prime and a multiple of both 3 and 5, print "fizzbuzz""
>>
>>54839810
otherwise print the number
>>
>>54839809
>not caring for the 'possible' downsides of using 'using namespace std' is now considered autism
wew lad

at least you got me to reply
>>
>>54839769
Documents/resume.pdf

Maybe?
>>
>>54839809
>i don't use 'using namespace std' because the internet told me so
>>
>>54839840
I can't upload a path as a filename..
>>
File: 1461932176436.png (643 KB, 678x653) Image search: [Google]
1461932176436.png
643 KB, 678x653
>>54839796
IT'S WRONG FAGIT
>>
File: cbrO09m.png (8 KB, 943x218) Image search: [Google]
cbrO09m.png
8 KB, 943x218
>>54839854
I dunno, anon.
>>
>>54839827
>>54839849
>using namespaces in the first place, but then putting all your namespaced names in global scope anyway
Nice meme
>>
>>54839827
>>54839849
kys

at least declare it inside the relevant functions, not in global scope
>>
>>54838244
> I got you:
for i in range(1, 101):
if i == 3:
print "Fizz"
if i == 5:
print "Buzz"
if i != 3 and i != 5:
print str(i)

> Enjoy, lol. 3 and 5 are the only "Fizz/Buzz primes"
>>
>>54839769
>>54839854
>how to filter out linux faggots with your application process
>>
>>54839884
Correct
>>
>>54839881
>>54839865

Not an argument.
>>
>>54839861
Yes, I know that the Regex matches that, but I'm saying I can't name a file like that. That's a path, not a filename that I can use for the file I'm uploading..
>>
>>54839865
>>54839881
who cares
as soon as I hit the make button it's nothing but hot air and your autism
>>
>>54839886
>how to check if i want to apply to shitty ass company
>>
>>54839903
>>54839914
>muh small programs
>>
>>54839886
Can you name it with forward slash in Windows?
>>
>>54839929
after it's compiled it's most likely the exact same program
>>
>>54839929
Not an argument.
>>
>>54839909
I'm not memeing, try it on a Windows VM or something, it may be horribly coded and uploading from a Windows machine might but it a single folder + file with extension.
>>
>>54839932
It might be looking for a single relative directory.
>>
File: HopelessProgrammer.jpg (91 KB, 625x625) Image search: [Google]
HopelessProgrammer.jpg
91 KB, 625x625
>>54839900
>>54839884
> It seems as if everyone else is hopeless.
>>
>>54839903
>>54839914
Ctards confirmed for only making low-quality fizzbuzz tier small programs
>>
>>54839982
Last time we had prime fizzbuzz/fizzbuzz sieve, there were only 2-3 failures

Just goes to show how /dpt/ has gone to shit
>>
>>54839986
Not an argument.
>>
>>54839986
stop trying to bait
you are the idiot here, that's a known fact
>inb4 hurr durr I was just pretending
>>
>>54838244
WriteLine(3);
WriteLine(5);
>>
>>54840029
No
>>
>>54839856
Here you go
public class test{

public static String fizzbuzz(int yourNumber) {
String fizzbuzz = "";

//only do the useless fizzbuzz if its a prime number
if (isPrime(yourNumber)){
if (yourNumber % 3 == 0) {fizzbuzz = "fizz"; }
if (yourNumber % 5 == 0) {fizzbuzz += "buzz"; }
return fizzbuzz;
}else{
return "Your shit isnt prime fag";}

}

private static boolean isPrime(int yourNumber){
if (yourNumber%2==0) return false;
for(int i=3;i*i<=yourNumber;i+=2) {
if(yourNumber%i==0)
return false;
}
return true;

}

}

>>
>>54840015
>>54840024
>hurr i'm so retarded i can't even use namespaces
the namespaces are there for a reason, fucking kill yourselves fucking idiots
>>
>>54840041
Still wrong.
Also a dumb solution.
>>
>>54840058
nope its right. GIve me a case where its wrong
>>
>>54839769
Is this, and all the replies bait? A joke? Or is everyone in here actually retarded?
That slash means or you mongoloid. As in select your resume OR CV file.
>>
>>54840038
>>54840029

Oh, you want the Fizz and the Buzz, eh?

I'll give you the Fizz and the Buzz.

Range(1, 2).ToList().ForEach(x => WriteLine(x));
WriteLine("Fizz");
Range(4, 1).ToList().ForEach(x => WriteLine(x));
WriteLine("Buzz");
Range(6, 95).ToList().ForEach(x => WriteLine(x));
>>
>>54840076
1, 2, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 and 100
That's 98% of the time
>>
Sup guys. Recently started working in a no name small business and am supposed to take over the financial management of this place, it's mostly processing numbers and knowing where the money goes at all times and keeping track of how the business is going.
The other day I saw the business owner try to calculate their spendings in the last project they did and it went basically like this:
>Try to find all receipts scattered over his office.
>Write it all down on a piece of paper.
>Use an old ass calculator to add up the costs.
>Write all details on an excel sheet to print.
This is imo a fucking retarded way to do things in the age of computers and internet so I'm thinking about setting up a database and a small program that does all this job for me so the only thing I'd have to manually do is entering data into the program everyday.
How difficult do you think doing this would be for someone who has no experience with database management? Is it really worth it or should I just use excel?
>>
File: Illya.jpg (64 KB, 1920x1080) Image search: [Google]
Illya.jpg
64 KB, 1920x1080
>>54840139
Maybe you should give your business a name first
>>
>>54840130
nah your tester is wrong.
>>
>>54840148
Or a logo
>>
>>54840139
You could conceivably stand up a small DB or just use Azure or something to host one, and connect to it with Excel's built in DBMS functionality, or write a small GUI to abstract the data entry using triggers for last modified date/creation date.
>>
>>54840172
>DBMS
ODBC*
>>
>>54840139
When I say no database management experience I'm not saying I'm a programming illiterate, have done some program projects so I guess it wouldn't be that difficult to get into MySQL or something like that.
>>
>>54840204
Just stick with Excel flat files, and back everything up offsite nightly.
>>
>>54840006
The point of this test is to differentiate between programmers who rely on research and those who rely on ingenuity and logic. Since most Of today's education (aside from higher-level degrees) focuses on "regurgitation" of facts in order to succeed, it is not entirely surprising that most people fail this type of test.

> Wake up sheeple!
> Think for yourself!
>>
I feel stupid for having to ask this, but I can't figure out how to get two arrays in python to converge in one 3d array (using a formula for the z-axis).

I'm using 2 linspaces to have two arrays with 1000 values each.

x = np.linspace(0.000001,1,1000)
y = np.linspace(1,270,1000)
z = []


I feel horribly incompetent for not finding an answer on the net.
>>
>>54840104
Correct!
> Outrageous Applause!
>>
My error:
/tmp/ccy4J4we.o: In function `main':
driver.cpp:(.text+0x39): undefined reference to `LongInt::LongInt(std::string)'
driver.cpp:(.text+0x5d): undefined reference to `LongInt::~LongInt()'
driver.cpp:(.text+0x84): undefined reference to `LongInt::~LongInt()'
collect2: error: ld returned 1 exit status


What I have in my driver:
#include <iostream>
#include "longint.h" // The header file is named "longint.h" same capitalization
#include <string>

using namespace std;


Constructor/destructor signatures in my LongInt.cpp:
LongInt::LongInt( const LongInt & rhs )
LongInt::LongInt( )
LongInt::~LongInt( )


Also, what's the difference between a .cpp file and a .cpp.h?
>>
>>54840104
Hideously ugly
>>
>>54838970
job counts seem old as fuck
>>
>>54840271
:)

>>54840318
Like your face, nerd.
>>
>>54838535
[codesort(cmp=]lambda x,y: something(x+y)))[/code]
Means about the same as
def myfunction(x,y):
something(x+y)

sort(cmp=myfunction)


In the case of sort, both x and y are elements of the list and the result of
myfunction(x, y)
determines if element x comes before or after element y in the sorted list. (e.g. a function that says if 'a' comes before or after 'b', but for nonstandard objects)
>>
File: 1462001696985.jpg (38 KB, 362x346) Image search: [Google]
1462001696985.jpg
38 KB, 362x346
>>54840242
you mean a 2d array that represents 3d coordinates right?
>>
>>54840326

jobs apart, it's right about the languages?
>>
As I said yesterday, today I took my time to finish FizzBuzz in Game Boy assembly.

Source pastebin:
http://pastebin.com/sX8s5A4h
Hardware.inc pastebin:
http://pastebin.com/uWBwmVGx
Addsubb pastebin:
http://pastebin.com/wN0FwRea

Download .gb ROM from here:
https://drive.google.com/file/d/0B2YI91EWUu1AWTl2c05kM3pJaWc/view?usp=sharing
>>
>>54838970
Nobody does AJAX by hand anymore
JavaScript part is missing backend (node) stuff
Objective C is replaced with Swift for iOS and its use declining fast
"Django or python" is not a thing
Java is probably not most useful in 10 years because it missed the web boat
PHP+SQL is getting old
>>
PCI is such a boring overly complex piece of shit
>>
>>54840424
Where does one learn something like this?
I played TIS-100 for a million years but still can't figure what's happening there
>>
>>54840369
Yep, 2d array from these two. (Trying to make an energy capacity graph for capacitors)

I'm trying to get the values of z to be .5*x*y^2.
>>
>>54838244
Is my fizzbuzz memetical enough?
using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace fizzbuzz
{
class Program
{
static void Main(string[] args)
{
Enumerable.Range(1, 100).ToList().ForEach((i) => Console.WriteLine(Regex.Replace(((i % 3 == 0) ? "Fizz" : "") + ((i % 5 == 0) ? "Buzz" : "") + i.ToString(), @"(\D+)\d+", @"$1")));
}
}
}
>>
>>54840454
Not him, but I'd suggest starting to experiment with emulator programming by going through chip-8 guides. Once you finish a chip-8 emulator and some games to get a feel for game programming in assembly, gameboy/z80 is just another step-up. A slightly bigger leap, but only slightly. Then practice writing a few games/functionality using the instructions it gives you, then FizzBuzz in it becomes easy
>>
>>54840458
ok let me try something here anon. It might not work, and I will be using java. But I think the concept is the same. Give me 5 minutes
>>
>>54840494
OP doesn't want regular fizzbuzz
>>
File: 1443386627880.jpg (709 KB, 666x999) Image search: [Google]
1443386627880.jpg
709 KB, 666x999
>>54840510
*Awaiting in anticipation*
>>
>>54840524
How about this then?
using System;
using System.Text.RegularExpressions;

namespace fizzbuzz {
class Program {
static void Main(string[] args){
Console.WriteLine(Regex.Replace(Regex.Replace("1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ",
@"(\d+ \d+ )\d+",
"$1Fizz"),
@"([^ ]+ [^ ]+ [^ ]+ [^ ]+ )(\d+)?([^\d ]+)?",
"$1$3Buzz")
);
Console.ReadKey();
}
}
}
>>
>>54840097
0/10
>>
>>54840554
>using
Console.WriteLine();

>not just using
WriteLine();
>>
>>54840573
Written for .net 4.0.
>>
>>54840590
>writing for old shit
>>
>>54840590
Can't you still compile for 4.0 with C#6.0 features?

The compiler translates that out, right?
>>
>>54840130
it's the prime version of fizzbuzz get a clue
>>
Reminder:
3 and 5 are not technically prime because they are single-digit numbers.
>>
>>54840633
Just checked, yes you can.
>>
>>54840550
wait quick question, does each x map to each y directly? Like the int at index 1 in the x-array matches the int at index 1 in the y-array?
so it will be:
index 1: x,y
index 2: x,y
index 3: x,y
etc
>>
>>54840655
>they are single-digit numbers
And why does this matter?
>>
>>54840655
this post actually exists

someone actually hit Post with this retardation
>>
>>54840557
Oh shit, I didn't see the error at the top. My bad.
>>54839769
It looks like it's complaining about the mime type not the filename. Maybe your browser is messing something up there, try another one.
>>
>>54840524
Oh, just saw "prime(x)". Gimme a sec.
>>
>>54840425
what about C++, it seems quite wide and powerful
>>
>>54840707
Even Euler stated how single-digit primes were a meme
>>
>>54840759
In binary they aren't single digit
>>
>>54840454
Googling now I found this list
https://github.com/avivace/awesome-gbdev

When I first started I used the following resources:

1) Nintento's manual - http://www.romhacking.net/documents/544/
2) First steps with asm - http://gameboy.mongenel.com/asmschool.html
3) Basic things to do - http://wiki.ladecadence.net/doku.php?do=show&id=tutorial_de_ensamblador (I cannot find the translated page though)

Then you just have to try things, updating background map, moving screen position, joypad handling, positioning sprites (trying to emulate the pokemon movement is one thing you could do).
The last thing I did was a very basic pacman clone in order to try handling collision, pathing and ghost AI.
>>
>>54840770
binary is also a meme
>>
>>54840759
They are still prime. Not every single digit number is a prime. 3 and 5 aren't even the only single digit primes. tl;dr your post decreased this thread's IQ by 10, congratulations.
>>
>>54840800
>decreased this thread's IQ
I don't see how that's possible, at best we're slightly above the previous thread

Also apparently the guy that got the correct solution in this thread posted it in the last one, sorry I missed it, I came back after like 6 hours
>>
if a person is 75% nigger he's a nigger
if a person is 50% nigger he's a nigger or a half nigger
if a person is 12.5% nigger he might not be a nigger

if a program is 75% OOP it's OOP
if a program is 50% OOP it's OOP or half OOP
if a program is 12.5% OOP it might not be OOP
>>
>>54840550
bruh answer my question, i cant go write it correctly if I dont know how you want the coardinates
>>
Actionscript 2 is best language desu

for(i, i<101, i++){
If(i℅5==0&&i%3==0){
trace("FizzBuzz")
}
Else If (i%5==0){
trace("Buzz")
}
Else If (i℅3==0){
trace("Fizz")
}
}
>>
>>54840872
A person can't be 50% of a nigger
>>
>>54840897
tiger woods
>>
>>54840685
>>54840885
Yes, I made it so that the indexes should align. The most gracious solution would still be a graph that could be rectangular if for example x is longer than y.
>>
>>54840814
It's cool. I also posted an incorrect answer, desu. I originally solved the stock FizzBuzz problem, not realizing that you wanted primes.

Unless you're just trolling, it might be a good idea to reformat your problem and put additional emphasis on primes.
>>
>>54840909
fucking tiger woods is your response instead of interracial children in general. nice
>>
File: dpt fails again.png (377 KB, 3324x988) Image search: [Google]
dpt fails again.png
377 KB, 3324x988
>>54840928
>additional emphasis on primes
It's hard to fucking miss if you read the question, but in a sense it is trolling because I just use it to collect the dumbass responses I get

>pic related
/dpt/ will defend this
How can any of you sleep at night?
>>
>>54840872
this is why /dpt/ is shit

fucking Python or JS are considered mainly OOP despite emphasizing procedural or functional paradigms respectively
>>
>>54840969
>in both languages, everything is an object
>emphasizing procedural or functional paradigms
>>
>>54840929
>interracial children
They are full blown niggers
>>
>>54838244
>wrote the prime solution
>looked at the output
>realized op is a faggot
using System;
using System.Linq;
using System.Text.RegularExpressions;
using static System.Console;
namespace fizzbuzz
{
static class Sieve
{
static bool[] s;
public static int SieveSize { get; private set; }
static Sieve()
{
SieveSize = 101;
s = new bool[SieveSize];
int i = 2;
while(i < SieveSize)
{
if(!s[i])
{
for (int j = 2*i; j < SieveSize; j += i)
s[j] = true;
}
i++;
}
}
public static bool IsPrime(int x)
{
if (x >= 2 && x < SieveSize)
return !s[x];
else
return false;
}
}
class Program
{
static void Main(string[] args)
{
Enumerable.Range(1, 100).ToList().ForEach((i) => WriteLine(Sieve.IsPrime(i)? Regex.Replace(((i % 3 == 0) ? "Fizz" : "") + ((i % 5 == 0) ? "Buzz" : "") + i.ToString(), @"(\D+)\d+", @"$1"):i.ToString()));
}
}
}
>>
>>54838244
What memes did you fall for?
>fell for the OS X is bad for development meme
>fell for the python is bad meme
>fell for the C is deprecated for game dev meme
>fell for the functional programming is good meme
>fell for the dynamic typing is bad meme
>fell for the x86 asm meme

and you?
>>
>>54841049
>realised I am retarded
FTFY
>>
>>54841071
Fizzbuzz is a skill test, not brain test.
>>
>>54841058
In the following pairs, which is meme and which is nonmeme?

XML and JSON
SQL and NOSQL
>>
>>54841110
A trick question, all of these are memes.
>>
>>54841081
>wtf I had to put thought into this
Holy shit
>>
is there a way to make this program faster?

// Leibniz' pi formula

#include<stdio.h>

#define LIMIT 4294967295

int main()
{
double pi=1.0,k=3.0;
unsigned long i;
for(i=0;i<=LIMIT;i++){
if(i%2==0)
pi += -1.0/k;
else pi += 1.0/k;
k+=2.0;
}
pi *= 4.0;
printf("%.20f\n",pi);

return 0;
}


$ time ./a.out 
3.14159265382093133567

real 0m23.266s
user 0m23.260s
sys 0m0.004s
>>
>>54841058
Dynamic typing itself is a meme.
>your data should carry around extra tags for mostly invalid combinations and produce runtime errors 90% of the time
>>
>>54841110
Memes:
XML
NOSQL

Non-memes:
JSON
SQL
>>
>>54841155
You can have untagged primitives under dynamic typing
>>
>>54841058
>>fell for the OS X is bad for development meme
>>fell for the python is bad meme
>>fell for the C is deprecated for game dev meme
>>fell for the dynamic typing is bad meme
those aren't memes you dip
>>
>>54841142
>implying programming requires thought
Literally just adapt examples from the Internet for your particular case.
>>
>>54841193
if you're a code monkey
>>
File: don't wake me up.jpg (51 KB, 540x429) Image search: [Google]
don't wake me up.jpg
51 KB, 540x429
>>54841193
>this is how the average /dpt/ user thinks these days
>>
>>54841208
Code monkeys don't adapt code, dummy.
>>54841212
>think
Lel. Anyway, try thinking of a task that can't be solved by googling.
>>
>>54841193
have fun getting outsourced to this guy
>>
>>54841239
Life
>>
>>54841240
>working as a programmer
You already are, I bet. I'm just a very lazy person, and many tasks are easily automated. Did you know you can create MS office documents in visual studio? No need for that VBA abortion anymore.
>>
>>54841279
>>working as a programmer
so you're a lazy as NEET or not even a programmer and you're not even getting paid for underperforming
>>
>>54841153
Use a better algorithm. Or use one of the methods described on the wiki page to speed it up. Maybe split the positive and negative terms into two loops to avoid the branch.
>>
>>54841298
I'll try other algorithms, I was talking more in terms of memory management which I know almost nothing about.
>>
>>54841239
Different guy but there's some shit out there you wouldn't believe you'd have to do. Shitty programming language(what is classes) and having to deal with a multitude of json xml and csv formats to load some shitty data into a shitty database so that a shitty app does a shitty job of processing that shitty data so customers get less shitty data back leads to some interesting code as well as 100 line functions that if fucked with break things in spectacular ways.
>>
I read about integer representations and bitwise Boolean operations a while ago and made a small program about it. I just wanted to see if I could combine some bits and numbers into a single integer value.

http://pastebin.com/mvpr0h4w

Some output:
>>> bitpacker.pack_bits([10,15,0,1])
33738
>>> bitpacker.pack_bits([31,31,1,1])
42975
>>> bitpacker.pack_bits([4,3,1,0])
8388
>>
>>54840550
It was too long to post in one reply. So I split it into two methods. I also used a map instead of a 2darray, since that is the smarter datastrcuture to use for coordinates. Here is the first method

/**
* Turns your x and y array into a HashMap of x and y, so that you plot it or do math to it etc...
* @param xArray x coordinate array
* @param yArray y coordinate array
* @return returns a hashMap with x,y pairs that match our arrays
*/
public HashMap<Integer,Integer> makeCoardinates(int[] xArray, int[] yArray){
//xArray and yArray are the x coordinate array and the y coordinate array you have
int size = 3; //this is how many points we have

//use a map data structure instead of a 2D array, this is what the map was meant for. We can link x and y together!
HashMap<Integer,Integer> coordinates = new HashMap<Integer,Integer>();
for(int i = 0; i < size; i++){
coordinates.put(xArray[i],yArray[i]); //iterating through our x and y and adding to our hashmap

}

return coordinates;
}

>>
>>54841329
You don't use memory there. Like, all of your code could be done using only registers.
>>
Is this a good pattern if I can construct a Foo from multiple different objects (not all of which will be compiled into the binary).
#ifdef USE_XCB
namespace xcb { class Window; }
#endif
#ifdef USE_WIN32
namespace win32 { class Window; }
#endif
//etc...

class Foo {
public :
Foo() = delete;
#ifdef USE_XCB
Foo(xcb::Window);
#endif
#ifdef USE_WIN32
Foo(win32::Window);
#endif
//etc...
};
>>
>>54840550
>>54841419
Here is part two. Use the methods together. And also where I put size = 3, you can put 1000 or however many points you have

/**
* Uses our map to make a third array of z cooardinates. You can plot using the z cooardinates, you have three arrays now.
* Or you can use the map for x and y, then use the z array alone
* @param coordinateMap Takes our map of x and y
* @return returns an array for z cooardinates
*/
public double[] findZCoardinate(HashMap<Integer,Integer> coordinateMap){
int i = 0; //using this to increment through our zArray
double[] zCoordinatesArray = new int[size]; //use the same size of your x and y

//we will return an array with our z values.
//So you will have an x,y, and z array. As well an x,y map

//this looks confusing but its just looping through our map, just google how to loop through maps in your language
for (Map.Entry<Integer, Integer> entry : coordinateMap.entrySet()) {
int xCoordinate = entry.getKey(); //this is our x coordinate;
int yCoordinate = entry.getValue(); //this is our y coordinate;

System.out.println("this is our x: " + xCoordinate);
System.out.println("this is our y: " + yCoordinate);


//this is where your you put your formula
double zCoordinate = .5*xCoordinate* Math.pow(yCoordinate, 2);


//add into our z-array
zCoordinatesArray[i] = zCoordinate;
i++; //increment our z array to the next index
}

return zCoordinatesArray;
}

>>
>>54841445
alright thanks m8
>>
Whats the best book about (3d) physics engine as in developing and writing one (and not implementing one.)?
>>
>>54838244
Ok, geeks, whats the best program to implement FizzBuzz program ?

>yeeze to code it
>eazy to memorize it

I am on interview tomorrow and I lied about knowing how to program, must work fast
>>
File: fizzbuzz of the christ.png (402 KB, 1024x768) Image search: [Google]
fizzbuzz of the christ.png
402 KB, 1024x768
>>54841592
Once they see the glory of christ, they will hire you on the spot
>>
Kan du vær så snill å hjelpe meg? Klokka mi går feil, og jeg kan ikke bruke datamaskinen min for å få hjelp fra faren min, fordi han er i Sverige i dag, og jeg snakker ikke arabisk.
>>
>>54841634
obssessed
>>
>>54841634
What language is this? Looks like C#
>>
>>54841715
It's cabal.
>>
>>54841110
all shit
>not using flat text files for a database
>not using plain english for data
All crutches for shit developers with inferior minds.
>>
>>54841705
Bodil?
>>
>>54841110
>XML
>JSON
JSON is less meme, still poor though.

>SQL
>NOSQL
Is NOSQL webscale? Does it support sharding?
>>
can anyone give me some short projects that are good for utilizing procedures as parameters and return values in lisp?
>>
>>54841772
>flat text files for a database
>plain english for data
the fuck
>>
>>54841903
A literal data dictionary, I guess.
>>
Working on an executable intuitionistic semantics for LTL.
>>
What are all the millenial phrases you guys know? I'm gonna try to make an extension/plugin to filter them out.
I have
>senpai
>lit
>turnt
>turn up
>swag
>lmao
>desu
>Wyd
>hbu
>>
>>54841627
I don't understand why people hate python.
>>
>>54842039
It ignores 30 years of programming language research.
>>
>>54842020
kys
>>
>>54842020
lol/kek are millenial phrases. enjoy your 4chan experience
>>
>>54842066
ignores != being an arrogant ignorant dickwad
>>
>>54842066
So do Lisp and Haskell.
>>
>>54842106
those are also shit
>>
>>54842129
idris 4 lyf
>>
>>54842066
how it does so?
>>
>>54842200
by being complete shit
>>
>C++
Is there a simplish explanation of std::memory_order. I understand (I think) relaxed/acquire/release/seq_cst, but I don't get the difference between consume/acquire and all the carries_dependency/kill_dependency bullshit.
>>
>>54841455
Just create two implementations with the same name based on the same header and instead of using the ifdefs include the implementation file in your build system based on the target system.

So like:

window.hpp:
class Window
{
...
};


window_win32.cpp:
implement Window for Win32API

window_x11.cpp
implement Window for X11/xcb API

Then compile either _win32 or _x11.
Thread replies: 255
Thread images: 28

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.