|
|
Most modern language lack set data type. Remember old Pascal set. For example
if ("A" in ["A","B","C"]) then
.. do something.
I implemented it in Javascript like this.
function SetOf(arr) {
var obj = {};
for (var i = 0; i < arr.length; i++) {
obj[arr[i]] = arr[i];
}
return obj;
}
if ('A' in SetOf(['A','B','C']))
.. do something.
|
|
|
|
|
Sander Rossel wrote: I'll admit that you usually don't need LINQ in your browser and getting arrgh just for remove is a bit overkill
At the moment, I'm not doing any manipulation of arrays and dictionaries other than adding items to them and iterating over them. But that might change...
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
I spent about 6 months in developer hell working with JavaScript ("cool--now can you add these 5 things?") about 5 years ago, and was fairly deep into some of these concepts.
Basic premise: Create a web UI to do scheduling for 5,000 workers (construction, lab, etc) that talked to the (very old) scheduling system.
Kink in the process: Needed to account for all sorts of static scheduling rules (start times, end times, allowed ranges, etc) and a variable list of union rules (lots of different unions on site) to match up and validate the work, the pay rates for job type, and such.
My JS coding was definitely old-school style, but prototypes were what saved the day. Date and time handling, rules, etc allowed me to push the common functions further up the chain, and going between 5 different datetime formats certainly made a difference. Same for the "rules" concept--basic rules and functions, and subclasses for specialized parameters.
The whole thing was cancelled just as it was getting functional ("Oh, wait! We need to get 5 departments and 3 unions to sign off on this"), but I definitely learned a lot.
vuolsi così colà dove si puote
ciò che si vuole, e più non dimandare
--The answer to Minos and any question of "Why are we doing it this way?"
|
|
|
|
|
Where there not solution already developed in this space by s/w companies ? example ()[^]
[^]
i guess its a matter of budget..
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
Budget and time. The primary contractor (a Dept. of Energy nuclear cleanup project) had taken over the system that was already in place as part of the original requirement. The site had also been running for about 50 years prior, so they couldn't just dump the historical data.
Spending big $$$ to do a migration (with all the sign offs from all parties involved) was going to bust the budget, as well as take too long. Instead, they had the idea that we could just build an overlay on the existing system that would automate the work previously done by all the managers and foremen.
It wasn't really a horrible idea, except that all the people who knew what needed to happen (the rules, restrictions, and such) had either left the site at the change over or were not involved in fleshing out the requirements. So it was a like a fractal rabbit hole--go down one, and you only see hundreds more inside.
vuolsi così colà dove si puote
ciò che si vuole, e più non dimandare
--The answer to Minos and any question of "Why are we doing it this way?"
|
|
|
|
|
It would be a challenge to get a new system in place, considering the change management needed.
Unless it is so simple a child could do it....anyway.Migrations would be costly , better to
park the existing system and cut over to a new one..but the new one should off course meet
all the requirements.....coming out of the rabbit hole with sanity intact...and doing
all this with JavaScript...whew...do you drink brandy...rum...
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
Don't forget about the nature of JS asynchronous execution. Between the this and async is what "Gotcha" the most for new comer. Promise helps, but it is not an easy beast to tam. Once it is understood, using it is easy enough.
|
|
|
|
|
|
I just decided to visit the VCFe 19.0 - Vintage Computer Festival Europe[^] at the end of next month, especially because it takes place in the small town right next to where I work now.
I really look forward to this workshop:
Quote: Echte Männer schauen auf Hochsprachen herab. Echte Männer wissen, Assembler ist was für Warmduscher. Echte Männer brauchen nur ein Datenblatt, eine Hextastatur und eine 7-Segmentanzeige um die CPU zu unterwerfen.
(Real men look down on high level languages. Real men know that assembly is something for pussies. Real men only need a data sheet, a hexadecimal keyboard and a 7 segment (hexadecimal) display to bring the CPU to submission.)
This will be fun. The first thing I ever learned to do on a computer.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Speaking of vintage:
I have in my possession a quite rare 32k-Word Magnetic-core memory - Wikipedia
With 40 bit words that amounts an exhilarating capacity of 128 kB! It dates to ~1970
The UK company that built it is still around (their name evades me at the moment). Dunno what to do with it. Gift it to a museum maybe?
... such stuff as dreams are made on
|
|
|
|
|
Use a Raspberry Pi to interface it to the iPhone and sell it to hipsters?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Do you have any idea in what system(s) they were used? Someone may just be looking for such a part and need it to bring an old machine back to life.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
I know exactly what system it was!
My dad pioneered by designing this - for that time - technological wonder: TRASK (computer) - Wikipedia
... such stuff as dreams are made on
|
|
|
|
|
Quote: All speeches will be given in German, unless otherwise noted That's vintage too.
|
|
|
|
|
As my father has related to me on multiple occasions...
When he was in college (early 1950s), one of his professors had recommended some math books for further study. One student complained, "they're all in German", and the professor responded, "of course, all the best math texts are in German".
|
|
|
|
|
At university most of my physics books were in English.
I always find amusing some of my friends saying: "Are you able to study textbooks in English?".
Like it was the English language, the problem.
|
|
|
|
|
When you have too many bugs...
Don't you wish you could just execute them all?
One day early. Busy Friday.
... such stuff as dreams are made on
|
|
|
|
|
megaadam wrote: When you have too many bugs users...
Don't you wish you could just execute them all?
FTFY
|
|
|
|
|
Too brutal. They become apathic once they lose all hope that anything they report will ever help to change anything. And after I had replaced the old mess with my new program, they still were quiet because the program gave them what they were looking for. Every day, without a single support case in almost two years after being installed.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
I thought you'd want a PROMPT reply, however, I was mulling over whether or not it's a good thing if the bugs RUN, and if they do so wildly, they might CRASH.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
C:\> PROMPT $P$_$G
C:\
> _
Software Zen: delete this;
|
|
|
|
|
You just dragged me down memory lane.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
Gotta love those 8-bit-samples!
... such stuff as dreams are made on
|
|
|
|