/dpt/ - Daily Programming Thread

Oliver Foster

What are you working on, Jow Forums?

Attached: 1562965914194.jpg (356 KB, 1280x720)

What are you working on, OP?

Luke Morris

nth for negative progress

William Nguyen

trying to solve the halting problem

Attached: 1563099583624.jpg (26 KB, 319x198)

Liam Wood

What are you working on, Jow Forums?
Mustering up the energy to implement locking memory pages into my allocator so that I can keep my secret keys from being swapped out.

It's easy, but boring, which is why I haven't done it yet.

Henry Jones

Porting a I2C sensor library written in Python to Go.

Attached: cd53c61559974d1fa22a094ecff1f8a3-original.jpg (266 KB, 1552x873)

Aiden Robinson

Why do you heff to be so mad?

Chase Murphy
James Ramirez

post a challenge

Attached: cr1135454337795.jpg (497 KB, 1737x1345)

Wyatt Reyes

java is the most powerful programming language

Brody Price

implement an interesting eso-lang.

Ethan Nelson

Write a program that adds two numbers together.

Carson Jenkins

Why hate them? Do you lack emotional competence?

Noah Walker

implement try, throw and catch in a language of your choice (without using builtin exceptions if your language already has them)

Jonathan Powell

Given a pattern and a string str, find if str follows the same pattern.

Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.

Example 1:

`Input: pattern = "abba", str = "dog cat cat dog"Output: true`

Example 2:

`Input:pattern = "abba", str = "dog cat cat fish"Output: false`

Example 3:

`Input: pattern = "aaaa", str = "dog cat cat dog"Output: false`

p.s. You may assume pattern contains only lowercase letters, and str contains lowercase letters that may be separated by a single space.

Elijah Evans

not calling out leeches for being leeches is emotional competence somehow

Attached: 1405462360897.jpg (138 KB, 380x572)

Hudson Garcia

have sex

Oliver Hill

What language does it compile to?
And why'd you start making it?

Mason Parker

From my perspective you seem delusional. Your view of yourself seems to be greater than what it is in reality. Not to put you down, just seems odd you would use incompetence as a reason to be angry. Perhaps, it is projection?

Charles Richardson

Abracadabra! Now Anone won't be late for my JavaScript lesson next time or his peepee will be small!

Attached: ee58db391d031da8257d3a2f4dd8ce93.png (679 KB, 510x680)

Brayden Morgan

impossible
oh fuck, the stakes have risen

Zachary Phillips

From my perspective you seem delusional
From my perspective I don't give a fuck about your opinion. What I care about is you stealing my time, which I'll prevent by ignoring you henceforth.

Austin Davis

Appropriate response, I suppose.

Eli Jackson

henceforth.

Attached: 1559553918450.png (119 KB, 583x482)

Liam Morales

insofar

Joshua White

Go back whence you came.

Anthony Hall

That language is very unbecoming of you

Jayden Cox

hitherto

Michael Williams

letten us beginnen

Julian Foster

I want to start with osdev. what do?

Josiah Green

start?

make haste

Wyatt Walker

Come back once you reached long mode in QEMU.

Samuel Martin

good tip.
let's write generic tips in fancy pants language.

Connor Moore

thou dost jest

Henry Martin

fancy pants
Pantaloons, user.

Luke Taylor

I'm working on a Majora's Mask HD Installer(which installs Project64, GlideN64, etc etc) for newbies since installing it requires a lot of effort from the user, so I'm completely automating the process, it's already largely done functionality wise(already works) and I made it flexible(I have an installer config the installer fetches when installing, which contains all the components it needs to install).

Lisp is the most powerful programming language.

Hunter Anderson

Don't think too much, just start.

Aaron Edwards

Maybe only second best to C++ if anything

Gavin Lopez

can sepples do this

`CL-USER> 12/94/3`

Jose Bailey

yes

Charles Baker

show me

Joseph Phillips

`#include <my_rational_lib>Rational r = 12_R / 9_R;}`

Blake Price

lulz

Dylan Carter

Aren't identifiers not allowed to begin with a number?

Ryan Jenkins

`>>> from fractions import Fraction Fraction(12,9)Fraction(4, 3)`

Dylan James

`(print 12/9.6)*** - EVAL: variable |12/9.6| has no value`

Easton Brooks

that's a user defined literal, not an identifier

Grayson Bennett

here you go

Attached: www.png (137 KB, 737x2966)

In that case wouldn't it be

`12r / 9r`

, like in
`12ul / 9ul`

?

Benjamin Russell

only literals defined by the standard library can have single letter suffixes
user defined literal suffixes must begin with _

John Sanders

`void Main(){    var inputs = new []    {        Tuple.Create("abba", "dog cat cat dog"),        Tuple.Create("abba", "dog cat cat fish"),        Tuple.Create("aaaa", "dog cat cat dog")    };        foreach (var input in inputs)        Console.WriteLine(solve(input));}bool solve(Tuple<string, string> input){    var dict = new Dictionary<char, string>();    var pattern = input.Item1;    var arr = input.Item2.Split(' ');        for (var i = 0; i < pattern.Length; i++)        if (!dict.ContainsKey(pattern[i]))            dict.Add(pattern[i], arr[i]);        else            if (dict[pattern[i]] != arr[i])                return false;    return true;}`

please don't kill me for not using {} in if & for

Joseph Sanders

version 2, change solve's parameters

`void Main(){    var inputs = new []    {        Tuple.Create("abba", "dog cat cat dog"),        Tuple.Create("abba", "dog cat cat fish"),        Tuple.Create("aaaa", "dog cat cat dog")    };        foreach (var input in inputs)        Console.WriteLine(solve(input.Item1, input.Item2));}bool solve(string pattern, string sentence){    var dict = new Dictionary<char, string>();    var arr = sentence.Split(' ');    for (var i = 0; i < pattern.Length; i++)        if (!dict.ContainsKey(pattern[i]))            dict.Add(pattern[i], arr[i]);        else            if (dict[pattern[i]] != arr[i]) return false;    return true;}`

Cameron Fisher

yes, that is not a ratio

Jaxson James

it should print the float value then

Wyatt Bell

version 3 with checking if pattern or sentence is empty

`void Main(){    var inputs = new []    {        Tuple.Create("abba", "dog cat cat dog"),        Tuple.Create("abba", "dog cat cat fish"),        Tuple.Create("aaaa", "dog cat cat dog"),        Tuple.Create("aaa", ""),        Tuple.Create("", "dog cat"),        Tuple.Create("", "")    };        foreach (var input in inputs)    {        Console.WriteLine(solve(input.Item1, input.Item2));    }}bool solve(string pattern, string sentence){    if ((pattern.Length == 0 && sentence.Length > 0) || (pattern.Length > 0 && sentence.Length == 0))    {        return false;    }        var dict = new Dictionary<char, string>();    var arr = sentence.Split(' ');    for (var i = 0; i < pattern.Length; i++)    {        if (!dict.ContainsKey(pattern[i]))        {            dict.Add(pattern[i], arr[i]);        }        else        {            if (dict[pattern[i]] != arr[i])            {                return false;            }        }    }    return true;}`

i'll be a good boy before someone murders me for not writing those {}

Isaac Parker

that for loop is way faster than a for each right?

Charles Williams

i tried using foreach first, but decided to change it.
if i use foreach, i still need to access the arr variable based on the index.
so i use for.

Julian Ortiz

you could give a number to the pattern like
pattern: abba -> 1221
string: dog cat cat dog -> 1221

and then compare them

Tyler Brown

Next challenge. Given a finite list as an argument, generate a circular list.

Example:

`Input: [1, 2, 3]Output: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1...]`

Parker Sullivan

`(ns fun.challenge  (:require [clojure.core.unify :refer [make-occurs-unify-fn]]            [clojure.test :refer [is]]            [clojure.string :as string]))(def unify (make-occurs-unify-fn string?))(defn follows? [string pattern]  (= (count (set pattern))     (count (unify (map str pattern)                   (string/split string #" ")))))(is (= true (follows? "dog cat cat dog" "abba")))(is (= false (follows? "dog cat cat fish" "abba")))(is (= false (follows? "dog cat cat dog" "aaaa")))`

those {}
It was fine without them.

Hudson Peterson

it means i still need that variable to store the number, right? and increment it every time i get a new one (1 -> 2, 2 -> 3, etc).

Colton Ortiz

generate a infinite list
what

`While True: input.repeat()`

Hunter Brown

`(cycle [1 2 3])`

Connor Johnson

I saw your Dictionary<char, string> and thought you could use 2 simple arrays of integers and you fill them while parsing the input

Blake Walker

can you give an example?
i'm not sure i understand it.

Oliver Barnes

Working on my kernel a bit today. Just added a sweet mechanism that allows you to block a thread until an arbitrary condition is true :)

`void Thread::block_until(Function<bool()> condition);`

Attached: Screenshot-at-2019-07-14-14-58-43.png (723 KB, 1920x1080)

Landon Gray

`function* repeat(iterable, amount = Infinity) {  if (amount === Infinity || amount !== amount) {    for (;;) {      yield* iterable;    }  }  let i = 0;  for (;;) {    for (const value of iterable) {      if (i++ >= amount) {        return;      }      yield value;    }  }}`

Noah Taylor

pattern: abba -> 1221
string: dog cat cat dog -> 1221

start with "a" give it a value of 1, then you have "b" give it a value of 2, next you have a "b" again so you give 2 again next you have "a" then you give 1 again

Neat, user! Very sweet mechanism indeed. That piano looks neat too!

Thomas Parker

Why are you using the Tuple class instead of value tuples?

Michael Lee

`(define (match s l)  (define (go ss l acc)    (cond ((null? ss) (null? l))      ((null? l) #f)      ((hash-ref acc (car ss) #f) => (lambda (x)                       (and (equal? x (car l)) (go (cdr ss) (cdr l) acc))))      (else (begin          (hash-set! acc (car ss) (car l))          (go (cdr ss) (cdr l) acc)))))  (go (string->list s) (string-split l #\space) (make-hash-table 32)))`

Isaac Edwards

well, i changed the parameters in v2.
the tuple is only used for problems.
i could changed them too into pair of strings

Grayson Lopez

Oh yeah, computers should always have a little desktop piano for tinkering

Evan Wilson

after adding a & b
then you add b & a, you need to check what are the values of b & a.
i use dictionary because it's fast to check.
of course it's not noticeable if the pattern is short like this example (only 4 chars).

Jason Morgan

`static IEnumerable<T> Circular<T>(IEnumerable<T> items)        {            while (true)            {                foreach (var item in items)                {                    yield return item;                }            }        }                static void Main(string[] args)        {            IEnumerable<int> items = new List<int>() { 1, 2, 3 };            var sequence = Circular(items).Take(10);        }`

Landon White

he didn't say the challenge was to prove how retarded this
{
bracing style
}
is

Hunter Richardson

lol try to be nice

Sebastian Cooper

Pretty nifty, bud. Have you managed to make the install/build process simpler, yet? That's the only thing that's been holding me back from tinkering with it.

Zachary Morris

`const builderFactory = () => ({  map: Object.setPrototypeOf({}, null),  getId: (i => () => ++i)(0),});function patternMatch(pattern, string) {  const patternNumbers = Array.from(    pattern,    function (char) {      return char in this.map ?        this.map[char] :        this.map[char] = this.getId();    },    builderFactory(),  );  return string.split(" ").every(    function (word, i) {      const number = word in this.map ?        this.map[word] :        this.map[word] = this.getId();      return number === patternNumbers[i];    },    builderFactory(),  );}`

Blake Reyes

Why aren't you using Go yet, user?

Attached: go-peek.png (19 KB, 179x300)

Samuel Hernandez

in python this is just

`>>> circular = lambda l,n:l*n circular([1,2,3],5)[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]`

Blake Lewis

`static IEnumerable<T> Circular<T>(IEnumerable<T> items {            while (true) {                foreach (var item in items) {                    yield return item;                }            }        }                static void Main(string[] args) {            IEnumerable<int> items = new List<int>() { 1, 2, 3 };            var sequence = Circular(items).Take(10);        }`

FTFY

Luis Scott

greedy execution
lmao

Nathan Wood

I use the idiomatic bracing style for the language being used because stylistic loyalty is for hobbyist devs.

Easton Jackson

I can't into go routines. I think synchronously and have synchronous problems.

Jace Green

Because Go doesn't allow me to perform memory allocation optimisations.

Ian Brooks

Are those {}s for single things necessary in C#? Kinda sad

Dylan Garcia

it's different.
in his code, when taking 10 the result is:
1,2,3,1,2,3,1,2,3,1 -> only 10 numbers
your code replicates the array by a number

Joshua Thomas

see

no

Jace Cook

It should be pretty easy these days. :)

`cd serenity/Toolchain/bash BuildIt.shsource UseIt.shcd ../Kernel/./makeall.sh./run`

Attached: 1560384674333.png (285 KB, 539x539)

Samuel Hughes

i'm stylistically loyal to ENTERPRISE because stylistic loyalty is retarded

Attached: 1562575877342.gif (167 KB, 500x382)

Chase Powell

C# is just like C/C++.
Single statement block doesn't need {} at all.
But some will try to murder you if you omit them.

James Garcia

It's not but C# doesn't understand shadowing :^)

`if (true){  int x = 34; }int x = 11; // error`

Camden Kelly

Oh that is based as fuck. Time to fire up my Lubuntu VM.

Thanks, Kling. You should hang out on the discord more.

Attached: 1522882308682.jpg (49 KB, 990x682)

Cameron James

Why aren't you learning the necessary math right now? This guy explains it so that even a brainlet can understand it!

Attached: 3b1b.jpg (75 KB, 900x900)

Wyatt Reed

it's fine

Carson Campbell

DISCORD TRANNY

Camden Bailey

You misspelled "maths".

Kayden Lee

`-module(summ).-export([main/0]).main() ->A=105, B=567895,addAB([A,B]).addAB([A, 0]) ->  A; addAB([A, B]) ->  A + addAB([1, (B-1)]).`

Cameron Young

who is this guy?

Christopher Fisher

here you go

`>>> circular = lambda l,n,y:(l*n)[:y] circular([1,2,3],5,10)[1, 2, 3, 1, 2, 3, 1, 2, 3, 1]`

Jace Price

`if (true){  int x = 34; }{    int x = 11; // not error}`

Dominic Miller

`static IEnumerable<T> Circular<T>(IEnumerable<T> items) {  while (true)    foreach (var item in items)      yield return item;}static void Main(string[] args) {  IEnumerable<int> items = new List<int>() { 1, 2, 3 };  var sequence = Circular(items).Take(10);}`

Luis Scott

3b1b. Based YouTube channel.

Aaron Williams

no generics

Jason Richardson

Not the same thing LOL SAD

Jacob Jackson

halting of progress?

Jonathan Brooks

i know lol

Benjamin Sanchez

We have systematically ousted leftists, trannies, and all other stripes of undesirable from the /dpt/ discord. Sort of an ubelraus, if you will.

Xavier Garcia

can someone throw an invite to the /dpt/ discord?
thanks

Chase Butler

the /dpt/ discord
you are an undesirable

Brandon Gomez

Based
fuck off zoomer

Jonathan King

Go 2 should be hopefully released by 2020.
Until then, we're stuck with WET code.

Joshua Myers

Sorry pops, but IRC doesn't support embedding tranny murder videos. Once you design a modern protocol and a thin client, let me know.

Asher Green

what makes you think IRC is any less cancerous

Lincoln Gonzalez

Each message is 512 bytes in size. That's simple.

Eli Kelly

sent ;)

Parker Clark

off-site circlejerks are cancerous

Joseph Hall

Right now the only cancer I see is you.

Ethan Cox

is python based?
how come its so much wanted on job market? what do these people do in python? dont tell me its webdev

Justin Sanchez

it's webdev
sometimes data science, but mostly django shit

Nicholas Rogers

Nice excuse to learn generators

`function* loopArray(list, index = 0) {    while (true) {        yield list[index % list.length];        index++;    }}const items = loopArray([1, 2, 3]);`

What does

`yield* iterable;`
mean in this context? generators are new to me.

Asher Rogers

certain branches of scientific computing, prototyping, teaching, webdev

Carson Kelly

Python exists because Pajeets cannot be bothered to actually learn how to do stuff, and there's more than one billion of the fuckers.

Catering for the masses and all that.

Xavier Brooks

i also wouldn't mind checking back in for a while just to see what people have been up to over the last few years

Brody Roberts

currently only into c++.

it started with writing algorithms to automate optimizations (ex: concurrency, locality of reference(cache friendliness), data structure choice, memoization,....).
some of these algorithms require input from the user, for example the constraints on the data structure (unique/ordered/... elements), or straight up run analysis on the AST/IR.
so i needed to create a language to let the user express that info.

some of these optimization algorithms aren't practical for humans to apply, so it would be really interesting to see how much performance they'll be able to squeeze out of the hardware, especially now that we start seeing high core count desktop CPUs.

Attached: 9e6.jpg (266 KB, 1539x743)

Carter Lewis

jobs: webdev
other uses: statistics, scientific computing, malware analysis

David Morales
Thomas Howard

post new challenge

Joshua Price

what did they mean by this? cant be webdev, please no
i thought people use python for writing scripts for system administration, science and shit
why dont they use php or js or other meme shit for webdev fucks sake

Attached: what.png (103 KB, 1036x938)

Benjamin Thomas

is python based?
Never liked whitespace indentation and dynamic typing, but it's neat for quick, dirty scripts.
what do these people do in python
Statistics, web scraping, data science, and the like.
We tried using it for the Raspberry Pi, but it was shit for the reasons above.

Christopher Clark

most development is webdev.
if something is popular, it's probably also used in webdev.

Lucas Clark

find a job for F# position

Camden Davis

The fact that Rust is topping 'most loved' for years despite being insanely high-friction and a meme hobby lang, I think that says enough about the SO dev survey.

Ethan Sanders

science and shit
, but system maintenance is mostly done in Bash and Perl.

Christopher Evans

sorry friend
it's webshit

Julian White

but I don't like fintech :(

Lucas Green

given a human body approximated by a cylinder of radius r and height h, and a rectangular towel with dimensions n x m that is moved across the cylinder randomly for s seconds for a total time t, calculate the probability that the same region of the towel was used to dry off the face and balls.

David Perry

Cheers m8. I read the yield docs on msdn but didn't see there where seperate yield* docs.

Angel Moore

but how the fuck did he top javascript? seems very suspicious

i know this or any survey cant be trusted 100% but it still is a survey of probably hundreds of thousands of faggots from SO so love it or hate it it does give us general picture of whats happening

Hudson Jenkins

because JS is a clusterfuck

Jacob Davis

because JS is a clusterfuck
yeah but its a webdev in a nutshell so its weird that those fuckers need anything but a meme clustefuck language or technology
lets write 1000 javascript libraries that move square 100px to the right and load 3MB of library to do that

Hudson Stewart

Attached: 1562881939404.png (906 KB, 1080x1087)

Jaxson Price

not everyone is a frontend webdev, and even frontend webdevs might have first learned python and remember it fondly while struggling in the toxic wasteland that is js

Angel Thompson

but my point was that javascript is used for backend as well nowadays and webdev idiots will push it even more

Connor Russell

`Equal @@ [email protected]*PositionIndex /@ {Characters[#1], StringSplit[#2]} &`

Asher Baker

nah, you're wrong

Mason Rodriguez

javascript is garbage bro

James Campbell

and you're still wrong

Liam White

There's no difference between a lazy infinite list and a function so

`def circ(l): return lambda i: l[i % len(l)]`

would work

Luke Rodriguez

He's right, tho.

Owen Allen

float.js

Robert Hughes

<function circ.<locals>.<lambda> at

Jackson Wood

`>>> l = circ([1, 2, 3]) l(10)2`

Jeremiah Cook

that's not even what the problem asks

Jeremiah Green

How is it different.

Ryan Walker

read carefully and see if your program does the same

Aaron Thompson

nah, only brainlets diss JS

Lincoln Jackson

working on gui library
make box select that adds elements to a semantic group
semantic group can include gui elements
a semantic group can itself become a gui element
semantic groups can be added to higher level semantic groups to produce new functionality
the gui primitives are themselves implemented this way
programmable gui that can be modified in real time using the gui itself
Am I going too deep?

Attached: 1562795884627.jpg (58 KB, 456x578)

Ian White

It effectively does.

Lucas Hall

what is 0.1 + 0.2 in JS

Aiden Thomas

How would you be able to tell, being a brainlet and all?

Mason Sanders

NaN

Hudson Moore

approximately 0.3

Jaxon Jackson

Exactly the same as in any other language that has doubles

Lucas Brown

last reply you get from me

`>>> l = circ([1, 2, 3]) l(10)2`

it should print
`[1, 2, 3, 1, 2, 3, 1, 2, 3, 1...]`

and take a slice from that list

retarded faggot

Jackson Thomas

an arbitrary box select shouldnt be a basic GUI construct. box selections only exist within a context, like an icon panel

Dylan Wright

`> (+ 0.1 0.2)0.3`

Joseph Evans

It's printing the rounded figure.

Ryder Cook

those aren't doubles

Charles Harris

nope
so? it has doubles.

Alexander Bennett

What are they?

Jordan Stewart

try again with doubles this time, retard

Attached: unknown.png (4 KB, 280x209)

Cameron Nelson

So a call to create a list should return a string with cute little ellipses? Are you stupid?

`>>> [l(i) for i in range(10)][1, 2, 3, 1, 2, 3, 1, 2, 3, 1]`

Julian Ramirez

single floats
i'm only going by what said lul

Landon Gray

Everything in the program is effectively an icon. This started as a basic circuit design tool but I'm going to keep pursuing it, I think it could be a very powerful paradigm.

Attached: 9UPP38D.jpg (76 KB, 438x750)

Aiden Baker

yes
the second edition of HtDP

Luis Sullivan

I'm not looking for a safe space. Go back.

Jaxon Wright

thats not how GUIs work though
icons are only one sub-category

alright for real this time

`> (+ 0.1d1 0.2d1)3.0d0`

Ryder Carter

new programming challenge?

Bentley Sanchez

What the heck is an ubelraus?

Alright. Check if a function terminates for all inputs. You should be able to do this.

Oliver Scott

kek
write a program that makes you look like a 1337 h4x0r

Christian Richardson

It's not how guis normally work, right.

Imagine if the cursor itself and how it behaved was just a function of gui elements and operators previously defined by the cursor in a semantic group, so you could program new cursor modes like group selection or grid snap within the program itself. I'm going full acid trip.

Attached: p.jpg (166 KB, 1000x1500)

Kayden Brooks

easy.

`def g(dom, f):    for v in dom:        f(v)    return true`

fullfills f terminates for all v in dom => g(dom, f) = true

Henry Sullivan

reminds me of how lisp works a lot, sounds cool

Jose Taylor

People generally want GUIs to behave the same so they know how to use them

Charles Mitchell

Here you go user, cute little ellipses and all.

`>>> class CircularInfiniteList():...    def __init__(self, l):...      self.l = l...      self.n = len(l)...    def __getitem__(self, i):...      if type(i) is not slice:...        return self.l[i % self.n]...      else:...        return [self[j] for j in range(i.start or 0, i.stop, i.step or 1)]...    def __repr__(self):...      return str(self[:3 * self.n + 1])[:-1] + ', ...]'...  l = CircularInfiniteList([1, 2, 3]) l[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, ...]`

Alexander White

...that took faster than expected.

Justin Carter

what is the usage of this

Caleb Sullivan

`cycle xs = go xs where  go [] = go xs  go (y : ys) = y : go ys`

Colton Green

you want to know if your code terminates, don't you?

Matthew Cooper

Actually I don't care.

Nathaniel Ramirez
Thomas Butler

but it always returns true

Mason Morales

A--user...

Owen Robinson

`cycle = cycle >>= foldr (:)`

Aaron Campbell

If i want to learn to be a developer, what should i do?

Learn CSS and HTML? Learn Javascript?

My plan for an App is an all in one fitness tracking, training program, nutrition and comparison app.

Mostly made for my personal needs because i can't find a fitness app that quite does what I want

Leo Foster

Learn Lisp.

Jaxson Morgan

If i want to learn to be a developer, what should i do?
Talk about projects that you never intend to do. Ironically you're already on the right path.

Jordan Flores

I was planning on making a prototype in excel first, a program i can actually use well already

John Brooks

`class CircularInfiniteList():  def __init__(self, l):    self.l = l    self.n = len(l)    self.d = dict()  def __getitem__(self, i):    if type(i) is not slice:      if i not in self.d:        return self.l[i % self.n]      else:        return self.d[i]    else:      return [self[j] for j in range(i.start or 0, i.stop, i.step or 1)]  def __setitem__(self, i, x):    self.d[i] = x  def __repr__(self):    return str(self[:3 * self.n + 1])[:-1] + ', ...]'`

`>>> l = CircularInfiniteList([1, 2, 3]) l[4] = "hey what's up" l[1, 2, 3, 1, "hey what's up", 3, 1, 2, 3, 1, ...]`

Why is Python so cute?

Camden Phillips

wow, it even fulfills "f doesn't terminate for all v in dom => g(dom, f) != true"!
let's apply the contrapositive to get "g(dom, f) = true => f terminates for all v in dom" and thus "g(dom, f) = true <=> f terminates for all v in dom"!
halting problem solved!

Logan Davis

this isn't a circular list

Joseph Barnes

Why not?

Jordan Kelly

Indexer

`void Main(){    var input = new [] { 1, 2, 3 };    var circular = new Circular<int>(input);    for (var i = 0; i < 10; i++)        Console.WriteLine(circular[i]);}public class Circular<T>{    private readonly T[] data;        public Circular(T[] data)    {        this.data = data;    }        public T this[int i]    {        get { return data[i % data.Length]; }    }}`

Thomas Nelson

each node is unique in your list
point the tail to another element in the list

Alexander Roberts

you programmers really suck
bunch of faggots lol

Attached: ayy.png (4 KB, 266x45)

Dominic Stewart

Not true. I don't think you understand what I wrote.

Daniel Carter

Your opinion on the TDD meme?

Attached: 1562397148547.png (299 KB, 480x480)

William Ramirez

what app

Isaiah Garcia

Attached: angtft.jpg (42 KB, 616x342)

Austin Campbell

Red-Green-Refactor is a meme, but the concept of writing how you want to solve the problem first, then making it work is solid.

Brandon Bennett

i do
your example proves you don't know what a circular list is

Nicholas King

Lel it's because swift is so verbose

Nolan Young

If only you knew how bad things really are.

Attached: 1563010972781.png (90 KB, 276x347)

Josiah Smith

Then what is your definition of a "circular list"?

Nathaniel Gonzalez

just finished this
github.com/majestrate/audiodookie

Bentley Garcia

just look at your example.
you modify the value of one of the nodes. thus it should affect every occurrence of said node. but 2 still appears.

Mason Ward

You definitely don't understand what I wrote.

Chase Gray

The item after the end of the list is set to the first element of the list.

`* (setf *print-circle* t)T* (defun circular (list) (setf (cdr (last list)) list))CIRCULAR* (circular '(hello Jow Forums how are you today?))#1=(HELLO Jow Forums HOW ARE YOU TODAY? . #1#)`

Jaxson Lewis

your output is wrong, try again.

Jaxson Cruz

int main(int argc, char * argv[])
doesn't use args
dropped

Aaron Smith

#1=(HELLO Jow Forums HOW ARE YOU TODAY? . #1#)
Don't shout at me daddy

Gavin Rogers

improves code quality tremendously.

Michael Taylor

Here you go buddy. You'll get there one day.

Attached: 447d9890552eb8f429d12ad1e9071bab.jpg (30 KB, 232x320)

Gavin Jones

is this the best python book?

Lucas Gonzalez

Lisp tends to shout at people, it came from a world where computers might not have had lower case characters.

`* (circular '("hello" "Jow Forums" "how" "are" "you" "today?"))#1=("hello" "Jow Forums" "how" "are" "you" "today?" . #1#)`

Jason Ortiz

It's perfect for some of our slower posters.

John Thompson

How the fuck do you deal with a codebase that does most of its business logic in stored procedures? Needless to say they tend to be hundreds of lines long and there's thousands of them.

Attached: 1553868306796.jpg (315 KB, 1280x720)

i don't know python, but i can guess what he wrote.
he override the circular array with the dictionary.
l[4] = "hey what's up"
so when printing the values, index = 4 is overrided by the value in dictionary.
this feature is not asked in the original problem.
it's like you're asked to draw a snake but add legs on the snake picture.

Attached: jashin-chan-leg.webm (189 KB, 700x394)

Isaiah Roberts

`CL-USER> (defun cycle (list)           (setf (cdr (last list)) list))CYCLECL-USER> (let ((l (cycle '(1 2 3))))           (setf (nth 4 l) "hey what's up")           l)#1=(1 "hey what's up" 3 . #1#)`

maybe understand what a circular list is lol

Ayden Parker

sql monkey here.
that's what we do all the time.
it's a hard because debugging sql is a pain in the ass.

Robert Johnson

yeah, it wouldn't surprise me the pythonista would misunderstand the problem.

Eli Wright

Come on user start reading. I believe in you.

`>>> l.l[1] = "hey what's up" l[1, "hey what's up", 3, 1, "hey what's up", 3, 1, "hey what's up", 3, 1, ...]`

Jace Sullivan

That's one thing, also shit's pretty much untestable. Version controlling is also a bitch. I'm thinking of looking for another job honestly.

James Thompson

that doesn't produce a list as the challenge states

Connor Johnson

How could there be that much logic?

` MSRP * Quantity = price `

It's not that complicated.

Daniel Hill

yes, this is what should be printed. was that so hard?

Logan Price

Good job.

If he really wants behavior like it's as easy as getting rid of the dict and doing

`def __setitem__(self, i, x):  self.l[i % self.n] = x`

Nathaniel White

i had a boss who's like that. one day we almost got the project done and presented to the client's it dept. the it dept was happy and asked to do minor cosmetic changes. boss said i had better idea, we should change the functionality of the system. a week went with us did massive changes to the core engine. next week, the it dept and the users did UAT. they were confused because what they saw last week was gone. changed into something they never want. it's like you ordered a steak and got something else.

Liam Robinson

is it a data analyst position?

Zachary Hughes

it's pretty messy, because we have lots of version running on each customer.

Henry Foster

This whole conversation was about behavior undefined in the original problem. If you didn't have the obligatory LISP programmer chip-on-your-shoulder you could have just stated this clearly from the beginning.

Leo Lewis

that's pretty funny. it amuses me what goes on in people's minds sometimes.

Jacob Robinson

No, regular software developer position. The software in question is a payment gateway.

Chase Wood

it did.

Brody Wood

i can't into reading comprehension: the post
git gud pythonista

Nolan Nelson

are you well versioned in SQL and git? did your bosses throw you something no one wants to work with?

Christian Watson

no, it prints out values as they are generated rather than storing them in a list.

Brayden Green

my ex-boss was a genius guy who thought that his ideas were the best and should be adopted by everyone even when they didn't want it. i quit the job after that project is done.

Michael Harris

The problem was solved at , everything after that was just having fun.

Hope that superiority complex keeps you warm at night.

Juan Cook

php will outlive you all ahhahaha

Austin Young

stay mad pythonfag hahaha
give me more (You)s pls

Wyatt Harris

Actually at

Jack Sullivan

do you program in it?

Attached: -r.jpg (1.03 MB, 4032x3024)

John Gray

i do :/

Brandon Mitchell

Yeah well that would be easy, it manipulates tons of state over multitude of tables usually. It's fragile as shit.

are you well versioned in SQL and git?
Yes.

did your bosses throw you something no one wants to work with?
I don't think anyone here enjoys working with it, but they just want to shit out stupid code and fuck the consequences. Kind of sad since they have many years of experience.

Lucas Torres

fag
Why the homophobia?

Kayden Nelson

Of course it didn't take long. I2C isn't a complex protocol.

Jacob Bennett

macbook

Attached: gross.jpg (88 KB, 320x440)

Cameron Cook

apple website

Jackson Reyes

tell me your longest stored procedures.
how many characters in it?
mine has 184044 chars

Ryan Wright

184044 chars
2985 lines

Owen Evans

1 procedure with +2000 lines
lol what

John Cruz

welcome to the real world, chump

Jaxson Parker

Making chocolate pudding.

Attached: stu-4am.jpg (16 KB, 480x360)

Christian Foster

Thoughts on Elixir? I'm looking for a new language to learn, and this seems interesting and different enough while still being useful.

Grayson Morales

my friend who worked at another company once had a 5000 thousand lines stored procedure.
i don't know how many chars in it.
could be longer/shorter, depend on his style.

Jason Price

*welcome to a shit ass boomer company with no standards

Jayden James

the real world is boneheadedly retarded

Dominic Brown

+2000 lines
it's almost 3000 lines, just 15 more lines

Ian Stewart

does SQL have a "SQLlint" that formats the code?

there're external tools to format your code.
but i don't use it.

Ryan Green

find me a company that has standards and i'll find you a goose that can shit golden eggs

find me a company that has standards
plenty of them around. companies that do code reviews, have a code style guide, etc.

Sebastian Ramirez

must be big companies.
small companies don't have time for code reviews, standard coding style, etc

Easton Hall

My company uses me as a standard;
if I don't barf reviewing it it's OK.

Brandon Jackson

just wait till a client needs their product right now, and there is no time for a review (or a very brief one)
"we'll just patch out the bugs later"

we don't test the code.
we let the customers test the product.

Charles Bell

what is A/B testing

Sebastian Long

yeah, what's QA? never heard of that before...

Leo Parker

I'm reading K&R second edition (which uses ansi C I guess?) and it seems outdated: everytime I compile a program compiler gives a warning about returning type being an int
is it better to use C: A Modern Approach (K. N. King) or Programming in C (Kochan) using C: A Referece Manual as supplement? which book has the best theory and which has the best exercises?

Josiah Parker

queef airators

Cooper Clark

what's the code that causes the warning?

Cooper Gray

Question
Authority

Camden Cruz

Nice one.

Anthony Baker

quality ass

James Wright

use Turbo C in Dosbox

Andrew Hughes
Isaiah Lewis

why did AMP fail? She's so much cuter than ((((((CUDA))))) and opencnile

Attached: aaarrgghh.jpg (73 KB, 788x805)

Elijah Cox

Because manipulating statistics can only get you so far.

Jackson Ross

38
explain

Brayden Miller

anything since hello world, to me it just shows how the book is outdated

`#include <stdio.h>main(){    printf("Hello, world\n");}`

I'll look it up but can't you recommend any of the books from my post? I've read rbt archive and many posts recommends either K. N. King or Kochan

thanks
I see this link lists a class using HTDP as prerequisite to read it, should I go through it first before K&R?

Benjamin Peterson

so why dont other languages use pointers?

Jackson Lee

FORTRAN

Isaac Edwards

Pascal

Luis Smith
Bentley Kelly

i meant releveant languages in 2019

Kayden Price

compile with the -std=c89 flag
(still outdated stylistically, but it doesn't matter)

Jordan Reyes

Because people are actually afraid of them.

You remember your old <insert human language here> classes, when the teachers don't tell you a couple base things about the language being taught here? Like that the "r" in French is generated using the uvular? That the "th" in English is done by placing the tip of the tongue against the upper teeth row? Stuff like that isn't taught and practised

It's the same with memory.. People nowadays don't even know what padding bytes are.

Nathan Evans

Sea
Sepples
Assembly
Rust kinda does

Alexander Cruz

explicit pointers really are great

Gabriel Green

Abstracting them away opens up more opportunities for optimization, not that it matters because many other common abstractions slow things down.

Joshua Gutierrez

I never take seriously someone who doesn't have a gf/wife

Jordan Carter

It's actually sad and funny that so many people care for premature optimisations that can actually be optimised by the compiler ("bitshift or multiplication"), but when it comes to memory people blindly trust the compiler to do the right thing (which it won't).

Logan Russell

im a 28 kissless virgin

James Flores

I am late

`bool Solve (string pattern, string str) {    string[] words = str.Split(' ');    return pattern.Length == words.Length &&             pattern.Zip(words, (p, w) => p + w)            .GroupBy(s => s[0])            .All(g => g.Distinct().Count() == 1);}`

Attached: baka.jpg (88 KB, 1280x720)

Eli Mitchell

thank you, user