@mngrif Dude I dont even bother wearing a shirt when i eat anymore.
@Gargron Anything I or the rest of us could do to cheer you up? Would you like a video of my friends cat talking to her I just saw, I know you like cats, might cheer you up?
He probably isnt using a database abstraction layer. Usually if you do then you can switch to any database under the sun with little issue and more or less the same feature set.
I think pizxelfed is written in PHP which is notorious among its programmers (not saying this is the case with pizelfed) to just skip the abstraction layer all together and code raw SQL. Presuming that is the case this is usually the result, support for just one database and if any other databases are supported the feature set can often lag if it works at all.
@snder You can do the migration issue is there is more than one way to convert some things that might exist in postgresql and some things youd have to convert by hand (like ant PL/SQL). So in practice it likely wont be trivial.
@snder is pixelfed compatible with both backends as-is?
@snder convert what exactly? The database content itself or the SQL queries that create and use the data?
@Absinthe
I'm not entirely sure I understand the original problem... An item would have a name then a encoded code and the encoded code along with the name can be used to decide some pricing info. Is that it? But what if the name has fewer than 10 letters. Since there isn't a letter for every number how is that handled?
@serra
Good catch, elm isnt one of the languages i mess with so i didnt run it myself and only got a vague idea of what is going on.
@johnlitt Looks spiffy might need to demo it
@billstclair
I don't know about that word "instantly" there but cool solution ;)
@Absinthe
@Absinthe
For me it was the most fun way to interpret the problem. Really enjoyed this one.
@billstclair @Absinthe Time-complexity has nothing to do with raw-speed. If you do the brute force solution and actually list all solutions with a copy approach (the absolute simplest least efficient way) then your dealing with exponential space complexity. Good luck computing large datasets on even the beefiest of machines where a linear solution would attack it with ease.
Octave solution
Linear in time and space by taking advantage of the Fibonacci numbers.
function count = interpretations(string)
ambig = string(1:end-1) == '1' | (string(1:end-1) == '2' & string(2:end) <= '6');
ambig &= string(1:end-1) ~= '0' & string(2:end) ~= '0' & [string(3:end) '1'] ~= '0';
ambig = [false ambig false];
consec = find(ambig(1:end-1) & !ambig(2:end)) - find(!ambig(1:end-1) & ambig(2:end));
fibo = zeros(max(consec), 1);
fibo(1:2) = [2 3];
for i = 3:max(consec)
fibo(i) = fibo(i - 1) + fibo(i - 2); end;
count = prod(arrayfun(@(x)fibo(x), consec)); end;
Jeffrey Phillips Freeman
Innovator & Entrepreneur in Machine Learning, Evolutionary Computing & Big Data. Avid SCUBA diver, Open-source developer, HAM radio operator, astrophotographer, and anything nerdy.
Born and raised in Philadelphia, PA, USA, currently living in Utrecht, Netherlands, USA, and Thailand. Was also living in Israel, but left.
Pronouns: Sir / Mister
(Above pronouns are not intended to mock, i will respect any persons pronouns and only wish pronouns to show respect be used with me as well. These are called neopronouns, see an example of the word "frog" used as a neopronoun here: http://tinyurl.com/44hhej89 )
A proud member of the Penobscot Native American tribe, as well as a Mayflower passenger descendant. I sometimes post about my genealogical history.
My stance on various issues:
Education: Free to PhD, tax paid
Abortion: Protected, tax paid, limited time-frame
Welfare: Yes, no one should starve
UBI: No, use welfare
Racism: is real
Guns: Shall not be infringed
LGBT+/minorities: Support
Pronouns: Will respect
Trump: Moron, evil
Biden: Senile, racist
Police: ACAB
Drugs: Fully legal, no prescriptions needed
GPG/PGP Fingerprint: 8B23 64CD 2403 6DCB 7531 01D0 052D DA8E 0506 CBCE