User:Kernigh: Difference between revisions

Add Emacs Lisp to the (already too long) list of languages.
m ({{subst:mylangbegin}}, {{subst:mylangend}})
(Add Emacs Lisp to the (already too long) list of languages.)
 
(10 intermediate revisions by the same user not shown)
Line 1:
{{mylangbegin}}
 
|- style="background: white;"
{| style="border:1px solid #c5fcdc; padding:0 4px 0 4px;height:40px;text-align:center;font-size:10pt;float:right;"
| colspan="2" |'''4''' is best, '''1''' is worst.
|-
| colspan="2" style="background: #5ed797;padding:0 4px 0 4px;" |'''{{#if: |{{{1}}}|My Favorite Languages}}'''
|- style="background: #5ed797;"
|style="padding:0 4px 0 4px;"|'''Languages'''
|style="padding:0 4px 0 4px;"|'''Proficiency'''
{{mylang|Ruby|4}}
{{mylang|C|3}}
{{mylang|Factor|3}}
{{mylang|WML|3}}
{{mylang|C++|2}}
{{mylang|CMake|2}}
{{mylang|Common Lisp|2}}
{{mylang|Java|2}}
{{mylang|Perl|2}}
{{mylang|Emacs Lisp|1}}
{{mylang|PicoLisp|1}}
{{mylang|Python|1}}
|- style="background: #df0;"
| colspan="2" |↓ ''Unix Classic Tools'' ↓
{{mylang|UNIX Shell|3}}
{{mylang|AWK|2}}
{{mylang|bc|2}}
{{mylang|CMake|2}}
{{mylang|Common Lisp|2}}
{{mylang|C Shell|2}}
{{mylang|dc|2}}
{{mylang|Factor|2*}}
{{mylang|Java|2}}
{{mylang|make|2}}
{{mylang|Perl|2}}
{{mylang|WML|2}}
{{mylang|es|1*}}
{{mylang|m4|1}}
{{mylang|PicoLisp|1*}}
{{mylang|Python|1}}
{{mylang|Scala|1*}}
{{mylang|sed|1}}
|- style="background: #df0;"
| colspan="2" |↓ ''Alternate Shells'' ↓
{{mylang|C Shell|2}}
{{mylang|es|1}}
|- style="background: #df0;"
| colspan="2" |↓ ''Not BSD'' ↓
{{mylang|AutoHotkey|1}}
{{mylang|TI-83 BASIC|1}}
{{mylangend}}
|}
 
Language proficiency:
Ruby is my best language. Most of my contributions come from an [[OpenBSD]] machine. A few of my examples come from a [[Windows]] machine with [[MinGW]]. I never used Factor, PicoLisp nor AutoHotkey until I found them at Rosetta Code.
* '''4''' I prefer this language.
 
* '''3''' I know much about this language. I can solve many tasks.
* [https://github.com/kernigh/factor Factor for OpenBSD/amd64]
* '''2''' I know part of this language. I can solve some tasks.
* [http://code.google.com/r/kernigh-picolisp/ PicoLisp for OpenBSD/amd64]
* '''1''' I can only use this language for a few simple tasks.
* '''*''' I never used this language until I saw it at Rosetta Code.
 
== Contributions by Kernigh ==
* First 20 examples for [[:Category:CMake]] and [[:Category:C Shell]]
* New tasks
** Message digests: ''[[MD4]] (DRAFT)'', ''[[RIPEMD-160]] (DRAFT)'', [[SHA-1]]
** [[Caesar cipher]]
** Matrices: ''[[Conjugate transpose]] (DRAFT)'', ''[[Identity matrix]] (DRAFT)''
** [[Least common multiple]]
** Other new tasks: [[Caesar cipher]], [[Deal cards for FreeCell]], [[Empty directory]], [[Even or odd]], [[Least common multiple]], [[Linear congruential generator]], [[Return multiple values]], [[Set]], [[Subtractive generator]]
** [[Linear congruential generator]]
** [[Return multiple values]]
** [[Set]]
** [[Subtractive generator]]
 
== InRuby progressmethods in Enumerable ==
{| class="wikitable"
<lang c>#include <stdio.h>
!| Method
#include <stdlib.h>
!| Rosetta Code task
 
|-
#if defined(_WIN32)
|| <code>#all?</code>
#include <windows.h>
|-
#include <process.h>
|| <code>#any?</code>
 
|-
/* ARGSUSED */
|| <code>#chunk</code>
unsigned __stdcall
|-
run2(void *arg)
|| <code>#collect</code>
{
|-
printf(" %d\n", rand());
|| <code>#collect_concat</code>
printf(" %d\n", rand());
|-
printf(" %d\n", rand());
|| <code>#count</code>
return 0;
|-
}
|| <code>#cycle</code>
 
|-
void
|| <code>#detect</code>
run(void)
|-
{
|| <code>#drop</code>
HANDLE thread;
|-
thread = (HANDLE)_beginthreadex(NULL, 0, run2, NULL, 0, NULL);
|| <code>#drop_while</code>
if (thread) {
|-
WaitForSingleObject(thread, INFINITE);
|| <code>#each_cons</code>
CloseHandle(thread);
|-
} else
|| <code>#each_entry</code>
puts("Error!");
|-
}
|| <code>#each_slice</code>
#elif defined(__unix__)
|-
#include <pthread.h>
|| <code>#each_with_index</code>
 
|-
/* ARGSUSED */
|| <code>#each_with_object</code>
void *
|-
run2(void *arg)
|| <code>#entries</code>
{
|-
printf(" %d\n", rand());
|| <code>#find</code>
printf(" %d\n", rand());
|-
printf(" %d\n", rand());
|| <code>#find_all</code>
return NULL;
|-
}
|| <code>#find_index</code>
 
|-
void
|| <code>#first</code>
run(void)
|-
{
|| <code>#flat_map</code>
pthread_t thread;
|-
if (pthread_create(&thread, NULL, run2, NULL) ||
|| <code>#grep</code>
pthread_join(thread, NULL))
|-
puts("Error!");
|| <code>#group_by</code>
}
|-
#else
|| <code>#include?</code>
#error Port run() to your system.
|-
#endif
|| <code>#inject</code>
 
|-
int
|| <code>#map</code>
main()
|-
{
|| <code>#max</code>
srand(42);
|-
puts("Thread A:");
|| <code>#max_by</code>
run();
|-
puts("Thread B:");
|| <code>#member?</code>
run();
|-
return 0;
|| <code>#min</code>
}</lang>
|-
 
|| <code>#min_by</code>
<pre>Thread A:
|-
41
|| <code>#minmax</code>
18467
|-
6334
|| <code>#minmax_by</code>
Thread B:
|-
41
|| <code>#none?</code>
18467
|-
6334</pre>
|| <code>#one?</code>
|-
|| <code>#partition</code>
|-
|| <code>#reduce</code>
|-
|| <code>#reject</code>
|-
|| <code>#reverse_each</code>
|-
|| <code>#select</code> || [[Filter]]
|-
|| <code>#slice_before</code>
|-
|| <code>#sort</code> ||
* [[Sort an integer array]]
* [[Sort using a custom comparator]]
|-
|| <code>#sort_by</code> || [[Sort an array of composite structures]]
|-
|| <code>#take</code>
|-
|| <code>#take_while</code>
|-
|| <code>#to_a</code>
|-
|| <code>#zip</code> || [[Loop over multiple arrays simultaneously]]
|}
Anonymous user