freenode/#lisp - IRC Chatlog
Search
22:14:47
aeth
stara: Solve for x in a given cubic function? https://en.wikipedia.org/wiki/Cubic_function#General_formula
22:16:07
aeth
It's fairly straightforward to solve things given a formula (although I've only done this for quadratic, not cubic). There's probably a fancy, more-correct way to implement it because of how floating point works, though.
22:19:20
aeth
stara: It's probably a good idea to use Wolfram-Alpha to check your program with some test inputs when you're working with equations that it can solve. https://www.wolframalpha.com/
22:22:30
stara
I substitute data for this formula: https://wikimedia.org/api/rest_v1/media/math/render/svg/4d91448198219ff6936ccd3063cc9cb4bb3740fe , but wrong result.
22:24:18
aeth
stara: You should probably post your source somewhere and someone here can find the mistake
2:03:49
White_Flame
whereas it wouldn't be a "proper list", because it's dotted. (unless the cdr of the dotted pair was NIL or another list)
2:05:02
White_Flame
the type LIST only really tests for consp or null, regardless of what the tail of the cons chains into
2:05:20
White_Flame
but that doesn't mean that it'll fly regarding sequence operations, if it's improper
2:06:20
White_Flame
"In general, lists (including association lists and property lists) that are treated as sequences must be proper lists. "
2:07:23
White_Flame
and yeah, going through the sequences dictionary, the sequence arguments are always "a proper sequence"
2:07:38
White_Flame
"proper sequence n. a sequence which is not an improper list; that is, a vector or a proper list. "
2:08:32
White_Flame
of course, there are some sequence operations like MEMBER that will stop when they find an element, so they won't break if the ending is improper
3:37:54
aeth
In SBCL, I get a style warning, but it works (i.e. prints the elements)... until it gets to the end and then it errors: (dolist (foo '(1 2 3 4 . 5)) (format t "~A " foo))
6:04:47
p0a
so far I wrote something using drakma and plump. Drakma retrieves the pages and plump is used to find the news titles
6:05:27
p0a
my issue is that reddit has everything in 1 line, making it hard to read the HTML to track down the relevant information. What should I do?
6:11:04
p0a
For example, I've noticed that the news articles have an attribute in <a> that other links don't have, but in general it is pretty cumbersome to extract exactly what I need every time
6:18:40
p0a
so it's pretty silly in what it does but the use is... you type (news) to get the frontpage news for the subreddits in the global var, and then you type (myread "worldnews") to read the titles of worldnews
6:25:14
MichaelRaskin
p0a: maybe look whether something like closure-css could be useful — you might be able to find someone who has written CSS selectors for that, and also Reddit's own CSS might be a hint. In general, data extraction from HTML has some amount of inherent (unless you control the other side…) complexity.
7:02:00
beizhia
well tbh, I dont really know where to begin. Should I make a separate asdf package for my tests? And do I need to symlink my project's dir in ~/common_lisp so asdf will find it?
7:03:13
beizhia
I think I might just be a bit spoiled by languages that set up the project structure for you, somewhat new to non-emacs lisp too. I just cant figure out what the normal thing to do it.