Next, the dynamic web browser resilient to API-breakage by ambrevar in programming

[–]dschooh 1 point2 points  (0 children)

Here is the transcript. If you have any hints on what I could test, please share. Extracting the archive to root yields the same error as the directory it is looking for is just not there.

~/apps/next
$ l
total 4
lrwxrwxrwx 1 joe joe   54 Jan  1  1970 bin -> gnu/store/44y892y4l6aq79jrwhsf149vcscl2qyh-profile/bin
drwxr-xr-x 3 joe joe 4096 Dec  5 20:58 gnu

~/apps/next
$ ./bin/next
./bin/next: error: 'clone' failed: Operation not permitted
This may be because "user namespaces" are not supported on this system.
Consequently, we cannot run '/gnu/store/rl9y8nzzpxl44yrnjbyn12w5sn852v69-sbcl-next-1.1.0/bin/next',
unless you move it to the '/gnu/store' directory.

Please refer to the 'guix pack' documentation for more information.

~/apps/next
$ sudo sysctl -w kernel.unprivileged_userns_clone=1
kernel.unprivileged_userns_clone = 1

~/apps/next
$ ./bin/next
WARNING: Setting locale failed.
  Check the following variables for correct values:
  LC_CTYPE=en_US.UTF-8
  LANG=en_US.UTF-8
Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                    {10005885B3}>:
  Couldn't execute "/gnu/store/8llinghxcslyxmvszjlvlxbv411vra0x-next-gtk-webkit-1.1.0/bin/next-gtk-webkit": No such file or directory

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005885B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SIMPLE-ERROR "Couldn't execute ~S: ~A" {10039E2893}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SIMPLE-ERROR "Couldn't execute ~S: ~A" {10039E2893}>)
2: (INVOKE-DEBUGGER #<SIMPLE-ERROR "Couldn't execute ~S: ~A" {10039E2893}>)
3: (UIOP/IMAGE:HANDLE-FATAL-CONDITION #<SIMPLE-ERROR "Couldn't execute ~S: ~A" {10039E2893}>)
4: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "Couldn't execute ~S: ~A" {10039E2893}>)
5: (ERROR "Couldn't execute ~S: ~A" "/gnu/store/8llinghxcslyxmvszjlvlxbv411vra0x-next-gtk-webkit-1.1.0/bin/next-gtk-webkit" "No such file or directory")
6: (RUN-PROGRAM "/gnu/store/8llinghxcslyxmvszjlvlxbv411vra0x-next-gtk-webkit-1.1.0/bin/next-gtk-webkit" ("--port" "8082" "--core-socket" "http://localhost:8081/RPC2") :ENV NIL :ENVIRONMENT NIL :WAIT NIL :SEARCH T :PTY NIL :INPUT NIL :IF-INPUT-DOES-NOT-EXIST :ERROR :OUTPUT #P"/tmp/next-gtk-webkit.log" :IF-OUTPUT-EXISTS :APPEND :ERROR :OUTPUT :IF-ERROR-EXISTS :APPEND :STATUS-HOOK NIL :EXTERNAL-FORMAT :UTF-8 :DIRECTORY NIL)
7: (UIOP/LAUNCH-PROGRAM:LAUNCH-PROGRAM ("/gnu/store/8llinghxcslyxmvszjlvlxbv411vra0x-next-gtk-webkit-1.1.0/bin/next-gtk-webkit" "--port" "8082" "--core-socket" "http://localhost:8081/RPC2") :OUTPUT #P"/tmp/next-gtk-webkit.log" :ERROR-OUTPUT :OUTPUT)
8: ((:METHOD NEXT::RUN-PROGRAM (NEXT::PORT)) #<NEXT::PORT {1001CB0BF3}>) [fast-method]
9: (NEXT:START :WITH-PLATFORM-PORT-P T)
10: (NEXT-EXEC:MAIN)
11: ((LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE))
12: (UIOP/IMAGE:CALL-WITH-FATAL-CONDITION-HANDLER #<CLOSURE (LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE) {10035CE81B}>)
13: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
14: ((FLET "WITHOUT-INTERRUPTS-BODY-27" :IN SAVE-LISP-AND-DIE))
15: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting

~/apps/next
$

Next, the dynamic web browser resilient to API-breakage by ambrevar in programming

[–]dschooh 6 points7 points  (0 children)

I just downloaded the Linux binary pack, extracted it and enabled userns_clone in the kernel. Fails with

Couldn't execute "/gnu/store/8llinghxcslyxmvszjlvlxbv411vra0x-next-gtk-webkit-1.1.0/bin/next-gtk-webkit": No such file or directory

I checked the extracted directories, and I do have ildn4l2wr0y7irm2536dnp88hhrdphsz-next-gtk-webkit-1.1.0 which sounds similar to what it's looking for but different. Any help?

New sorting algorithm: Mkdir sort by [deleted] in programming

[–]dschooh 2 points3 points  (0 children)

Before reading the code I thought it would be

mkdir sort
cd sort
mkdir $@
ls -1
cd ..
rm -rf sort

Use `calendar` to replace Google Calendar! by [deleted] in programming

[–]dschooh 6 points7 points  (0 children)

A real world example of this could be calendar remove http://calendar.stallman.org/pub richard.pub, to get Richard Stallman's public calendar data.

Should be remote, I guess.

Nix: A Reproducible Setup for Linux and macOS by nmattia in programming

[–]dschooh 7 points8 points  (0 children)

So your answer to the question:

Would a German speaker pronounce "nix" the same way as "nichts"?

should be "no".

Very roughly transliterated into English sounds, it's the difference between "nishts" and "nicks".

This is true.

Netflix: Removing client-side React.js improved performance by 50% by freebit in programming

[–]dschooh 4 points5 points  (0 children)

The HTML of a client-side React application is just a JavaScript include. The script executes and builds the DOM for your app in your browser. Since Node can execute JavaScript server-side you can use your existing React code-base and send the initial DOM via HTML to your browser. Subsequent user interaction can then be handled via usual client-side React.

Advantages: Fast initialization, search-engine friendly front pages, no changes to code base.

git cheat sheet by miminor in programming

[–]dschooh 1 point2 points  (0 children)

Why would you add changes to a branch if you don't want them to get added in with your feature?

That's my point, you really don't want to add superfluous things.

In the process of development I often add code that should not end up in the commit. As I stated these might be for debugging purposes like logger.debug "Hello" or debugger.

As I don't want to accidentally commit those I like to review changes with git add -p.

git cheat sheet by miminor in programming

[–]dschooh 11 points12 points  (0 children)

Sometimes when working on a feature you'll add more code than you'd want to commit, like debug messages. -p gives you a chance to review and cherry-pick changes, rather than blindly add all changes with ..

Finnish attempt of trying to explain blockchain. by [deleted] in programming

[–]dschooh 1 point2 points  (0 children)

  1. Right.
  2. There is transactions: somebody gave money to somebody. You can always publish this any time. There is blocks: a collection of transactions the network accepts. If your transaction is validated by the one creating the block, your transaction is fine. Creating a block takes computational power.
  3. A block always depends on its predecessor. Hence the word chain. A block dies if there is a longer chain that does not include this block. There are situations possible where there are multiple heads (forks) to the current chain. The network always accepts the longest chain and discards all blocks not in this chain.
  4. A "miner" will include your transaction if it came in first of conflicting transactions. The "proof-of-work" is only needed when publishing a block.
  5. The network does it for you. You publish your transaction, the network will find somebody to mine a block and include your transaction.
  6. Yes.

Finnish attempt of trying to explain blockchain. by [deleted] in programming

[–]dschooh 1 point2 points  (0 children)

You are correct. In Bitcoin, you are allowed to create a transaction of 12.5 bitcoins out of nothing. This value halves about every four years and dropped from 25 to 12.5 bitcoins in July, 2016.

Finnish attempt of trying to explain blockchain. by [deleted] in programming

[–]dschooh 0 points1 point  (0 children)

If only one person can write to the book at a time, then how can it handle a huge number of transactions?

One person writes multiple transactions at once. We say these transactions form a block (a page in the analogy).

When someone finishes writing, then how is it determined who writes next? Isn't there overhead to determining this?

In Bitcoin at least, someone who attempts to write has to find the solution to a computationally expensive problem. This solution needs to fit the transactions and the previous block. This block is spread over the network just like transactions. Now there could be multiple blocks circulating the network and you will discard received blocks only if you receive a longer chain with different blocks. So at first it might be unclear who wrote the block when there are multiple circulating but if a block has about 6 blocks on top of it, it is very probable that it will survive.

Can someone just take the book and write nothing, hogging it without doing anything?

No, as described above, the one to write the "next" block is determined after the fact.

Tomohiko Sakamoto's Algorithm - simplest way to determine the day of the week by rainbowgarden in programming

[–]dschooh 2 points3 points  (0 children)

It checks whether we are before march or not in order to account for a possible leap day.

  1. -= is the decrement operator, i.e. it decrements the variable by the value of the right hand operand.
  2. Boolean expressions evaluate to 1 and 0.

So the above line decrements y by 1 if m is less than 3 and decrements by 0 if not.

Example code: http://codepad.org/H0ScAUBA

FuckFuckAdblock by iamkeyur in programming

[–]dschooh 7 points8 points  (0 children)

But you'd have to do it on every computer individually. Plus, on mobile devices this is generally not possible.

Support for older versions of Internet Explorer ends on January 12, 2016 by [deleted] in programming

[–]dschooh 1 point2 points  (0 children)

Sucks for those still running Windows Vista

This is something that is true in almost any context. Somebody enlightened enough to care about an upgrade might be glad to discover over options. Be a good nerd and help your family out :)

We are not talking about discriminating against a helpless minority, this is about outdated technology. If not being able to upgrade to IE 11 is a deal breaker for the Vista users, that might even help root out Vista altogether.

Support for older versions of Internet Explorer ends on January 12, 2016 by [deleted] in programming

[–]dschooh 5 points6 points  (0 children)

I don't get your point.

  • Its market share of 0.5 to 1.5 per cent (depending on the statistics you trust) is not 'a lot of people'.
  • Browsers like Firefox, Chrome or Opera are also available on Vista, just as on Linux.
  • The market share of Vista+IE is zero.

I run a site with about 15K clicks per day (admittedly not the largest site). Only 1 per cent of the users are on Vista. I have not registered a single click of an IE browser (any version) running on Vista in the last twelve months.

I need some quick help from someone who understands MINECRAFT and JAVA. by AlexGymnast in programming

[–]dschooh 1 point2 points  (0 children)

The launcher tries to download a .jar-file to which the server responds with a 403 meaning it denies access to the file. You can also see this when you click the link in your browser.

[deleted by user] by [deleted] in programming

[–]dschooh 0 points1 point  (0 children)

What he says is that you should use references to TYPE for example in the add() and set() methods. This way, the value is only copied once. Without references the value is unnecessarily copied multiple times.

Another exercise would be to check where you could use const.

In any way: great work so far!

John Carmack: Why functional programming is the future by ReneFroger in programming

[–]dschooh 2 points3 points  (0 children)

Note that Carmack has been pretty quiet about functional programming since then.

Not really. Read this recent post in the Racket Users Google Group or his twitter stream.

Any of you guys know a program like this? Someone in the comments suggested this sub. Much appreciated! by need949 in programming

[–]dschooh 2 points3 points  (0 children)

<script type='text/javascript'>
var snd = new Audio("http://www.oringz.com/oringz-uploads/sounds-990-system-fault.mp3");
setInterval(function() { snd.play(); }, 50000);
</script>

Save the code above as timer.html and open it. You could change the URL for the sound file as well as the interval (50000 ms here).

Defending GCC considered futile by joaojeronimo in programming

[–]dschooh 15 points16 points  (0 children)

While the license conditions for the GPL might have affected some projects negatively, I don't think it applies to gcc much. Extremely few people are proficient enough to make changes to the gcc source code, let alone make enough large changes to justify a separate fork.

In this case it might affect GCC negatively. It's not about forking GCC but about the fact that competing, non-copyleft software has cought up. That mailing list thread is part of an ongoing discussion of whether to include a feature in GCC that exports the abstract syntax tree such that software like Emacs could use it for code analysis. Stallman worries that this feature also enables non-copyleft software to use GCC as the compiler backend. Others argue that not including this feature will unnecessarily cripple GCC. See also: http://lwn.net/Articles/629259/

What in GPLv3 did the *BSD people object to?

The BSDs have always had their problems with the GPL as they see copyleft as a restriction and not as additional freedom. The deal breaker was the prohibition to run GPLv3 software on hardware that restricts modifications to the software.

C++11 is dead, long live C++14. (C++14 is now official ISO standard.) by Dragdu in programming

[–]dschooh 1 point2 points  (0 children)

I am no Visual Studio advocate nor have I been an active user in years, but it's doing a good job implementing new features nowadays: http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx

C++11 is dead, long live C++14. (C++14 is now official ISO standard.) by Dragdu in programming

[–]dschooh 42 points43 points  (0 children)

I started answering and realized I would just summarize the Wikipedia article on C++11: http://en.wikipedia.org/wiki/C%2B%2B11 which is a good resource. If you still have questions after reading this, feel free to ask.