arisuchan    [ tech / cult / art ]   [ λ / Δ ]   [ psy ]   [ ru ]   [ random ]   [ meta ]   [ all ]    info / stickers     temporarily disabledtemporarily disabled

/λ/ - programming

structure and interpretation of computer programs.
Name
Email
Subject
Comment

formatting options

File
Password (For file deletion.)

Help me fix this shit. https://archive.arisuchan.jp/q/res/2703.html#2703

Kalyx ######


File: 1508372843026.png (111.67 KB, 1366x768, screenshot.png)

 No.814[Reply]

I figured it would be fun to try to set up an imageboard. I managed to install vichan and make a few posts, but when I tried to log into mod.php, I got the error message shown in pic attatched. I thought that I had to install that module(?), so I used apt-get install php-mcrypt. This still didn't work even after reinstalling vichan. I read on the modules webpage that it was depreciated in newer versions of php.(I'm using 7.0) Is there a way to work around this?
1 post omitted. Click reply to view.

 No.817

>riced taskbar
>adnauseam
>opera
laughinggirls.jpg

 No.818

>>816
Thanks, Its seems to be working fine now. What exactly were the first four lines for? The page wouldn't load unless I left them out. Just want to make sure I didn't end leave out something important.
>>817
I'm confused, is one of them out of place, or are all three bad?

 No.819

>>818
mcrypt_create_iv was deprecated in 7.1.0

I didn't directly post code, it's my git log.
Only one line had to be changed

 No.820


 No.1674




File: 1493223694043.png (660.71 KB, 600x600, 1485722285101.png)

 No.37[Reply]

Share your one-off scripts or helpful scripts

I'll start off with simple thread scrapper

#!/usr/bin/ruby
require "open-uri"
require "json"
def download(post,board)
    if post["filename"]
        file = "#{post['tim']}#{post['ext']}"
        puts file
        File.open(file,"w") do |f|
            f.write open("https://lainchan.jp/#{board}/src/#{file}").read
            f.close
        end
    elsif post["extra_files"]
        post["extra_files"].each do |p|
            download p,board
        end
    end
end
link  = ARGV[0].gsub(".html","")
/https:\/\/lainchan.jp\/(.*?)\/res\// =~ link
board = $1
body = open("#{link}.json").read
thread = JSON.parse body
thread["posts"].each do |post|
    download post,board
end
7 posts and 1 image reply omitted. Click reply to view.

 No.127

#!/bin/sh

#sc.sh
#/usr/local/bin/sc

#rfn is a program I wrote that outputs a random name to stdout

filename=$(rfn png)

#interactive screenshot with scrot
scrot -s "/var/screenshot/$filename"

#send to vps
scp -P 69420 "/var/screenshot/$filename" "vps:/var/www/domain.tld/ss"

#echo url into clipboard
echo "http://ss.domain.tld/$filename" | xclip -r -selection clip-board -i


This is a great script if you're interested in brewing soykaf even faster.

 No.132

File: 1495232445711.png (74.37 KB, 640x400, dicksred.png)

>>127
Upgraded it today to automatically draw dicks on top of the things I screenshot for me. I'm considering starting a website dedicated to scripts/programs that make brewing soykaf in irc/IM stuff easier.

Requires image magick.

#!/bin/sh

#scdicks.sh
#/usr/local/bin/scdicks

#rfn is a program I wrote that outputs a random name to stdout

filename=$(rfn png)
filename2=$(rfn png)

#interactive screenshot with scrot
scrot -s "/var/screenshot/$filename"

#overlay the dicks
composite -gravity center "/var/screenshot/dicksred.png" "/var/screenshot/$filename" "/var/screenshot/$filename2"

#send to vps
scp -P 69420 "/var/screenshot/$filename2" "vps:/var/www/domain.tld/ss"

#echo url into clipboard
echo "http://ss.domain.tld/$filename2" | xclip -r -selection clip-board -i


 No.148

>>109
Nah, you gotta write it
 :(){ :|: & };:

else the schmuck that c/ps it into Gnome Terminal with the default settings won't know how to invoke it.

 No.843

>>109
will the fork bomb not prevent rm from running?

or will it make the system unresponsive while rm is running?

i don't understand how they work together.

 No.1652

Get how many of the alive posts were made on the different days:
#!/bin/bash

get_posts_by_day () {
    domain="${IMAGEBOARD:-https://archive.arisuchan.jp}"
    board="$1"

    threads=$(wget -q -O - "${domain}/${board}/threads.json" \
                  | jq '.[].threads[].no')

    for t in ${threads}; do
        wget -q -O - "${domain}/${board}/res/${t}.json" \
            | jq '.posts[].time' \
            | sed -e 's/^/@/' \
            | xargs -n1 date -I -d
    done | sort | uniq -c | awk '{ print $2 " " $1 }'
}

(( $# != 1 )) && { echo "Usage: $0 <board>"; exit 1; }
get_posts_by_day "$@"



File: 1506079934730.png (119.16 KB, 942x1698, duke.png)

 No.706[Reply]

Java 9 came out yesterday, what do you think of it?

Here are the new features/changes: http://openjdk.java.net/projects/jdk9/
5 posts and 1 image reply omitted. Click reply to view.

 No.815

>>730
yeah, and you're fucking wrong bro.

 No.829

File: 1509217444697.jpg (91.46 KB, 640x480, 1499170337699.jpg)

>>706
the repl looks neato
didn't really understand the point of this whole puzzle thing though, i thought this was what 3rd party tools were for

 No.1617

>>829

Could any of you list off the features that came out in Java 9? I'm familiar with the Java 8 features where they added a bunch of functional programming stuff but I haven't heard much talk about the Java 9 things at all.

 No.1628


 No.1630

>>1628
>>1617
To summarize,
nothing interesting.



File: 1527891677532.jpg (44.3 KB, 1080x720, 31511221_211493586119029_1….jpg)

 No.1154[Reply]

I really don't think there is anything more suitable than IDM. In general I've noticed that most consider any ambient music sans lyrics best, but IDM specifically is also diverse enough to provide energetic tracks to listen to while executing something simple as well as calmer tracks for focused attention while working on something more complex. I'm curious what others think What does Alice listen to while programming?
17 posts and 2 image replies omitted. Click reply to view.

 No.1407

I usually listen to whatever is played here:
radio.dangeru.us

 No.1408

http://musicforprogramming.net/

Alternatively you can listen to these while visualizing yourself in the middle of a hacking montage, this will increase your productivity by at least 500%:
https://www.youtube.com/watch?v=RCyOUR2FbU8
https://www.youtube.com/watch?v=3kF7u3tWlns

 No.1409


 No.1618

I've been trying to decide lately if programming with music on or off leads to me being able to concentrate more or less while programming. I feel like it almost hampers my ability to concentrate. What do you all think or experience? Is it similar?

 No.1629

I don't actually program, but still needs concentration to work in front of a screen, so I guess I'll barge in to add one thing. Another kind of music that is most of the time peaceful, regularly intense without being disturbing but takes you along with it flow, without lyrics, is post rock (as well as post metal). You'll find various sources for it, the most obvious being, for me, Wherepostrockdwells and Worldhaspostrock channels on YT



File: 1494671541628.png (49.95 KB, 517x384, tLh8r.png)

 No.106[Reply]

I saw Project Euler mentioned somewhere in a thread, and after visiting the site, I decided to try to learn programming by going through it. Sadly, this newfound resolve was short-lived because I couldn't get past the first problem:

>If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of >these multiples is 23.

>Find the sum of all the multiples of 3 or 5 below 1000

I used batch to make the program, and it outputs the right answer when I set the multiple limit to under 10, but it won't work for multiples below 1000. I have no idea what I'm doing wrong.
Here's the script:

@echo off
REM Initial Variables
:Start
set /a third=0
set /a fifth=5
set /a numend=1000
set /a ttotal=0
set /a ftotal=0
REM Finding the sum of the Multiples of 3
:ptStart
set /a multiple=1
:tStart
set /a third=%multiple%3
if %third% GEQ %numend% goto :pfStart
set /a ttotal=%ttotal%+%third%
set /a multiple=%multiple%+1
GOTO :tStart
REM Finding the sum of the multiples of 5
:pfStart
set /a multiple=1
GOTO :fStart
:fStart
set /a fifth=%multiple%
5
if %fifth% GEQ %numend% goto :end
set /a ftotal=%ftotal%+%fifth%
set /a multiple=%multiple%+1
GOTO :fStart
:end
set /a fsum=%ttotal%+%ftotal%
echo %fsum%
pause
18 posts omitted. Click reply to view.

 No.636

File: 1505130890336.jpg (56.79 KB, 680x472, wall_decal_pi_s.jpg)

I wrote some solutions in several languages in past with some friends. ProjectEuler is better to learn about programming and mathematics. I'll say that you learn more about mathematics than programming, but mathematics is very important. At least is very well accepted, known and developed language for describing logical problems. And you can benefit on programming with mathematical thinking (on daily programming, much more than the mathematics itself and its infinite fields).

Ah, before I forget, the link is this: https://github.com/DestructHub/ProjectEuler

Enjoy programming and make sure to use a great language for start. I didn't will recommend BATCH. Python, Scheme or even C can be a very good start.

 No.657

>>123
You can also use #:when to only traverse certain elements from a for loop

(for/sum ([i (in-range 1000)]
          #:when (zero?
                  (* (remainder i 3)
                     (remainder i 5))))
  i)


I keep considering moving away from Racket to other Lisps (since "nobody uses Racket"), but they never seem to compare. Racket feels awkward and pretty bad at first, but when you learn how to write it effectively, it's excellent. Definitely my favorite programming language. I'm currently building a Lisp->MIPS optimizing compiler, and it's only about 1k lines of code.

 No.668

>>302
let rec f acc =
  let p x = x mod 3 = 0 || x mod 5 = 0 in function
    | x when p x -> f (acc + x) (x - 1)
    | x when x > 0 -> f acc (x - 1)
    | _ -> acc
;;

 No.721

>>147

Denko, is that you? (´・ω・`)

 No.1619

>>570

This is a really elegant solution in Scheme.



File: 1560252923670.png (390.76 KB, 318x570, 1501664284986.png)

 No.1584[Reply]

Bought an MHS 3.5" LCD screen for pi 3b+.

Tried executing driver.
Every time it downloaded the driver it rebooted and was no longer visible on the main hdmi monitor and the 3.5" screen still white.

GOD DAMN CHINESE CHEAP TECH soykaf!!!!!!!!

There is no Web page for this company I can find. All the 3.5 " LCD driver install videos seem to be for different screens.

 No.1585

cute post

 No.1587

Log in over SSH and look for relevant logs.

>There is no Web page for this company I can find. All the 3.5 " LCD driver install videos seem to be for different screens.


Pretty sure they're all compatible clones of one or two designs.

 No.1597

Yeah use SSH if the HDMI stops working.

Find out what distro/kernel version they expect you to be running.

If they also have a source code download then building that might be a better option.



File: 1558032540658.jpg (103.64 KB, 640x775, b366a3a8710d0cac203b26200c….jpg)

 No.1556[Reply]

is there any feasible way to work with .dex files that dosent fuck them up when rebuilding

 No.1557

or extract any data like strings for them? the formats all fucked up

 No.1558

What are you trying to achieve?

 No.1567

Dunno if it's quite what you're looking for, but there's dex2jar. There might be something in there you can use.



File: 1548887486280.png (7.92 KB, 227x95, logo.png)

 No.1449[Reply]

Anyone here work or play with these technologies? Unfortunately I work in a monolith Python/Django but I've been getting into distributed systems. These two languages and their OTP framework have been very helpful in learning many concepts.

 No.1456

I just started playing with a phoenix tutorial the other day, personally I think the BEAM vm and the way they have structured their languages very neat and fun to play with but overall I think that both languages are really ugly to look at.

 No.1553

>>1449

Has anyone built much with Elixir here? I'd be really interested if anyone could recommend me some projects to look at on Github that are exemplary examples of nice Elixir codebases.

 No.1555




File: 1497741668921.png (37.04 KB, 256x223, lisp guy.png)

 No.262[Reply]

What would your ideal Lisp dialect include?
What kind of data structures would it have? What would the macro facilities be like? What misfeatures would it not have?
2 posts omitted. Click reply to view.

 No.371


 No.373

Scheme is already pretty close to my ideal, it just needs a bigger ecosystem.

 No.399

File: 1499624494129.jpg (85.48 KB, 450x583, thumb-395275-450x583-ab11c….jpg)

well I like me some gosh darn clojure, but Id like it if we could eck out some more performance out of the JVM. Also I am just learning clojure so I havent found out how to get lein give me an executable or something that I can deploy.

Side note, just getting back on lainchan after 2 years and I found .jp so fuck you bastards for hiding from me. (pic unrelated)

 No.484

>>262
I'm getting more into racket now, having convinced the people at my job that it will be an effective tool. I used it before of course but for totally different things. I used to make things like sudoku-solvers, simple-AI's, brainfuck interpreters etc. Now I need to do things like subprocess communication, connecting to remote servers, a lot of input validation (often using regex, but sometimes by calling other programs) and a lot of text processing so it's a bit different. I must say I like it a lot. It's like scheme but with a bigger standard library. I found this to make it a bit unappealing because minimalism if one of the nice things about scheme; but for a regular job it's a lot better.

I do not like the syntax now and then though. For example, when you have a function which has an argument that defaults to something and you want to override this you get a call like (myfunction #:usually-default my-actual-argument). And for regex you have the prefix #re I believe; a bit weird.

 No.1554

>>262
I honestly get really overwelmed by a lot of the library stuff in Common Lisp, it becomes really unweildly and unreadable very quickly. Scheme is much nicer in many respects for keeping track of what is going on. But I don't really think that any of these dialects are really ideal at this point.



File: 1554951768468.jpeg (14.41 KB, 338x435, images (3).jpeg)

 No.1536[Reply]

hey arisu, can you give me CS senior project suggestions? I would like to work in cloud or networking, but any idea is welcome. my uni wants us to work in teams from 3 to 7 to keep in mind that the project needs to scale with the amount of members

 No.1538

are you aware of ipfs? https://ipfs.io

it has some problems on the architecture side that make it kinda soykaf. The network has too many announces and the default server is unstable & buggy.

You should rework it to make it better.

 No.1552

>>1536
Why don't you try to work on a patch or library for one of the secure messenger applications that are popular these days? A lot of them have project lists ready and waiting to give to people just like you that can be considered standalone. Something in the Cryptocurrency space might be cool also.



Delete Post [ ]
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
[ Catalog ]