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.
 
  • Post
  • Reply
Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Nomnom Cookie posted:

would you accept 128 MBps

i would accept them,

Adbot
ADBOT LOVES YOU

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



i think i weigh almost a megagibigram? but bits instead of bytes? you know what i mean? circa

jesus WEP
Oct 17, 2004


Krankenstyle posted:

i think i weigh almost a megagibigram? but bits instead of bytes? you know what i mean? circa
i know a belt won’t go all the way circa your waist

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



jesus WEP posted:

i know a belt won’t go all the way circa your waist

it do

idk its a pretty long belt, like 90 cm. rack belts are lik 75-80 cm :fatbert:

Soricidus
Oct 21, 2010
freedom-hating statist shill
put a girdle round your waist in forty inches

Doom Mathematic
Sep 2, 2008
A centbimeter is 1/128th of a meter.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Doom Mathematic posted:

A centbimeter is 1/128th of a meter.

i think cebimeter mostly because it's more upsetting to say

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



i prefer to call it 7.8 debimeters

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



i got it: i weigh one eigth of a megabig

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Krankenstyle posted:

i prefer to call it 7.8 debimeters

that's what i owe my credibitors

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



https://www.youtube.com/watch?v=d2tBhaVEWGM

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



pro tip: put milk in the gears, it makes them slower

call it lactasafFUC call it sabotage but milky

gonadic io
Feb 16, 2011

>>=
rethinking making this vs code extension now

Soricidus
Oct 21, 2010
freedom-hating statist shill

gonadic io posted:

rethinking making this vs code extension now


lol

webdev gonna webdev

matti
Mar 31, 2019

regex is the worst PL

gonadic io
Feb 16, 2011

>>=
i'm going mad here dealing with escaping of escaping

my grammar has
code:
		"keywords": {
			"patterns": [{
				"name": "keyword.other.dominionsmod",
				"match": "\\b#icon\\b"
			}]
		},
but I see these results: (no indentation or whitespace before the top 2 lines)


i thought \b, or word boundary, included start of line and whitespace. all the examples of keywords say to use it.

gonadic io
Feb 16, 2011

>>=
Even weirder, my numbers are defined as
code:
		"numbers": {
			"patterns": [{
				"name": "constant.numeric.integer.decimal.dominionsmod",
				"match": "\\b[[:digit:]]+\\b"
			}]
		},
and those work just fine

gonadic io
Feb 16, 2011

>>=
okay turns out that the example I was following was just wrong and textmate recommends you do this instead:
code:
		"keywords": {
			"patterns": [{
				"name": "keyword.other.dominionsmod",
				"match": "\\s*#icon\\b\\s*"
			}]
		},
so i don't know if \b behaves differently compared to normal regex, or if i never understood what it was supposed to do in the first place, but whatever

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
The issue there is that # is not a "word character". \b looks for the boundary between words and non-words, so your first regex is looking for #icon immediately after some word characters.

If you don't care about getting some superfluous matches then you could just look for #icon.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


gently caress regexes

akadajet
Sep 14, 2003

Powerful Two-Hander posted:

gently caress regexes

truth

gonadic io
Feb 16, 2011

>>=
I would absolutely love a better way to specify blazingly fast DFAs. Maybe I should give nom another go although in this case it wasn't an option since I was firmly in the vscode ecosystem.

Presto
Nov 22, 2002

Keep calm and Harry on.

gonadic io posted:

i'm going mad here dealing with escaping of escaping
I wrote a line once that had like literally dozens of backslashes in it. It was a command string that was getting passed around from shell to subshell to sub-subshell, with whole thing wrapped in a Python script.

I put a comment in saying basically I can't explain how this works.

Xarn
Jun 26, 2015

gonadic io posted:

I would absolutely love a better way to specify blazingly fast DFAs. Maybe I should give nom another go although in this case it wasn't an option since I was firmly in the vscode ecosystem.

Are you sure that you even get DFAs?

This is your regularly scheduled reminder that most popular regex implementations use backtracking.

jesus WEP
Oct 17, 2004


Powerful Two-Hander posted:

gently caress regices

gonadic io
Feb 16, 2011

>>=

Xarn posted:

Are you sure that you even get DFAs?

This is your regularly scheduled reminder that most popular regex implementations use backtracking.

It was my understanding that if you stick to the regular parts of the language and don't use lookahead or lookbehind you were fine. These aren't user controlled.

Xarn
Jun 26, 2015
An implementation needs special casing for that. I am not saying it doesn't, I don't use whatever VSCode thingy you are writing for, but it is worth keeping it in mind.

Zlodo
Nov 25, 2006
i did a syntax highlighting thing for vscode once and it was awful

they reused a system developed for the textmate editor (that i never heard of other than for this) which itself used a regex library developed by some random dude

the docs for vscode syntax highlighting points you to the textmates docs which themselves contain a copy of that regex lib docs bc it was hosted on geocities and its long gone

gonadic io
Feb 16, 2011

>>=

Zlodo posted:

i did a syntax highlighting thing for vscode once and it was awful

they reused a system developed for the textmate editor (that i never heard of other than for this) which itself used a regex library developed by some random dude

the docs for vscode syntax highlighting points you to the textmates docs which themselves contain a copy of that regex lib docs bc it was hosted on geocities and its long gone

this was my experience too. somebody is releasing a textmate 2 so all the textmate 1 docs and half the search results point to it but, unfortunately, it is empty and has nothing but seo inducing headers.

gonadic io
Feb 16, 2011

>>=

Xarn posted:

An implementation needs special casing for that. I am not saying it doesn't, I don't use whatever VSCode thingy you are writing for, but it is worth keeping it in mind.

Does it though? I've done (non optimised) implementations before and you have a function that can return a list of results but (with my regexes) that list will always have length 1. An NFA that only ever has one state surely isn't _that_ much slower than a proper DFA?

Hmm, now I kind of want to test what speeds I can get out of an underfeatured actually regular regex library

MrMoo
Sep 14, 2000

Woohoo, I’ve gone and done it again. Webdev world hits scrolling ticker technology again. So first version was using WebAnimations for CPU controlled GPU animation but suffered from Chome overheads, getting better and more popular now: Apple uses the tech quite frequently.

Version 2.0 as covered in a long projects post moved to WebGL using PIXI.js to paint to a canvas and animate in GL land. This is on NYSE floor and outside on broad street and works well if you have a nice speedy CPU to GPU memory bus.

Version 3.0 rips out the canvas and uses multi-signed distance fields (MSDF) from a paper by Valve that uses a font texture atlas with smarty pants magic to make text scale up biggly. So now there are no canvas elements in play, everything traditional GL stuff and can have shaders thrown around at will. So I took the Unreal Bloom Pass and made a nice neon effect sports ticker, even works on Firefox.

http://ahyoomee.miru.hk/zignage-sports7/build/default/www/3840-bloom.html

edit: adding craptacular gif:



Here's the MSDF font image:



The server side software is the same spectacular junk as NYSE, a Node.JS message router, :lol: together with a dedicated feed handler for a sports data service. I went a bit OT and separated out the data schema for each sport and implemented a runtime agent to convert each one as a child process so that it can be dynamically updated without restarting the main process.

Client side software is a multi-threaded monster, the renderer thread uses Polymer and LitHTML x LitElement as a basic container for a webcomponent. The graphics are all in THREE.js with modified MSDF code to work with ES6 imports, and Bloom Pass to work with global THREE include. The renderer thread talks to a series of worker threads that each manage the business logic behind each tile in the ticker, all using ES10 with polyfill for TC39 extension. Basically the main ticker subscribes to list of games for each sport and creates a webcomponent for each game that then subscribes to that games data and manages its display. The comms is on an additional thread via websocket shared between all the worker threads and communicating via Google's Comlink, a convenient wrapper around PostMessage and friends.

MrMoo fucked around with this message at 06:41 on Dec 24, 2019

Nomnom Cookie
Aug 30, 2009



gonadic io posted:

Does it though? I've done (non optimised) implementations before and you have a function that can return a list of results but (with my regexes) that list will always have length 1. An NFA that only ever has one state surely isn't _that_ much slower than a proper DFA?

Hmm, now I kind of want to test what speeds I can get out of an underfeatured actually regular regex library

an NFA that's only ever in 1 state at a time is a DFA

FlapYoJacks
Feb 12, 2009

Powerful Two-Hander posted:

gently caress regexes

I use regex for two things and two things only:

Find a pattern and everything after it:
IE: foo.*

Find all blank lines:
^(?:[\t ]*(?:\r?\n|\r))+

akadajet
Sep 14, 2003

ratbert90 posted:

I use regex for two things and two things only:

Find a pattern and everything after it:
IE: foo.*

Find all blank lines:
^(?:[\t ]*(?:\r?\n|\r))+

wow, you found 2 bad use cases for regexes

brand engager
Mar 23, 2011


:hmmyes:

FlapYoJacks
Feb 12, 2009

akadajet posted:

wow, you found 2 bad use cases for regexes

Oh lord, I don't use them in code, I use them in editors. I'm not a monster.

gonadic io
Feb 16, 2011

>>=

Nomnom Cookie posted:

an NFA that's only ever in 1 state at a time is a DFA

yes, this was in response to:

gonadic io posted:

It was my understanding that if you stick to the regular parts of the language and don't use lookahead or lookbehind you were fine. These aren't user controlled.

Xarn posted:

An implementation needs special casing for that. I am not saying it doesn't, I don't use whatever VSCode thingy you are writing for, but it is worth keeping it in mind.

the NFA engine itself wasn't necessarily built with the knowledge that I am not going to give it a non-regular regex

Tanners
Dec 13, 2011

woof

MrMoo posted:

Woohoo, I’ve gone and done it again. Webdev world hits scrolling ticker technology again. So first version was using WebAnimations for CPU controlled GPU animation but suffered from Chome overheads, getting better and more popular now: Apple uses the tech quite frequently.

Version 2.0 as covered in a long projects post moved to WebGL using PIXI.js to paint to a canvas and animate in GL land. This is on NYSE floor and outside on broad street and works well if you have a nice speedy CPU to GPU memory bus.

Version 3.0 rips out the canvas and uses multi-signed distance fields (MSDF) from a paper by Valve that uses a font texture atlas with smarty pants magic to make text scale up biggly. So now there are no canvas elements in play, everything traditional GL stuff and can have shaders thrown around at will. So I took the Unreal Bloom Pass and made a nice neon effect sports ticker, even works on Firefox.

http://ahyoomee.miru.hk/zignage-sports7/build/default/www/3840-bloom.html

Neat

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
a backtracking regex implementation won't use an nfa or dfa regardless of what type of regex you give it.

you can create pathological regexes that exhibit exponential behaviour on a backtracking implementation that are completely regular

Adbot
ADBOT LOVES YOU

Nomnom Cookie
Aug 30, 2009



https://www.regular-expressions.info/catastrophic.html

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply