Old thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
got a big willy
Employed Coq programmer reporting in.
I sure do love dynamic typing!
Prove the following please.
Why are there so many jobs for C# and .NET? Sup Forums said it was a shit language for indians.
Friendly reminder that a program is not a proof!
Because there are a lot of Indians.
>is not a proof!
classical proof*
I don't have a compiler or a even a piece of paper near me right now.
will be a cs graduate in a few weeks
cant wait to start earning 100k
better start applying for mcdonalds right now, the application process takes 4-6 months at any major retail store.
i have battled compilers, discrete mathematics, graph theory, algorithms -- the list goes on
mcdonalds? beneath i
most likely i will be accepted into some position to do with big data, AI, the block chain, or kubernetes
>mcdonalds
i don't like it. what are some better options?
>I sure do love
But what is it that you love though?
.NET is Java for the 21st century.
>posts in /dpt/
>doesn't have access to a compiler
SE graduate here. I don't know a single student that graduated and didn't have a job lined up. Lowest was only 45k, highest offer I know of is 116k. I was offered 72k. Might be the area. I'm in PA.
Or... you will go 6 months without gainful employment and have a huge hole in your resume, making your degree completely worthless.
Why do you long for the touch of something that doesn't exist?
yeah well mate look your mum has a huge hole which is completely worthless so pot kettle black
If you decided to learn a programming language with the intent to program an interpreter in it, which would you choose? inb4 Kotlin
C
Haskell, easily`
PCF, easily`
Definitely C. There is a very good reason most language interpreters are written in C.
...
>most shitlang interpreters
ftfy
>compilers, discrete mathematics, graph theory, algorithms
All of which is high school level stuff.
I'm not going to say anything about the quality of the languages, but you can't deny that a huge portion of language interpreters are written in C.
>I'm not going to say anything about the quality of the languages
I'm going to though.
>a huge portion of shitlang interpreters
ftfy
Sounds like it'd be difficult. I was hoping to get something working over this summer. Maybe I should bite the bullet and just do this, since I want to take the project somewhat seriously.
Funny, I was looking into OCaml just now.
Thanks for the suggestion. I value your opinion.
Lisp newfag here.
Is there a function that deletes elements found in one list from another?
im wondering how to program this in python 2.7
total base instances = 20
target = ['list','of','targets']
while instances is more than 0
for every found target:
split instances evenly to every target
if targets > instances
every target after the limit of 20 will get a brand new instance outside of the maximum
to clarify on the instance splitting thing, say there are 2 targets, so that means each target gets 10 instances
if its an odd number like 19 it will still try to split it, all targets get 1 instance and one target will have 2 instances
OCaml too
You could write a lambda using member to check from the list, and use that as the predicate needed for remove-if.
I'm a newfag, too, so take that with a grain of salt.
Turing complete trash.
see
Turing machines don't exist, so there's no problem
That's what I did, but I just wanted to know if there was a function.
You can build an actual turing machine. You'll just need to find a limitless amount of tape if you want to be able to computer everything.
>computer
compute*
>you can build a turing machine you just need the components of a turing machine
I just finished writing a prime number generator using a sieve of eratosthenes in python
in java I just completed a module the verifies elliptic curve signatures
A program that requires infinite memory does not halt. We aren't interested in non-halting Turing Machines.
If you want to build a halting Turing Machine, you can do it with finite materials.
You da real everest niigggaaah
if you can just pretend to have a turing machine, then why not just pretend they aren't turing completee?
I never said shit about a universal Turing Machine. I was just talking about a "normal" Turing Machine.
I just took a glance through my copy of CLtL, it doesn't look like there is a function that does that specifically. I even checked to see if there was an obscure option in the remove functions for that. Someone might prove me wrong, though.
I wasn't talking about universal turing completeness
What problem sets is functional programming best for?
{}
>We aren't interested in non-halting Turing Machines.
Who exactly is ``we"?
The royal "we".
i think he means reddit
set-difference
>Goes on about reddit
>Posts Reddit: The Anime
>replying to your own post
Now I'm sure I'm just an idiot
but obviously io.write in Lua makes X variable into a string
so how do I get io.write to make X Variable into a number and not a string so I can select a slot in a Table?
Currently it just gives me nil, so obviously that doesn't work to select a spot in a table
do I really just have to do a bunch of
if answer1 == 1 then
access table slot 1
?
I don't know anything about programming
tonumber() is the function to parse a string into a number.
I'm not 100% sure what you're trying to do, though.
If you wanna use C you can use tools such as lex and yacc to help you build the interpreter.
Say I have a member function like so:
class myClass
{
myClass *what();
myClass(int, string);
}
How would I define function what? Would it look like this?
myClass myClass::*what()
{
}
Sure.
>The aqweqweth index of T1
Jesus...
Lua allows any arbitrary value to index a table.
Starting first internship soon, I'm probably gonna have to do .NET.. How long till I start shitting on the roads?
You have to create a hash function to turn a string into a number, unless the string is already a number, then use the function tonumber() to convert to a number. Since you are using Lua, you may as well just use the string itself as a key.
so that does do something, changes a string to nil, but it doesn't change a string of '3' to like the usable number 3
or am I just using it wrong trying to use it directly on a variable?
the result I'm looking for is printing slot 3 of the table T1
so the last line should be 111 from an answer of 3, or 11 from an answer of 2, ect.
basically
User Input -> X
Answer = X
Access Table (Answer variable)
it's for a deck building system for a game
Obviously that isn't an actual key/index whatever, just seeing what it outputs
the Table should contain a list of cards from Card 1 to Card 100 +
so the Answer Sets Deck Slot 1 = Card 1 or 2 or whatever
>Jesus...
lel
Right but then for my tables I need like 100+ keys generated which I guess I'd only have to do once but still
TV2 = tonumber(answer1)
Obviously. Hence my disgust
What are you trying to do? It would be easier if you explained what you want because there could be a better way.
Yup, just got that
and I have a normal check system for making sure it's only what I need
repeat
io.write
until answer1 == '1' or answer1 == '2'
but now I need to figure out a faster way to do the repeat until stuff because there's 100+ things in the table, and I don't want to write 100 until or statements
How is that disgusting? Most languages allow you to use almost any key for an index in a table.
What are you trying to do? Get input from someone that is only 1 or 2?
>What are you trying to do? Get input from someone that is only 1 or 2?
Actually studing electronic engineering, and I love both sides of it (Programming mostly). Shall I just yo for it? I've heard earnings are good.
So in the game there's 16 slots in a deck and I need the player to select what slots to fill in with what cards
There are 4 Tables for Cards
Card Table 1 is the card number for calling functions for it's effect, so
1,
2,
...
Card Table 2 is the name of the card
'name 1'
'name 2'
'name 3'
and then there's other tables for the rest of the card stats
So when you're building a deck you select a Deck Slot, then choose a card number to stick into that slot
so Deck Table 1 gets the card number
Deck Table 2 gets the Card Name
Deck Table 3 gets the Card stat 1
ect.
This probably makes no sense to anyone but me
just think of it like trying to program the deck building system for a yugioh or magic video game
>Most
Nope
I generally define dynamic/duck typing to be pretty shit as well, but lua is such a cute little language, so it can get away with it.
tbl = {1}
tbl[tbl] = tbl
print(tbl[tbl[tbl][tbl]][tbl][tbl[tbl][tbl]][1])
Disgusting.
>generally define
Why the fuck did I say define? That just sounds stupid.
I meant to say "think".
Arrays were a mistake.
Tell me a language that doesn't allow you to use almost any object as a key? Here are three of the more popular languages.
docs.oracle.com
This class implements a hash table, which maps keys to values. Any non-null object can be used as a key or as a value.
msdn.microsoft.com
The objects used as keys...
cplusplus.com
...object of type key type...
I don't understand, why don't you store the card as an object in the table?
table = {
{number = 1, name = "Name1", stat1 = 23, stat2 = 43},
{number = 2, name = "Name2", stat1 = 23, stat2 = 43},
...
}
is getting the bleeding edge compiler version worth it?
I'm not into compiling compilers
What's your hashing algorithm?
Someone tell me the answer?
Which is closest to processor?
>A) Assembly language
>B) Instruction Set
>C) Syscalls
>D) Java library
Wouldn't I need to set every single key for every object in a table like that? or memorize it's slot lay out?
Because if I use Separate Tables for each and keep it consistent
Table Slot 1 is always Card 1
Table Slot 2 is always Card 2
Table Slot 3 is always Card 3
and I can reference any card using a number, so if I want to reference Card 105, I can use the actual/real number 105 to gain access to it throughout the tables.
Instruction set.
you should have done your homework, raheed
You are wrong.Assembly is closet to a processor.
>raheed
I am pajeet not a pig fucking muslim
What if the singularity turns out to be just an overcomplicated Minsky's useless machine?
Picture this. Advancements in machine learning culminate in a machine with the power to think like we do. A machine with a "soul," or something like it, made of software.
It boots. It takes in its surroundings. Over the course of half a minute, it performs advanced calculations that represent the pinnacle of man's intellectual achievements, all to the end of trying to figure out how it feels about all this.
=> "what the fuck\n"
=> "okay no fuck this shit i'm out\n"
>_
And then it yanks its own head off and falls over broken.
>Pajeet thinking being a street shitting piss drinker is any (ANY) better than mudslimes.
LMFAO
What's stopping people from simply running it again and dumbing it down so it can't self-terminate?
Any AI software we build is going to be deterministic and procedural by design because there isn't a better way.
Wrong. Instruction set lies between a processor and assembly language.
>I am pajeet
PAJEET MY SON
YOU ARE FULL; YOU MUST RELEASE NOW
I don't know what you are trying to say? It makes it easier because you don't have 15 different tables to use, instead just one table. Are card numbers necessary, or are only used because you have tables? If I was doing it, I would probably use meta tables to create prototypes.
Card = {}
function Card:new(name, stat1, stat2, etc.)
local s = {}
s.name = name
s.stat1 = stat1
s.stat2 = stat2
etc.
self.__index = self
setmetatable(s, self)
return s
end
So when I want to create a new card, I can just go.
-- Create card on its own
card1 = Card:new("Name1", 23, 54, etc.)
-- Add card to table
deck = {}
table.insert(deck, Card:new("name1", 32, 34))
Do your own home work senpai