[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 previous thread >>55367288
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: 25
File: dpt.jpg (198 KB, 720x720) Image search: [Google]
dpt.jpg
198 KB, 720x720
/dpt/ daily programming thread

previous thread >>55367288

What are you working on /g/?
>>
>>55375878
that's a man
>>
>>55375940

worse. that's a nigger
>>
>>55375878
>3DPD
awful thread
>>
rewriting the GNU/Linux kernel in OCaml
>>
>305 posts
What the fuck are you doing?
>>
>>55376214
github link?
>>
>>55367288
Real /dpt/ is here
>>
>>55375878
Is it faster to check if vector has values, or just add and sort?
>>
>>55375878
>dpt.jpg

Thank you OP.
>>
File: halp.png (34 KB, 647x800) Image search: [Google]
halp.png
34 KB, 647x800
>>55375878
am try python
am make number counter
am going to try make number counter repeat numberchoice() block after done count number
problem though
when upordown variable is of used outside of numberchoice() block it is say that it not defined
I try make upordown global variable
cannot since it is storing input at specific time
wat do
>>
>>55375878
Can you please put /dpt/ in the title so that my filter catches it? Thanks guys.
>>
>>55375878
who is this? she looks like my ex ;-; even wearing the tumblr af choker, except she wasnt remotely into programming.
>>
>>55375878
>/dpt/ isn't even in the title
You really fucked up you idiot.
Guess we need a new thread now.
>>
>>55376729
See >>55375964
But yes, the trapfag is retarded.
>>
>>55376660
just initialize it outside numberchoice and pass it as a parameter to it
>>
>>55376660
what the fuck is with all the time.sleep(1)'s?
>>
>>55376935
his computer is lazy
>>
>>55376935
so that it doesnt all appear on screen at once
>>
Now is that a trap or is it a grill?
>>
File: smooth.gif (159 KB, 652x452) Image search: [Google]
smooth.gif
159 KB, 652x452
>>55376935
>>
>>55376660
>jap locale
stop playing h-games anon
>>
>>55377130
>programming thread
the fuck do you tihnk
>>
>>55376660

like so:

def numberchoice(upordown)
# func def

upordown = []
numberchoice(upordown)

#rest of main func
>>
File: 1466532967522.jpg (41 KB, 394x353) Image search: [Google]
1466532967522.jpg
41 KB, 394x353
>>55377130
>women
>programming
>>
How much experience and which qualifications did you have for your first programming job.
>>
int main( ) {
cout <<< ILIKECOCK XDDD >>> endG;
}


why won't this fucking compile? I've tried getting this to compile for 26 fucking days now.
>>
File: uh.gif (52 KB, 357x200) Image search: [Google]
uh.gif
52 KB, 357x200
>>55377147
u-uh
it was innocent jrpg's i swear

>>55377205
thanks anon
figured another way i could do it is by importing the block from another script each time the counter stopped
>>
>>55377285
I've seen that a few times.

But one of them was a dirtbag smoker and the other one thought she was beautiful by not wearing any makeup. I detest such a thing.
I understand her, but I prefer painted faces. Just like you, it seems, because the face u posted is painted y'know
>>
File: 1465255210504.png (36 KB, 330x422) Image search: [Google]
1465255210504.png
36 KB, 330x422
Repostan:
Anything like this https://hbpms.blogspot.com/ for someone who wants to learn programming and some computer science? I took several courses during school, but don't know where to go from there.
>>
>>55377343
Are you saying that this linux can run on a computer without windows underneath it, at all ? As in, without a boot disk, without any drivers, and without any services ?

That sounds preposterous to me.

If it were true (and I doubt it), then companies would be selling computers without a windows. This clearly is not happening, so there must be some error in your calculations. I hope you realise that windows is more than just Office ? Its a whole system that runs the computer from start to finish, and that is a very difficult thing to acheive. A lot of people dont realise this.

Microsoft just spent $9 billion and many years to create Vista, so it does not sound reasonable that some new alternative could just snap into existence overnight like that. It would take billions of dollars and a massive effort to achieve. IBM tried, and spent a huge amount of money developing OS/2 but could never keep up with Windows. Apple tried to create their own system for years, but finally gave up recently and moved to Intel and Microsoft.

Its just not possible that a freeware like the Linux could be extended to the point where it runs the entire computer fron start to finish, without using some of the more critical parts of windows. Not possible.

I think you need to re-examine your assumptions.
>>
>>55377372
Where did this copypasta come from?
>>
>>55377135
lol
>>
>>55377410
rapidshare
>>
>>55377315
>
int main( ) {
std::cout << "ILIKECOCK XDDD" << std::endl;
}
>>
>>55377508
I forgot the return value but whatever
>>
File: 1467469676928.png (197 KB, 1708x246) Image search: [Google]
1467469676928.png
197 KB, 1708x246
What should I learn if I want to get into programming operating systems, cracking / reverse engineer software and just knowing how the inner workings of a pc work (memory, cpu) etc.

I was referenced by some anon to assembly. He also said ''you need a lot of strong knowledge in memory and data theory too''

But besides that, where should I start? Been learning c++ for a while if that counts.
>>
>>55377664
If you want to learn about low level stuff like that C++ is a waste of time.
I'd recommend C for starters.
>>
>/dpt/ still stumbling around in the dark
Nothing ever changes.
>>
>>55376134
>being this autistic
>muh 2dpd
>>
>>55377696
The only thing that is not a problem with the following link to a new thread is about the possibility of a new thread in the future. If you have a good idea of what you want to do with it but it is not an option then you will have to do it in the future.
>>
File: 1464435955140.jpg (235 KB, 600x800) Image search: [Google]
1464435955140.jpg
235 KB, 600x800
>>55375878

>shit OP image
>3dpd

fuck off.
>>
>>55377793
>being attracted to women
kys
>>
>>55377776
>/dpt/
>not being autistic

fuck off
>>
>>55377813
>kys
Kill yourself.
>>
>>55377869
kys
>>
>>55377886
>kys
Kill yourself.
>>
>>55377918
kys
>>
>>55377945
>kys
Kill yourself.
>>
quality thread guys
>>
I WILL KILL ALL OF YOU IF YOU DON'T STOP SHITTING UP MY DPT MOTHERFUCKERS
>>
File: quality dpt discussion.png (61 KB, 485x675) Image search: [Google]
quality dpt discussion.png
61 KB, 485x675
>>55378060
These fags turn up and ruin every thread.
I'm confident they don't even know how to program in anything but Java
>>
My brother is taking a python tutorial online and asked me for help. It wanted me to take a string as input and reverse it using a for loop without using the reverse command or ::-1. No idea how to do it, and it makes no practical sense why it would be necessary.
>>
>>55375878
>daily phaggot thread
>>
>>55378079
No you won't. You're going to post angry screeds on 4chan, then rub one out to your mouse mat.
>>
>>55378095
>My brother is taking a python tutorial online and asked me for help. It wanted me to take a string as input and reverse it using a for loop without using the reverse command or ::-1.

>No idea how to do it, and it makes no practical sense why it would be necessary.

>No idea how to do it
>it makes no practical sense why it would be necessary.

This is why everyone hates snekfags.
>b-but there's a library for that
>>
RX480 or GTX1060?
>>
>>55378095
Oh god, you're like one of those autistic fucks who get upset when they're asked to solve problems at programming interviews.

Yes, the problem has no practical applications in the real world, but it's to test your thinking and basic grasp of programming, you dumbass.
>>
>>55378095
You're an autistic faggot, but I pity you enough to help. Try this:
def reverse(text):
if len(text) <= 1:
return text
else:
return reverse(text[1:]) + text[0]

It's not even fucking rocket science.
>>
I just finished making a good unique applications. How do I market the shit out of my software?
>>
>>55378203
>uses the reverse command
You're nearly as autistic as he is.
>>
>>55378095
Indeed. You can't even reverse a string in-place in Python. What a retarded language.
>>
>>55378220
>doesn't know how to read
A real pity
>>
>>55378220
Wow, anon. Were you hit on the head as an infant?
>>
>>55378220
It's called recursion, dumbass.

>>55378225
You can with reversed() or ::-1, but the tutorial apparently didn't want that. It's not the language's fault.
>>
File: 1464438022987.png (2 MB, 2500x2500) Image search: [Google]
1464438022987.png
2 MB, 2500x2500
>>55377813

If Hilda doesn't make you change your cock sucking ways then I don't know what will anon, you are clearly lost.
>>
>>55378270
>fat
>>
>>55378248
Both create a copy of the string,
>>
-
-
where can i find the source code of the python programming language?
>>
>>55378095
looks stupid, desu, but it works. [::-1] would be the pythonic way of doing this

def reverse(text):
result = ''
for i in range(len(text) - 1, -1, -1):
result += text[i]
return text
>>
>>55378095

String moo = "";
String cuck = "java";

for(int i = cuck.length();i > 0;i--)
{
moo += cuck.charAt(i);
}

System.out.println(moo);

>>
My first programming project. I'm writing a script in Python that interprets well-formed-formulas in first order predicate logic with quantification, then I'm going to expand it to cover modal logics. I might try to make a website out of it for shits and giggles
>>
>>55378331
Source?
>>
>>55378315
doesnt work fag

print reverse("abcdef") outputs abcdef
>>
>>55378095
foldl [] $ flip (:)
>>
/dpt/ should start posting pictures or videos of their applications showing what it does and what they are working on. Lets make /dpt/. great again
>>
>>55378362
>quadratic
You're fired!
>>
>>55378361
should be
return result

not
return text
>>
>>55378203
>python
>recursion
kek

>>55378095
not a homework thread, fag
>>
>>55378376
>>55378315
better way
def reverse(text):
result = ''
for i in range(len(text)):
result += text[len(text)-i-1]
return result
>>
>>55378373
I messed up anyway, got the order of the arguments to foldl wrong.

A corrected version should only take linear time, though.
>>
>>55378373
That's linear though
>>
File: Babies-Smiling-150923.jpg (38 KB, 600x793) Image search: [Google]
Babies-Smiling-150923.jpg
38 KB, 600x793
>>55378315
>return text
Where did you learn programming, anon?
>>
>>55378419
what is programming?
>>
>>55378130
Integrated graphics?
>>
File: 117 - zvcyb.jpg (129 KB, 357x346) Image search: [Google]
117 - zvcyb.jpg
129 KB, 357x346
>>55378419
:(
>>
>>55378389
My way is the best>>55378317
>>
>>55378437
It's what you see on television.
>>
File: 136 - Z5ZOv.jpg (52 KB, 397x300) Image search: [Google]
136 - Z5ZOv.jpg
52 KB, 397x300
>>55378389
nice one
>>
>>55378241
Yes. I bled from my head to the floor, I even left bloodstains everywhere.

Now I hate everybody.
>>
>>55378344
Trust me it's not worth sharing
>>
>>55378448

its the same thing you fag
Also
>calling the .length method in each iteration
>calling a method to access array positions
>>
>>55378485
Nothing wrong with either of those things. That is the standard way of doing things in Java
>>
>>55378473
FAGGOT
>>
File: scrot.jpg (193 KB, 1900x944) Image search: [Google]
scrot.jpg
193 KB, 1900x944
>>55378525
ok here you go...
>>
>>55378568
>.java
Almost had me anon
>>
>>55378568
>>55378576
I love the verbosity of java it's great it is like writing a long Lord Of The Rings novel feels good man
>>
>>55378525
It's my first real script and I haven't even started to optimize it yet so i'm insecure )^:
>>55378568
ebin
>>
>>55378568
That's got nothing to do with predicate logic >:(
>>
def has_errors(val):
if val == true:
return true
else:
return false
>>
Now I remember why I stopped lurking these threads. Even when I expect nothing, I still get disappointed.
>>
File: how about wow.jpg (36 KB, 600x409) Image search: [Google]
how about wow.jpg
36 KB, 600x409
>>55378568
>>
>>55378647
>>>reddit
>>
>>55378642
 
while (1):
goto reddít;
>>
>>55378612
what are you trying to do anon?
>>
>>55378642
Parents said the same thing about you, I'm sure
>>
Write a program that prints out in range if a number is between 1 to 5 inclusive


import Scanner;
import java;

Scanner input = new Scanner(System.in.out);
int num = input.nextInt();

if(num == 1)
{
System.out.println("in range");
}

if(num == 2)
{
System.out.println("in range");
}

if(num == 3)
{
System.out.println("in range");
}

if(num == 4)
{
System.out.println("in range");
}

if(num == 5)
{
System.out.println("in range");
}

>>
>>55378653
>>55378642
>>
>>55378676
TOPEST KEK

def TOPEST_KEK(YOUR_FUCKING_NUMBER):

if 1 <= YOUR_FUCKING_NUMBER <= 5:
print ("IN RANGE")
>>
>>55378700
>if 1 <= YOUR_FUCKING_NUMBER <= 5:
>java
>>
>>55378700
Whoops, you forgot indentation so your code doesn't actually work
>>
>>55378700
>not having an else command
Joke could have been much better 2/10
>>
>>55378735
that's not java you cock sucking faggot.
it's python

>>55378755
suck it

>>55378756
>else
for what? its not specified in the problem
>>
>>55378676
>>55378676
def is_it_in_range(num):
if num >= 1 and <= 5:
print "not in range"
else:
print "in range"
>>
>>55378865

def is_it_in_range(num):
if 1 <= num <= 5:
print "in range"
else:
print "not in range"

>>
>>55378735
>thinks python is java
wew lad
>>
>>55375878
What's wrong with this?

 
def A(m, n, s="%s"):
print s % ("A(%d,%d)" % (m, n))
if m == 0:
return n + 1
if n == 0:
return A(m - 1, 1, s)
n2 = A(m, n - 1, s % ("A(%d,%%s)" % (m - 1)))
return A(m - 1, n2, s)
>>
>>55378913
What the fuck does % do in snektong?
>>
guys i am trying to choose a university for a cs degree (4years), is is better to choose one that has a big range of classes but it is hard to find a job in the city it is located OR one that focuses on Java and has a smaller range of classes BUT there are a lot of jobs and i believe it will help me gain experience ? ,
>>
>>55378881
def is_in_range(num):
if num in range(1, 6):
print('in range')
else:
print('not in range')
>>
>>55378933
it's modulo or, in this case, string formatting syntax
>>
>>55378913
first of all if you really want to read this pile of shit try using variable names that actually make sense
>>
>>55378940
What about a course that includes a year in industry?
>>
>>55378940
Learning to program is easy. Choose a course which teaches how to apply programming - AI, robotics or anything to do with maths.
>>
>>55378976
Rude
>>
>>55378642
My exact thoughs
>>
>>55378884
>>55378851
That's what I said you fucking retard, the program of >>55378676 is in Java.
>>
what is your opinion on compscientists and compsci students that use a macbook?
>>
>>55379044
Linux is my litmus test for good programmers.
>>
>>55379044
Alpha they have gfs
>>
>>55379044
Why do you care so much?
>>
>>55379044
Casuals, probably took CS because of the learn2code meme
>>
How do I simplify this?

total = total * (1.0 - min(30, reduction) / 100.0)
>>
>>55379044
They're not as autistic as most comsci students
>>
>>55379067
maybe
total *= (1.0 - min(30, reduction) * 0.01f

*0.01 is a bit faster than dividing if im correct
>>
I'm going through a file in python with a for loop:
for line in file:
however once I reach certain lines I need to get the line under it. But using line.readline() to consume the current line gives me an error. Is there a better way to do this?

>please use an anime image next time OP
>>
>>55379170
what error are you getting?
>>
File: 1464441511273.jpg (251 KB, 890x1150) Image search: [Google]
1464441511273.jpg
251 KB, 890x1150
>>55378279

The right kind of fat anon.
>>
>>55379218
Python doesn't want you using myfile.readline() when you're looping through a file with a for loop.

 ValueError: Mixing iteration and read methods would lose data
>>
>>55379243
could you post your code?
>>
>>55379315
 
def read_file(filename, i):

myfile = open(filename, 'r+')
num = 1

entries = []

for line in myfile:
if line[1] == '-':
num += 1
#consume the line with date
myfile.readline()

else:
print line



I have a file with entries separated by '-----' then the next line is just a date which I don't want.
I need the lines starting after the date.


example file:
-------
07/02/2016
data_I_want1
data_I_want2
data_I_want3
-------
>>
>>55378658
>weak typing
>goto
wew
>>
>>55378676
template <int n>
auto fcn() -> std::enable_if_t< (1 <= n && n <= 5) >
{
std::cout << "In range.";
}


:^)
>>
>>55376660
upordown is a local variable to the numberchoice function and is not available outside of it. Maybe return it and the assign it when you call the function
>>
>>55379362
I don't think enable_if_t works as a trailing return type
>>
>>55378095
>,[>,]<[.<]
>>
>>55379362
>using the smiley with a carat nose
>>
>>55379353
https://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects
you could have googled it.
>>
>>55379392
Yeah I already fixed it. I was being lazy.
>>
>>55379362
EXPLAIN
>>
>>55379370
Works for me.

>>55379433
Checks if it's in range already at compile time.
>>
>>55379353

This won't work. Either iterate over the file using the for loop or call readline every time you need a new line.

What you need to do is store the data that you care about in a list. To do that, read file line by line and skip the entries if the previous line was --- something like

skip_next_line = False
for line in file:
if line == '----':
skip_next_line = True
continue
elif skip_next_line:
skip_next_line = False
continue

# line now contains your data


I dont remember if line contains the newline character in the end so you might need to trim it when doing the comparisons. I hope this helps.
>>
>>55379431
writing that post and solving the captcha takes more time than googling it
>>
>>55376660
Winfags confirmed for too stupid to even program in python.
>>
>>55379466
Possibly. Who's really to say?
Maybe I just wanted to talk to some anons.
>>
>>55379362
not a c++ fag. how do you compile this shit?
>>
>>55379453
What if n is passed at runtime?
>>
>>55379505
>>55379362
I get
$ g++ -Wall -std=c++1y -o o{,.cpp}
o.cpp:2:20: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
auto fcn() -> std::enable_if_t< (1 <= n && n <= 5) >
^
o.cpp:2:31: error: expected initializer before ‘<’ token
auto fcn() -> std::enable_if_t< (1 <= n && n <= 5) >
^
>>
>>55379519
It doesn't work, it's a template
>>
>>55379530
Try including utility
>>
>>55379537
that's pretty shitty
>>
>>55379519
Can't pass at run time. :(

>>55379530
Compile with
-std=c++14
, or replace with
std::enable_if< (1 <= n && n <= 5) >::type
.
>>
>>55378964
>2016
>being bad at golph.

def is_in_range(n):print((not n in range(1,6))*"not ")+"in range"
>>
>>55379656
Objectively less readable.
>>
>>55379556
It's 2016 and C++ STILL doesn't support delaying template expansion at runtime.
>>
>>55379678
Not for people who can program, and if you're going full muh-readability fag, >>55378676 is most readable.
>>
>>55379549
what do you mean?

>>55379556
>Compile with -std=c++14
already done, didn't help, I get the same error
>or replace with
>std::enable_if< (1 <= n && n <= 5) >::type.
not sure what you mean

is c++ always this shitty?
>>
>>55379705
#include <utility>
>>
>>55379705
enable_if_t(...)
is just an alias for
typename std::enable_if(...)::type
that was added in C++14.

But if it still doesn't compile, then it might be what >>55379370 said.

This will work:

template <int n>
typename std::enable_if< (1 <= n && n <= 5) >::type fcn()
{
std::cout << "In range.";
}
>>
>>55379705
typical pythonista fagstorm
>>
I'm working on a Scheme interpreter, and I thought it would be a good idea to implement scheme macros just so I can copy paste syntax definitions from the report. Does there exist a guide to implementing R7RS macros, or an easy-to-understand implementation, and if it does exist, what is it? My best languages are Haskell, Lua, Java, Scheme, but I need to implement it in Lua, so ideally the algorithm does not use language features that can't be easily emulated in Lua.
>>
>>55379726
that worked, thanks.
>>
where do I apply to get title "world greatest brainfuck programmer"?
>>
>>55379790
>Writing languages in interpreted languages
Just out of curiosity, why?
>>
>std::vector<bool> uses single bit for each element
why C++ is so great?
>>
>>55379878
Fizzbuzz in brainfuck.
>>
>>55379897
I think that's been since changed, not certain
>>
>>55379894
I want to write a lisp machine Minetest mod.
>>
>>55379942
It hasn't, sadly.
>>
Ahh fuck, didn't know this thread existed.

http://pastebin.com/k6iHkAjS

I'm trying to cast a ray in SDL, it kind of works, but its rather jittery.

It seems to be jittery because I'm multiplying normalized_x and normalized_y. When I multiply these values by larger numbers it becomes less jittery, but the line can go inside of the box.

I don't know why, but when I don't multiply these values the program crashes.

Can somebody help?
>>
So when I have an array to a struct or class, is that array just an array of pointers or is the space for the class and struct allocated for each index of the array.
>>
File: ss (2016-07-02 at 10.15.29).png (5 KB, 248x497) Image search: [Google]
ss (2016-07-02 at 10.15.29).png
5 KB, 248x497
Cellular thingies.
>>
>>55380053
I hope you're using comonads
>>
>>55380046
It is allocated on the stack for each element.
>>
>>55380046
allocated, i think
>>
>>55380046
If you are talking about C++, elements are continuously allocated on stack. it is not an array of pointers
>>
has anyone tried making a neural network to solve captchas?
is it hard to make one from scratch?
>>
>>55380079
>>55380086
Ah thanks. Yeah that makes sense now that I think about it. You usually make pointers to classes and structs when used in another class probably for this reason. Ill just make it an array of pointers to the class/struct then.
>>
What's the easiest way to display an image in Linux/BSD? I need to display an image for about 10 seconds when my machine gets a packet.
>>
>>55380140
you can use an array of elements but store address of elements on the class that uses aa element
>>
guys, i need a good introduction to computer vision, specifically i need to find a ball in a bitmap, what should i look into?
>>
>>55380216
A university degree
>>
>>55380134
has anyone really been far even as decided to use even go want to do look more like?

but seriously, this, I wonder if it's possible
>>
>>55380134
>>55380278
Yes, that's why newer captchas are designed to be hard to recognize
>>
>>55379699
Verbose =/= readable
In fact, repeated if statements is not very readable because if you happened to forget one, it would be hard to find the bug at a glance.
>>
Working on how to design programs. I'm only 45 exercises in and getting stuck already. It's going to be a long road until I'm even a below average programmer.
>>
>>55379790
Scheme macros are just scheme functions that generate scheme code.

macro_dict = { ... }
-- macro_dict[macro_name] = macro_function
local function compile_macros (expr)
if is_list(expr) then
if is_symbol(car(expr)) then
local name = symbol_name(car(expr))
if macro_dict[name] ~= nil then
return macro_dict[name].apply(cdr(expr))
end
end
end
return expr
end


Implementing macros is actually a lot more trivial than a lot of what you have to do to implement scheme. Do you have any experience with implementing languages?
>>
>>55380378
post some code
>>
>>55380399
I'm talking about the hygienic macros specified in the revised scheme reports.

The paper "Macros that Work" describes an algorithm for implementing them, but it doesn't include some things, such as patterns and templates with ellipsis.

It is not an ordinary lisp macro where you just put a function from expressions to expressions
>>
Whats a good place to listen to some chill music while programming? Bonus points if it doesnt have any lyrical vocals. Shit's distracting.
>>
>>55380467
Though probably many of the keywords I want to define could be defined just fine with a simple macro system
>>
>>55380488
Couldn't you implement hygenic macros using non-hygenic macros? I bet somebody already has that written
>>
>>55380484
I like ZUN's OST.
>>
>>55380503
I read somewhere it's possible to implement them if you also include primitives like gensym, things for identifying whether an identifier is free, and things like that. Maybe that would be an easier path.
>>
>>55380559
free as in free variable
>>
>>55380484
https://www.youtube.com/user/ThePsychedelicMuse/videos?flow=grid&view=0&sort=p

peruse at your pleasure
>>
i'm trying to fuck this java code to output some stupid xml but it's literally outputting corrupt XML


<collection name="authors"><reference ref_id="-1_15"/><reference ref_id="-1_55"/><reference ref_id="-1_94"/><reference ref_id="-1_95"/><reference ref_id="-1_24"/><reference ref_
id="-1_96"/><reference ref_id="-1_85"/><reference ref_id="-1_97"/><reference ref_id="-1_98"/><reference ref_id="-1_35"/><reference ref_id="-1_99"/><reference ref_id="-1_38"/><re
ference ref_id="-1_39"/><reference ref_id="-1_13"/><reference ref_id="-1_44"/><reference ref_id="-1_43"/><reference ref_id="-1_45"/><reference ref_id="-1_47"/><reference ref_id=
"-1_100"/><reference ref_id<item id="-1_103" class="Publication">


you'll note that last ref_id isn't closed. something to do with stax i guess but i dunno why
>>
>>55380076
>I hope you're using meme
nice meme
>>
>>55380779
comonads are not a meme
>>
>>55380727
>i'm trying to fuck this java code to output some stupid xml but it's literally outputting corrupt XML
sounds like a nightmare
>>
Maybe I am just a dummy but I am having trouble using outside libraries for C++. I just download the files and include the directory/headers, right? I do that and it can find the header, but it cannot find all of the other includes that the header needs that are in the same folder. Does anyone know the issue?

I'm using windows 8 if that matters.
>>
>>55380811
>>55380811
according to "cloc ." this codebase is literally a million lines of code
>>
>>55380572
>lyrics

YOU HAD ONE JOB
>>
>>55380484
I shall post again
https://www.youtube.com/watch?v=u0P9u8nCFyY
>>
>>55380863
most of those don't have lyrics, idiot
>>
>>55380076
I played around a lot with the Haskell version, I'm now implementing it in various other languages; this one was C, hence no (explicit) comonads :(.

>>55380779
Fucking idiot.
>>
>>55380037
Anybody?
>>
>>55380484
Russian folk.
https://www.youtube.com/watch?v=0JQ0xnJyb0A

>>55380905
fuck this is good
>>
>>55375878
Is that book worth owning? Is it still relevant?
>>
>>55381047
If you don't already have it, buy it only for the historic value or if you want to learn C from THE K&R.
>>
>>55380854
nighmare confirmed, then

>>55380905
noice
>>
>>55380976
>C
no parametric types either
>>
>>55380976
Struck a nerve there, buddy? :^)
>>
>>55381322
His mother was a comonad
>>
Is it illegal to copy the layout of a gui of another program.
Im really feeling this one program and stealing its color and layout.
>>
>>55380727
Classic off-by-one error. You wouldn't have to pull all your hair out while chasing that bug if you bothered proving your code to be mathematically correct.
>>
>>55381322
kys (C:
>>
>>55381609
Don't they all look the same.
>>
>>55381609
As long as it's not almost exactly the same, you should be fine.
>>
>>55381631
i doubt it. it seems like a race condition


<reference ref_id="-1_58"/>
<reference ref_id="-1_59"/>
<reference ref_id="-1_60"/>
<reference ref_id="-1_61"/>
<reference ref_id="-1_62"/>
<


...


<reference ref_id="-1_97"/>
<reference ref_id="-1_98"/>
<reference ref_id="-1_35"/>
<reference ref_id="-1_99"/>
<reference ref_id="-1_38"/>
<reference ref_id="-1_39"/>
<reference ref_id="-1_13"/>
<reference ref_id="-1_44"/>
<reference ref_id="-1_43"/>
<reference ref_id="-1_45"/>
<reference ref_id="-1_47"/>
<reference ref_id="-1_100"<item
...

<reference ref_id="-1_112"/>
<reference ref_id="-1_113"/>
<reference ref_id="-1_114"/>
<reference ref_id="-1_85"/>
<reference ref_id="-1_53"/>
<reference ref_id="-1_115"/>
<reference ref_id="<it
>>
>>55381776
Why would you be concurrently writing to the same thing with multiple threads?
>>
Why do this not work in c++
struct a{
int b;
};
struct c{
a d();
d.b=4;
}
>>
>>55382019
missing semicolon after the second struct
>>
>>55375878
Where do I learn from scratch?
Is the "Programming Foundations with Python" course on Udacity a good place to start?
>>
>>55382019
>a d();
Why do people do this? In the many years of using c++, ive seen this and yet never saw the purpose of it
>>
>>55382089
sorry its there in the actual code. Still doesnt work.
the error I get is at d.b=4;
>>55382104
the initial the struct.
>>
>>55382129
I hardly used structs, so thats probably why I was confused to not see the new allocator. Forgot why you dont have to
>>
>>55382139
its not on the heap.
>>
>>55382019
what the fuck is
a d();
>>
>>55382210
d is an a struct.
>>
>>55382206
right right
>>
>>55382019
well I found the problem. its unhappy because theres no parameters.
so changing
a d();
to
a d;
fixes it. I thought if I made a constructor that didnt have parameters itd take care of it.
>>
>>55380844
If you library has a folder layout similar to this:

external-library-1.0.0
include
external-library.h
lib
libexternal-library.a


Then you must link the library as:

g++ -Iexternal-library-1.0.0/include -o program program.cpp -Lexternal-library-1.0.0/lib -lexternal-library


And include the header in program.cpp

#include <external-library.h>

int main ()
{
return 0;
}
>>
>>55382299
>I thought

there's your problem. stop doing that. read more.
>>
;AnimationState
;interpretation: number of clock ticks since the animation started
(define (clock-tick-handler ws)
(


And we're stuck
>>
>>55382360
lol how long have you been programming. This is a fairly specific case thats compiler dependent.
>>
Anonymous 07/03/16(Sun)00:53:02 No.55382406▶
I was redirected here when i started a thread about finding a bug in my python code. I am a beginner, so go easy on me.
I am trying to program a ceasarian cipher, but it only returns a blank list.
 """Ceasar Cipher code - annotated for you faggots"""
x = list(input("enter phrase to be encoded, letters and spaces only: "))
y = list(map(ord,x))#changes plaintext to ascii
n = int(input("enter ceasarian key: "))
def encodeint(y):
return [32 for i in y if i == 32] # keeps spaces
return [(i-26+n) for i in y if 122<(i+n)<149] #loops around to a if cipher goes past z
return [(i+n) for i in y if 96<(i+n)<123] #applies cipher to regular terms
return [(i+26+n) for i in y if 64<i<91] #loops forward to a if there are capital letters
encoded = (list(map(chr,encodeint(y)))) #changes ascii back to plaintext
print(y) #for troubleshooting purposes
print(encodeint(y)) #for troubleshooting purposes
print(("").join(encoded)) #returns ciphered input
>>
>>55382750
Only the first return will be executed, and it's just a list of spaces, 32 is the ascii decimal number for space.
>>
>>55380263
thanks senpai
>>
>>55382750
You should make a function that encodes one character and map it over the plaintext
>>
>>55382600
Quick question:
(on-tick tick-expr)

tick-expr : (-> WorldState HandlerResult)

tells DrRacket to call the tick-expr function on the current world every time the clock ticks. The result of the call becomes the current world. The clock ticks at the rate of 28 times per second.


and

syntax
(on-tick tick-expr rate-expr)

tick-expr : (-> WorldState HandlerResult)
rate-expr : (and/c real? positive?)

tells DrRacket to call the tick-expr function on the current world every time the clock ticks. The result of the call becomes the current world. The clock ticks every rate-expr seconds.


Means that (on-tick tick-expr) and (on-tick tick-expr 28) should be the same correct?
>>
>>55376688
thats a boy
>>
File: 1420500175412.jpg (438 KB, 900x2134) Image search: [Google]
1420500175412.jpg
438 KB, 900x2134
Uhmm, excuse me. With which one of the God tier books I should start with? I have just some experience with C. Also, I'm studying EE, if that helps. Thank you.
>>
>>55382837
Thanks. I still get a problem after i fixed that though.

This time shell says " line 9, in encodeint
elif 122<reg<149: TypeError: unorderable types: int() < list()".
That does not make any sense. I am comparing an integer to element(s) from a list, not an entire list. It does not work if i try to redefine it as int() e

>>55382993
good idea. I do not see how that would be much different from just doing it to the entire list at once though, but i will try that if i cannot solve it my way.

new (fixed) code that returns the list problem:
"""Ceasar Cipher code"""
x = list(input("enter phrase to be encoded, letters and spaces only: "))
y = list(map(ord,x))
n = int(input("enter ceasarian key: "))
reg=[(i+n) for i in y]
def encodeint(y):
if [i for i in y] == 32:
return [32 for i in y if i == 32]
elif 122<reg<149:
return [(i-26+n) for i in y]
elif 96<reg<123:
return [(i+n) for i in y]
elif 64<reg<91:
return [(i+26+n) for i in y]
encoded = (list(map(chr,encodeint(y))))
print(y)
print(encodeint(y))
print(("").join(encoded))
>>
>>55383334
[(i + n) for i in y] is the list produced by adding n to everything in y.

In general, [<expression> for <name> in <list>] will return the list where each element (bound to <name>) is replaced by <expression>, which is an expression that may or may not use the named variable.
>>
>>55383458
Fuck
that makes sense
im retarded

Tried it as specified in >>55382993 and it worked perfectly.
Thanks for all the help
Thread replies: 255
Thread images: 25

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.