[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: 318
Thread images: 27

File: daily programming thread2.webm (2MB, 600x338px) Image search: [Google]
daily programming thread2.webm
2MB, 600x338px
old thread: >>57967490

What are you working on, /g/?
>>
>>57974736
First for D
>>
File: simple typed.png (16KB, 552x230px) Image search: [Google]
simple typed.png
16KB, 552x230px
>>
>>57974736
>Fag shit
Delete this thread.
>>
>>57974767
I thought you abandoned us you fag ;_;
>>
>>57974736
Is this lolicon?
>>
File: simple typed eg2.png (31KB, 721x377px) Image search: [Google]
simple typed eg2.png
31KB, 721x377px
>>57974749
better example
>>
>>57974776
Why would I abandon akari-bbs?

Also I forgot my pic~
>>
>>57974811
Hoh boy
>>
File: 9cTx3.gif (1MB, 400x400px) Image search: [Google]
9cTx3.gif
1MB, 400x400px
From last thread: Currently trying out ReactJS. Horrified that a simple example app requires 1.8MB after webpack.

Going to work through Sirajology's videos on youtube and put together a HFT bot that uses Twitter sentiment analysis and Trump tweets to see if it can beat the market.
>>
>>57974811
>dickbutt

Found the redditor!
>>
>>57974805
>Horrified that a simple example app requires 1.8MB after webpack.
Yeah hello world is like 24k lines of JavaScript, sucks that the "right" way of doing things shifts every month in the JS land so I'm not even touching it because all the doc/tutorials are broken and outdated.
>>
File: 1472492429079.jpg (310KB, 1920x1080px) Image search: [Google]
1472492429079.jpg
310KB, 1920x1080px
>>57974811
you are easily the best anon in this thread
>>
List the top 10 essential languages to learn.
>>
>>57974843
chinese
>>
what is the easiest way to draw pixels into a window?

raw XCB?
opengl?
>>
In C, is it possible to define a macro that pastes another macro that will get expanded in that same pass of cpp?
Ex:
#define hash #
#define defmacro(X) hash define (X)

defmacro(Y 10)

int x = Y;

->
int x = 10;

?

Does this necessarily require 2 passes of cpp?
Can another method make this require only one pass of cpp?
The end goal is this:
download("https://www.website.com/file.h")
int x = FILE_Y;

into this in one pass:
/* contentes of file.h */
int x = 15;
>>
>>57974843
D
D
D
D
D
Assembly
D
D
D
D
>>
im programming a templated subroutine with a Traits object filled with compile-time static variables.

Something like

template< class Traits>
void Blah( InData in_data)
{
...
}


How do i make my function call
in_data->utils->iterate(...) if Traits::Bits is 8 and in_data->utils->iterate16(...) if Traits:Bits is 16 without having two copies of Blah() just for this one specialization?
>>
>>57974829
dickbutt is a /b/ meme
>>
>>57974867
nevermind the end goal, cpp cant download things
how do i delete posts again
I think my css hides it
>>
>>57974891
Sure, tell yourself that. Maybe you're gonna sleep well after stating that, who knows?
>>
>>57974879
is Traits::Bits constexpr?
>>
>>57974899
ok
>>
>>57974805
will?
>>
>>57974900
yes.
It's
static constexpr size_t Bits = 8;
>>
Should I bother learning SQL?
>>
>>57974950
can the 8 vs 16 not be a function parameter to iterate?
>>
Why is Python such a fag language?
>>
>>57974952
If you want to do anything fun with the web, yes.
>>
>>57974963
That's why you should learn Elixir instead.
>>
>>57974961
no, as it's a library function outside my reach of modification.
>>
>>57974980
actually wait
they're compile time static variables
templates only instantiate the one that's used

are you actually instantiating the function twice?
>>
>>57975021
ones that are used*
>>
>>57974861
Try SDL. OpenGL is only worth the effort if you're doing 3D shit or you need to render a lot of shit in real-time.
>>
>>57974873
Everyone says D but I have honestly never seen D code posted here, or even any indication that anybody is actually using it and not just talking about it.
>>
>>57975021
this isn't leading to the problem being resolved but the compile-time Traits object I am talking about does not only vary by the single variable I just told you about and will alter the behavior of this function depending on the compile-time variables inside. And I've reached a point in which I need to call one library function for 1 bit-depth, and a different one for another.

There is no compile-time conditional function either so if I was to make a big rack of if-ifelse it will still have to evaluate the cases that do not match.

There has to be a way to set an "auto" function pointer to either `iterate` or `iterate16` at compile-time based on this one variable.
>>
>>57975082
If it varies by other things then how do you expect it to generate only one function?
>>
>>57975074
That's because they're not.
>>
>>57975074
I've been too busy this semester to do anything substantial in it
I guess I could pick up AoC and post some here
>>
>>57975101
its not. that's the point of templates. It emits a completely different assembly depending on the parameters of the template argument. I get this part already. I am using a compile-time "Traits" objects to control the specific behaviors of the generated assembly. This is something the standard library does even. This is going on a completely far tangent of the original question at hand.
>>
>>57975128
You're not passing it a traits object, you're passing it a traits type. You don't get multiple instances of the same type with templates. That's what constexpr and regular functions are for
>>
>>57975151
Could swear I was on stack overflow for a second.
>>
>>57975128
>>57975151
So even if you had something like this

struct Traits1
static const constexpr size_t bits = 8;
}

struct Traits2
static const constexpr size_t bits = 8;
}

You can't bring them together with templates.
You want to seperate the bits out of the template and make it a regular parameter to the function, if you only want it generating once
>>
>>57975151
>>57975168
You clearly don't get what he's doing.

>>57975082
>There has to be a way to set an "auto" function pointer to either `iterate` or `iterate16` at compile-time based on this one variable.
This is probably the way if you can write a templated "pick" method that selects between the two.
>>
>>57975168
Just stop. I never said I wanted it generated once and Im not bringing it together like you are.
Yes
>>
>>57975191
>>57975181

>How do i make my function call
>in_data->utils->iterate(...) if Traits::Bits is 8 and in_data->utils->iterate16(...) if Traits:Bits is 16 without having two copies of Blah() just for this one specialization?

You're both idiots.
>>
>>57975207
Without having two copies of Blah() as in not having to literally just copy-paste code and make a specialization of the entire fucking function when there is only one damn difference between them.

I know clearly that the compiler will emit the function in different ways for different arguments but this traits object/type is what statically configures the function at compile-time.

You're useless.

I'm just going to look into this: >>57975181
>>
>>57975226
Oh, so you meant only WRITING it out once.

Well there's this thing called an if statement
>>
>>57975236
>Well there's this thing called an if statement
clearly didnt read
>>57975082
>There is no compile-time conditional function either so if I was to make a big rack of if-ifelse it will still have to evaluate the cases that do not match.
>>
>>57975254
Yes, you will have to do a big rack of if-elses.
Or switch.
>>
>>57975258
There.
Is.
No.
Compile.
Time.
Conditional.
That.
Encapsulates.
Logic.

Static-ifs were even specifically rejected.

http://baptiste-wicht.com/posts/2015/07/simulate-static_if-with-c11c14.html

http://stackoverflow.com/questions/13799420/why-there-is-no-static-if-in-c11


Just stop now.
>>
>>57974736
Fixing bugs and cleaning up spaghetti code boss keeps introducing to our C++ codebase when he doesn't know C++
>>
>>57975283
constexpr-if is in C++17

But I wasn't talking about constexpr-if, I meant regular if.

As in

if (traits::bits == 8) ...
else if (traits::bits == 16) ...
>>
>>57975258
template <typename T> void f()
{
if (T::Foo == Bar)
{
// stuff that relies on Foo being BAR
}
else
{
// stuff that doesnt rely on Foo being BAR
}
}



this is not valid code as the code that does not rely on Foo Being BAR will still be evaluated at compile-time
>>
>>57975305
T::Bits is a size_t
>>
GIVE ME SOMETHING INTERMEDIATE TO PROGRAM
>>
>>57974836
Why haven't you killed yourself yet
>>
>>57975341
C++ Compiler
>>
>>57975082
>>57975298

>There is no compile-time conditional function either so if I was to make a big rack of if-ifelse it will still have to evaluate the cases that do not match.
>if (traits::bits == 8) ...
>else if (traits::bits == 16) ...

Modern optimizing compilers can perform something known as dead code elimination. If it sees something like if (0), it will never even check that section of code at runtime, and code is not generated for that section. Similarly, if (1) will not check something, it will just generate that code block.
>>
>>57975305
#include <iostream>
using namespace std;

class A {
public:
static constexpr const size_t Bits = 8;
};
class B {
public:
static constexpr const size_t Bits = 16;
};

template <typename T>
size_t f() {
if (T::Bits == 8) return 0;
return 1;
}

int main() {
std :: cout << f<A>() << '\t' << f<B>();
return 0;
}
>>
>>57975363
>intermediate
>>
>>57975377
This is under the assumption that you are only keeping the template <> so that you can parametrise it in a later position.
Effectively it's like an implicit, static parameter.
>>
File: jingle bells.jpg (171KB, 490x1015px) Image search: [Google]
jingle bells.jpg
171KB, 490x1015px
Can I realloc() an allocated block of memory if I don't have a pointer pointing to the beginning of that block?

I'd like to write a function that inserts n characters into a location pointed to by *dest, but i'll need to grow the array first and I'm not sure if it's possible without a pointer to the original memory block.
>>
>>57975436
No.
>>
>>57975436
>Can I realloc() an allocated block of memory if I don't have a pointer pointing to the beginning of that block?
No. It must point exactly to the same place that malloc/whatever returns.
>>
>>57975436
don't use c
>>
>>57975436
I read your post in an indian accent
just letting you know
>>
>>57975436

The realloc function should only be used on a pointer returned by a previous call to malloc or realloc, or else undefined behavior will result. If you have a function where you are copying data, with a source and destination pointer, along with a length parameter, you should not have that function do memory allocation.
>>
>>57975483
I don't get why some retards associate C with pajeets. It makes absolutely no sense.
C is considered a "hard" language by most people, and the pajeet meme is about terrible Indian programmers who can't do anything but shit out terrible Java/C# code.
>>
>>57975531
where did you get the impression of anyone associating C with pajeets? it's about the poster himself who is a pajeet
>>
How can I shorten the following Python 3 code?
print('S'+p if d<b else p)

The best I can find so far is
print((p,'S'+p)[d<b])
>>
>>57975548
>where did you get the impression of anyone associating C with pajeets?
I have seen it many times in the past.
>>
>>57975557
so? why do you think your "experiences" are relevant here if you can't even decode a simple post?
>>
File: vomit.jpg (90KB, 650x650px) Image search: [Google]
vomit.jpg
90KB, 650x650px
>>57975550
>Python ternary statements
>>
>>57975570
>Python
fixed that for you
>>
return vector[0].map[i]


vector is a const vector, map is a map owned by each object in the vector, and i is an int that gets passed in. This should return the ith value in the map, right? It's giving me some garbage error that doesn't make any sense.
If it matters, the map is: map<int, SDL_Point>
>>
>>57975623
What's the error?
>>
>>57975651
>error: passing 'const std::map<int, SDL_Point>' as 'this' argument of 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = SDL_Point; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, SDL_Point> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = SDL_Point; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]' discards qualifiers [-fpermissive]|

I think it might have something to do with the fact that the vector is const.
>>
>>57975695
>discards qualifiers
that'll be it

is your member function const qualified?
>>
>>57975695
That's what you get for using C++.
>>
>>57975695
>>57975623
hahaha disregard that i suck cocks

I just had to change it from map[i] to map.at(i)
>>
>>57975717
map[i] can be const too
>>
File: win32.jpg (264KB, 1440x1080px) Image search: [Google]
win32.jpg
264KB, 1440x1080px
Apparently the Magi are programmed with Win32. No wonder Iruel was able to penetrate them.
>>
>>57975752
>it's entirely declarations
I didn't know C was a declarative language
>>
>>57975767
They make a WNDCLASS at least.
>>
>>57975377
>>57975375
>>57975313

just ended up doing this thanks I'll optimize it later.

    typedef std::conditional<
PixTraits::Bits == 8,
decltype(Params->in_data->utils->iterate),
decltype(Paramsin_data->utils->iterate16)
>::type IterateProc;

IterateProc* Iterater;

if( PixTraits::Bits == 8 )
{
Iterater = reinterpret_cast<decltype(Iterater)>(&Params->in_data->utils->iterate);
}
else if( PixTraits::Bits == 16 )
{
Iterater = reinterpret_cast<decltype(Iterater)>(&Params->in_data->utils->iterate16);
}

(*Iterater)(
...
)
>>
CAN I WRITE AN OPERATING SYSTEM IN HASKELL
>>
>>57975829
No.
>>
File: git-cheat-sheet-large01.png (143KB, 920x1301px) Image search: [Google]
git-cheat-sheet-large01.png
143KB, 920x1301px
What's the best git cheat sheet out there? I want to print one out.

I have these 2.

[1/2]
>>
>>57975505
How does this make you feel, ruby-senpai?
char *strins(char **loc, size_t pos, const char *src, size_t n)
{
char *dest = *loc; /* realloc */
dest = (char *) realloc(dest, strlen(dest) + n + 1);
memmove(dest + pos + n, dest + pos, strlen(dest + pos) + 1);
memcpy(dest + pos, src, n);
*loc = dest;
return dest;
}
>>
>>57975837
[2/2]

https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf
>>
What's the cringiest programming language? Is it LOLCODE?
>>
>>57975829
it's GC so no
>>
>>57975851
javascript
>>
>>57975851
lolcode, shakespeare programming language, trumpscript, python, brainfuck, oog, they're all quite cringy

https://www.kickstarter.com/projects/520965826/basil-the-comprehensive-programming-language
>>
>>57975851
Whatever Urbit uses.
>>
>>57975981
>We should note that in Nock and Hoon, 0 (pronounced "yes") is true, and 1 ("no") is false. Why? It's fresh, it's different, it's new. And it's annoying. And it keeps you on your toes. And it's also just intuitively right.
>>
File: vomit.png (402KB, 1248x788px) Image search: [Google]
vomit.png
402KB, 1248x788px
I'm working on ripping some textures from SH3

I can rip the textures, but the 8bpp ones are displaying wrong for some reason.

Pic related, it's just the raw pixel data. 24bpp textures display 100% correct, but 8bpp and it's just vomit.

Does anyone have any idea??
>>
File: Extra5.jpg (56KB, 600x955px) Image search: [Google]
Extra5.jpg
56KB, 600x955px
import std.stdio;
import std.conv;
import std.string;

bool and(bool[] valids)
{
if(valids.length == 1)
{
return valids[0];
}

return valids[0] && and(valids[1..$]);
}

bool checkSides(int[3] sides)
{
bool[3] valids;
for(int i = 0; i < 3; ++i)
{
if(sides[i] + sides[(i + 1) % 3] > sides[(i + 2) % 3])
{
valids[i] = true;
}
}

return and(valids);
}

void main(string[] args)
{
File input = File("day3input.txt", "r");
int total;

while(!input.eof())
{
string line = input.readln().chomp();
if(line != "")
{
line = line.stripLeft().squeeze(" ");
int[3] sides = line.split().to!(int[3]);
if(checkSides(sides))
{
++total;
}
}
}
writeln(total);
}


AoC Day 3 Part 1 (I know I'm helluva far behind)
>>
File: sweat1-300x277.jpg (39KB, 300x277px) Image search: [Google]
sweat1-300x277.jpg
39KB, 300x277px
did programming ruin your eyesight yet?
>>
>>57976609
Yes. I wear glasses now for eye strain.
>>
>>57976564
Wouldn't something like this be more idiomatic:
void main(string[] args)
{
uint[] results;

int valid_triangle(ref in string line) {
uint[] s = line.split.to!(int);
return (s[0] + s[1] > s[2] && s[1] + s[2] > s[0] && s[0] + s[2] > s[1]) ? 1 : 0;
}

auto data = File("D3.txt")
.read
.split('\n')
.each!(line => results ~= valid_triangle(line));

"Total: %d".writefln(results.sum);
}
>>
File: Johnson.png (310KB, 480x640px) Image search: [Google]
Johnson.png
310KB, 480x640px
>>57976564
import std.stdio;
import std.conv;
import std.string;

bool and(bool[] valids)
{
if(valids.length == 1)
{
return valids[0];
}

return valids[0] && and(valids[1..$]);
}

bool checkSides(int[3] sides)
{
bool[3] valids;
for(int i = 0; i < 3; ++i)
{
if(sides[i] + sides[(i + 1) % 3] > sides[(i + 2) % 3])
{
valids[i] = true;
}
}

return and(valids);
}

void main(string[] args)
{
File input = File("day3input.txt", "r");
int total;
int[3][3] triangles;
int[3] tmp;

while(!input.eof)
{
foreach(i; 0..3)
{
string line = input.readln.chomp.stripLeft.squeeze(" ");
foreach(j; 0..3)
{
tmp = line.split.to!(int[3]);
triangles[j][i] = tmp[j];
}
}

foreach(i; 0..3)
{
if(triangles[i].checkSides())
{
++total;
}
}
}
writeln(total);
}

Part 2

>>57976726
import std.stdio;
import std.conv;
import std.string;
import std.algorithm;

void main(string[] args)
{
uint[] results;

int valid_triangle(ref in string line) {
uint[] s = line.split.to!(uint[]);
return (s[0] + s[1] > s[2] && s[1] + s[2] > s[0] && s[0] + s[2] > s[1]) ? 1 : 0;
}

auto data = File("day3input.txt")
.readln
.split('\n');
data.each!(line => results ~= valid_triangle(line));

"Total: %d".writefln(results.sum);
}


Fixed
I did add a lot more than I needed to though
>>
>>57976904
Actually, now that I think of it, it could be chained further by doing something like this:
import std.stdio;
import std.conv;
import std.string;
import std.algorithm;

void main(string[] args)
{
uint[] results;

int valid_triangle(ref in string line) {
uint[] s = line.split.to!(uint[]);
return (s[0] + s[1] > s[2] && s[1] + s[2] > s[0] && s[0] + s[2] > s[1]) ? 1 : 0;
}

"Total: %d".writefln(
File("day3input.txt")
.readln
.split('\n')
.map(line => valid_triangle(line))
.sum;
);
}


(Although I'm not sure whether it's valid, again, since I haven't really touched D in a while and I didn't know much to begin with).
>>
>>57974804
lisp?
>>
>>57974811
link?
>>
>>57976941
https://github.com/microsounds/akari-bbs
>>
>>57976961
>you will never write something like this
why even live?
>>
>>57977001
That sort of stuff isn't that difficult.
>>
>>57975752
atleast its actual code
everytime theres a "hacker" scene in a movie nowadays its always htlm shit or just gibberish
>>
>>57977024
can I write it in lisp?
>>
File: Screenshot_2016-12-13_02-43-02.png (77KB, 1148x52px) Image search: [Google]
Screenshot_2016-12-13_02-43-02.png
77KB, 1148x52px
>>57976933
I'm getting this error when I'm compiling, and I'm too tired to figure out how to fix it

I really need to into higher order functions more often though
>>
>>57974783
No, it's a boy
>>
>I think if I didn't do this in C I would spend alot less time debugging seg faults.

What did he mean by this?
>>
>>57977318
Who?
>>
>>57976609
Nope. I've been staring at screens for twenty years now and everything's fine. Just use the lowest brightness setting available for your screen in a lit room and you should be fine.
>>
>>57974879
template<size_t N>
struct foo;

template<>
struct foo<8>
{
static constexpr auto pfn = &decltype(std::declval<InData>()->utils)::iterate;
};

template<>
struct foo<16>
{
static constexpr auto pfn = &decltype(std::declval<InData>()->utils)::iterate16;
};

template<typename Traits>
void Blah(InData in_data)
{
(in_data->utils->*foo<Traits::Bits>::pfn)(...);
}
>>
>>57976609
you should check for glaucoma
>>
>>57974736
I'm going throught this C++ book from like 2002 and it's referencing all these non-standard .h files, like msoftcon.h and conio.h.

Should I skip those excercises spend all day trying to find it and get it working with g++ ?
>>
>>57978003
Why would you learn from an outdated book?
>>
>>57978016
Because I didn't research the product I bought.

Are there many modern C++ books out? or at least one with a edition published this decade?

To be honest, some of the code examples are pretty atrocious, just on a readability front.
>>
>>57978059
http://stackoverflow.com/a/388282
>>
>>57978059

http://mazonka.com/shared/Straustrup4th.pdf
>>
>>57974736
I'm a Business Intelligence consultant.
This means taking oodles of data from SQL servers and other sources and putting them into a data warehouse so we can make neat OLAP cubes.
So far so good, right?

But today, I have to read and learn two TSQL scripts, each ~4000 lines long.
They gather relevant data that the customer needs, and puts them into an Excel file.

What method of suicide do you recommend?
>>
I hate TIS-100, because it shows how utterly crap i actually am at programming.
>>
>>57976008
Isn't that how C does it?

And it makes sense to, because you can do somehting like:

errors = 0;
for(lambda fun : allYourProcesses) {
errors += fun.execute();
}
return errors;

// Then later...
if(errors) {

}

I mean, yeah, you could write if no errors, but that seems weird.
>>
>>57978291

I wouldn't dwell on it too much. It's not like writing a traditional program -- even a traditional assembly program. Each register can only receive inputs from adjacent registers and such.
>>
>>57978411
No, that's the opposite of how C does it.
>>
>>57974736
What are some good books to learn C++? I know python pretty well and an using it with Django regularly. I am am currently downloading "Programming: Principles and Practice Using C++, Second Edition", is it alright?
>>
>>57978266
Try to get CS degree.
>>
>>57978478
You have small set of operations, a small set of registers, and the problems aren't terribly complex. It shouldn't be that hard.
It shows just how terrible i am at creative problem solving.
>>
>>57978504
I like it, but i didn't start liking it until i was already fairly comfortable with C++.
>>
>>57978411
>Isn't that how C does it?
There are many conventions for indicating failure or not.
The convention for a lot of POSIX functions is 0 for success, < 0 for failure though.
>>
>>57978071
Is there something like this for C?
>>
File: 2016-12-13-130538_1348x874_scrot.png (173KB, 1348x874px) Image search: [Google]
2016-12-13-130538_1348x874_scrot.png
173KB, 1348x874px
clang and llvm BTFO!
>>
>>57976936
no, STLC
>>
What are your favorite books for learning programming? I'm currently in need of some java books.
>>
>>57978515
Already did that, survived.
That's how I got this gig to begin with?
And the guy who wrote those 4k lines had one too.

It doesn't kill people.
>>
Can you return and pass a pointer to a specific position in a string in C?
return string[5];
and then use that return value to pass a pointer to position 5 in a string to a function
Or will it always return a pointer to the first position in a string?
>>
>>57978953
&string[5]
or
string + 5
works.
>>
>>57978953
Doing string[index] is equivalent to doing *(string+index).

So basically you can do it two ways:
first: return string+index;
second: return &(string[index]);
>>
>>57978756
That's pretty nifty.
>>
>>57978964
>>57978982
Thanks
>>
File: anal beads.png (73KB, 661x373px) Image search: [Google]
anal beads.png
73KB, 661x373px
>>57974843
>>
>>57979084
Haskell should be number #1
>>
File: anal beads.png (64KB, 693x387px) Image search: [Google]
anal beads.png
64KB, 693x387px
>>57979084
for reference
>>
>>57979126
Haskell should be number 1000
>>
>>57978964
>>57978982
Another question, can't I just do string++; until I get to the desired position and then just return string; or will that only the return pointer to the first value?
>>
>>57974736
Just wrote a script to set random wallpaper from /wg/. You can change the board is it from editing the python script. Change the name of python script to pape.py.
Also in the script you can change interval, and the way wallpaper is it (this one is for gnome 3).
https://files.catbox.moe/gw1p66.sh
https://files.catbox.moe/bon2bt.py
>>
Currently doing some simulation on NS-3
I need to model some LAN network and two wifi networks, which should be able to access a server on the LAN network. The thing is, for some reason, I don't think the wifi networks can connect at all to any device on the LAN network. When tracing, it just shows the packets being sent, but nothing being received back, and given this is an UDP model, i'd imagine the packet never reached it's destination. Any ideas on how to solve this? I tried both doing something like
 NodeContainer p2pNodes;
p2pNodes.Create (4);

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer Csmap2pDevices1, Csmap2pDevices2;
Csmap2pDevices1 = pointToPoint.Install (p2pNodes.Get(0), p2pNodes.Get(2));
Csmap2pDevices2 = pointToPoint.Install (p2pNodes.Get(1), p2pNodes.Get(3));


and

  NodeContainer p2pNodes;
p2pNodes.Create (3);

PointToPointHelper pointToPoint;
pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

NetDeviceContainer Csmap2pDevices1, Csmap2pDevices2;
Csmap2pDevices1 = pointToPoint.Install (p2pNodes.Get(0), p2pNodes.Get(1));
Csmap2pDevices2 = pointToPoint.Install (p2pNodes.Get(0), p2pNodes.Get(2));


And neither seem to work. Any ideas?
>>
>>57979293
I forgot to add, those nodes declares are added to the networks. On the first case, p2pNodes.Get(0) and p2pNodes.Get(1) go to the LAN network, while p2pNodes.Get(2) and p2pNodes.Get(3) each becomes an individual AP for the wifi networks.

On the second case, p2pNodes.Get(0) is added to the LAN network, while p2pNodes.Get(1) and p2pNodes.Get(2) each become an individual AP for the wifi networks
>>
>>57979173
>can't I just do string++;
You can if 'string' is a pointer.
If it's an array label, you can't do this, as those are not modifiable.
>>
What is the semantic meaning of uninitialized variables in C?

/*this is fine in C, but an error on C++*/
int foo;
int foo = 1;

/*this is an implicit type declaration warning in C, but fine in C++*/
int bar;
bar = 1;
>>
>>57979399
in C++, you're initializing the same variable twice, hence the error
I think the same happens if you initialize an int pointer, but i'm not 100% sure
>>
What's the freshest resource on OpenCL programming?
>>
>>57979430
Yes i know. I don't understand why that is not an error in C.
>>
>>57979126
>JavaScript
>NodeJS
>AngularJS
>different rows
It feels like it's shit.
>>
>>57979399
the top throws an error for both C and C++ because it should

bottom is fine, shouldn't and doesn't throw an error (in the example given) in C and C++

post your code
>>
>>57979499
int var;
int var = 1;

int main(){return 0;}

Compiles with gcc for me, but not with g++.
>>
>>57979540
var isn't used so it's ignored by gcc
try putting var=1 inside main instead, or add var++ inside of main
>>
>>57979110
Even the lead developer of GHC thinks haskell is useless.
>>
>>57979540
The C++2011 standard has a section 3.2 that mentions a "One definition rule"
1. No translation unit shall contain more than one definition of any variable, function, class type, enumeration type, or template.

That probably applies.

I'm checking through the C99 standard to see if there's anything about this.
>>
>>57974747
Whats so great about D? Is it not just cleaned up C++? Which in itself wouldn't be bad but I'd expect more.
>>
>>57979699
You're useless

but I still love you
>>
In C++ is it possible to send an element of an array to a function as a reference variable so you can modify it like you can with vectors or do you have to just send the array in one parameter and the iteration you want to change in another?
>>
>>57979126
So C# is the best intersection of being a loved and popular language.

So is it then the best language?
>>
>>57979818
:(
:)
>>
>>57979867
Not the best language for all situations, but the fact that it's both massively popular for employment and personal pet projects is pretty telling.
>>
>>57979859
You can pass a reference to an individual element in a vector yes.

References are just pointers with certain syntactic constraints to them (like const references). Now that you understand this you can probably see how your question is a bit silly. That the element is part of a vector doesn't change the fact that you can take the address to it.
>>
>>57979293
Someone pls help. I don't have anything to trade back for help besides my rare pepes, but I am willing to post them, given this is for an uni work due today
>>
What's a good programming community like /dpt/, but not full of retards?
>>
>>57979906
>like /dpt/
>not full of retards
>>
>>57979892
>You can pass a reference to an individual element in a vector yes.
But can you do that with arrays or no? My attempts to do it with an array sorta work, as in I get a parameter with the correct value but it's still working as pass by value. I'm just not sure if what I'm trying to do is not possible or if I'm doing something wrong.
>>
>>57979906
IRC/Discord/Slack related to the languages you're interested in.

The C# Discord is pretty good.
>>
>>57979906
lainchan
>>
>>57979926
This

>>57979927
Melodramatic fizzbuzzers central
>>
>>57979540
>>57979721
C99 doesn't seem to have a "One definition rule" like C++.
It appears to depend on "Linkages of identifers". Which there's external, internal, and none.

2. In the set of translation units and libraries that constitutes an entire program, each declaration of a particular identifier with external linkage denotes the same object or function. Within one translation unit, each declaration of an identifier with internal linkage denotes the same object or function. Each declaration of an identifier with no linkage denotes a unique entity.

static does internal.
extern does external.
Functions without static or extern are extern.
And the moneyshot "If the declaration of an identifier for an object has file scope and no storage-class specifier, its linkage is external."
storage-class specifiers being extern, static, typedef, auto and register

that seems to be it

>>57979924
does something like this work
int func(type& val) {...}
func(array[i]);
>>
>>57979721
So what's the difference between a variable declaration and definition in C?

Because in C++ they seem to be the same thing.
>>
>>57979926
>x Discord
>good
lmao
>>
>>57979975
>each declaration of a particular identifier with external linkage denotes the same object or function
Thanks.
>>
File: Capture_comp.jpg (111KB, 903x723px) Image search: [Google]
Capture_comp.jpg
111KB, 903x723px
>>57979997
section 3.2 of C++11 standard is pic related

so linkage-specifiers like static and extern bypass the one definition rule it what I took from this
>>
>>57979924
>But can you do that with arrays or no? My attempts to do it with an array sorta work, as in I get a parameter with the correct value but it's still working as pass by value.
Maybe you should post what you're doing then.
#include <vector>
#include <iostream>
void addOnePtr(int &y) // y is a reference variable
{
y = y + 1; //references don't need dereferencing
}
void addOneRef(int* y) // y is a int pointer
{
*y = *y + 1; //with a pointer we have to dereference the variable
}

int main()
{
std::vector<int> v;
v.push_back(0); //added first so it's v[0]
v.push_back(1); //v[1]
v.push_back(2); //v[2]

addOneRef(v[0]);
addOnePrt(&v[0]);
addOneRef(&v[0]);

addOneRef(v[1]);
addOnePtr(v[1]);

addOneRef(v[2]);

for(int i=0;i<3;i++)
{
std::cout<<v[0]<<v[1]<<[2]<<endl;
}
return 0;
}

See this example. It should print "333".

I haven't tested it. Not on a computer where I could easily do that.
Maybe this will help you understand? Unless I messed up.
>>
>>57980056
correction, 3.1(.2)
>>
>>57980064
   v.push_back(0); //added first so it's v[0]
v.push_back(1); //v[1]
v.push_back(2); //v[2]

Stupid of me to make the index and the value the same. Should have gone in reverse order or used higher values.
>>
>>57979891
It's the best general purpose imperative language, purely in terms of its qualities as a language (meaning, not including things like portability)
>>
>>57979975
>>57980064
welp, figured it out. really small syntax error
thx 4 the help anons
>>
>latest version of windows10 insider bash now supports ghc
>>
>>57980368
The latest version of Windows 10's bash now supports the GHC.
>>
I'm making a customizable new tab page that I'm going to put on GitHub and the Chrome Extension Store eventually. I wanted some feature requests. Trying to make it lightweight (using vanilla JS, CSS, and HTML)

Currently on my radar:
-a parser (in Python or Ruby) to convert the bookmarks (in a txt file) to HTML
-a method to edit the page within the browser
-keyboard shortcuts (using a txt file)
-names for each bookmark and folder
-folders for bookmarks
-search engine (Google or DDG)
-builtin themes
-builtin backgrounds
-clock
-todo list with two-way sync with Google Calendar
-weather
-unread email count?
-stock quotes

So, yeah, give me some feature requests. If you were using a new tab page, what would you want it to act like?
>>
>>57980408
insider only
>>
>>57979997
thought that was asking for the difference in C++
but in C "A definition of an identifer is a declaration for that identifier that: -- for an object, causes storage to be reserved for that object; -- for a function, includes the function body; -- for an enumeration constant of typedef name, is the (only) declaration of the identifier." (6.7(.5))

the picture from the C++ standard is should still show relevant examples of definitions for C though (excluding the C++ ones)

here's a link to the C99, C11, and C++11 standards if you fell like diving in
https://my.mixtape.moe/xlsbny.rar
>>
Is there any good use for C++ smart pointers with custom deleters? I've seen people use them for stuff like SDL_Texture but it's better to wrap that stuff in C++ classes anyway.
>>
>>57980414
Unnecessary.

After opening a tab, I immediately type 1-4 letters of something and hit enter to get to the information I want.

I'd rather go to my calendar for a moment than view a less-informational version cluttered by other things.
>>
>>57980473
a limited GC?
>>
>>57980488
Classes provide RAII so that's not a reason.
>>
>>57980507
no, it is a reason
>>
>>57980552
No, it's not a reason to go with smart pointers specifically because both solutions provide RAII.
>>
>>57980569
What if you have a heap that potentially has circular references?
>>
>>57980598
How is this related?
>>
>>57980609
a pointer into that heap
can't use shared or unique ptrs
>>
>>57980650
It can with a custom deleter.
>>
>>57980665
wasn't that the point
>>
>>57980769
But you can do that with a normal class.
>>
>>57980997
but you want heap gc pointers for arbitrary types
>>
>>57981122
But I'm not using a heap
>>
>>57975375

I recall you asking for CV advice in the previous thread. Here you go:

https://mega.nz/#!bBxT1L4K!ND4jN5ZhDwst0HiE77pCXePn67OoTuK7yIXfcwdVJCY
https://mega.nz/#!mRAglBLI!y0w69AKntpAR0bK9pby7TKBW0LTtqbwIhYJGal-_Jyo
>>
>>57974804
>implementing toy languages in Haskell
It's like you're me.
>>
GOD FUCKING DAMMIT

Why can't these interviewers tell the fucking truth about what they're interviewing me for. I was preparing for machine learning questions and completely froze up because they only asked unix and database questions!
>>
I can't fucking take this anymore!

It's now 100% clear to me that the only reason I managed to get my last job was sheer luck and by getting fired I permanently and irreversibly fucked myself. I'm never going to get another opportunity like that and I'm going to be an unemployed parasite living off my parents for the rest of their lives

Suicide is literally my only way out and I know that when I do that it's going to kill one or both of my parents from the grief.

Fuck my fucking boss for firing me when I was getting stuff done. Fuck my school for not preparing me for getting an entry level job and fuck god for having the gall to create me for the sole purpose of fucking me over!
>>
>>57979975
>>57980056
>>57980462
/dpt/ comes through again
>>
>>57981872
have you read SICP ;)?
>>
>>57981872
That wasn't god. That was your parents.
>>
>>57981886
yes, it was assigned reading

>>57981894
they didn't conspire to fuck my life up from its inception
>>
>>57981912
neither did god.
>>
>>57981920
You're right, because god doesn't exist.
>>
File: file.png (329KB, 612x646px) Image search: [Google]
file.png
329KB, 612x646px
https://arxiv.org/pdf/1612.03242v1.pdf

holy fug
>>
if only I could go to a job fair with a pistol against my head, find the most sentimental-looking employer and tell them that if they don't give me a job this instant, or if they try to call for help I would blow my own fucking brains against the floor and it would be all their fault

>>57981920
>>57981941
who gives a shit?! I'm trying to attach a recognizable name and identity to the amorphous machinations of fate that screwed me over again and again
>>
>>57981872
Maybe you should get another job, bro.
>>
is thenewboston's tutorials on java a good way to start. I started his playlist and have been enjoying it so far
>>
>>57981962
Jesus Christ, is that legit?
>>
>>57982010
It's very much legit.
>>
>>57981986
gee, what the fuck do you think I've been trying to do for the past four months you monumental dipshit?

I've been applying again and again and failing each and every fucking time. sometimes I get to the second stage, but most never contact me again. of course, most firrst stage interviews are fake because they're really just recruiters whose only purpose is to filter out applicants before they're even considered by the company for interviews.

the whole system is a gigantic clusterfuck designed specifically to screw over recent graduates but especially ones like me!
>>
It's true, school doesn't prepare you for real life programming, they usually just shove language concepts at you and then feel good when a few people get A's because they've been programming since they were 12, the rest of the class is lost 'cause they haven't taught shit, only expecting everyone to "get it". Atleast HtDP is "systematic", but nobody wants to use that book because it doesn't teach whatever hip fad language is popular today
>>
>>57982034
I still think that getting a job should be your first priority.

I posted some resources earlier that might be of help to you: >>57981336

>>57982041
I love HtDP.
>>
>Windows 10
>Python 3.5.2 IDLE
>http://www.greenteapress.com/thinkpython/swampy/install.html

How the fuck do I install it, fuck. Could anyone paste my exact steps include what I type in terminal?
>>
So... Why do every jobs feel completely retarded and useless?

How do I create my own business?
>>
File: bbe778ff39ce5c0dadc549c474025c4c.jpg (893KB, 4128x2322px) Image search: [Google]
bbe778ff39ce5c0dadc549c474025c4c.jpg
893KB, 4128x2322px
>>57982099
>Pythong on Windows
>anything on Windows except .NET
>.NET
>>
>>57982113
>provide something people are willing to pay you for
>charge them
>pay taxes
business
>>
>>57982099
try this
https://pip.pypa.io/en/latest/installing/
and then if you get pip installed then
>pip install swampy
"If that doesn't work, or you don't have pip, you can downoad the zip file from the Cheese Shop and and unzip it. Cd into the directory it creates and run this command:"
>python setup.py install

an elevated CMD is probably needed
>>
>>57981726
>programmer says he knows machine learning
>can't fucking navigate a server or query a database for information
>>
>>57982099
In GHCi this is just
:! pip install swampy
>>
Hey, /dpt/, I need to learn C# for a job. Any suggestions?
>>
>>57982213
Quit?
>>
>>57981726
>they interview me for a programmer job
>I'm hired as a system analyst instead
sheeeeeeeeeeeeit
>>
I give up.

kill me. Shoot me in the fucking head. Shove me out of a goddamn window. I'm done.

4 months unemployed, every potential opportunity failed, most of the time I don't even get past the first interview.

I have no viable skills, a speech impediment that makes me look retarded (which I probably am), am personally unlikable which will cost me any job I do manage to get in a matter of months.

I wasn't meant to work. This was all a big fucking mistake from the moment I was born and I never should have lived to adulthood but here I fucking am. Unemployed. Unemployable. A parasite.


I know for a fact that the living room window opens wide enough for me to jump out because I've tried it before. That's my fucking exit strategy, hopefully there isn't a fucking afterlife!
>>
File: file.png (890KB, 922x855px) Image search: [Google]
file.png
890KB, 922x855px
>>57981962
what the fuck
>>
>>57982213
Rob Miles' Yellow Book if you don't know shit about C# or programming. C# Player's Guide if you know some shit about programming but nothing about C#.

Look for SO answers by Jon Skeet. Consider buying C# in Depth by Jon Skeet. Praise be unto Jon Skeet, lord of C#.
>>
>>57982247
Have you thought about getting another job?
>>
>>57982249
It's the fucking singularity, I know it.
>>
>>57982251
Thanks anon.
>>
>>57982161
What are things people are willing to pay for?
>>
>>57982247
what type of job are you a programmer? why don't you get interviews? have you tried a working internship? do you have any programming projects online? can you even program?
>>
>>57982258
Maybe I should devote the rest of my life to tracking you down and taking you with me
>>
>>57982284
But I don't need a new job, Anon. I'm a doctor.
>>
File: lucice-brac.jpg (218KB, 730x457px) Image search: [Google]
lucice-brac.jpg
218KB, 730x457px
Ok, you fucks.
I will push into Java. Is this book selection good and in good ORDER?
Can I do this in 6-12 months after I come form work and during weekends? I am el. engineer btw (know a bit of Python, great eye for design, shit in JavaScript).
Should I add Pragmatic Programmer and Clean Code?
(plz no meme-courses)

1. Head First Java, 2nd Edition, Sierra
2. Core Java Volume I--Fundamentals (10th Edition), Horstmann
3. Head First Design Patterns: A Brain-Friendly Guide, Freeman
4. Effective Java (2nd Edition), Bloch
5. Core Java, Volume II--Advanced Features (10th Edition), Horstmann
6. Algorithms (4th Edition), Sedgewick
7. Code Complete: A Practical Handbook of Software Construction, McConell
8. become motherfucker that moves around europe making sick money and later start a business with actual employees and shit just so I can buy a car trough my firm and avoid taxes wherever possible
>>
>>57982283
>what type of job are you a programmer?
literally anything, but I'm looking for web dev positions

>why don't you get interviews?
because most companies want years of experience, especially with databases

>have you tried a working internship?
I've had several, but I shouldn't be doing that as a recent graduate

>do you have any programming projects online?
I have my senior design project. Nobody cares

>can you even program?
yes
>>
>>57982278
If you ask this question, you are not business material.
>>
File: hb-pencil-713.jpg (22KB, 600x400px) Image search: [Google]
hb-pencil-713.jpg
22KB, 600x400px
>>57982284
Post a pic of yourself anon
>>
>>57982172
Pip comes installed with Python, but says
>>> pip install swampy
SyntaxError: invalid syntax

When I type this in IDLE.
What do?
>>
>>57982317
Life is meaningless, should I kill myself?
>>
>>57982310
That is one weird photograph.
>>
>>57982327
typing it into the idle? nigger type into your command prompt make sure pip is in your systems path.
>>
>>57982346
Brač has very clean sea, and there might (99,99%) be some filters here

just answer my questions, please
>>
>>57982247
> I know for a fact that the living room window opens wide enough for me to jump out because I've tried it before.
Don't do that. You can end up paralized but not dead. You will not be able to even kill yourself anymore after that.
>>
File: Untitled.png (852KB, 1404x681px) Image search: [Google]
Untitled.png
852KB, 1404x681px
>>57982249
i think this is the most enlightening experiment

all these networks are doing is parametrizing a latent data manifold, it's really impressive but it's not magic like >>57982274 seems to think
>>
>>57982360
Do I simple start CMD with clicking on pip.exe?
Cause when I do, the terminal is not accessible.
>>
What kind of python coding would be needed for a job in an IT support/engineering job? I work in the area of video editing/VFX engineering (hardware/server/network management) and a listing came up for a position that lists "Knowledge and experience of python is an advantage" as a requirement. I know how to use python in terms of scripting but can't code in it. Would I be able to get away with saying I know it and then learn what I would need to should I get it? The job wouldn't be starting til mid January.
>>
>>57982251
https://codeblog.jonskeet.uk/
Choice quote:
>I won’t personally speak in any white-male-only panels of three people or more. Ideally, I’d like to see efforts for there not to be any such panels.
>>
Realtalk: If I take an internship after having graduated and held a real job, will I be unemployable after that?

Furthermore, will I be seen as overqualified for an internship?
>>
>>57982399
>...advantage" as a requirement
wat?

> Would I be able to get away with saying I know it and then learn what I would need to should I get it?
yeah, do that
get some book on OOP, some algorithm crap, some design pattern book and you are golden
>>
>>57982395
in the start menu right click on command prompt and launch as admin then navigate to the folder with pip and the run it

it's best to put pip in the %Path% but you may not need to
>>
>>57982392
IT'S FUCKING MAGIC AND YOU KNOW IT
>>
>>57982408
>one single line invalidates absolutely anything else the guy has to say

C'mon dude.
>>
>>57982034
>>57981872
Anon I'm genuinely interested in what you're doing wrong so I won't have to repeat your mistakes.

So tell me everything you do so I can cross-reference with successful people.

Also how would you describe your programming experience?
Are you knowledgeable on many different things related to programming like networking, UI/rendering, offline-work backends etc?
How would you consider your general computer skills, things like electronics or arduino, operating system usage (sysadmin stuff) etc?
Do you only ever modify code or have you written projects for yourself from the ground up?
What was your previous job?
Do you ever face something in /dpt/ that you don't understand which isn't language specific? (so that's excluding not understanding whatever random functional programming language someone is writing averages of integers in)
Where did you learn what you know from?
Would you consider yourself a practical person who employs philosophies like divide and conquer (just to name one) or do you plan out everything ahead of time and when you run into a problem you just randomly prod?
Do you consider yourself to have a good intuition for where what issues may appear?
What do you feel is the weakest part of the interviews you have had? (aside from the presentation of yourself as a functional human being, everyone here would consider that bad)


Anyone else may answer too of course but I'd apprechiate if you mention your interview success rate and approximate sample size, how high you've been aiming (entry level programmer vs senior developer etc) and anything you think is relevant.
And of course you could just post because it's fun.
>>
>>57982399
Depends on who you're working with. You will find that the more the company works outside of python the more likely it is that the python scripts are just straight procedural code or using some GUI library simply for convenience.

If it's likely they do a lot in python then you can't really be so sure.

But as with every OOP-supporting language the inquisition is always pounding at the door to try and root out any sanity.
>>
File: angry reddit frog.jpg (5KB, 252x161px) Image search: [Google]
angry reddit frog.jpg
5KB, 252x161px
>>57982408
DELET

(He's definitely being unreasonable/sipping the kool-aid a little too frequently but his answers and knowledge are top-notch)
>>
>>57982424

Thanks. Based on the listing and what I know of the company its mainly a junior tech support/monkey job so I wouldn't imagine I'd be creating any code just implementing scripts written by the more senior guys. Knowing what the scripts actually do and how to read or modify them is probably the most important part.
>>
File: kawaii question.gif (994KB, 241x200px) Image search: [Google]
kawaii question.gif
994KB, 241x200px
"(A*B*C)*(A*B*C)*(A*B*C)" Is this a sum of product?
>>
>>57981995
anyone?
>>
>>57982427
Well, it states it has successfully installed swampy, however when I try to import swampy.TurtleWorld

I get

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import swampy.TurtleWorld
File "C:\(me)\programs\Python3\lib\site-packages\swampy\TurtleWorld.py", line 8, in <module>
from Tkinter import TOP, BOTTOM, LEFT, RIGHT, END, LAST, NONE, SUNKEN
ImportError: No module named 'Tkinter'

Tried pip install Tkinter - there's no such thing.
>>
>>57982519
it's fine
>>
>>57982507
It's a string.
>>
>>57982519
>Angular
>"Windows"
>Java
It's perfect, don't worry about anything.
>>
>>57982499
Very true.

My personal favourite part is this:
>However, over the last couple of years as feminism has become an increasingly important part of my life

Anyone who has only just started thinking these things are important in the last 'couple of years' is not a feminist OR egalitarian: they are just bandwagon'ing.
>>
>>57982507
No, it's a product.
>sum of a product
makes no sense.
>>
>>57982534
the python installer for windows might provide an optional "Tcl" or "Tk" that will fix that
>>
>>57982559
(A*B*C)^(1+1+1)
Clearly it's a sum
>>
>>57982553
Maybe even less bandwagoning and more the tried-and-true practice of CYA; just smile and nod and do you.
>>
>>57982559
>c=a*b
Product
>d=c+a+b
Sum of a product?
>>
>>57982580
Hm,
>>>import tkinter
>>>tkinter
results in message showing that I have this module installed and the path.

However, I still get the message above when I try
>>>import swampy.TurtleWorld

What should I do now? This is not supposed to be that hard.
>>
>>57982591
this is not how these words work
>>
>>57982559
"sum of products" is a boolean expression with the form ΣΠ(b_i)

all boolean expressions can be expressed in this form

(a&&b&&c)&&(a&&b&&c)&&(a&&b&&c) = (a&&b&&c)

so it's a sum of prod but the top index of the sum is just 1 (teehee)
>>
>>57982610
no
a*b is a product of factors
c+a+b is a sum of terms
>>
>>57982541
is that sarcasm?
>>
>>57978411
errors = 1;
for(lambda fun : allYourProcesses) {
errors &&= fun.execute();
}
>>
>>57982618
reading through https://wiki.python.org/moin/TkInter
Step 2 mentions defining environment (?) variables you could see about that
>>
>>57982657
Yeah but maybe it's short for 'sum of a products terms'?
It obviously doesn't make conventional sense.
>>
>>57982632
"sum of products" makes more sense than "sum of a product"
>>
>>57982675
maybe if you want to redefine words to suit a context you should also provide the context
>>
>>57982675
also
>a products terms

no
>>
>>57982701
>redefine words
It's not a redefinition of words. It's a word being omitted. Common in languages.
>>
>>57982408
>someone's views on something unrelated to a technology invalidates their technical prowess

Go back to tumblr, faggot.
>>
>>57982719
Fucking autists. Hitler was right.
>>
>>57982720
>>57982743
Well, if you don't WANT to make yourselves understood...
>>
>>57982672
Doing tkinter._test()
Works fine. But this is the lowercase variant (import tkinter).
>>>Import Tkinter
makes nothing. Renamed tkinter into Tkinter at /lib, importing module succeded. Tried to import swampy.TurtleWorld, now it says I have Tkinter and lack module Gui, God damn it.

Should I just delete it all and get python 2.whaterver?
>>
>>57982743
Stop this racist bullshit please.
>>
>>57982774
maybe
btw it seems that the version on pip might only work for python2

so either jump ship to python2 with pip
or
download the python3 zip of swampy at the bottom of the swampy homepage and deal with installing that with the "python setup.py install"
>>
>>57982817
gas the kikes race war NOW
>>
>>57982839
I know you think this is funny but it isn't.
please fucking stop.
>>
>>57982743
Curious that no one has ever said this to my face.
>>
>>57982837
>download the python3 zip
Did that in the first place before coming here.
Maybe, you could also so nice to tell me exact steps for that?
So, I donload the zip, then what? I tried multiple things, again, importing, renaming, pip'in, putting it simply into different directories.

What what you say should I do with that zip?

After I am done, it's either working either I go python 2.
>>
>>57982727
Where did I say anything about his technical prowess?
>>
Multiply two numbers without using multiplication
firstnum = input("enter your first number")
secnum = input("enter your second number")
firstnum = int(firstnum)
secnum = int(secnum)
for i in range(firstnum):
secnum = secnum + secnum
print(secnum)

for some reason it doesn't work
enter your first number10
enter your second number10
10240

how would you guys do it in your language and maths isn't my strong suit, can anyone spot why this isn't working?
>>
>>57982940
Multiplication (by an integer at least) is just repeated addition.
>>
>>57982953
Not necessarily, it can be a couple of bitshifts.
>>
>>57982940
You end up doubling num2 num1 times
Try using a separate variable to hold the final answer
Also, you can do int(input("..."))
>>
>>57982988
did not know you could do int(input("")) that will come in useful
>>
>>57982981
With bitshifting it also requires addition, but that would be better.
>>
Realtalk: If I take an internship after having graduated and held a real job, will I be unemployable after that?

Furthermore, will I be seen as overqualified for an internship?

I need to know if I'm going to have any chance of surviving as anything other than a parasite
>>
>>57982847
>>57982864

hitler was right in only two things
1. jews actually did back stab germany with their commie revolution
2. that paratrooper attack on forts in belgium
>>
>>57983025
Have you thought about getting a job? It seems like the obvious solution.
>>
New thread:

>>57983026
>>57983026
>>57983026
>>
>>57982865
>download
>extract
>copy the swampy-2.1.5 folder to C:\(me)\programs\Python3\lib\swampy

and uninstall the version on pip however that's done

then setting the %PYTHONPATH% environment variable to have
C:\(me)\programs\Python3\lib\swampy

because swampy likes to import Gui from the local folder and fails
>>
>>57983043
thanks, senpai.
>>
>>57983062
How do I set up the variable?
Is it again done inside IDLE shell, or with IDLE Gui? Cause before posting here I was figuring out how to set pathes and came over some commands which did not work for me.
>>
>>57983171
On Windows 7
Control Panel => System (view by large icons) => Advanced system settings => Environment Variables => New System Variables => PYTHONPATH and value with the path

probably similar on w10

there's always this fallback tho
import sys
sys.path.append('the swampy folder')
>>
>>57983223
Thanks, senpai, but that was the command which was not working for me.

Also
>pip uninstall swampy
It fails with an error stating swampy is currently being used for another application (however I have closed all IDLE-associated windows).

Okay, I reboot my PC, then try it once again.
And then I mostly likely fail and switching for Python 2. Thank you for you help! Would tell in the next thread if I succeeded, but not bothering you anymore, have your time.
Thread posts: 318
Thread images: 27


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