User:Kernigh: Difference between revisions

From Rosetta Code
Content added Content deleted
m ({{subst:mylangbegin}}, {{subst:mylangend}})
(Split "My Favorite Languages" into 4 sections: top, Unix Classic Tools, Alternate Shells, Off Platform.)
Line 1: Line 1:
<div style="text-align: center; font-size: 10pt; float: right; padding-left: 8px;">

{| style="border:1px solid #c5fcdc; padding:0 4px 0 4px;height:40px;text-align:center;font-size:10pt;float:right;"
{| style="border:1px solid #c5fcdc; padding:0 4px;"
|- style="background: #5ed797;"
|-
| colspan="2" style="background: #5ed797;padding:0 4px 0 4px;" |'''{{#if: |{{{1}}}|My Favorite Languages}}'''
| colspan="2" |'''My Favorite Languages'''
|-
|- style="background: #5ed797;"
| colspan="2" |'''4''' is best, '''1''' is worst.
|- style="background: #5ed797;"
|style="padding:0 4px 0 4px;"|'''Languages'''
|style="padding:0 4px 0 4px;"|'''Languages'''
|style="padding:0 4px 0 4px;"|'''Proficiency'''
|style="padding:0 4px 0 4px;"|'''Proficiency'''
{{mylang|Ruby|4}}
{{mylang|Ruby|4}}
{{mylang|C|3}}
{{mylang|C|3}}
{{mylang|UNIX Shell|3}}
{{mylang|AWK|2}}
{{mylang|bc|2}}
{{mylang|CMake|2}}
{{mylang|CMake|2}}
{{mylang|Common Lisp|2}}
{{mylang|Common Lisp|2}}
{{mylang|C Shell|2}}
{{mylang|dc|2}}
{{mylang|Factor|2*}}
{{mylang|Factor|2*}}
{{mylang|Java|2}}
{{mylang|Java|2}}
{{mylang|make|2}}
{{mylang|Perl|2}}
{{mylang|Perl|2}}
{{mylang|WML|2}}
{{mylang|WML|2}}
{{mylang|es|1*}}
{{mylang|m4|1}}
{{mylang|PicoLisp|1*}}
{{mylang|PicoLisp|1*}}
{{mylang|Python|1}}
{{mylang|Python|1}}
{{mylang|Scala|1*}}
{{mylang|Scala|1*}}
|- style="background: yellow;"
| colspan="3" |&darr; ''Unix Classic Tools'' &darr;
{{mylang|UNIX Shell|3}}
{{mylang|AWK|2}}
{{mylang|bc|2}}
{{mylang|dc|2}}
{{mylang|make|2}}
{{mylang|m4|1}}
{{mylang|sed|1}}
{{mylang|sed|1}}
|- style="background: yellow;"
| colspan="3" |&darr; ''Alternate Shells'' &darr;
{{mylang|C Shell|2}}
{{mylang|es|1*}}
|- style="background: yellow;"
| colspan="3" |&darr; ''Off Platform'' &darr;
{{mylang|TI-83 BASIC|1}}
{{mylang|TI-83 BASIC|1}}
|}
|}
</div>
Language proficiency:
Language proficiency:
* '''4''' I prefer this language.
* '''4''' I prefer this language.

Revision as of 00:07, 25 November 2011

My Favorite Languages
4 is best, 1 is worst.
Languages Proficiency
Ruby 4
C 3
CMake 2
Common Lisp 2
Factor 2*
Java 2
Perl 2
WML 2
PicoLisp 1*
Python 1
Scala 1*
Unix Classic Tools
UNIX Shell 3
AWK 2
bc 2
dc 2
make 2
m4 1
sed 1
Alternate Shells
C Shell 2
es 1*
Off Platform
TI-83 BASIC 1

Language proficiency:

  • 4 I prefer this language.
  • 3 I know much about this language. I can solve many tasks.
  • 2 I know part of this language. I can solve some tasks.
  • 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

In progress

<lang c>#include <stdio.h>

  1. include <stdlib.h>
  1. if defined(_WIN32)
  2. include <windows.h>
  3. include <process.h>

/* ARGSUSED */ unsigned __stdcall run2(void *arg) { printf(" %d\n", rand()); printf(" %d\n", rand()); printf(" %d\n", rand()); return 0; }

void run(void) { HANDLE thread; thread = (HANDLE)_beginthreadex(NULL, 0, run2, NULL, 0, NULL); if (thread) { WaitForSingleObject(thread, INFINITE); CloseHandle(thread); } else puts("Error!"); }

  1. elif defined(__unix__)
  2. include <pthread.h>

/* ARGSUSED */ void * run2(void *arg) { printf(" %d\n", rand()); printf(" %d\n", rand()); printf(" %d\n", rand()); return NULL; }

void run(void) { pthread_t thread; if (pthread_create(&thread, NULL, run2, NULL) || pthread_join(thread, NULL)) puts("Error!"); }

  1. else
  2. error Port run() to your system.
  3. endif

int main() { srand(42); puts("Thread A:"); run(); puts("Thread B:"); run(); return 0; }</lang>

Thread A:
  41
  18467
  6334
Thread B:
  41
  18467
  6334