[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: 332
Thread images: 48

File: 1416928491388.gif (731KB, 200x202px) Image search: [Google]
1416928491388.gif
731KB, 200x202px
Code as data edition
(reminder that lisp > hasklel)

Previous thread: >>56246290

What are you working on /g/?
>>
too early, I will be making another
>>
File: 1403766818980.gif (982KB, 400x299px) Image search: [Google]
1403766818980.gif
982KB, 400x299px
>>56251755
>>56251775
Let the butthurt flow through you
>>
>>56251748
>>56251748
>(reminder that lisp > hasklel)
If you like broken type systems that you pretend don't exist, that is.
>>
File: 1311382021277.jpg (94KB, 320x394px) Image search: [Google]
1311382021277.jpg
94KB, 320x394px
can someone explain how the wavefront algorithm actually works? it always leaves holes and I dont see how I can calculate a heat map with it.
>>
File: akari2.jpg (58KB, 514x524px) Image search: [Google]
akari2.jpg
58KB, 514x524px
I just rewrote my CGI script in C!
It's a comment board!

http://45.32.80.36/board.cgi
Please try it out and don't break it pls.
>>
File: kyouko_sad.jpg (42KB, 280x370px) Image search: [Google]
kyouko_sad.jpg
42KB, 280x370px
>>56251803
Where's the image sharing capability?
>>
Does anyone here know how to write programs in LLVM IR? How did you learn it?

I want to learn how to write it by hand in preparation for using it as a compile target for my language.
>>
>>56251828
That's an upcoming feature.
I wanted to get the hang of string processing in C first.
>>
>>56251856
Last time I wrote an LLVM language, I just dug through the standard every 5 mins writing my codegen.
>>
>>56251748
nice pic, OP. it sort of represents the future of computing
>>
>>56251891
How successful were you? Did you have a lot of compiler experience beforehand?
>>
>>56251803
>C

madman
how many lines of code?
>>
>>56252035
Not very successful because I didn't have a ton of experience. Wasn't my first language but if I did it over it'd probably be a lot prettier.
I've been having more fun just writing interpreters
>>
>>56252035
As a protip, let LLVM do the optimizing.
For instance, you could code your immutable variables to be SSA registers, with phi instructions and shit, but instead just use alloca, and load/store; LLVM has an optimization that turns the stack frame space into a register.
>>
>>56252069
341
>>
why doesn't my stuff work
its supposed to delete trailing spaces & tabs
#include <stdio.h>
#define IN 1
#define OUT 0
#define MAX 1000

int main () {
char current[MAX];
int state, count=-1, ind, c;

while ((c = getchar()) != EOF) {
current[count++] = c;

if (c == '\t' || c == ' ')
state = IN; ind = count; continue;
if (c == '\n') {
(state == IN) ?
printf("%.*s", ind, current)
:
printf("%.*s", count, current);
count = -1; state = OUT; continue;
}
state = OUT;
}
return 0;
}
>>
File: 1437339605559.png (311KB, 334x462px) Image search: [Google]
1437339605559.png
311KB, 334x462px
>>56251803
>mfw my XSS doesn't work :-(
>>
>>56252555
#define MAX 100
int main () {
char buffer[MAX + 1];
int len = 0;
while ((c = getchar()) != '\n') {
if (len >= MAX)
break;
else
buffer[len++] = c;
}
while (len > 0 &&
(buffer[len-1] == ' ' ||
buffer[len-1] == '\t' ||
buffer[len-1] == '\n' ||))
len--;
buffer[len] = '\0';
printf("[%s]\n", buffer);
return 0;
}
>>
File: 1471190281164.gif (3MB, 350x262px) Image search: [Google]
1471190281164.gif
3MB, 350x262px
>>56251786
For your collection
>>
>>56252625
What's the story behind this?
>>
>>56252555
if (c == '\t' || c == ' ')
state = IN; ind = count; continue;

This is equivalent to
if (c == '\t' || c == ' ') {
state = IN;
}
ind = count;
continue;


You shouldn't write your code in such a misleading style.
One statement per line.
>>
>>56252711

She kept on asking for that android dick, he was sick of it.
>>
>>56252740
But what actually happened?
>>
why code doesn't works ?
#include< stdio,h >

main( void){
char* hello=( char* )malloc( 11, sizeof( char)) ;
hello[ 1]="h" ;
hello[ 2]="e" ;
hello[ 3]="l" ;
hello[ 4]="l" ;
hello[ 5]="o" ;
hello[ 6]=" " ;
hello[ 7]="w" ;
hello[ 8]="o" ;
hello[ 9]="r" ;
hello[ 10]="l" ;
hello[ 11]="d" ;
puts( "%s", * hello) ;
return hello ;
}
>>
>>56252749
wew
>>
Are we being invaded by pajeets attempting C?
>>
File: 1461005231404.jpg (687KB, 826x1167px) Image search: [Google]
1461005231404.jpg
687KB, 826x1167px
>>56252677
>>
>>56252812
No, use either virtualbox or xen.
>>
File: wew bane.gif (860KB, 245x209px) Image search: [Google]
wew bane.gif
860KB, 245x209px
>>56252777
>777
>>
>>56252823
Is Xen better than VB?
>>
>>56252785
sorry im new to c
>>
C# 7 is based
if (o is int i || (o is string s && int.TryParse(s, out i)) { /* use i */ }

switch(shape)
{
case Circle c:
WriteLine($"circle with radius {c.Radius}");
break;
case Rectangle s when (s.Length == s.Height):
WriteLine($"{s.Length} x {s.Height} square");
break;
case Rectangle r:
WriteLine($"{r.Length} x {r.Height} rectangle");
break;
default:
WriteLine("<unknown shape>");
break;
case null:
throw new ArgumentNullException(nameof(shape));
}
>>
>>56252848
It's the fastest virtualization solution out there, and runs at 95%-98% native speeds. The use case is a little bit different, though, since you install xen as the main operating system on the computer first, then you install other operating systems inside of xen.
>>
>>56252877
Why would pol spout a nigger meme?
>>
File: "satire".png (83KB, 905x624px) Image search: [Google]
"satire".png
83KB, 905x624px
>>56252858
>>56252894
Are you even trying?
>>
>>56252908
Are you retarded

Based is from Based God Lil B retarded /pol/ shitters
>>
>>56252950
>>56252926
>>56252908
>>56252901
>>>/pol/
>>
>>56251803
Wow. Actually not half bad
>>
Hi, guys. I'm pretty rusty. Can you guys check my work?

class DynamicStringArray
{
public:
DynamicStringArray(); // Default Constructor

private:
int size; // holds the number of entries in the array
};

DynamicStringArray::DynamicStringArray() // sets the dynamic array to NULL and sets size to 0
{
string *dynamicArray;
dynamicArray = new string[NULL];
size = 0;
}


Any corrections or tips? I posted this in the last thread, but that thread has exhausted.
>>
>>56253014
You have a newline separating DynamicStringAr and ray.
>>
File: mpv-shot0001.jpg (64KB, 1280x720px) Image search: [Google]
mpv-shot0001.jpg
64KB, 1280x720px
don't mind me just taking the poo to the loo
>>
>>56252711
>>56252745
It's Data's evil twin. His brother has a completed emotions chip and is a sociopath.
>>
File: mpv-shot0002.jpg (63KB, 1280x720px) Image search: [Google]
mpv-shot0002.jpg
63KB, 1280x720px
>>56253044
>>
>>56251803
Add some CSS
>>
File: mpv-shot0003.jpg (63KB, 1280x720px) Image search: [Google]
mpv-shot0003.jpg
63KB, 1280x720px
>>56253061
>>
>>56253014
why the fuck isn't dynamicArray a member variable? It's gone after the constructor.
>>
File: mpv-shot0004.jpg (62KB, 1280x720px) Image search: [Google]
mpv-shot0004.jpg
62KB, 1280x720px
>>56253075
>>
Fuck ya'll niggas
>>
File: mpv-shot0005.jpg (41KB, 1280x720px) Image search: [Google]
mpv-shot0005.jpg
41KB, 1280x720px
>>56253090
>>
File: mpv-shot0006.jpg (96KB, 1280x720px) Image search: [Google]
mpv-shot0006.jpg
96KB, 1280x720px
>>56253105
Okay I'm done. Up next more same fag arguing with himself about niggers.
>>
>>56253062
>white ass
Reported for racism :^)
>>
File: c++ in a nutshell.png (72KB, 1016x98px) Image search: [Google]
c++ in a nutshell.png
72KB, 1016x98px
>>56253090
>>56253105
>>56253126
No wonder C++ is so retarded. They pigeonhole themselves into thinking
>this is the only way!!!!111!!1111oneone
>>
>>56252975
t. PHP webdev
>>
>>56253163
>Punjabi Hindu Paki
>>
>>56253126
Looks like he got all scared getting his cover blown and deleted fucking everything.
>>
>>56253147
What is happening in this pic?
>>
File: ProgrammingChallenges, 4.0 (HD).png (2MB, 3840x2160px) Image search: [Google]
ProgrammingChallenges, 4.0 (HD).png
2MB, 3840x2160px
First for challenges
>>
>>56253252
Gonna give the OpenAI gym a shot...
>>
>This is actually kind of impressive. Good job!
why do people think that a very basic webapp is an impressive job? have they never, ever coded in a safe language that supports unicode well?
interesting. and I thought I was useless.

this reinforces my idea that this thread is filled with useless fags that think of themselves as elites or something.
>>
Please help, in python I want to generate a standard result for each user based off their cookies. But because the md5 cookies are provided as strings, I can't perform maths on it.

for example
>>>x = 'b9155515728fa0f69d9770f7877cb50a' ## Some example
>>>x[3] << 8
TypeError: unsupported operand type(s) for <<: 'str' and 'int'


Please help.
>>
>>56253201
Looks like he made as much of a cluster fuck out of replacing new as possible.

>>56253186
Do the reptilians have a party van? It looks like he took megadoses of the red and blue pills. That shit is bound to draw attention.
>>
File: FB_IMG_1467872406775.jpg (81KB, 960x1209px) Image search: [Google]
FB_IMG_1467872406775.jpg
81KB, 960x1209px
>>56252341
my god share the source you dingus
>>
>>56253397
int(x[3]) << 8

I'm not sure why you're using the [3]rd value in the list, but since md5 is base 16 you might want
int(x[3], base = 16) << 8
>>
>>56253388
They're just words of encouragement to keep people going. Kill yourself.
>>
File: faggot.jpg (45KB, 471x361px) Image search: [Google]
faggot.jpg
45KB, 471x361px
>>56252749
you can't return a character array, firstly, and you can't return anything out of the main function you cuck
>>
>>56253432
Actually I just realised it would safer and smarter to take the cookies and hash them again with a seed.

Thanks anon!
>>
>>56252749
kekek
>>
>>56253445
>They're just words of encouragement
and what if the guy had made the webapp in, say, java? I'm pretty sure you all would be telling him/her to go back to >>>/g/wdg
fucking memers.
>>
>>56247862
you can think of it more as a map that takes 2 lists
>>
so, what is haskell / ocaml / fp in general not good for?
>>
>>56253448
>you can't return a character array
>what is string.h
>>
File: 1462970641659.png (754KB, 736x715px) Image search: [Google]
1462970641659.png
754KB, 736x715px
>New C2X proposals

>Named constants using 'register'
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2067.pdf

>Const correct some functions and add type-generic string functions (a la <tgmath.h>)
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2068.pdf

>Forced implementation of standard headers and new feature test macros
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2069.pdf

What does /dpt/ think about these proposals?
I think the use of 'register' like that seems is pretty unintuitive and I'm not really sure if it's necessary. <tgstring.h> seems pretty interesting though.
>>
>>56253738
Performance
>>
>>56253738
Anything other than cute code snippets, e.g. real world applications involving state
>>
>>56253756
C11 was a mistake and so was C99.

The only true standard is C89.
>>
>>56253766
You realise code bases are made of code snippets?
>>
>56253775
That was so poor, you don't even deserve a (You)
>>
>>56253781
Yes, except not exclusively ones that print fizzbuzz or find the prime factors 31337
>>
File: 1471719526619.gif (844KB, 800x786px) Image search: [Google]
1471719526619.gif
844KB, 800x786px
>_Generic
>>
how do I get more gud at haskell
I need a project that involves just logic and and an intermediate knowledge of haskell
no need of knowldege about some libraries
>>
File: 1439008579129.jpg (247KB, 928x1428px) Image search: [Google]
1439008579129.jpg
247KB, 928x1428px
>>56253448
>cuck
Go back to your containment board stormtard.
>>
File: 1404450097276.gif (1MB, 300x225px) Image search: [Google]
1404450097276.gif
1MB, 300x225px
>>56253814
Haskell is deprecated. Learn lisp.

>inb4 muh types
>inb4 inb4 >having to fuck up your code with brittle type annotations
>inb4 inb4 inb4 they're optional
>inb4 inb4 inb4 inb4 no, they're not: the wiki even has a page documenting how the type system is broken in hasklel
https://wiki.haskell.org/Monomorphism_restriction
>>
>>56253876
rollin' 4 dubs?
>>
>>56253876
>Why have expressive types with type annotations and compiler failure when you could have 3 types with no annotations and runtime failure?
>>
File: 1469806507252.png (122KB, 500x286px) Image search: [Google]
1469806507252.png
122KB, 500x286px
>>56251748
What can I do to inform a TCP server that its only client is disconnected?

I tried to use client.Connected that return a boolean but it only return the last operation which is false and shit.

I could use something like make the server to try send a message to its client and if it is arrives then the connection is still up and use this as a handler for disconnection.

But I write my server in a way that it is only capable of receiving data so it will kill the point.


Maybe I have just to move to Sockets and rewrite the whole thing? C#
>>
File: rekt.gif (406KB, 300x231px) Image search: [Google]
rekt.gif
406KB, 300x231px
>>56253888
>implying type errors don't account for less than 5% of code errors
>implying static typing a la hasklel doesn't add 100% development time to everything to fix less than 5% of errors
>>
>>56253930
>>implying type errors don't account for less than 5% of code errors
>using an inexpressive type system

>implying static typing a la hasklel doesn't add 100% development time to everything to fix less than 5% of errors
>literally making shit up
>>
File: rage.jpg (19KB, 500x209px) Image search: [Google]
rage.jpg
19KB, 500x209px
>>56253886
data as code

code as data

hasklel as shit
>>
>>56253888
>3 types with no annotations
Lisp has a more expressive type system than Haskek, except it doesn't force its autism in the way. It can have types dependent on values, intersection and union types, subtypes, and types defined based on general predicates.
>>
fucking datafag can't even program so he spends all his time in /dpt/

write an ncurses program in lisp that lets you browse the filesystem, do it datafag, and maybe I won't discard your opinions
>>
File: 1408719381380.jpg (36KB, 636x480px) Image search: [Google]
1408719381380.jpg
36KB, 636x480px
>>56253945
>this is what hasklelfags actually believe
Lel, if you would actually go out and try other languages you would realize how retarded haskell is in comparison. You're exactly like the sepples idiots who think code that looks like this >>56253147 is desireable
>>
File: 1418105597411.png (259KB, 500x487px) Image search: [Google]
1418105597411.png
259KB, 500x487px
>>56253974
Maybe tomorrow. It's late and I have to get to bed.

Not all of us have the amount of free time that NEET's do :^)
>>
>>56253973
No it can't, you're thinking of a specific variety of Lisp, not Lisp itself but one of its bastard children. Not to mention that I'm certain you're talking about dynamic typing.

>>56253987
I do try other languages, Haskell is the best I've come across. Anon's pic is disgusting, C++ is my second used language (the only excuse to use it is performance)

>>56251748 >>56251786 >>56253876
>>56253930 >>56253956 >>56253987
>>56254005

Avatarfagging is against the law
>>
File: hot text.png (207KB, 640x960px) Image search: [Google]
hot text.png
207KB, 640x960px
I'm a creep, I'm a weirdo,
What the hell am I doing here?
I don't belong here, but I need some help.

in Android Studio, i design the layout via drag/drop. cool. easy. and i want to now write my Java code (interacting with the buttons/user input)
but when i switch from design mode to text mode, the .xml shows my widgets, the .java does not.
using java, how to i call upon the things that are in the .xml?
>>
>>56254005
>1am
>not a neef
>>
>mrw no one here can actually explain the difference between a good software engineer and pajeet
>>
File: 1436013226997.png (44KB, 256x256px) Image search: [Google]
1436013226997.png
44KB, 256x256px
>>56251803
>>
>>56254039
One uses Java
>>
File: 1467876083137.jpg (62KB, 873x927px) Image search: [Google]
1467876083137.jpg
62KB, 873x927px
>>56251803
congrats senpai
>>
>>56254060
>>56254039
if shitInStreet = new pajeet
if pooInLoo = new softwareEngineer
else: purge resume cache
>>
>>56254008
>No it can't, you're thinking of a specific variety of Lisp, not Lisp itself but one of its bastard children.
Nope, Common Lisp.

>Not to mention that I'm certain you're talking about dynamic typing.
Again, no. Here's an illustrative example:
* (type-of (make-array 3 :element-type 'fixnum :initial-element 4))

(SIMPLE-ARRAY FIXNUM (3))
* (typep '(1 2 3) '(and sequence (or null cons)))

T
* (typep 2 '(satisfies evenp))

T
* (typecase #(1 2 3)
((simple-vector 3) "This vector has size 3."))

"This vector has size 3."

You can use any of these as type annotations in a definition using a declare form, and it would do compile-time type checking for you. But unlike Haskek, it's not forced on you, and the compiler infers types based on the types of predefined functions and values.
>>
>>56253046
He comes back??
>>
>>56254175
>>No it can't, you're thinking of a specific variety of Lisp, not Lisp itself but one of its bastard children.
>Nope, Common Lisp.
So you don't even know what Lisp is?


>it's not forced
aka feel free to write functions that error and could only possibly error
You haven't convinced me at all that it's not dynamic btw.
You would have to be passing proofs (or annotated return types) at some point to be safetly using predicates.
>>
>>56254172
/**
* Pajeet simulator
* @author Abhay Rajesh Patel
* @version 1.0.10.1.2
*/
public class Pajeet{
private String hasName;
private String inLocation = "tech support";
private boolean bowelsAreFull = false;
private boolean isHungry = true;

public Pajeet( String hasName){ this.hasName = hasName;}

public void doTheNeedful( boolean kindly){
if( getIsHungry( )==true ){
eat( "curry");}
if( getBowelsAreFull( )==true ){
poo( );}
if( kindly==true ){
setInLocation( "tech support");}
doTheNeedful( kindly==true ? kindly==false : kindly==false);}

public void eat( String food){
if(food.indexOf( "curry") >= 0){
setBowelsAreFull( true);}
setIsHungry( false);
doTheNeedful( true);}

public void poo() {
setLocation( "street");
setBowelsAreFull( false);
setIsHungry( true);}

public String getHasName( ){ return this.hasName;}

public String getInLocation( ){ return this.inLocation;}

public boolean getBowelsAreFull( ){
return this.bowelsAreFull==false ? this.bowelsAreFull==false : this.bowelsAreFull== true;}

public boolean getIsHungry( ){
return this.isHungry==false ? this.isHungry==false : this.isHungry==true;}

public void setInLocation( String inLocation){ this.inLocation = inLocation;}

public void setBowelsAreFull( boolean bowelsAreFull){
if( bowelsAreFull==false ){
this.bowelsAreFull = bowelsAreFull==true;}
else{
this.bowelsAreFull = bowelsAreFull==true;} }

public void setIsHungry( boolean isHungry){
if( isHungry==false ){
this.isHungry = isHungry==true;}
else{
this.isHungry = isHungry==true;} } }
>>
>>56254172
what language checks implicitly whether not null without boolean check

pajeet writes better code than this
>>
>>56254220
>getHasName
>no getHasGetHasName
>>
>>56254220
actual tears from laughter
it's been a while since that has happened
>thank you for the funny "eat curry" lmao
>>
>>56254233
>checking if not null
If you have to do this you are the pajeet.
>>
File: IMG_20160820_005156.jpg (148KB, 1080x1080px) Image search: [Google]
IMG_20160820_005156.jpg
148KB, 1080x1080px
>>56253876
mfw my language doesn't have this restriction
>>
>>56254217
>muh type errors
Quit with that autism already. Every interactive environment is bound to give errors when it takes a command with the wrong types.
Prelude> fmap 1 'a'

<interactive>:7:8:
Couldn't match expected type ‘f a0’ with actual type ‘Char’
Relevant bindings include it :: f b (bound at <interactive>:7:1)
In the second argument of ‘fmap’, namely ‘'a'’
In the expression: fmap 1 'a'
In an equation for ‘it’: it = fmap 1 'a'


In Common Lisp, the type of car is (function (list) (values T &optional)), which means it only takes arguments of type list. And in the example above, fmap takes (a -> b) and f a for Functor f, and GHCi throws an error when it sees fmap applied to arguments clearly not of those types.
>>
>>56254009
500 internet points for help on this
>>
>>56254282
... Yes, and with GHC you can then compile your code and it will force you to not have errors.
And using type checking plugins you'll see the errors in your editor.

How the fuck are you not understanding this?
Are you new to programming? Have you never used a non-dynamic language?
>>
Could somebody explain to me how to draw a circle in C step by step, like I'm retarded? All the libraries I've tried are either ridiculously complex, like SDL and OpenGL, and thus refuse to work for a mirriad of reasons, or archaic and possibly not ever meant for C, like the graphics.h package. It's just a single bloody circle I want, we did this in four lines in Pascal, for god's sake
>>
i want to create a universe with no restrictions on the potential for emerging complexity; what's the best way to do this?
>>
>>56254282
>>56254292
Oh, and of course even with GHCi you know that if any of your input doesn't typecheck, none of it will run
>>
>hurr durr le xenophobia is so funny xddD!1
>>
>>56254303
Use OpenGL and GLUT.
GLUT does a lot for you, like window initialisation.

You won't get it in 4 lines, it's C.
>>
>>56254258
https://en.wikipedia.org/wiki/Null_Object_pattern

did devry ever teach u this
>>
>>56254303
Do you think trigonometry is "ridiculously complex"?

it's basically
for (float i = 0.0; i < pi * 2; i += (pi * 2) / 32)
{
int x = sin(i);
int y = cos(i);
whatever_draw(x, y);
}
>>
>>56254342
>OOP
Exactly my point.
How retarded do you have to be to include something in a language that can assign the same value to ALL types and is a type that isn't actually a type?
>>
Why is it that bash can't seem to properly run commands made of joined strings?

replaceid=$(cat /tmp/rsnotifid)
#is int
declare -i replaceid
echo "replaceid" $replaceid

str1="gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify appname "
#replaceid
str2=" /home/user/scripts/xfpm-brightness-lcd.png \"\" \"\" [] \"{'String':<0>,'value':<"
#100, value placeholder
str3=">}\" 2000 | cut -c 9-10"

strcommand=$str1$replaceid$str2"100"$str3

echo $strcommand

replaceidnew=$($strcommand)


Seems it tries to run it, but it breaks somewhere and I get a generic help output from gdbus instead. Same command works when pasted into terminal directly.
>>
>>56254356
I doubt that's what he's having trouble with, probably more

>glut initialise
>window initialise
>context initialise
>>clear buffers
>>DRAW CIRCLE
>>swap buffers
>terminate context
>close window
>terminate glut

It's non trivial in a language like C
>>
>>56254380
no idea if this helps, but... you should use "${var}" instead of $var
>>
>>56254403
If you mean like
strcommand="${str1}${replaceid}${str2}${placeholder}${str3}"

then it just does the same thing.
>>
>>56254356
Mate, shove that cheeky code up yours, you clearly haven't been what the man's going through, I remember my early days in C: it was hell.
>>
>>56254356
This doesn't work by the way.
>>
>tfw a fucking idtio
>>
>>56254356
in haskell this is just
    init [0.0, pi*2/32 .. pi*2] 
& map circulate
& traverse_ whatever_draw
where circulate x = (cos x, - sin x)
>>
>>56254303
SFML has C bindings and is pretty good for just doing graphical shit. You can draw a circle in 15ish lines.
>>
>>56254769
init just drops the last element, otherwise it would be a 33 element list (it would include pi*2)
>>
>>56254769
is & even a function
or are u doing an imperative pseudo code version
>>
>>56254841
& is from Data.Function
x & f = f x

you could also do
traverse_ (whatever_draw . circulate) $ init [0.0, pi*2/32, pi*2]
>>
the fuck is const for
>>
>>56254924
to make things read only
depending on what you apply it too, it's either literary fluff, a compiler suggestion, or it places that variable in read-only memory.
>>
>>56254856
this is so useful
why isn't it in the prelude????
>>
>>56254971
it's in Data.Function, it's part of base
it's literally just flip ($)
>>
>>56254778
How do I make SFML work? Do I just shove the windows CSFML files in my project folder?
>>
>>56254991
but it should be in the prelude
so much easier to read
basically lists what you're going to do in order
>>
(.|.)

>this is a haskell function

fucking perverts
>>
>>56255022
only u see that
I just see a pillar with two stones
>>
>>56255022
Even the people who created the language know it's a joke.
>>
>>56255044
Only I see what?
>>
>>56255061
a dick

does anybody believe in the principle that there is always an elegenta and fast solution?
>>
>>56255070
Elegance is only a thing because programming attracts OCD ridden autists.

Prove me wrong.
>>
File: haskell function.png (442B, 53x33px) Image search: [Google]
haskell function.png
442B, 53x33px
>>56255075
>elegance is bad

>>56255070
>a dick
You faggot, that's not what I was thinking about at all
>>
>>56254292
Common Lisp is also compiled, nigger. Type annotations are included in compiler directives, and macros, a most useful consequence of Lisp's homoiconicity, are expanded in compile-time. That compilation can be done JIT in a REPL, or it can be done through the command line by your favorite compiler. Hell, you can even print the disassembly of every function within the REPL itself.

The static/dynamic dichotomy has nothing to do with compilation. First get your terms straight before throwing them around everywhere.

>>56254306
Exactly as in a Lisp REPL.
>>
>>56255097
Ah, you're right. It's a dick resting on someone's moled butt.
>>
>>56254356
Give me a working example of that, smartass. We all can shitpost, most are better at it than you as well.
>>
>>56255183
do your homework by yourself
>>
So I've been trying to make a post on 4chan using python. I'm trying to find the variables for the comment field, but when I inspect the site and use the network tab, "post" doesn't have a "Form Data" and my post is nowhere to be found in the post request. Kinda lost right now, anyone knows what I'm doing wrong or any other way to do this?

https://youtu.be/eRSJSKG4mDA?t=273
I used this video to get an idea on how I get this information
>>
>>56255111
>Exactly as in a Lisp REPL
Lisp REPLs don't do typechecking
Your 109th variant of Lisp + types + OOP + kitchensink might
>>
>>56255247
>no true scotsman
:^)
>>
>>56255237
Have you programmed your reCAPTCHA solver yet?
>>
>>56255278
No but isn't there easy modules that you can use for that? That works like jdownloader, they pop up and you solve them then it continues.
>>
>>56254356

Why are you casting your floats to int?
>>
>>56255263
>>no true scotsman
You literally have no idea what Lisp is.
You think your modern Lisp++ is what Lisp is.
>>
>>56255329
>>56255263
Both of you are faggots for keeping this inane argument going on for as long as it has been. LISP the language hasn't been used since 1980. Lisp the language family is still around.
>>
things I can do right now:
>write python to ti basic interpreter
>work on converting calculus problems to ti basic without writing interpreter
>learn matlab
>finish reading great expectations for class next week
not really sure what to do desu someone make up my mind for me

>>56255300
a recaptcha solver is way over your skill level, bud. And as far as you are concerned i recommend learning the requests module

try writing something like this:
http://pastebin.com/2aSyb6HV

As you can see you set a headers and a form data area. On 4chan you need to also supply a separate form but you shouldn't worry about that quite yet because you can't even get close to solving the captcha

Also note that by pressing f12 and watching the network packets you can identify which tokens are necessary to pass
>>
>>56255329
Lisp is the programmable programming language. And objects, types and whatever other feature you release your autism on are built up from the simple principles of homoiconicity and macros. If you've noticed, types in CL are just quoted s-expressions whose meanings rest on those abstractions made possible by homoiconicity. Now go play with your toys.
>>
>>56255365
just download google's image sets and feed them to your neural network AI and wa la you've got an automatic captcha solver ez pz

or try to send a fabricated signature
>>
>>56252281
> I've been having more fun just writing interpreters

your job isn't done until you write a compiler for each interpreter
>>
>>56255392
or just use legacy recaptcha and write a letter identifier, I feel like that would be easiest
>>
can somebody do a cross program in c
i just wanna know how an expert would do
>>
>>56255365
>Also note that by pressing f12 and watching the network packets you can identify which tokens are necessary to pass
That's what I'm trying to figure out, it's just that what I need isn't showing up when I'm making a post here.
>>
>>56253126
> 1-10% of the problem space
where does this figure come from?
>>
>>56255380
"not compiling" is not a property of lisp programs
compilation is not a property of lisp programs
>>
>>56255440
A what?
>>
>>56255480
make it output an n by n cross
somehting like
*   *
* *
*
* *
* *
>>
>>56255446
just look at it it says right there

and in that program I sent you it reads all your form data back to you so you can verify that it's being sent properly

REQUEST HEADERS

Accept:*/*
Accept-Encoding:gzip, deflate, br
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:1796
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryOCqJYB9cVu5LMzvE
Cookie:__cfduid=dd024bd6afaa833e749a12a28803e51361471523816; 4chan_pass=_d9sV804Mfrzx63hgbTBWwLZtHnRovDeP
Host:sys.4chan.org
Origin:http://boards.4chan.org
Referer:http://boards.4chan.org/
User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

REQUEST PAYLOAD

------WebKitFormBoundaryOCqJYB9cVu5LMzvE
Content-Disposition: form-data; name="resto"

63958666
------WebKitFormBoundaryOCqJYB9cVu5LMzvE
Content-Disposition: form-data; name="com"

wahey
------WebKitFormBoundaryOCqJYB9cVu5LMzvE
Content-Disposition: form-data; name="mode"

regist
------WebKitFormBoundaryOCqJYB9cVu5LMzvE
Content-Disposition: form-data; name="pwd"

_d9sV804Mfrzx63hgbTBWwLZtHnRovDeP
------WebKitFormBoundaryOCqJYB9cVu5LMzvE
Content-Disposition: form-data; name="g-recaptcha-response"
[long block of text]
>>
where can I find the previous version of the challanges ??
>>
>>56255478
You were the one that brought up compilation in the first place, as an advantage of Haskell's type checks over Lisp's. >>56254292
>>
>>56251803

Must have source.
>>
>>56255549
... yes, your point?
>>
>>56255510
I'm not an expert, but I wrote one ages ago for dpt, so I might as well "help" you with your homework.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

int main(int argc, char** argv)
{
uint32_t size = atoi(argv[1]);
uint32_t offset = 0;

char row[size];
for(uint32_t j = 0; j < size; ++j) {
row[j] = ' ';
}

for(uint32_t i = 0; i < size; ++i) {
row[offset] = '*';
row[size - (offset + 1)] = '*';

for(uint32_t j = 0; j < size; ++j) {
putchar(row[j]);
}
putchar('\n');

row[offset] = ' ';
row[size - (offset + 1)] = ' ';

++offset;
}

return 0;
}
>>
File: C lambda.png (46KB, 849x489px) Image search: [Google]
C lambda.png
46KB, 849x489px
>this is lambda syntax in C
>>
>>56255600
That's not a lambda, that's just writing shellcode, and isn't standard C at all.
>>
>>56255584
Yours? All you've been doing is play semantics separating Common Lisp from the Lisp concept you're attacking, even though all the time you've been arguing about things in Common Lisp.
>>
>>56255630
>>56255584
Just shut the fuck up already, both of you autists
>>
>>56255600
Nice leak, there.
>>
>>56255630
... I attacked Lisp because it didn't have X
Now you're saying "But Lisp doesn't have X!"

What are you doing?


>>56255648
God forbid anyone discuss fucking programming you cur
>>
>>56255656
Memory leaks don't matter if the program concludes right after them :^)
>>
>>56255668
Then show a real world example using your """lambda""" in a loop.
>>
>>56255657
I've shown you countless times it does, you just covered your ears and split hairs
>>
>>56255677
No you fucking didn't, and I'm not splitting hairs.
As I said in my first fucking post on this, Lisp does not have compilation, your abomination of language that calls itself a lisp might, but it's really closer to other languages than it is to lisp
>>
>>56255600

>sys/mman.h
>mmap
Hate to break it to you, but the set of platforms that the C standard library has been ported to is actually a bit greater than the set of platforms that support POSIX either in whole or in part. In fact, if you were to be targeting Windows -- still the largest desktop operating system out there -- you would be unable to run this code, or even compile it, without using something like Cygwin as a crutch.
>>
>>56255626
>>56255656
>>56255698
It's clearly a joke
You idiots
>>
>>56255657
>God forbid anyone discuss fucking programming you cur

>>56255677
>>56255584
>>56255263
>these
>discussing programming
m8, if you want to argue about each other like an old married couple, you can take that shit to /soc/
>>
how do I force an interger to be odd
any simple operations I can do?
like, an expression that no matter what n is, will always result in an odd number
>>
>>56255728
n | 1
>>
>>56255728
2n+1
>>
File: curious octopus.jpg (30KB, 480x326px) Image search: [Google]
curious octopus.jpg
30KB, 480x326px
>>56255673
>lambda
>loop
>>
>>56255693

Common Lisp can be compiled
Racket can be compiled
Some variants of Scheme can be compiled

What do you consider to be the one true Lisp, which cannot be compiled?
>>
>>56255751
Common Lisp, Racket and Scheme are barely Lisps, that's the point. They're closer to other modern languages than they are to a lisp.
>>
>>56255693
>muh it's not a real lisp because it doesn't fit my mythical conception of it that automagically validates every argument of mine
>>
>>56255736
>>56255735
how do I make it as close to the original n as possible
>>
>>56255767
>how do I make it as close to the original n as possible
n | 1 will only be at most 1 different.
All odd numbers will stay the same, and all even numbers will be 1 bigger.
>>
>>56255760
Then what the fuck are you even sperging on about? If nothing is a real Lisp, what's your damn issue?
>>
http://c2.com/cgi/wiki?IsSchemeLisp
>>
>>56255773
im sorry, I don't use c much
what is that operator supposed to do
>>
>>56255775
The original point was just that lisps are retarded because they're not type safe and in an obvious way.
>>
>>56255789
Bitwise OR.
All C-like languages use that operator for that.
>>
>>56255795
But you just took every lisp that's remotely in use today out of that point.
>>
>>56255795
What about Typed Racket?
>>
>>56255820
The person that replied to me responded with an interactive session and compared it to GHCi.
No mention of compilation or type checking
>>
>>56255841
It's another example of a Lisp++
I don't even see the use of Lisp today, there are other languages where you can capture an AST
>>
>>56255856

Lisp++ isn't a thing, Anon. Believe it or not, languages are allowed to evolve. C generally doesn't refer to the version of C made in the early fucking 70s, but instead either to C89, C99, or C11. Similarly, Lisp doesn't refer to the watered down Lisp of the early 60s, but to the many Lisp families in use.

Common Lisp is Lisp
Scheme is Lisp
Racket is Lisp
Clojure is Lisp
Emacs Lisp is... tragically, also Lisp.
>>
>>56255894
>watered down
>of the early

C doesn't refer to the watered down C of the 11s, believe it or not, languages are allowed to devolve, but instead to either C++ or Java
>>
>>56255894
>>56255910
And more to the point, Lisp isn't "a" language. It describes a particular kind of language, and it does not describe types or annotations.
You may as well be saying "binary trees are allowed to evolve into ternary trees - they're not binary++ trees, they're binary trees"


For lisp++ers - are the type annotations homoiconic too?
>>
>>56253738
Nothing. That's like asking what C++ is not good for.
>>
This is the only way you can write Lisp, any other way and you're a Lisp++er :^))))
(DEFUN PROVER ()
(PROG (S)
LOOP (PRINT ‘(PLEASE ENTER PROPOSITION OR H OR R))
(TERPRI)
(SETQ S (READ))
(COND ((EQ S ‘H) ; H is the HELP command…
(PRINT ‘(HERES AN EXAMPLE))
(PRINT ‘((A AND (NOT B)) IMPLIES A)) )
((EQ S ‘R) (RETURN NIL)) ; R is the RETURN command.
(T (COND ((VALID1 NIL (LIST (FORMAT S)))
(PRINT ‘VALID)
(TERPRI))
(T (PRINT ‘(NOT VALID))) )) )
(GO LOOP) ) )
>>
>>56255929

Lisp refers to a family of languages and is not defined as being interpreted. We're not talking about binary++ trees or ternary trees. You insisting that Lisp is defined by not being compiled is like insisting that a binary tree be defined by being balanced.
>>
>>56255952
>a binary tree be defined by being implemented as an array
A more appropriate analogy
>>
>>56255952
A subset of lisp programs could be compiled (because of quotation), though all could be optimised and have a lot erased (you could call this compilation).

I never said all Lisps have to be interpreted, I complained about typing errors and we side tracked into how modern Lisps are closer to other languages than they are to Lisp itself.

The whole point of my analogy is that a ternary tree isn't a binary tree. The addition of an extra branch makes it no longer a binary tree.

>>56255948
So why do YOU hate Lisp?
>>
>>56255972
Basically, if you want Lisp with types, then the types should be defined in terms of Lisp, and not be primitives or builtin (optimisation aside)

I could understand having some kind of "compiler" top level lisp function that can feedback into the actual program
>>
>>56255929
>are the type annotations homoiconic too?
Yes, fucking yes. Type specifiers are just s-expressions, and the compiler directives, among which are type declarations, in a function or macro definition are just lists that are evaluated at compile-time in the expansion of the definition macro.
>>
>>56255996
If that's true then I was wrong, it's a Lisp

I still think types should be part of the language and not the library though
>>
>>56256003
It is part of the language. At least for ANSI Common Lisp.
>>
>>56256008
I mean as in primitive

Does CLisp do polymorphism (not specifically inheritance, just functions that depend on types)
>>
>>56256019
Yes, using generic functions. Example from Wikipedia:
 (defgeneric add (a b))
(defmethod add ((a number) (b number))
(+ a b))
(defmethod add ((a vector) (b number))
(map 'vector (lambda (n) (+ n b)) a))
(defmethod add ((a vector) (b vector))
(map 'vector #'+ a b))
(defmethod add ((a string)(b string))
(concatenate 'string a b) )
(add 2 3) ; returns 5
(add #(1 2 3 4) 7) ; returns #(8 9 10 11)
(add #(1 2 3 4) #(4 3 2 1)) ; returns #(5 5 5 5)
(add "COMMON " "LISP") ; returns "COMMON LISP"
>>
()()()(((((((()))))))))()()(((((((()()()()()()()()
>>
How du i send email using EWS in VB6? I got it working using EASendmail with a test license, but none of the full licenses they offer fit my needs
>>
>>56256040
>()()()()
is this even valid
>>
Guys, i am stuck. Is there a good website/book for c# exercise?

I feel like i can't remember anything i learnt in the past few months.
>>
>>56256063

Somewhere floating around there is a thing for rolling for various projects. Use that. It's not language specific, and it's going to require you to do a bit more work than just exercises.
>>
>>56255207
We all know your just a chicken McFly
>>
File: 4chanUniversityDiplomaOfG.jpg (52KB, 620x413px) Image search: [Google]
4chanUniversityDiplomaOfG.jpg
52KB, 620x413px
package fizzbuzz;
public class fb1 {
public static void main(String[] args) {
for (int c = 1; c <= 100; c++){
if (c % 3 == 0 && c % 5 == 0){
System.out.println("fizzbuzz");
}
else if (c % 3 == 0){
System.out.println("fizz");
}
else if (c % 5 == 0){
System.out.println("buzz");
}
else
System.out.println(c);
}
}
}
>>
Would anyone be so kind and help me to understand how I can make the for loop work as I was naively intended it to work?
package Examples;

import java.util.Scanner;

/**
* Created by NotTellingYou,you bullies on 8/25/2016.
*/
public class LoopModulo {

//get the digits, made them into a method.
public static long digits(long a){
int digits = 1;
while ((a = a/10) != 0){
++digits;
}
return digits;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long num = sc.nextInt();
System.out.println(digits(num));
//long dig = digits(num)*10;
//System.out.println(dig);

/**
* should be something like this:
* a = 999/100 = 9
* b =999%100= 99
* a =99/10 = 9
* b = 99%9 = 9
* a =9/1=9
* b =9%1=0
* a +=a;
* a =27;
*
*/
for (int i = 0; i < digits(num) ; i++) {
num= num/10;
num = num %10;
num +=num;
System.out.println(num);

}


}


}
>>
>>56251748
Has anyone here worked with the twitter api and python to get the tweets from a timeline? How do I make it to mine all 30k of a user for example? I currently only get about 200 tweets per call and can go back to the december 15th, at this point I'm not able to fetch any more tweets. I'm confused.
>>
File: today.jpg (124KB, 1080x765px) Image search: [Google]
today.jpg
124KB, 1080x765px
how are you feeling today /g/uys?
me, i'm more like the dog today.
>>
File: wright_in_da_benis.png (7KB, 290x174px) Image search: [Google]
wright_in_da_benis.png
7KB, 290x174px
>>56256344
nvm, looked it up and it seems like I can't get any more tweets than the 3200 most recent ones. Fugg
>>
>>56256377
This is really nice bait anon, keep up the good work

>>56256391
Why do you need more than 3200?
>>
why won't this compile?
#include <stdio.h>
void main(int,char**a){for(char*p="25YZ[<TT];SR^2]W+%'C^,X-O?O&__V[!;TT];D+ #.A3,A+ 4C,$!_.",c=a[1][0];*p;putc(c=(*p+++c&63)+32,stdout));}
>>
>>56255320
are you retarded?
>>
>>56256399
more data
>>
>>56256423
It's probably due to that error your compiler spat out.
>>
>>56256399
well, at least i'm in 2nd place
>inb4 "2nd place is just the 1st loser"
>>
>>56256455
I'm pretty sure I typed it as it's written.

https://twitter.com/Hitman/status/768728307915485184

I think hitman is trying to run a small arg.
>>
>>56256473
Yeah, but the way it's written is non-compliant with standards. It required two changes for me to work. READ THE COMPILER ERRORS.
>>
>>56256423
>void main
>unnamed argument
>>
>>56256499
Valid C
>>
>>56256511
It it's not.
void is not a valid return type for main. Only int is allowed.
Unnamed arguments are only allowed for prototypes, not function definitions.
>>
File: 20160410_104201.png (72KB, 233x289px) Image search: [Google]
20160410_104201.png
72KB, 233x289px
>>56256046
>license license license
Seriously how is being a winslave even remotely livable? And ffs why can't your "application" just talk SMTP to some server over TLS and be done with it? Why does it have to be obfuscated by licensed SAASS services and apis? Free yourself and join us now. Hasta siempre la Liberaciòn!
>>
I have a few questions. I want to hit into the programming market and I know the requirement for python jobs is a bit low, so I was thinking on learning another language and I narrowed it to Ruby.

Are there any good interactive tutorials in Ruby? Or at least a book that's not dense and full of pretty shitty jokes?
>>
>>56256307
No.
>>
>>56256494
>READ THE COMPILER ERRORS
suggest parentheses around '+' in operand of '&'

I fixed the first issue, but not this one.
>>
>>56256473
Btw, the "password" is "o".
>>
god I hate character encodings
why couldn't we just have one standard and that be the end of it?

>>56256307
ah yes the beginning of CSE 020 students
we're in for a long semester
>>
>>56256559
Wait, what? How?
>>
File: lol funny xkcd comic.jpg (61KB, 667x645px) Image search: [Google]
lol funny xkcd comic.jpg
61KB, 667x645px
>>56256576
>god I hate character encodings
>why couldn't we just have one standard and that be the end of it?
>>
>>56256576
>why couldn't we just have one standard and that be the end of it?
Yes. Use UTF-8 for everything, and reject all other non-compatible encodings.
Using anything else (especially UTF-16) is pants on head retarded.
>>
>>56256576
>god I hate character encodings
>why couldn't we just have one standard and that be the end of it?
>¿What is Unicode?
>>
>>56256591
forgot

>inb4 that one lame xkcd comic on standards is reposted for the thousandth time
>>
>>56256604
oldie but a goodie
>>
>>56256596
What if you have a full-chinkoglyphs text? It makes sense to have utf-16 for non-latin scripts. And itvwould be manageable piss-easily if you weren't a bad programmer.
>>
>>56253756
A new C standard? holy fuck.
I thought this was some C++ thing at first.
>>
>>56256647
Can't wait for C21

>>56256617
No it isn't
>>
>>56256637
The slightly larger file size for non-English text is perfectly acceptable. Most of the shit on the internet is English text anyway (HTML, JS, etc.).
UTF-16 is fucking retarded, because it has both the disadvantages of a non-byte oriented encoding AND a multi-byte encoding.
>>
Addendum >>56256637 :
>>56256576 is also a bad programmer

And could #DependentTyping help with preventing multi-encoding related headaches? Like streans of text have an encoding type-parameter attached and you have to honor it?
>>
>>56256559
I got a space character.
>>
>>56256536
The only reason I need to ask is because VB6 is so outdated, Microsofts current API don't work out of the box. If just the application ran VB.NET or C, but it's way too old and still irreplaceable (working at a big company and it's one of the core systems)
>>
>>56256700
unnecessary

[ASCII]
[U8Char]
[U16Char]
>>
>>56252555
Why not use isspace()
>>
>>56256741
>unnecessary
For you right now, but think big anon. Also: read
man ntohl
>>
>>56256740
>write another component in the new api style that receives data from the existing component continuously.
Probably the stupidest way to make it work, but it'll make it work.
>>
>>56256046
>>56256740
>VB6

Fucking hell.

Interfacing with EWS is trivial using C#, maybe 5 lines for a basic email.
>>
File: feeling the squeeze.jpg (443KB, 600x739px) Image search: [Google]
feeling the squeeze.jpg
443KB, 600x739px
/dpt/ is about to get a lot more active.

Fall classes are starting soon, and we'll be inundated with CS101 questions.

Are you ready?
>>
File: 235235.jpg (63KB, 845x506px) Image search: [Google]
235235.jpg
63KB, 845x506px
>>56256977
But you're already here
>>
>>56256997
If I wasn't here, then I wouldn't very well be able to post, now would I?
>>
>>56257004
>If I wasn't here, then I wouldn't very well be able to post, now would I?
objectively false
>>
Blech. Tried fucking around with RISC-V today, but can't get qemu-system-riscv and riscv64-unknown-linux-gnu-gdb to talk to each other properly, so I can't actually test a program on it.
>>
>>56251748
>(reminder that lisp > hasklel)
don't you mean
(reminder (> lisp, hasklel))
>>
>>56257010
You're objectively false, nerd.
>>
>>56257147
Not an argument.
>>
>>56257114

Don't you mean
(reminder (> lisp hasklel)) ;; There isn't a comma, faggot
>>
>>56257261
(reminder (> (, lisp hasklel)))
>>
Anyone have any resource on how to implement pattern matching and implicit arguments in type theories?
>>
>>56251803
Cool site, bro, care to share the source later?
>>
>>56257361
There's nothing really type theoretical about it
>>
I am going to create skynet anyone wanna join in?
>>
>>56257462
hello i am want to help
what is pay?
contact me: [email protected]
>>
>>56257462
sure
>>
>>56257462
https://skynet.unc.edu/
http://www.cyberdyne.jp/english/
>just join them, they already exist
>>
>I tried to define foldl in terms of foldr, and discovered
>foldl' = foldr (\x y -> (\a h -> y (h a x) h)) const
>doesn't typecheck while
>foldl' xs v f = foldr (\x y -> (\a h -> y (h a x) h)) const xs v f
>does. Spent a solid couple hours trying to find where my derivation went wrong before >accidentally stumbled upon the solution. -- wzy
oh, haskell
u so crazy
>>
>>56257412
wat?
>>
File: moot.jpg (85KB, 1024x512px) Image search: [Google]
moot.jpg
85KB, 1024x512px
>>56257552
Who are you quoting?
>>
File: 1471893588284.jpg (140KB, 800x800px) Image search: [Google]
1471893588284.jpg
140KB, 800x800px
>>56257576
>>
File: rarest moot.jpg (663KB, 3000x2098px) Image search: [Google]
rarest moot.jpg
663KB, 3000x2098px
>>56257594
>>
>>56256307
First make sure your sample output is correct. You didn't follow the modulo with the same value. As for your loop, use two vars, one to hold the whole number and one to hold the value to be presented. That means num can't be changed until the end of the block in the iteration. Your code basically looks like you expect magic to happen. First, you need to know what you are trying to do. As it is, you are dividing 999 by 100 thats 99 ( I think you mean by 10 ) and then applying modulo with a factor of 10; that makes num 9. Then you add num to num which is 18. What you claimed to want is done by using only 10 in the operation and then having the result be output using the format you specified above.

What you ought to do instead is place an output function in the loop and feed it the result of each of the operations ( /, % ) with /n between each in the set. Your code literally just uses the operands but gets nowhere near what you want.
>>
>>56257552
Just checked in GHCi and the first typechecked fine, and had the same type as the second
>>
>>56256889
Problem is that I don't think there is an existing component (at least not one I can use for this purpose and use commercially).

Or am I misunderstanding something?
>>
>>56257712
whoops lots of errors in my own post that weren't there when I submitted post. I guess they filter over homework help questions.

That must be what the new posts.that.look.like.this are about.
>>
>>56256912
Yea, same goes for almost every language newer than VB6.. Thats the thing with big coorporations - They don't update their shit but still expect the IT guys to fix it like it was brand new
>>
>>56256344
I dont know twitter but maybe you need the "post" call for the javascript to update the page before you can crawl the text base to the account. You may need to inspect element if the api doesn't provide the means.
>>
>>56256307
What the fuck is ((a = a/10) != 0)?
>>
File: Where do you think we are 2.png (2MB, 1439x1080px) Image search: [Google]
Where do you think we are 2.png
2MB, 1439x1080px
>>56257692
help, need machine for programming
>>
>>56257800
This. Big corps run on old shit; pretty sure a bunch of banks still run on things made in COBOL?
>>
What's the best resource to learn C# online?
>>
>>56257827
Most programming can be done on a shitbox.

Your needs depend on the type of programming you're doing.

Your main constraints are RAM (if you use multiple instances of larger IDEs like VS or IntelliJ), CPU if you're trying to emulate Android devices or do audio/video encoding, and GPU if you're doing any sort of gamedev.

No one knows your budget or your exact habits and technologies.
>>
>>56257855
New to C# or new to programming?
>>
I want to implement a sort of note-taking syntax highlighting

anyone ever done that before?
Like defining an entire language you can place entries in and get their definitions, that sort of thing

I know notepad++ offers a capability similar to that but I've never heard of anyone using it for anything non-programming related
>>
>>56257822
lol

is the joke that this is the only part of the program that does as he intends for the program?
>>
>>56257830
Wouldn't surprise me. I know a lot of the biggest retail stores in my country do. The thing I'm working with is an old IBM platform. It turned 25 years old last year and the only thing being done to it upgrade wise is to build new fancy GUIs on top. It sucks
>>
>>56257881
Last I checked a command can't be used as a value.
>>
>>56257870
>larger IDEs like VS or IntelliJ), CPU if you're trying to emulate Android devices
trying to keep it under 1000 USD.
used server xeons? or is that a meme?
>>
>>56257902
You can assign within the conditional in java. possibly c#. I kinda liked that part of those languages.
>>
>>56257855
Everyone learns differently, but the banana book seems pretty solid.

http://www.csharpcourse.com/

There's a link to the PDF on the page; it's free.

>>56257909
You don't need to spend more than $600 or so on a desktop. Bump that to $900 for a laptop.

Either of these price-points would give you solid, multi-purpose machines.

Use this guide as a guideline (you can find prebuilts in these price ranges, too):
http://www.logicalincrements.com/
>>
>>56257925
That's really shoddy. You can't assume that (a = a/10) != 0 is the same as a != 0 after it's been divided by 10.
>>
>>56257902
>>56257925
It's valid in C# and Java
>>
>>56257855
If new to programming, google Rob Miles Yellow Book. >>56257927 beat me to it. Be warned that the book is by someone from the UK, so there are a few Brit-specific idioms and some Brit slang but it doesn't interfere at all with the writing (which is absolutely top-notch).

If new to just C#:
C# Player's Guide (general ins and outs of the language)
MSDN C# Tutorials
http://csharp.net-tutorials.com/ <-- These guys have a bunch of cool tutorials for general C# related things and web related things as well.
>>
>>56257879
I guess both.
Used C# in school about 6 years back, then I got a good job in tourism and I haven't coded since.
This year I'm going back to school and I want to be as prepared as possible in the small ammount of time I have.
>>
>>56252341
share is care
>>
>>56258002
see
>>56257927
>>56257982

Get the banana book.
>>
>>56257781
>write another component
Yes you are. I'm not a Microsoft Insider Poo2loo tho, so it might be an innappropriate way to go about it. To clarify: find an interprocess communication medium into which the legacy code can dump its emails, and have a more modern program read them at the other end and send them --- if there's really no other way. I have no clue on which IPC medium you could use tho cause I grew up with GNU/Linux and am not familiar with wangblows.
>>
>>56257727
>The restriction is turned on by default in compiled modules, and turned off by default at the GHCi prompt (since GHC 7.8.1).
isn't it great when the REPL produces a result different from what the compiler produces???
>>
>>56258009
>>56257982
>>56257927
I have the kindle, can any of you upload a free version? I have 0$ on my debit card.
>>
>>56258077
... The Yellow Book is free, moron.
http://www.robmiles.com/s/CSharp-Book-2015-Final.pdf
>>
>>56258077
It's free, you fucking moron.

You've already been linked to the book by >>56257927
>>
>>56258086
>>56258087
I meant for the kindle version which is $1.something on amazon.
>>
>>56258048
Given that you never input type signatures nor try to write backwards compatible code at the REPL, yes.
>>
>>56257955
Why would you assume?
The condition here is being asserted as, "where a as the result of the expression ( a /10 ) isn't yet equal to 0 -> continue )"

It's an amorphized approach to the literal parsing of the expression. I know "while this is that blah blah" is the intended syntax but the specific program he's modelling should make sense to him out of the proper and "well known" reading.
>>
>>56258096
this has nothing to do with backwards compatability
haskell cannot infer some types at all without the restriction
>>
>>56258096
And please not that when I write "you never input type signatures at the REPL", it doesn't mean that you usually don't, it's just that you CAN'T input them in the usual way at the REPL. I'm aware that there are clunky workarounds tho inb4. And yes it's the same as the syntax inside of a do block inb4. inb4 too many inb4s.
>>
>>56257880
nobody?

granted, it is difficult to even be allowed to use a laptop in-lecture
>>
I thought it'd be a good idea to have users drag and drop files and then zip them in the browser before sending them so I don't have to worry about fuckheads trying to send rars, as well as being a usability bonus, but holy shit it is SLOW. My one page app just bombs the fuck out for 15 seconds while it zips up two files adding up to about 10MB. I'm using JsZip. Do I have to use webworkers for this cancer?
Then when I try to send it using websockets it DOUBLE bombs out for like two minutes before it finally wakes the fuck up.
>>
>>56258114
We're both talking about the monomorphism thing right?
>>
>>56257880
So be the first and make a blog post about it.
>>
>>56258244
yeah? well maybe I will!
>>
>>56258153
What are you using? I can't be bothered to type out the whole implementation without a basis. I'd recommend using the readLine() documentation in that case. Like you said, n++ would let you do what you want but I don't know what few people using it has to do with the term to project.
>>
>>56258267
don't forget to link.
>>
>>56254435
Welp, I'm a moron

replaceid="0"
placeholder="90"
replaceidnew=$(gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify appname ${replaceid} /home/user/scripts/xfpm-brightness-lcd.png "" "" [] "{'String':<0>,'value':<${placeholder}>}" 2000 | cut -c 9-10)
>>
New thread:
>>56258339
>>56258339
>>56258339
Thread posts: 332
Thread images: 48


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