Programming

Are you sure g++ is running on the Pinebook Pro?

A typical way to build open source is configure && make && make install.
Configure will find the system c++ compiler which might not be g++. Read the output of configure.

I would do g++ --version to see if you have g++ installed and 64 bits. If not, install it and specify to use it as a param to configure.

You can also cross-compile by building a g++ which runs on your other machine and produces arm binaries. Start here https://www.linuxfromscratch.org/

1 Like

I had an interview which included “here are failing test cases, fix the bugs”. They went from trivial to difficult. The expectation was the candidate would not be able to finish all in time.

My g++ version is 6.3.0

I’m not familiar with Configure and I’m getting, bash: configure: command not found. Is it part of some package I need to install?

I’ve just been using make. The makefile begins with:

CXX=g++
CXXFLAGS=--std=c++11 -W -Wall -O3 -DNDEBUG

I also tried manually typing g++ [file1] … [fileN] -o [file] and got the same complaint about __int128

Your idea of cross-compiling sounds promising. I suppose another option (involving more effort) would be to transcode to a portable language. I’m more fluent with Julia and it has Int128 which ought to work just fine.

Here is a c++ int128 you can use.

1 Like

yes the problem must be tractable, and as interviewer you can show as much information about it as you need

So TIL that a configure script converts a makefile.in into a makefile. This is how new to C++ compiling I am heh. Since I already have the makefile, that explains why I lack a configure script.

I found a g++ cross-compiler for my other linux machine, installed it and changed the first line of the makefile accordingly to:

CXX=aarch64-linux-gnu-g++-8

That compiled successfully. As a sanity check, I tried running the binary on the same machine and got an exec format error–a good sign. I copied it to the pinebook with high hopes of it working. I dot-slashed it and got “permission denied”, so then I did sudo chmod +x and tried again. Result: No such file or directory. Wtf?

I feel like the process I described only needs a small tweak in order to work? But if I continually bang my head I’ll try the library you linked, thanks.

ETA: after recompiling with the -static flag, it’s working now! Sahweeet tyvm

Hah correct, and +x is what I typed into the console. I don’t use linux often, so I usually have to google this stuff again every time I do it unless I can just hit the up arrow.

sounds like you have the -dev or -devel package of the library for the compilation, but the shared lib isn’t installed on the system. static linking fixes it obv.

I just can’t imagine wanting to put typescript into the mix if you’re just writing hacker scripts for yourself.

5 years of running an industrial-sized node app in production and I can’t think of one time we had a run-time error for something that type safety would have caught at compile time. Have you run into these kinds of errors? If so I’d be interested to see one.

1 Like

Makes sense, especially when the lib comes in TS. Our big node app was built before most 3rd party libs came in TS.

The one killer app that for sure TS would have helped is the npm package I wrote that was shared by a few apps had a base object (representing an API endpoint) that then got extended by an internal shared lib and finally the app. Each layer added optional fields that could be either missing or have values. There was no way to point to one file that devs could go to see all the possible options for their endpoints. TS would have helped that.

But there were so many other things that not having to worry about types made easier. I don’t know if it was worth it for that one feature. With express middleware, you’re basically tacking on stuff to the request or response object as the flow moves through the request/response chain. This keeps the method signatures constant so (req, res, next), so you can easily chain async middleware functions. TS really borks that paradigm.

Def use deno.

1 Like

DeepMind AI is ready to pass the programming interview (sort of):

1 Like

Grunching, but what is the most effective and useful way to start coding nowadays? I’m a CPA doing some group accounting 10 hours per week but mostly I’m betting esports to pay the bills.

Here’s my 2c but I’m just a hobbyist so others might have better advice.

Pick a language and start playing around with it. Doesn’t really matter which one because it’s easy to transition to another if you need to. If you’ll be doing mathy code then Python / Julia / R might suit your needs. Think of a program you want to write, then open up the language’s documentation and start coding. There will be multiple ways to code it, but see what solution you can come up with using the available commands outlined in the manual. Some basic ingredients you’ll need are variables, types, arrays, if and else, for and while loops, and operators like && and || and ! and ==.

I actually would like to have an IDE that did this for Javascript (yes I know about coffeescript but no one uses that anymore). I think all languages should be indentation-based. It’s just so many less lines of code and easy to read. And you never get into tab vs. space wars.

Although here I would put a blank line between methods at least. Also fuck 4 space tabs. Why would I want to give up so much real estate? Another advantage of indentation-based is you can set tab stops to whatever you want.

2 Likes

So back on leetcode because yeah the usual reason and man I’m looking at these “easys” and am like uh thats not really easy, I guess I suck. And then I solve it and go to the forum to see what other people did for this in my language and its like “oh wow guess I don’t suck because these solutions are terrible for loop crap”. Rollercoaster.

As a service to the alumni of the university I work for, we let them create an @alumnI.XXX.edu email account. This used to be just a dumb forwarder, but then they converted it to gsuite. Which means our alumni can now create unlimited shared drives and hand them off to others.

This week we discovered 780 shared drives with terabytes of movies and porn, some of it very illegal. Someone compromised one alumni email and off they went - creating shared drives and then handing them off to others. I’m told gsuite offers no setting to limit this behavior.

I just found out about all of this. Now my boss wants to have a meeting to discuss how we can avoid this in the future. The first 20 minutes of the meeting will just be me going, “WTF? Why? What were they thinking? Why do alumni need shared drives?” and her getting increasingly annoyed at me. Should be fun.

https://m.imgur.com/2fIHmJp?r

  1. From the Admin console Home page, go to Apps > Google Workspace > Drive and Docs.
  2. Make sure that, for your organization, Drive is turned on.
  3. Click Sharing settings.
  4. To apply the setting to everyone, leave the top organizational unit selected. Otherwise, select a child >organizational unit.
  5. Click Shared drive creation and choose an option:
  • To allow users to create shared drives, uncheck the Prevent users in your organization from creating >new shared drives box.
  • To not allow users to create shared drives, check the Prevent users in your organization from creating >new shared drives box.
  1. Click Save. If you configured an organizational unit or group, you might be able to Inherit or Override a >parent organizational unit, or Unset a group.

It might take 24 hours for changes to take effect.