What are you working on, Jow Forums?
Last thread:
What are you working on, Jow Forums?
Last thread:
Other urls found in this thread:
en.wikipedia.org
twitter.com
this tiny piece of code runs in the python terminal but when I try to execute wheremouse.py form inside the terminal it doesn't do anything, what gives?
HAHAHAHAHAHAHAHAHAHAHA
Sounds pretty accurate.
How do I get on top of everything? There's too much to learn.
when you say it doesn't do anything, do you mean it hangs or it quits?
Haha, you're a funny one, Anone! Doesn't excuse you from being late to my JavaScript lessons though!
There is no such thing as being on top of everything in this field. Do what you find necessary to achieve worthy goals.
it quits, the cmd terminal just stays open though and it just goes back to C:\users\blahblahblah without printing to the screen
I expected programmers to be generally high IQ. It seems I was disappointed.
I think the only high IQ programmers are those who do functional programming.
Where can I unsubscribe from your blog?
Have you tried changing range(1) to range(10) or something?
What happens in that time.time() < t_end comparison? Do you know what values it is comparing? If not, could you have it print them?
You can be high IQ and delusional at the same time. In fact, great intelligence is often required to sustain great delusions.
>What happens in that time.time() < t_end comparison? Do you know what values it is comparing? If not, could you have it print them?
why would it work in the terminal then?
Probably. That’s where most of the Math people crossover is. Physics and Math are pretty retard free (barring tv meme physicists)
Wise words
I don't know. I'm just checking the premises.
What do you want it to do? From the looks it you have a while loop that will run for 245 years, with two function calls, one which looks like you want to assign to something.
By python terminal you mean in Idle or ipython or just running python interactively?
Maybe those are idling while you don't type anything but running the script directly finishes quickly. Try printing some debug lines inside the while and after the for to see if they get printed.
I want to get frequencies for a numpy ndarray. Which one of all the different scipy FFT modules should I use? I just want to be able to see the amplitude for different frequencies.
*for sound data
The fft function from scipy.fftpack I think, it returns an array of complex values so you'll have to calculate magnitudes afterwards
it seems pyautogui.position just returns the mouse position. If you don't print it it won't do anything.
And your backline function just prints a return carriage which again doesn't show anything in the console, it just moves the cursor back to the start of the line (I think, I'm not sure how it works in window's cmd).
So your program will just do nothing for 5 minutes.
but what an exciting 5 minutes it is!
>physicians
>functional programmers
yeah, sure, bro.
no because this exact same code does this in IDLE
>physician
kek
pretty sure that's because the python REPL prints out the results of expressions that aren't assigned anywhere
in IDLE you can do shit like picrelated but in a real standalone program just putting "x" on a line by itself will be a no-op
you dont understand how the idle works. the idle log prints out the result of every line to the console (unless the result is None). for example:
>>> "2" # the value of the above line is 2 so it prints it
'2'
>>> a = "" # the value of this line is None, so it doesnt print
>>>
but if you ran "2" as a python file there wouldn't be any output
listen to user, brush your teeth, and add a print.
We use functional programming because alternative paradigms are Too Hard.
alright, now it still isn't doing anything
FUCKING REKT M8
why didnt it print hello user?
no manners
i have no idea, I've never done python in my life
>C#/.NET Core/ASP .NET Core > F#
>Java > Scala
which to choose to do backend programming? also which is more future proof?
I admit I'm not 100% aware about all those licensing shit Oracle did but I have a feeling C# will take Java's place in a near future due to this shit
c# will be much more popular now that it has a proper linux runtime and real devs can use it
cute dolls but why js?
What are some small, fun projects to do in C for a beginner? I'm just starting out, but all the stuff I want to eventually do is too hard to try right now.
Fizzbuzz
preemptive multithreaded kernel.
Read in a text file, replace all lowercase letters with capital letters, save it to a new file.
- reverse a string
- sum of primes below 2 million
- determine if a string is a palindrome
- invert binary tree
re-implement roller coaster tycoon
Sum of primes above 2 million.
type python wheremouse.py instead
How do i count "depth" of html tree? I tried like that, but nestedExpression must be not matched, because iterator stays at 0
%{
#include
#include
int min=0;
int i=0;
%}
tags ((h[1-5].*)|(p.*)|(i)|(li)|(ol).*)
openTag ()
closingTag ()
expression ({openTag}.*{closingTag})
nestedExpression ({openTag}. {expression}+.*{closingTag})
%%
[ \t\r\n] ;
. ;
{nestedExpression} i++;
{expression} printf("%s, %d\n", yytext, i);
%%
main()
{
//printf("Give me your input:\n");
FILE *fp = fopen("nEH.html", "r");
yylex();
fclose(fp);
}
here is HTML file i am testing:
My First Heading
My first paragraph.
1
2
BARABARA
>preemptive multithreaded
multi threading is always preemptive.
thank you user, much helpful. Now how do I get it to "return carriage" so it doesn't print a new line but prints on top of the old one.
How many lines are your longest single function in your current project?
Found one that's 300 lines. I know it's bad practice, but there is a certain elegance to having a clusterfuck of code in one place doing exactly what you want it to do, like a well oiled machine. Segmenting it all into 10 classes makes it lose its magic.
Scala. All the others are horseshit.
Long functions are fine as long as there's no repeated code, but 99% of the time you find a long function the reason it's long is because it repeats a lot of code, which is pretty much the single worst thing you can do in programming.
Is that Yacc? I'd write these by hand like a brainlet, but then it would be trivial to get the top of the parser stack.
It can be cooperative. TempleOS does that actually.
I only ever have a main function and put everything in there.
Based and codepilled.
threads: preemption
coroutines: cooperation
multi tasking: higher concept that may rely on preemption, cooperative, or both
F# seems pretty nice
What if you had a thread running on each cpu concurrently, but context switches only happened when you call yield? You could hardly call that coroutines.
Okay actually I admit I haven't used F# before, I just assumed it sucked because microsoft.
>threads: preemption
No they don't imply that. Try SCHED_FIFO (realtime scheduling priority) on Linux (and set /proc/sys/kernel/sched_rt_runtime_us to -1). Your threads will NOT be preempted and your PC will basically freeze if you do
for (;;);
189 but there is no reason for it because I could break it down so easily
you dont have to break it into classes, just split it off into private / hidden functions.
thisWasOnceReallyLong():
kitties = findTheKittens()
skinned = skinTheKittens(kitties)
food = cookTheKittens(skinned)
poop = eatTheKittens(fodd)
It's based on O'Caml.
of those, I'd choose Java unless you wanted to run Windows servers for whatever reason.
>licensing
OpenJDK, the reference implementation of Java, is FOSS and GPL.
Fiber implementations will typically not run two fibers in parallel though.
Uhh?? There are an infinite number of primes above 2 million.
Do you have a proof for that?
Not if you don't use bigint.
Plus, Oracle has competitors, so it's not like people are dependent on a monopoly. Companies such as Azul and IBM have produced their own JVMs.
>There are an infinite number of primes period
>2 million is not infinite
>Therefore there are an infinite number of primes above 2 million
>QED
Based and notbigintpilled.
>>There are an infinite number of primes period
Do you have a proof for this?
>There are an infinite number
>infinite
>number
infinite is not a number
you can always multiply two prime numbers together to get another one
based retard
you have to add one though
but then it may not be divisible
Are you retarded?
I assume you are fucking with me, but if you are being serious, here is the proof. It's a proof by contradiction.
>Suppose there is a finite number of primes
>These primes can be enumerated p1, p2,..,pn since there are a finite number.
>Let p=p1*p2*...pn+1
>p>pj where 1Thus p is prime.
>Therefore the set of primes is not finite
>Thus the set of primes is infinite.
Just semantics.
And this right here is why they tell you not to roll your own crypto.
That's the point. You DON'T want your new prime to be divisible.
if(test)
{
test
}
static const char myfmt = &"\t\t\t\t%s\n"[4];
printf(myfmt - indent, some_string);
Is it time for another edition of /dpt/ prime fizzbuzz? For the numbers 1 to 100
>print Fizz if it is divisible by 3 (not 5) and prime
>print Buzz if it is divisible by 5 (not 3) and prime
>print FizzBuzz if it is divisible by 15 and prime
>print the number otherwise
assert(isPrime((3 * 5) + 1));
off by one error
p1*p2*...*pn+1 does not itself have to be prime. It just has to be non-divisible by our finite set of primes.
That's not what the other user said though.
I hope your pointers are 8 bits long.
ptr + 1 will increment it by sizeof(ptr)
>+1 isn't always always +1
and Cniles complain about abstractions and hidden behavior behind overloads
>running a startup tech company
>looking for other programmers
>bunch of applicants mostly pajeets
>they're all more qualified than the people in my country
I need a programming project completable in C, java and python that a recent graduate should be able to complete in roughly 4-8 hours that will definitely filter out pajeets. What would you recommend?
A smartphone app that tracks the locations of any nearby ice cream trucks.
myfmt isn't a pointer though
Prime numbers are those numbers prime for division, right?
I haven't seen an ice cream truck in 5-10 years, they sell ice cream everywhere.
just read the rust book and now thinking about porting a library to rust
Any freelancers in here? what is it like?
its flex
What's a good way to do a pitch shift on an audio file in Java?