Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Mahatma Goonsay posted:

' is not so like ! in any normal programming language. There is no <= or >= so to get less then or equal to you have to use not greater then. ^ is for assignment and goes left to right. You can do things like 1^X^Y^Z^FOO^BAR and it sets them all to 1. There is no declaring variables other then by assigning things to them. The N() just wraps the result in a newline, so you don't get a result of 12fizz4buzz. # is a prefix open to the screen.

Wow, that really does feel like a really pointless mutation of mumps. I wonder why they threw away the= operator and used ^ for assignment instead. Does MAGIC have globals still? How do you do persistent storage or array notation in MAGIC?

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

MALE SHOEGAZE posted:

well that solves problem number 4

enter your search, press <enter> (to find candidates), page through them with n and N.

Valeyard
Mar 30, 2012


Grimey Drawer
They are doing a 4 hour workshop on backbone.js here next week, I am going, and hope that they do one about React next

Mahatma Goonsay
Jun 6, 2007
Yum

LeftistMuslimObama posted:

Wow, that really does feel like a really pointless mutation of mumps. I wonder why they threw away the= operator and used ^ for assignment instead. Does MAGIC have globals still? How do you do persistent storage or array notation in MAGIC?

Not really sure why they went with the ^, although it frees up = to actually mean equal. In a magic terminal the ^ actually looks like a little right arrow kinda like ->. So for storage and globals and whatnot you need to open up a prefix, which is kind of like the # one we were talking about before that is open to the screen. You would open up & to all your lab data or whatever and then you can read/write data to it. You can also open up a private prefix which will work as a global for whatever data you want to put into it and it will stick around in that session until that prefix is closed.

There are things that are sort of like arrays, but not really. There are some really funny limitations on things, like strings crashing if they are over 255 chars. I should probably go get some work done for now.

Bloody
Mar 3, 2013

Mahatma Goonsay posted:

All this mumps chat is very interesting. Let me introduce you all to meditech $t, which I am coming to learn is the PL that time forgot.

Here is a fizzbuzz for you.

code:
0^X,DO{X'>100 N(IF{X\15=0 "FizzBuzz";X\5=0 "Buzz";X\3=0 "Fizz";X})^#,X+1^X}

i dont know what this language is or anything about it or whatever so here goes:
0^X stores 0 in X
DO{X '> 100... } loops while X is not greater than 100
N(...) does... something? maybe something about string handling
IF{...} blocks are composed of checks and results and seem more like a switch statement.
X\ n = 0 is X mod n i guess
The empty X at the end of the if block i guess handles the default/nonmatching cases and returns nothing
^# stores to the console or stdout or whatever
X+1^X increments X obvi

Bloody
Mar 3, 2013

definitely not as bad as assembly

JawnV6
Jul 4, 2004

So hot ...
my big unix learning was on tcsh and I miss the history search. type a prefix, esc-p searches matches

now I have to pipe history thru grep like some chump

Jeffrey of YOSPOS
Dec 22, 2005

GET LOSE, YOU CAN'T COMPARE WITH MY POWERS

MALE SHOEGAZE posted:

My problems are:
1) I like using ctrl-c to leave insert mode, and remapping ctrl-c is a bad idea in the shell.
Map caps lock to escape, and use that to get out of insert mode. It's amazing unless you somehow have found a reason to hit caps lock on purpose, something I've never done after decades of computering. It's something I do immediately on every machine I own.

Jerry Bindle
May 16, 2003
i solved that problem by spending too much money on a keyboard that has the keys in the right place. control is where caps lock usually is, and caps lock is relegated to fn+tab

just remembered that this fucks me up when i have to go into the office and use the laptop keyboard. i keep hitting caps lock, and the alt-meta keys are in the opposite order :/

gonadic io
Feb 16, 2011

>>=

Barnyard Protein posted:

i solved that problem by spending too much money on a keyboard that has the keys in the right place. control is where caps lock usually is, and caps lock is relegated to fn+tab

just remembered that this fucks me up when i have to go into the office and use the laptop keyboard. i keep hitting caps lock, and the alt-meta keys are in the opposite order :/

Same but my company paid too much money for a mac. Now when I get home I'm always hitting alt-t in chrome and at work I hit cmd-h and instead of showing my history it minimises the window.

Arcsech
Aug 5, 2008

JawnV6 posted:

my big unix learning was on tcsh and I miss the history search. type a prefix, esc-p searches matches

now I have to pipe history thru grep like some chump

as always fish is the best shell

type prefix->press up to cycle through matching history entries

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Jeffrey of YOSPOS posted:

Map caps lock to escape, and use that to get out of insert mode. It's amazing unless you somehow have found a reason to hit caps lock on purpose, something I've never done after decades of computering. It's something I do immediately on every machine I own.

no i already map capslock to ctrl, and I definitely won't be changing that.

i'm just trying to get used to ctrl+[ for exiting. i think it's better than ctrl+c anyhow

Jeffrey of YOSPOS
Dec 22, 2005

GET LOSE, YOU CAN'T COMPARE WITH MY POWERS

MALE SHOEGAZE posted:

no i already map capslock to ctrl, and I definitely won't be changing that.

i'm just trying to get used to ctrl+[ for exiting. i think it's better than ctrl+c anyhow

Ctrl is right there though, you can just hit it, escape you gotta reach for. Remapping it is some emacs-rear end poo poo. I don't like hitting ctrl with one hand and the button with the other but if you can get used to it - good luck.

Also ctrl+r for history search in zsh saves me a ton of time, but sometimes with nested shells it stops working for some reason.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Jeffrey of YOSPOS posted:

Ctrl is right there though, you can just hit it, escape you gotta reach for. Remapping it is some emacs-rear end poo poo. I don't like hitting ctrl with one hand and the button with the other but if you can get used to it - good luck.

Also ctrl+r for history search in zsh saves me a ton of time, but sometimes with nested shells it stops working for some reason.

yeah i'll consider mapping ctrl to escape, since it's basically just unused currently. i think that would gently caress me up though because i still hit ctrl a lot by accident.

also i'm pretty sure i still prefer caps+[ to hitting ctrl. ctrl is awkward to press. caps+[ is not.

JawnV6
Jul 4, 2004

So hot ...

Arcsech posted:

as always fish is the best shell

type prefix->press up to cycle through matching history entries

it ends up with me hitting esc-p in bash, watching it switch to whatever goofy : mode it does with that, then figuring out some dumb piping way to remember what i typed a day ago

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

gonadic io posted:

Same but my company paid too much money for a mac. Now when I get home I'm always hitting alt-t in chrome and at work I hit cmd-h and instead of showing my history it minimises the window.
I work at a similar company and I installed karabiner to switch around alt and control (or option or whatever it's called) and now my Mac has similar shortcuts to my home PC. Too bad there are no apps that fully replicate the way you can move and snap windows using the keyboard.

Soricidus
Oct 21, 2010
freedom-hating statist shill

JawnV6 posted:

it ends up with me hitting esc-p in bash, watching it switch to whatever goofy : mode it does with that, then figuring out some dumb piping way to remember what i typed a day ago

have you tried ctrl-r

e: oh wait y'all are talking about vi modes instead of the standard straightforward settings aren't you

Spime Wrangler
Feb 23, 2003

Because we can.

Sagacity posted:

I work at a similar company and I installed karabiner to switch around alt and control (or option or whatever it's called) and now my Mac has similar shortcuts to my home PC. Too bad there are no apps that fully replicate the way you can move and snap windows using the keyboard.

also with karabiner you can map caps to both control and esc - a single tap is interpreted as esc, press + hold is control.

Elder Postsman
Aug 30, 2000


i used hot bot to search for "teens"

Sagacity posted:

I work at a similar company and I installed karabiner to switch around alt and control (or option or whatever it's called) and now my Mac has similar shortcuts to my home PC. Too bad there are no apps that fully replicate the way you can move and snap windows using the keyboard.

i've been using better snap tool and it's pretty good. there are some things it doesn't do, like where you can win+arrowkey to move a window all across all screens.

distortion park
Apr 25, 2011


Soricidus posted:

reminder that branding originally referred to having a bit of red-hot metal shoved into your face, and was a thing reserved for livestock and slaves

Adtech isn't much different now tbh

gonadic io
Feb 16, 2011

>>=

Sagacity posted:

I work at a similar company and I installed karabiner to switch around alt and control (or option or whatever it's called) and now my Mac has similar shortcuts to my home PC. Too bad there are no apps that fully replicate the way you can move and snap windows using the keyboard.

On the other hand, the magic mouse is absolutely amazing (with the extension that allows you to ha e both mouse buttons pressed at once) and I'm bitterly disappointed with my logitec flat smart touch mouse thing for Windows. Honestly that mouse alone might be enough to switch my home use one day.

Arcsech
Aug 5, 2008
current terrible programmer status: just moved teams at work, now in a "full stack" role. was working on some javascript last week, now working on a piece of a giant java codebase

haven't use java in years, not since about the time i registered my account (2008 or so) and that was for a college class so welp

intellij is the only thing saving my sorry rear end and i still look like the giant fuckin moron i am

Baxate
Feb 1, 2011

So I'm writing up a lil' angular app and i dunno how to do both pagination and filtering at the same time.

i had the pagination set up with the ui angular bootstrap thing and it worked ok, but then the filter filter would only filter on the page being displayed instead of for the whole data set.

like i had it set up so when a page would be displayed it would slice the data set and then do ng-repeat on the slice.
so like <tr ng-repeat="user in slicedUsers | filter:query">

is there like some simple way to display only a slice of data but filter on the full set?
all i can think of is putting all the data not on the displayed page into an invisible section of the page, but then it would still be invisible when filtered

this would be super easy to do server side :cripes:

JawnV6
Jul 4, 2004

So hot ...

Soricidus posted:

have you tried ctrl-r

e: oh wait y'all are talking about vi modes instead of the standard straightforward settings aren't you

no im on default bash (haven't even installed git completion) but I don't want a "(reverse-i-search)`':" I want the last fuckin grep i used on the line or maybe it was the second and I can push the same keys to keep looking up

JawnV6
Jul 4, 2004

So hot ...

MALE SHOEGAZE posted:

tomorrow I will be officially employed at Red Hat as a full time salaried employee. "Applications Engineer" or something

congratulations! this is pretty awesome. i've relied on a lot of (F)AE's and they're absolutely indispensable.

Soricidus
Oct 21, 2010
freedom-hating statist shill

JawnV6 posted:

no im on default bash (haven't even installed git completion) but I don't want a "(reverse-i-search)`':" I want the last fuckin grep i used on the line or maybe it was the second and I can push the same keys to keep looking up

ctrl-r, type "grep", then keep pressing ctrl-r to keep looking up

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

eschaton posted:

I think I've heard jwz suggested just embedding scheme48 but eich went all special snowflake about getting to be a language designer

no, that was bullshit that crockford made up. eich was hired specifically to do scheme in the browser, but by the time the project actually got started management had gone all gung-ho on java and insisted on something that looked like it

Soricidus
Oct 21, 2010
freedom-hating statist shill

Plorkyeran posted:

no, that was bullshit that crockford made up. eich was hired specifically to do scheme in the browser, but by the time the project actually got started management had gone all gung-ho on java and insisted on something that looked like it

if only at that point he'd just done scheme with curly-brace m-exprs

or something that functioned like java instead of just looking vaguely reminiscent of it

or basically anything other than his own fancy experimental language that ignored all the lessons of scheme and java and just went and did whatever he thought would be cool, some prototype inheritance here, some arbitrary syntactic sugar there ...

Jerry Bindle
May 16, 2003
we were supposed to get scheme instead of javascript? ok fucjk this alternate timeline we're living in.

MeruFM
Jul 27, 2010
do people unironically like lisp other than "there's some good stuff in here that may work in some specific situations"

Jerry Bindle
May 16, 2003
i use lisp to soothe my aspergers when it flares up, but java everywhere else. i bet its the same for other lisp enthusiasts

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

Ludwig van Halen posted:

this would be super easy to do server side :cripes:

welcome to front end development

Soricidus
Oct 21, 2010
freedom-hating statist shill

MeruFM posted:

do people unironically like lisp other than "there's some good stuff in here that may work in some specific situations"

i'm not going to say i would love browsers to embed scheme

i am definitely going to say that it would have been better than javascript

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Mahatma Goonsay posted:

Not really sure why they went with the ^, although it frees up = to actually mean equal. In a magic terminal the ^ actually looks like a little right arrow kinda like ->.

I bet the languages forked at a time when ASCII was not quite so reliably implemented as it is today

some Smalltalk dialects looked like they used _ for assignment because the original Smalltalk extended character set had ← at that code point, but most releases that came out of the Smalltalk-80 diaspora switched to := for assignment instead

they'd also render the code point that maps to ^ in ASCII as ↑but that's a far more sensible substitution and one they didn't need to change (^ is used to return a value from a method in Smalltalk)

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

JawnV6 posted:

my big unix learning was on tcsh and I miss the history search. type a prefix, esc-p searches matches

now I have to pipe history thru grep like some chump

control-r might interest you

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

i havent used scheme too much except fo rmessign around with racket a little bit, but it would own compared to javascript

Merdifex
May 13, 2015

by Shine

MeruFM posted:

do people unironically like lisp other than "there's some good stuff in here that may work in some specific situations"

I guess, same people also like Haskell because of its lax functors from a terminal bicategory

JawnV6
Jul 4, 2004

So hot ...

eschaton posted:

control-r might interest you

already linked, it's a horrible flow and I hate it after a few hours of trying

rather than "oh hey i used this before! shell, find the last instance of this prefix" it's "oh hey I used this before! lemme do a naive grep across the entire cmd instead of my known-good prefix, then once it's actually found do some OTHER chord to escape the weirdly captured terminal, THEN clean up any characters I put in before I remembered"

esc-p is much lighter and ive stockholmed the worse search method

Soricidus
Oct 21, 2010
freedom-hating statist shill

fart simpson posted:

i havent used scheme too much except fo rmessign around with racket a little bit, but it would own compared to javascript

racket is quite a long way from scheme now, that's why they renamed it (it used to be called plt scheme)

racket also owns period

Adbot
ADBOT LOVES YOU

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Merdifex posted:

I guess, same people also like Haskell because of its lax functors from a terminal bicategory

hey now, some of us like LISP without liking Haskell

  • Locked thread