/dpt/ - Daily Programming Thread

What are you working on Jow Forums?

Previous thread:

Attached: blaze_it.png (1008x709, 715K)

Other urls found in this thread:

youtube.com/watch?v=UyK9geJasjE
archive.is/mnbNo
jazzscheme.org/
github.com/jazzscheme/jazz/commits/master)
github.com/search?utf8=✓&q=repo:jazzscheme/jazz extension:.c&type=Code&ref=advsearch&l=&l=
pastebin.com/fnQBdfSq
twitter.com/SFWRedditImages

install shen

I want to create a location and match based app with no programming skills and experience. Since i have unlimited time, ill try to do it on my own while learning how to program in the meantime.

Where do i start?

learn swift if you're on apple
C++ or kotlin if you're on android.

or he could make a web app and access it from both iphones and androids without having to bother programming two different apps one for each platform
the important thing in those apps is the backend anyway

well android is a shit platform, so really all he needs is swift.

Can web app only be accessed from browser?

wrote this thing that tells you the possible shortest paths in order to breed a particular move onto a pokemon.

have to port it from python to js and host it

also have to figure some algorithm in order to do shortest path where there are muiltiple things you have to get.

Sort of like a maze solving algorithm like dijkstra's algorithm but there are also 3 keys you have to pick up to open the door.

I like the new pic OP. Almost as good as an anime OP.

forgot pics

Attached: emc.png (559x663, 46K)

No. Think of it this way

Backend
-> Web backend
|-> Web browsers (platform agnostic)
-> Android app
-> iOS app


The important matching logic will be in the backend. I don't know enough about web development but maybe you could combine the backend and the web backend like this

Web backend server
-> Web browsers (platform agnostic)
-> Android app
-> iOS app

>that 69 yo zoomer who thinks java is faster than c++

Attached: DahnC6ZX0AYWy56.jpg (675x1200, 64K)

Who cares about speed? If your language doesn't have monads, applicatives and sum types it might as well be pajeet tier

In the general case of an application with a larger codebase, this will generally be true

>that cnile who think he is a master programmer but his frameworks can't beat java

Remember to never listen to first year cs students who mindlessly spout memes from a decade ago that they picked up from Jow Forumsprogrammerhumor

imagine having such an empty life as a java pajeet in a shit code monkey job, you have to come to an image-board and desperately try to shill it to try and rationalize your time not being wasted.

I most likely make more money than you as a Java dev. Must suck knowing that a pajeet language has been gobbling up c++ jobs for 20+ years

I have a 64 bit int
let's say i wanted to insert a particular pattern of bits in the 8th to 15th position (basically a char) without chaing the bits at the other positions

using bitops

anyone have any ideas?

>who cares about my well being when i have my precious shekels
wwwwwwwwww

uint64_t foo = bar;
foo &= 0xFFFF00FF;
foo |= 0X0000AA00;
replace AA with the byte of your choice

Setting a 64 bit int bit
>number |= 1L number &= ~(1L

this seems to work
i also found that for example let's say i have
0 1101 1 and i want 0110 to be the middle 4 bits

following works
0 1101 1 xor 0 0110 0 -> 0 1011 0

0 1011 0 xor 0 1101 0 -> 0 11 0

since of course (A xor B) xor A = B

cniles != sepplesfags

by the way
do you think this will be faster than just storing the chars in an array

using a 64 bit int as an array and using bitops as access?

Reminder to prefer use C++ as a declarative template metaprogramming language.

>"hey, you can simplify this code"
>it works differently now
what a piece of shit

Attached: WOdPxmVwH4nhaYR5bDdg-A.png (625x600, 54K)

C++
templates
not even once

Hi, i am this guy
I settled on Selenium/Python but i have few problems.
1. Selenium wont load default chrome profile. Every time it goes to website, i am logged off so i need to log in automatically to post anything. How to "export" default chrome profile to code?
2. I cant use Firefox instead of Chrome. I downloaded geckodriver and copied it to /usr/local/bin but to no avail
3. I managed to go to website and click "log in button" with Selenium, but its only start of problem. Fields where i input Username and Password are hidden in myriads of divs and classes and even tho i discovered correct id name for login_field code wont put username there directly.

So what i need to do: login with Selenium to my account (or export default Chrome profile to Selenium). Then input text into text field in shoutbox and just spam those fuckers into oblivion. Here is what i wrote but please help me with login
from selenium import webdriver
#from '/usr/local/bin' import geckodriver

webpage = r"website_url"
searchterm = "comment"

driver = webdriver.Chrome()
driver.get(webpage)

login = driver.find_element_by_id("sign_in")
login.click()

#//*[@id="sign_in_popup_popup"]
loginuser = driver.find_element_by_xpath('//*[@id="ips_username"]').find_element_by_class_name('input_text')
loginuser.send_keys("username")

passwuser = driver.find_element_by_id("ips_password")
passwuser.send_keys("password")

loginbutton = driver.find_element_by_class_name("ipsButton")
loginbutton.click()

sbox = driver.find_element_by_class_name("input_text")
sbox.send_keys(searchterm)
####

submit = driver.find_element_by_class_name("input_submit")
submit.click()

But modern c++ is written in templates. They are more verbose than in other languages but that’s what you get when you want speed

youtube.com/watch?v=UyK9geJasjE

>muh speed
With each passing year this is becoming more of a non-argument outside of AAA 3d games. But even some AAA companies are trying alternatives.

>this is becoming more of a non-argument outside of AAA 3d games

Attached: 1505585825556.jpg (500x495, 60K)

dumb frogposter

GC'd langs are catching up and even beating C++ at times.
Even at Facebook they used a C++ preprocessor written in D. Which highlights the absolute state of sepples.

I agree. But if speed is not an issue don’t program in C++. If you’re going to use cpp do it the right way, with templates.

GC is orthogonal to the language, the main overhead comes from the memory footprint and not the collection speed. Also you're having trouble with the notion of "using appropriate tools". I'd probably write a preprocessor using Haskell or OCaml rather than C++. Your post only highlights the absolute state of your retardation.

Irrelevant to "[muh speed] is becoming more of a non-argument outside of AAA 3d games"

So the language not being the appropriate tool to write its own preprocessor is not a problem at all?
alright m8.

gcollection needs more memory

aaa games actually use garbage collection a plenty. for example, gears of war code base is 90% made of unreal script.

Attached: Grace_Kelly_MGM_photo.jpg (1096x1349, 319K)

if I want to do something productive with Lisp what should I choose? CommonLisp or Clojure?

Memory footprint and collection overhead are interconnected issues. As the memory footprint grows the collection overhead decreases because collection cycles can become less frequent.

clojure is not really a lisp but it's definitely ready for production.

why isn't it a lisp?

>muh brackets
it's a lisp, ignore lisplets.

don't want to go into this discussion again. if you are a beginner, maybe you shall actually consider clojure as a lisp.

Attached: 1373694480124.png (696x542, 284K)

yeah and js is also lisp and XML makes java acceptable lisp.

I'm just not familiar with the language, I don't have any particular bias toward Clojure.

>js is also lisp
are you serious or joking ?

Attached: 1458780613244.jpg (704x528, 25K)

is kyoko sick??

Attached: 1505302543958.jpg (357x415, 35K)

So file a bug.

no one argues those things. When the author of the language says it's a dialect of Lisp, it's a dialect of Lisp.

brainlet

>preprocessor
>implying anyone cares about a few % difference in the preprocessing phase of build

simplest way i can think of is creating a graph data structure, i have no idea about pokemon so if somehow edges have weights (some transformation take longer/consume more resources or something) then use dijkstra's algo (considering no negative weight) to pick up three keys, simple modify the algorithm to return a special value to indicate an impossible path unless three keys are picked.

If graphs are unweighted use simpler algorithms like modified BSF
Also, you can export the complete graph DS into a static JSON and use it with whatever language/platform you want.

she's just overloaded on presence.
something you don't need to worry about.

well, I would love to use Racket but there is not documentation and/or libraries to do anything.

>something productive
>with lisp

Attached: 3A892590BE97412CB41D24532BA2C588.jpg (374x486, 70K)

In java, is there any benefit to using an object for something with only one string in it, such as an object animal that only holds the name of the animal or a genre object that only holds the genre string? Or would it be better off to just use a String. We were required to do this in one of our university assignments, not sure if there's a certain advantage or just to improve our ability to work with and understand objects.

implying Lisp is not a productive language
>unlimited brackets and indentation is better

look at this imperative pleb.

>What are you working on Jow Forums?
Managing my record collection with a COBOL CRUD program.

Attached: 1530330667534.jpg (675x601, 168K)

there are people who have been much more productive with lisp than you will ever be with whatever the language you are using now. never forget that.

Attached: lambdabg.png (1920x1080, 32K)

>waaaaaahhhh lisp is productive
Yet you can't make a text editor archive.is/mnbNo

what is Emacs? Light Table? DrRacket?

hmm yeah basically each pokemon has a list of "egg moves" that it can pass down and either belongs one or two of around 15 "egg groups". Pokemon can only breed with other pokemon that belong to the same egg group, so I webscraped and generated adj. lists for each move so I could make a digraph

not sure if this was the most efficient method though.

Attached: Capture.png (1622x804, 318K)

Nothing that relies on Lisp itself alone.

Emacs is 15.7% C

Why does he strike me, on this picture as well, as an empty suit?

jscheme is entirely made in scheme, from compiler to ide.

>jscheme
>written in pure java 1.1
The state of lispfags.

Please help
I loaded profile successfully. And running script opens instance of Chrome on already logged website of my choice. Now i want to post it:
sbox = driver.find_element_by_class_name("input_text")
sbox.send_keys(searchterm)
####

submit = driver.find_element_by_class_name("input_submit")
submit.click()

But it wont work!

jazzscheme.org/

>The requested URL /~lasallej/jedi-2.6-linux-intel32.tar.gz was not found on this server.
alright then

>points out mentioned project was not what was claimed
>"wait lemme give you another link"

the site is no more maintained but the project is (github.com/jazzscheme/jazz/commits/master)

>scheme 9.9%
????????????

because most of code is written in jazz scheme (.jazz files). are you really this retarded?

>C 84.9%
???????????
Why is it so difficult for lisplets to showcase a project written in 100% lisp/scheme?

How the fuck do you set the mirror list priority of pacman?
My pacman always uses the farthest mirror on earth before failing and connecting to the one in my city.
How to set the mirror priority?

Switching to arch is a mistake

post the general structure of the site if you cant post the actual site itself

github.com/search?utf8=✓&q=repo:jazzscheme/jazz extension:.c&type=Code&ref=advsearch&l=&l=

>Switching to arch is a mistake
ah yes, this is definitely a wide-spread issue in arch and definitely not a PEBKAC

Ionic Framework
Super easy and cross-platform (write once, deploy thrice). I single-handedly wrote my senior project app in it in a few weeks. I was the only one on my team who knew how to code.
If you know general web development, the transfer of skills is very easy (and if you don't, you can learn HTML/CSS in days with W3Schools). Docs are very good, and there's built-in functionality for using almost everything from android (audio, camera access, mic access, GPS, etc)

I highly recommend it if you have no programming skills. All you really need to learn is Javascript and HTML/CSS. Maybe a bit of typescript if you're using the newer versions.

I would say start by not doing your app, it will only lead to frustration. Decide to take a month or two *just* for learning programming, don't even think about the project. Then you can start working on it.

Thank you for interest
Here is code for shoutbox
pastebin.com/fnQBdfSq
Specifically i think here starts: input-field, and besides: Shouts, Prefs etc buttons

Why do people use highly abstracted languages?

...

why not?

How?

You lose flexibility? It's slower?

I have more control in an FPL than i do i C when it comes to types.

(s-expressions (on (shit (people (do why))))) (readable (perfectly (are (they))))

>you lose flexibility
no
>it's slower
a bit, and up to a point. hand written assembly can be slower than C code because the compiler can be better at assembly

I think this might be a very dumb question, but here it goes: I developed a log parser in Java (using IntelliJ as IDE, if that matters), and it runs on the console/terminal as expected, receiving inputs and printing out outputs.


Now here's me question: I've built a .jar file of it, but how do I turn this into an executable that launches a terminal/console windows when run?


pic unrelated

Attached: the wall.jpg (720x720, 76K)

s expressions are shit
the only advantage they have over standard fpl syntax is that your expressions can have variable arity. who cares

...and?

what is a monad:
1) a monad m is a context. it's like a real-world box: you can put things (that is, values) into this context and theoretically take them out.
2) it has a function "return". this is just putting a value into the context.
3) it has a function ">>=" called bind, which takes a monadic (that is, in-context) value and a function that puts an out-of-context value to some new monadic/in-context value. this more-or-less does the following: given a monadic value ("m a") and a function f specified before ("f: a -> m b"), >>= simply removes the context from a and then applies it to f.
4) Another binding is ">>". If you have a monad m and values a and b, then "m a >> m b" (without using Haskell notation) is really just "m a" >>= "f: anything -> m b". That is, as long as a is *something*, >> will bind "m a" to "m b"; f isn't actually specified if you solely use >> and have already made "m b". This *something* depends on what exactly the monad is: with Maybe, it has to be a Just value, not Nothing. Comparatively, with IO, you can abuse what many IO functions return to do sequential actions via >>: many output functions -- after writing to output -- return the IO monadic value (), which isn't Nothing but is really nothing-to-do; when you have nothing-to-do, >> doesn't return nothing-to-do again but rather just does what's on the right side (assuming what's on the right side is also an IO monadic value). So, print("hello") >> print(", world!") does what you'd expect (again, not using Haskell notation/functions).

no

You're describing the implementation details.
A [monad] is an [monoid] in the [category] of [endofunctor]s. Look up each word on Wikipedia and be enlightened.
Pro tip: even me with my 5 braincells is able to comprehend it.

yes
no, because neither category nor endofunctor are applicable in 99% of the contexts in which monads are used in functional programming