tag:blogger.com,1999:blog-53899299517488648112024-03-06T06:37:53.050+01:00The J HeadJaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.comBlogger75125tag:blogger.com,1999:blog-5389929951748864811.post-67481384980829035532023-01-27T15:03:00.005+01:002023-01-31T14:57:08.797+01:00A proposal to improve C++ safety<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2023-01-26 Thu 10:29 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="viewport" content=" width=device-width, initial-scale=1">
<title>A serious proposal to improve C++ safety</title>
<meta name="generator" content="Org mode">
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: auto;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
p.blockquote
{
background-color:silver;
margin:12pt;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
<script type="text/javascript">
// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.add("code-highlighted");
target.classList.add("code-highlighted");
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.remove("code-highlighted");
target.classList.remove("code-highlighted");
}
}
/*]]>*///-->
// @license-end
<body>
<div id="content">
<div id="outline-container-org91ac290" class="outline-2">
<h3 id="org91ac290">The C++ of old times</h3>
<div class="outline-text-2" id="text-1">
<p>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizh3MHPz3tNUOf7G4SuOT77COP0LjHamANoUBLduKRPekHLWNImBfljSwiRW0JdbmgKpG8sxFAMrnPk6hbQVECDEy_rbiKpOHF7Xc5AbKQGZZ3A5nwb-d_8EwfUO03D9NNzrejF-qa2id-JIOn1TfOBWNyfWjbCq7wSZUqpy2rv4bLCx2100g6hJ1gIg/s1600/c++unsafe.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="220" data-original-width="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizh3MHPz3tNUOf7G4SuOT77COP0LjHamANoUBLduKRPekHLWNImBfljSwiRW0JdbmgKpG8sxFAMrnPk6hbQVECDEy_rbiKpOHF7Xc5AbKQGZZ3A5nwb-d_8EwfUO03D9NNzrejF-qa2id-JIOn1TfOBWNyfWjbCq7wSZUqpy2rv4bLCx2100g6hJ1gIg/s1600/c++unsafe.png"></a></div>
When I began my voyage in the land of programming, my teacher taught my classmates and me C++. It was a <i>really good</i> way to start programming, since it gave me a deep undestanding of how a program is written and how computers work (thank you, Renato Conte!).<br>
C++ at the end of the '90s was almost a <i>C with classes</i>. Sure, we had streams, but it lacked lists, vectors and even strings where still C's characters arrays. Without Boost libraries, programming in C++ gave little more than plain C.<br>
</p></div></div></div></body></![CDATA[></script></![CDATA[></style></head></html></!DOCTYPE></?xml><a href="http://thejhead.blogspot.com/2023/01/a-serious-proposal-to-improve-c-safety.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com2tag:blogger.com,1999:blog-5389929951748864811.post-25916013629800867532022-11-17T10:01:00.002+01:002022-11-20T17:41:37.470+01:00Hands up! Measure! And keep it simple!<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2022-11-16 Wed 17:30 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="viewport" content=" width=device-width, initial-scale=1">
<title>‎</title>
<meta name="generator" content="Org mode">
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: auto;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
.picture_note
{
text-align:center;
font-size:9pt;
font-style:italic;
}
/*]]>*/-->
<script type="text/javascript">
// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.add("code-highlighted");
target.classList.add("code-highlighted");
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.classList.remove("code-highlighted");
target.classList.remove("code-highlighted");
}
}
/*]]>*///-->
// @license-end
<body>
<div id="content">
<p>
At the end of this post I will expose an example of a speedup of 8000x. This means that a program that at first took almost <b>five hours</b> to complete, ended up in <b>two second</b>.<br>
A ratio of 8000:1.<br>
Pretty impressive!
</p>
<p>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIcGpasQ0SZlQTe9zn8ZDgZDppeVD_3auvzNLQKcHxGdE39xh9XizXUIBJtwSIBQo5r7zZiZC3th5TjrgK2u68TZTxBlYu2fLFVE4ZCUJaMz5Ku6G4Kmm9XRHhoYiXtFZkVBD8x4vgL0t2RNtQfFusP4ZDcgTS7j0s8sJQcpmg6W0hL_4o3Zu6m_88Jw/s651/koala-eating-wait-what-meme.jpg" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" height="320" data-original-height="651" data-original-width="600" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIcGpasQ0SZlQTe9zn8ZDgZDppeVD_3auvzNLQKcHxGdE39xh9XizXUIBJtwSIBQo5r7zZiZC3th5TjrgK2u68TZTxBlYu2fLFVE4ZCUJaMz5Ku6G4Kmm9XRHhoYiXtFZkVBD8x4vgL0t2RNtQfFusP4ZDcgTS7j0s8sJQcpmg6W0hL_4o3Zu6m_88Jw/s320/koala-eating-wait-what-meme.jpg"></a></div>
<div class="picture_note">Wait! What?!</div>
</p>
</div></body></![CDATA[></script></![CDATA[></style></head></html></!DOCTYPE></?xml><a href="http://thejhead.blogspot.com/2022/11/hands-up-measure-and-keep-it-simple.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-32289436368849749392022-10-24T10:30:00.003+02:002022-10-24T10:51:06.266+02:00Why C++ is difficult<style>
p.quote
{
margin:20pt;
text-align:justify;
font-family:Monospace;
border-left: 3pt solid silver;
padding-left: 1pt;
}
div.picture_text
{
text-align:center;
font-style:italic;
font-size:10pt;
}
pre
{
background-color:silver;
color:black;
font-family:Monospace
}
div.rule
{
text-align:center;
font-style: italic;
color:green;
}
</style>
<p class="quote">
C++ is a horrible language. It's made more horrible by the fact that a lot
of substandard programmers use it, to the point where it's much much
easier to generate total and utter crap with it. Quite frankly, even if
the choice of C were to do *nothing* but keep the C++ programmers out,
that in itself would be a huge reason to use C.
</p><p>
Source is <a href="http://harmful.cat-v.org/software/c++/linus">here</a>.
Many of you will recognize these words: it's a piece of Linus Torvalds' rant aganist C++, when some developers asked him to move Git from C to C++.</p>
<a href="http://thejhead.blogspot.com/2022/10/why-c-is-difficult.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com2tag:blogger.com,1999:blog-5389929951748864811.post-72956308566155088592021-04-26T08:00:00.004+02:002022-10-27T10:59:51.430+02:00Between the product and the prototype<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://commons.wikimedia.org/wiki/File:An_accident_on_Savy_Aerodrome_during_the_German_offensive_in_1918_(3288866270).jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="367" data-original-width="512" height="229" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-SWu9qyKUQ5CMUDtSMa7pWfcd5QG1vSwuua6OrAhVoljFcdfC-Uud41JuV97A-fMBduRogPrzs-ZrTmIgm7ScKhUlyxgFRB7t3lCiEaBsmQcLjWMPwWrHXZ2MmIeVsS7Vx2XGNNZ-o8zw/w320-h229/An_accident_on_Savy_Aerodrome_during_the_German_offensive_in_1918_%25283288866270%2529.jpg" width="320"></a></div><br>
<p align="center" style="font-size: 8pt;">
So, it seems lead isn't a good material for wings<br>(Australian War Memorial collection, No restrictions, via Wikimedia Commons)
</p>
<p>
These days I had a conversation with my colleagues about Python. One of them supported strongly the argument that Python is a good language for prototyping, but not for a final product. As stylists prepare prototypes for their new dresses with cheap fabric and then made the final product with the costly silk they designed from the very beginning.<br>
To better support the paragon, they asked me: would you make the software control of a robot in Javascript or PHP?<br>
Strong opinion, indeed. My answer was "no, because they are languages with big ambiguities".<br>
But Python?
</p>
<a href="http://thejhead.blogspot.com/2021/04/between-product-and-prototype.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-38364601884185050712021-01-04T09:36:00.004+01:002021-01-04T09:36:56.343+01:00Makefiles Returns<style>
pre.code{
background-color:silver;
font-family:Monospace, sans-serif;
color:black;
}
i{
color:#d60059;
}
span.command{
background-color:black;
font-family:Monospace, sans-serif;
color:green;
}
h3{
padding-top:1em;
text-align:center;
}
div.top_image
{
width:50%;
left:25%;
margin-bottom:3pt;
margin-top:3pt;
}
</style>
<div class="top_image" style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAtVjbnH27XMfkGKZh2cyL_qx_97L5NWXPPLYIE442CstC9ap41NWKI35wrtPmXNG23CZh_qraSMmSK1PqWAkW1MC-vlrq0wwhPObZWEnqk-JM1TNzvwN_d1INfHDvpf5j1aF9q5w1o4UZ/s1600/blacksmith-3437495_640.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="426" data-original-width="640" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAtVjbnH27XMfkGKZh2cyL_qx_97L5NWXPPLYIE442CstC9ap41NWKI35wrtPmXNG23CZh_qraSMmSK1PqWAkW1MC-vlrq0wwhPObZWEnqk-JM1TNzvwN_d1INfHDvpf5j1aF9q5w1o4UZ/s320/blacksmith-3437495_640.jpg" width="320"></a></div><p style="text-align: center;">
<sub>Doing stuff: the good old way</sub></p><p>I often write Makefile(s) for my projects, even when they’re in some scripting language. This because the good old, humble <b>make</b> is installed almost everywhere and its simple syntax does one thing and does it well: doing tasks according to dependencies.<br>
<br>
</p><a href="http://thejhead.blogspot.com/2019/03/makefiles-returns.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-3652114337085992782017-02-22T13:01:00.002+01:002017-02-22T14:17:41.510+01:00Some reflections about In Defense of the "Not Invented Here" Syndrome<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB8WBjuZn1CW8OBt-ltx9jWEha3bPkSsz-jak6SFkJAKpQplB-C7Vbutc581r1abJx_pcH_Sz4LEAp3hY1tX9UTiOnDjYgz7jIXbYjdJcaiMEvn5w3gcA4Skef_IXMbHY7QpJtONbhx1SY/s1600/Car_tires.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB8WBjuZn1CW8OBt-ltx9jWEha3bPkSsz-jak6SFkJAKpQplB-C7Vbutc581r1abJx_pcH_Sz4LEAp3hY1tX9UTiOnDjYgz7jIXbYjdJcaiMEvn5w3gcA4Skef_IXMbHY7QpJtONbhx1SY/s320/Car_tires.png" width="320" height="320"></a><br>
<sub>Just invented here!<br>Image curtesy of <a href="https://upload.wikimedia.org/wikipedia/commons/1/14/Car_tires.jpg">Wikimedia</a></sub><br>
</div>
Some months ago I read an <a href="http://www.joelonsoftware.com/articles/fog0000000007.html">interesting article</a> by Joel Spolsky, written back in the neolithic epoch (2001).<br>
<br>
<a href="http://thejhead.blogspot.com/2017/02/some-reflections-about-in-defense-of.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-27188491508771605862015-11-18T15:14:00.001+01:002022-10-21T13:59:41.668+02:00A Way to Deploy Python Programs<style>
pre.code{
border:1px solid black;
background-color:silver;
font-family:Monospace;
font-size:12px;
color:black;
}
span.keyword{
font-weight:bold;
color:blue;
}
span.string{
color:purple;
}
span.comment{
color:green;
}
</style>
<div style="text-align: justify;">
<i>[...]we will use Java, because a jar file is easier to deploy.</i></div>
This sentence occurs sometimes where I work. In this multi-environment place, a easy way to deploy your software is a fundamental requirement.
<a href="http://thejhead.blogspot.com/2015/11/a-way-to-deploy-python-programs.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-53155741994945514002014-12-03T10:54:00.001+01:002022-10-21T13:13:36.968+02:00Why a Build System in IDEs Era?<style>
span.code
{
background:silver;
color:black;
font-weight: bold;
font-family: Monospaced, Courier New, Tahoma;
}
</style>
<p>Some friends of mine criticized my old post «<a href="http://thejhead.blogspot.it/2011/11/build-your-cc-programs-everywhere-with.html">Build your C/C++ programs everywhere with SCons</a>», arguing a build system is useless in modern world.
<br>
<div class="separator" style="clear: both; text-align: center;">
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggEp6x72mMY_kCXRzgToTmqC33fh_R3_gvNSw1WSzmgtPwAZhGG790KoGFjY4ynmNZkef5rzZG1Yq0GwqH_AlHezC1g4s6MzykWyjI18__i-IES8ik3FcUroBA7wq4Vf-ISSLADoyy_3Dv/s1600/etbkg.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggEp6x72mMY_kCXRzgToTmqC33fh_R3_gvNSw1WSzmgtPwAZhGG790KoGFjY4ynmNZkef5rzZG1Yq0GwqH_AlHezC1g4s6MzykWyjI18__i-IES8ik3FcUroBA7wq4Vf-ISSLADoyy_3Dv/s320/etbkg.jpg"></a></div>
</div>
<br>
</p><a href="http://thejhead.blogspot.com/2014/12/why-build-system-in-ides-era.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-77573565675475985832014-06-17T09:34:00.004+02:002022-10-27T11:00:46.187+02:00What I miss in Python Game Development<style>
span.keyword{
font-weight:bold;
color:blue;
}
pre
{
background-color:silver;
font-family: Liberation Mono, Courier New, Monospace;
color:black;
}
</style>
<br>
As <a href="http://thejhead.blogspot.it/2013/02/why-i-will-not-use-java.html">I said before</a> (and <a href="http://thejhead.blogspot.it/2013/01/lua-vs-python-or-embedding-vs-extending.html">I repeated</a>), if I start a new project, I prefer to work with Python, 'cause I like its huge standard library, its portability and its syntax and this is true for <strong>every</strong> new project I do for work: such as "building netcdf files", "analize meteorological datas", "manage databases". But I had a big problem for a personal project, a long dreamed chimera never really realized: a videogame. I thought to build a simple shooter, something like the old "galaga" or "space impact", using hardware accelerated graphics for great effects, such as particles and flashes. There are many schools of thought on game development under Python: there's PyGame ones, Pyglet, Pandas, ecc. I would like to talk with you about actual game development in python and reflect about my needs
<br>
<a href="http://thejhead.blogspot.com/2014/06/what-i-miss-in-python-game-development.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-25205760825834539482013-10-17T10:43:00.003+02:002022-10-27T11:01:28.350+02:00Mac OS X, Python, PySide and Matplotlib<style>
body{ counter-reset: numero 0; }
h4{ counter-increment: numero; margin-top:15px;}
h4:before{ content: counter(numero) " - " ; }
div.bash {
font-family:Courier New;
background:black;
font-weight:bold;
color:silver;
padding:5px;
}
span.keyword{
color:yellow;
}
span.variable{
color:#FF00FF;
}
</style>
In these days I'm working on Python application for manage some metereological
datas. It uses PySide for the GUI and Matplotlib to plot some useful
charts. Unluckily, I had some troubles to add this last library. After some work,
I found a solution. This post is a brief guide to my little oddity on using
PySide and Matplotlib on a Mac OS X environment.
<a href="http://thejhead.blogspot.com/2013/10/mac-os-x-python-pyside-and-matplotlib.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-1231842849335918762013-03-06T12:58:00.001+01:002023-01-09T13:49:43.089+01:00Miguel de Icaza moves to Mac<style>
p.quote{
background:silver;
font-family:Courier New, Courier, Monospace;
color:black;
}
</style>
This is a fresh news: Miguel de Icaza, founder of Gnome and Mono projects,<a href="http://tirania.org/blog/archive/2013/Mar-05.html"> declares in this post</a> he moved from GNU/Linux to Mac OS X.
<br>
<br>
<a href="http://thejhead.blogspot.com/2013/03/miguel-de-icaza-moves-to-mac.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com2tag:blogger.com,1999:blog-5389929951748864811.post-56790525054681775172013-02-27T09:37:00.001+01:002013-02-27T09:37:38.752+01:00Tecnonaty<span style="background-color: #fcffe8; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 16px;">QTEN9DCZ9AD2</span>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-66199392005251365442013-02-27T09:12:00.003+01:002022-10-27T11:09:38.253+02:00New Aqueduct Release<br />
Aqueduct development continues and now it supports HTML throught a new AqueductDriver. So you can export your Fountain files as HTML+CSS files.<br />
Try it and report bugs.<br />
You can obtain Aqueduct at<br />
<br />
<br />
http://www.github.com/jacopoprendin/aqueduct<br />
<br />
<br />JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-76419639900250192402013-02-18T10:02:00.001+01:002022-10-21T13:22:14.188+02:00Aqueduct on GitHubIf you're a writer and you like to write screenplays for theatre or movies (as me), maybe you know <a href="http://fountain.io/">Fountain</a>, a markup language realized to give you a simple, easy and elegant way to manage your scripts.<br>
<br>
<a href="http://thejhead.blogspot.com/2013/02/aqueduct-on-github.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-60724850786659569542013-02-07T09:06:00.002+01:002022-10-21T13:52:51.700+02:00Why I Will Not Use Java<style>
pre.code{
background-color:silver;
color:black;
font-family:Monospace;
font-size:10pt;
}
span.keyword{
color:purple;
font-weight:bold;
}
span.datatype
{
color:blue;
font-weight:bold;
}
span.comment{
color:green;
font-weight:bold;
}
span.string{
color:red;
}</style>
<br>
This post is quite old. I wrote it back in 2010, when I realized Java's main drawback is its verbosity. I didn't expand my thoughts, 'cause I was too engaged at work with C, Objective-C and Python. But in these days I read some articles about Java 8 and I felt very disappointed, 'cause it lacks some features, some snippets and doesn't resolve Java's main drawbacks.<br>
<h3>
Java Language is Verbose</h3>
Java Language is verbose, in the worst way you can say it, mainly for two reasons.<br>
<a href="http://thejhead.blogspot.com/2013/02/why-i-will-not-use-java.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-16525668606365003252013-01-06T13:39:00.003+01:002022-10-21T13:59:29.098+02:00Lua vs Python or Embedding vs Extending<style>
p.citation{
font-family:Monospaced, Courier New, Courier;
font-size:14px;
background-color:silver;
}
</style>
<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrb7WiKp_0TVcTuWAPwAf2T-ZVVdIJa6vJ9ovRU0nonDkubRKxFjvY9VoewyRPDOLtgjAAJxtic7-oQhEh0l85NhbyuBSDBmtrQ7gyErrSKPlmdEd4WovoPjLa_D9tzU0AsxuaUT5sWm76/s1600/Python_vs_Lua.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrb7WiKp_0TVcTuWAPwAf2T-ZVVdIJa6vJ9ovRU0nonDkubRKxFjvY9VoewyRPDOLtgjAAJxtic7-oQhEh0l85NhbyuBSDBmtrQ7gyErrSKPlmdEd4WovoPjLa_D9tzU0AsxuaUT5sWm76/s320/Python_vs_Lua.png" width="320"></a></div>
<div style="align: center; font-style: italic;">
Another (in)famous comparison!</div>
At least once in your programmer career, you will face the need to add a scripting language to your program. Many famous programs use a scripting language: Unreal, Quake, Emacs, Blender 3D and many games.
But, when you decide it and when you start to project your implementation, you face a terrible dilemma: should you make a program <strong>with</strong> a interpreter or functions <strong>for</strong> a interpreter?
This crossroad is the "embed vs extend". I'll talk about my <strong>personal</strong> opinion and how this dilemma is equal by Lua vs Python comparison.
<br>
<br>
<a href="http://thejhead.blogspot.com/2013/01/lua-vs-python-or-embedding-vs-extending.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-60148842673096372442012-09-17T18:43:00.001+02:002022-10-21T13:26:35.849+02:00Welcome on Aquamacs Emacs!<style>
span.path{
font-family:Courier New,Courier;
color:green;
}
span.string{
color:red;
}
pre.code{
background-color:silver;
font-family:Courier-New, Courier;
}
</style>
<i>First post of 2012. I'm sorry for this, but I have really a lot of work to do!</i>
<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCT1cyQwZAyykX0HIzLabzBF4ZeuKkuLJemDqXfPHQx5dsmXCduUwjfPUR_22G9jZYAhAhi2BmG5ra-T5erVDR_kjoDx0cH_E-9e1sbPkjEG-M7VphVWlXm2dyRPanx0uyqXNJ1a7yEWLt/s1600/Gnu.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCT1cyQwZAyykX0HIzLabzBF4ZeuKkuLJemDqXfPHQx5dsmXCduUwjfPUR_22G9jZYAhAhi2BmG5ra-T5erVDR_kjoDx0cH_E-9e1sbPkjEG-M7VphVWlXm2dyRPanx0uyqXNJ1a7yEWLt/s320/Gnu.jpg" width="319"></a></div>
Emacs is one of most famous Free-Software project. It's the first brick posed by Stallman for the GNU project and the most favourite editor for real programmers.
Ok... VIM is equally famous, but I choosed Emacs for my jobs!
Aquamacs Emacs is a Emacs implementation designed to run on Mac OS X systems. Maybe Mr. Stallman could hate me to advertising this program, but I hope he forgive me, because I think this "trojan horse strategy" could be successful.
Anyway, let's talk about this good piece of software.<br>
<a href="http://thejhead.blogspot.com/2012/09/welcome-on-aquamacs-emacs.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-49504854369150108592011-11-30T12:52:00.001+01:002013-02-07T10:20:23.878+01:00The End of Multi Threaded ProgrammingI warn you: this is a provocation. I really want to have replies to this post. Because I'm talking about one of most famous themes for computer-science students: threads and multithreading programming.<br>
A special thanks to <b>Andrea "MEgrez" Talon</b> whom solved some doubts I had about Node.js<br>
<br>
<a href="http://thejhead.blogspot.com/2011/11/end-of-multi-threading-programming.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-2982459703254755572011-11-23T12:41:00.001+01:002022-10-21T13:26:59.004+02:00Build your C/C++ programs everywhere with SCons<style>
pre.code
{
background-color:silver;
font-family:Monospaced, Courier New;
font-size:12px;
color:black;
}
span.string{
color:purple;
font-weight:bold;
}
span.keyword{
color:blue;
font-weight:bold;
}
span.comment{
color:green;
}
</style><br>
<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWM-pVAUnacfXO0D9Tar-9dpDu_X8X41Qj3JWnT00dWfH-Y9ZhyphenhyphenReMWo5dQxohwcArEdzf_8XAX3xgLs0kcUJt3oH2G-smkC35NXka-oqVhWOGh-cyzgC2ShmRPLwHjhMY1ona2NkwX8zA/s1600/lego_engine.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="252" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWM-pVAUnacfXO0D9Tar-9dpDu_X8X41Qj3JWnT00dWfH-Y9ZhyphenhyphenReMWo5dQxohwcArEdzf_8XAX3xgLs0kcUJt3oH2G-smkC35NXka-oqVhWOGh-cyzgC2ShmRPLwHjhMY1ona2NkwX8zA/s320/lego_engine.png" width="320"></a></div>
<div align="center" style="font-size: 10px;">
<em>Maximum Power!</em></div>
<br>
In these days I'm trying to realize a small and portable game engine using SDL+OpenGL, fascinated by their power. I begun writing some C files and a simple Makefile.<br>
Portability is a fundamental requisite, so I decided to move to a portable building system. I thought <a href="http://www.cmake.org/">CMake </a>could be a good choice, mainly because it's used by several open-source project: <a href="http://en.wikipedia.org/wiki/Cmake#Notable_applications">KDE, Inkscape, OGRE, MySQL</a> use CMake. So, I decided to write my platform-indipendent CMakefile. It was one of most boring and error-prone task I've ever saw. After some days, I still can't have a functionally CMake file: I've got less problems writing then a python script for compiling it. Frustrating.<br>
<br>
<a href="http://thejhead.blogspot.com/2011/11/build-your-cc-programs-everywhere-with.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-12344806694650228952011-11-14T11:49:00.002+01:002022-10-21T13:27:11.973+02:00Homebrew, everything you need<style>
pre.code{
background-color:black;
font-family:Courier New, Courier, Monospaced;
color:silver;
font-weight:bold;
}
</style><br>
<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4yWLfA5KJ_wX4r7Dh-aBKVMNg4RJf5JD4Lcj_UPDoqcJqMvtnp_Ht7uIr6Ae7Nc0vxUCGmtWHJTNTjey2j4tqAYCKA89wQcddRi8QfY4cdM_8G0iQayytXqdbdXa1nbi3aeODzYe4AAl1/s1600/homebrew.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4yWLfA5KJ_wX4r7Dh-aBKVMNg4RJf5JD4Lcj_UPDoqcJqMvtnp_Ht7uIr6Ae7Nc0vxUCGmtWHJTNTjey2j4tqAYCKA89wQcddRi8QfY4cdM_8G0iQayytXqdbdXa1nbi3aeODzYe4AAl1/s320/homebrew.png" width="313"></a></div>
<br>
<br>
<br>
I am a Mac OS X user. I like my OS and I love how I can install/remove applications just with a drag'n drop. But some useful programs can't be find and this could be very annoying. Command-line programs like <b>netcat</b> or <b>sdl-config</b> or <b>chocolate-doom</b> still haven't a Mac OS X package.<br>
<br>
<a href="http://thejhead.blogspot.com/2011/11/homebrew-everything-you-need.html#more">Read more »</a>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-53020496906472150162011-11-03T17:13:00.001+01:002022-10-21T13:54:49.638+02:00The Robot and the BabyI would like to salute John McCarthy, father of lisp recently passed away, in a more constructive way than a simple dedication.<br />
McCarthy wrote a beautiful science-fiction story, <a href="http://www-formal.stanford.edu/jmc/robotandbaby/robotandbaby.html">The Robot and the Baby</a>, talking about robot's perceptions.<br />
I think it's quite lovely: inviting you to read it could be better than write a simple necrology.<br />
Farewell, mr. McCarthy.JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-8642882970700902082011-10-13T12:15:00.003+02:002022-10-21T13:58:37.026+02:00Farewell, Master<style>
pre.code{
background-color:black;
color:silver;
font-family:Monospaced, Courier New;
font-size:12px;
}
span.key{
font-weight:bold;
color:green;
}
span.string{
color:purple;
}
</style><br />
Today I read the latest sad news. Denis Ritchie, co-writer and co-ideator of UNIX and C programming language, died at 70.<br />
Thank you for your immense contribute to computer science.<br />
<br />
<pre class="code"><span class="key">int</span> main(<span class="key">int</span> argc, <span class="key">char</span>** argv){
printf(<span class="string">"Farewell mr. Ritchie.\n"</span>);
printf(<span class="string">"You made our tools.\n"</span>);
printf(<span class="string">"You made the True Operating System.\n"</span>);
printf(<span class="string">"You made us programmers.\n"</span>);
printf(<span class="string">"You made us hackers.\n"</span>);
<span class="key">return</span> 0;
}
</pre>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-21072180548729907612011-10-06T09:45:00.000+02:002011-10-06T09:45:01.285+02:00Thank youThank you for NeXT and its codebase.<br />
Thank you for the Macintosh, a real personal computer, wich does what a PC should do in 2011.<br />
Thank you for iPhone.<br />
Thank you for iPad, the "magical" device.<br />
Thank you for creating this framework, giving me the opportunity to work as a Real Programmer in a Real Programming Language.<br />
Thank you, Steve.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNqd2gndbwMhkC_ETJylj6aDjtjOnTXGZ_8PZ3AN4kpxKvR2qYpS4kUbZiBLJhLEYT2m9OGNqIs-_GUJqDpNCVDOiUK7ZbAjoF5JfI8DqxhASek1RwBalEWGJ2YMqzm19dIX36q61AHKXQ/s1600/steve.png" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="364" width="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNqd2gndbwMhkC_ETJylj6aDjtjOnTXGZ_8PZ3AN4kpxKvR2qYpS4kUbZiBLJhLEYT2m9OGNqIs-_GUJqDpNCVDOiUK7ZbAjoF5JfI8DqxhASek1RwBalEWGJ2YMqzm19dIX36q61AHKXQ/s400/steve.png" /></a></div>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-12518440702365829062011-09-14T13:14:00.002+02:002022-10-21T13:55:28.557+02:00iPhone SDK Troubles: ios SDK blurry fonts<style>
pre.code{
background-color:silver;
font-family:Courier New;
color:black;
}
span.comment{
color:green;
}
span.keyword{
font-weight:bold;
color:purple;
}
</style>
A very annoying thing is when you programmatically create contents for a UITableViewCell and text in UIlabels appears blurry. Why? The answer is simpler than you can think: you positioned your UILabels in the wrong place.
Probably, you positioned your UILabel:
<pre class="code">
<span class="comment">//At allocation time</span>
<span class="keyword">UILabel</span>* l=[[<span class="keyword">UILabel</span> alloc] initWithRect:CGRectMake(x,y,w,h)];
<span class="comment">//or after</span>
l.frame=CGRectMake(x,y,w,h);
</pre>
Now, be careful: what's the meaning of (x,y,w,h)? They're floating point values. When placed in a UIView, they must have no fractional part. If you specify it with (e.g.)
<pre class="code">
(1.0f, 3.0f, 200.0f, 400.0f)
</pre>
your label will not appears blurry. If you <strong>calculate</strong> UILabel's frame, you must call <strong>floor</strong> function to force to zero fractional part.
<pre class="code">
float a=1.0f;
float b=3.0f;
float c=200.0f;
float d=400.0f;
l.frame=CGRectMake(
floor(x/3.0f),
floor(y/3.0f),
floor(w/3.0f),
floor(h/3.0f)
);
</pre>
Texts appear blurry when coordinates aren't approximate to nearest integer. Floor force this approximation. Now your text will appear sharp as a japanese sword :)JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0tag:blogger.com,1999:blog-5389929951748864811.post-6041256743460076522011-08-09T09:44:00.002+02:002022-10-21T13:56:12.817+02:00iPhone SDK Troubles: Rotating scrollview image gallery<style>
.code{
color:purple;
font-weight:bold;
}
</style><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl_lGNbXwqySWRWsu716OeUeeh-Xy2-n75r9LU0H-900f0RUGWIonQ-yeXjDEb1NOZ5yrYwZxzJN5eyVXPjU09XU7L7KGQqa8BhfM85BZihVG1j9hrzkHUjW6BcAac9IqQ9maexZVvJghe/s1600/gyroscope_RKR.png" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="200" width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl_lGNbXwqySWRWsu716OeUeeh-Xy2-n75r9LU0H-900f0RUGWIonQ-yeXjDEb1NOZ5yrYwZxzJN5eyVXPjU09XU7L7KGQqa8BhfM85BZihVG1j9hrzkHUjW6BcAac9IqQ9maexZVvJghe/s200/gyroscope_RKR.png" /></a></div><br />
Everybody love iOS interface and its "magic" appeal: fluid rotations, fluid swipe, ecc. A iOS programmer knows that there's a lot of work under that magic. If you try to realize a simple image gallery, you'll have some surprises when you'll try to rotate it:<br />
<br />
<ol><li>your image will not be located on view's center, but on a corner.</li>
<li>if you forced your gallery to scroll to a certain page with <span class="code">scrollToRect</span>, then you'll see all your precedent images in a fast scroll, even if you set parameter <span class="code">Animated</span> to <strong>NO</strong> </li>
<li>if you need to scroll after rotation, you'll see a rotation around a corner<br />
</ol>Solutions I found are: <ol><li> Point 1: when detecting a rotation, (<span class="code">willRotateToInterfaceOrientation</span>), you have to resize:<br />
<ul><li>Images on the scrollview</li>
<li>scrollview content</li>
</ul><br />
<li>Points 2 & 3: you must cover gallery's scrollview with a UIImageView containing current gallery image, hiding all scrollview animations. The "cover" will rotate around screen center, giving a more professional (and Apple) look.<br />
</li><br />
<br />
<br />
</ol>JaKhttp://www.blogger.com/profile/07988412558474757718noreply@blogger.com0