tag:blogger.com,1999:blog-29189227723288403002024-03-24T16:32:17.270-07:00All about developmentAnonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-2918922772328840300.post-39979848224049703022018-07-27T04:46:00.001-07:002018-07-27T04:46:25.893-07:00Gender-API.com shows best results in name-to-gender inference service benchmarkJust recently <a href="https://gender-api.com">Gender API</a> was mentioned in a comprehensive benchmark and comparison of several available gender inference services.<br />
<br />
The team of Gender Gap in Science who conducted the survey assembled a list with more than 7,000 people and their gender and used this list as a basis for the comparison. They combined different error metrics and constraints to define benchmarks for realistic situations (e.g.minimize the proportion of all inaccuracies while keeping the mix-ups between female and male assignments under the threshold of 5. In all benchmarks, and on almost all sources comprising the test data set, Gender API shows the best results.<br />
<br />
"In all our benchmarks, and on almost all sources comprising our test data set, Gender API shows the best results."<br />
<br />
This outcome makes us very proud and confirms that conducting not just a simple database lookup, but working with data in detail is the best service we can offer to our customers.<br />
<br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/jdSMmb1tD7M" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com1tag:blogger.com,1999:blog-2918922772328840300.post-32093543588439293872016-05-09T12:54:00.002-07:002016-05-09T12:56:41.095-07:00Build ffmpeg with non free codecs includedWith my recently updateted build script it is now more easier than ever to build ffmpeg with non free codecs included. At this page you will not find any ffmpeg downloads with non free codes but you can build your own binary with some simple steps.<br />
<br />
Go to <a href="https://github.com/markus-perl/ffmpeg-build-script">https://github.com/markus-perl/ffmpeg-build-script</a>. Download and install the build script. All dependencies are downloaded and compiled without any interaction.<br />
<br />
Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com1tag:blogger.com,1999:blog-2918922772328840300.post-20483522414677807292015-04-26T13:27:00.003-07:002015-04-26T13:31:34.469-07:00Pushover Cli<h2>About</h2><a href="https://github.com/markus-perl/pushover-cli">pushover-cli</a> is a command line client for https://pushover.net to send pushover notifications. Moreover it is possible with this client to pipe streams directly to your cellphone like tail -f /var/log/my.log | pushover-cli -<br />
<br />
<h2><a href="https://github.com/markus-perl/pushover-cli">Pushover Cli</a> download and installation</h2>Simply execute the following command to install the latest version of this script to your system:<br />
<br />
<pre>sudo curl -o /usr/bin/pushover-cli https://raw.githubusercontent.com/markus-perl/pushover-cli/master/pushover-cli && sudo chmod 555 /usr/bin/pushover-cli
</pre><br />
<br />
<h2>Commandline options</h2><pre>Usage: ./pushover-cli [options] <message> <title>
Stdin: ./pushover-cli [options] - <title>
Example: ./pushover-cli -u ubLBe5u3zNXF9gBtX2zKkezSuPgu3v -t aK5BW3sjAqPsedH44VyQSbaQecoRen "Hello World"
-u --user <user id> Pushover User-ID
-t --token <api token> Pushover API-Token
-p --priority <high, normal, low> Default: normal
-l --url <url> Link the message to this URL
-c --config <path to file> Default: /etc/pushover.conf
-v --verbose Be verbose
-q --quiet Be quiet
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com7tag:blogger.com,1999:blog-2918922772328840300.post-14074371419541891972014-10-21T07:47:00.001-07:002014-10-21T08:46:16.025-07:00FFmpeg Build ScriptAfter searching the whole internet for a Mac OSX binary built of ffmpeg with non free codecs included i finally gave up and wrote my own building script.<br />
<br />
Since I wanted a statically compiled binary which also can be used on devices without Xcode installed, homebrew was not the perfect solution for me.<br />
<br />
I started from scratch building a script that automatically downloads all dependencies and compiles all necessary libraries.<br />
<br />
My final script can be found on github: <a href="https://github.com/markus-perl/ffmpeg-build-script">https://github.com/markus-perl/ffmpeg-build-script</a>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com19tag:blogger.com,1999:blog-2918922772328840300.post-11529882061555521932014-10-11T08:23:00.003-07:002014-10-21T07:45:35.234-07:00PHP CSV detect delimiter<pre class="brush: php">/**
* @param string $csvFile Path to CSV file
* @return string
*/
public function detectDelimiter($csvFile)
{
$delimiters = array(
';' => 0,
',' => 0,
"\t" => 0,
"|" => 0
);
$handle = fopen($csvFile, "r");
$firstLine = fgets($handle);
fclose($handle);
foreach ($delimiters as $delimiter => &$count) {
$count = count(str_getcsv($firstLine, $delimiter));
}
return array_search(max($delimiters), $delimiters);
}
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-58320771642448639532014-04-23T01:54:00.001-07:002014-04-23T01:54:05.783-07:00HowTo install ZendDebugger for PHP 5.4 or PHP 5.5 on DebianSince the ZendDebugger is bundled with ZendStudio and ZendServer the PHP module cannot easily be downloaded standalone.<br />
<br />
But with some simple steps the module can be extracted out of the official ZendStudio tarball which can be downloaded for free on http://www.zend.com/en/products/studio/downloads.<br />
<br />
<h2>Prerequisites</h2><br />
Make sure, openssl0.9.8 is installed. Newer Versions like openssl1.0.0+ will not work.<br />
<br />
<h3>on debian squeeze</h3><pre class="brush: bash">$ sudo apt-get install libssl0.9.8
</pre><br />
<h3>on debian wheezy</h3><pre class="brush: bash">$ wget http://snapshot.debian.org/archive/debian/20110406T213352Z/pool/main/o/openssl098/libssl0.9.8_0.9.8o-7_amd64.deb
$ sudo dpkg -i libssl0.9.8_0.9.8o-7_amd64.deb
</pre><br />
<h2>Extract the extension</h2><br />
<h3>Create a temporary working dir</h3><pre class="brush: bash">$ mkdir /tmp/zend_debugger
$ cd /tmp/zend_debugger
</pre><br />
<h3>Download Zend Studio 10.6</h3><pre class="brush: bash">$ wget http://downloads.zend.com/studio-eclipse/10.6.0/ZendStudio-10.6.0-linux.gtk.x86_64.tar.gz
</pre><br />
<h3>Find the extension in the archive</h3><pre class="brush: bash">$ tar -tvf ZendStudio-10.6.0-linux.gtk.x86_64.tar.gz | grep ZendDebugger.so
</pre>This will give you the following output:<br />
<pre>-rwxrwxr-x vagrant/nogroup 238153 2014-01-08 16:11 ZendStudio/plugins/com.zend.php.debug.debugger.linux.x86_64_10.6.0.v20140128-2127/resources/php53/ZendDebugger.so
-rwxrwxr-x vagrant/nogroup 238217 2014-01-08 15:56 ZendStudio/plugins/com.zend.php.debug.debugger.linux.x86_64_10.6.0.v20140128-2127/resources/php54/ZendDebugger.so
-rw-r--r-- vagrant/nogroup 238631 2014-01-08 15:22 ZendStudio/plugins/com.zend.php.debug.debugger.linux.x86_64_10.6.0.v20140128-2127/resources/php55/ZendDebugger.so
</pre><br />
<h3>Extract the extension for PHP 5.3, 5.4 and 5.5</h3><pre class="brush: bash">$ tar -xzvf ZendStudio-10.6.0-linux.gtk.x86_64.tar.gz --strip-components 4 --wildcards *ZendDebugger.so
</pre><br />
<h2>Install the extension</h2><br />
Now copy the extension matching your PHP Version to the local extension dir<br />
<br />
<h3>For PHP 5.5</h3><pre class="brush: bash">$ sudo cp php55/ZendDebugger.so `php -i | grep extension_dir | awk '{print $NF}'`
</pre><br />
<h3>For PHP 5.4</h3><pre class="brush: bash">sudo cp php54/ZendDebugger.so `php -i | grep extension_dir | awk '{print $NF}'`
</pre><br />
<h3>Update your php.ini</h3>Add the following lines at the end of your php.ini file<br />
<pre>[Zend Debugger]
zend_extension=ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1/24,192.0.0.1/32
zend_debugger.expose_remotely=allowed_hosts
</pre><br />
<h2>Check the extension</h2><pre class="brush: bash">$ php -v</pre><pre>PHP 5.5.11-1~dotdeb.1 (cli) (built: Apr 4 2014 02:15:16)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
<span style="color: #38761d;"><b>with Zend Debugger v6.0.0, Copyright (c) 1999-2013, by Zend Technologies</b></span>
</pre><br />
That's it. If you can find the line "Zend Debugger v6.0.0" in the output the debugger extension is successfully installed.Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com1tag:blogger.com,1999:blog-2918922772328840300.post-27988947591334477842014-04-22T11:07:00.003-07:002014-04-22T11:07:39.935-07:00NodeJs socket hang up<pre>events.js:72</pre>
<br />
throw er; // Unhandled 'error' event<br />
^<br />
Error: socket hang up<br />
at createHangUpError (http.js:1472:15)<br />
at Socket.socketOnEnd [as onend] (http.js:1568:23)<br />
at Socket.g (events.js:180:16)<br />
at Socket.EventEmitter.emit (events.js:117:20)<br />
at _stream_readable.js:920:16<br />
at process._tickCallback (node.js:415:13)<br />
<br />
<br />
This error happens even with the latest nodejs version if you're using a ssl certificate whose domain cannot be resolved by your dns.<br />
<br />
Let's say your SSL certificate is issued to www.your-domain.com make sure a dns lookup can resolve this domain.<br />
<br />
Simply add your domain to your /etc/hosts file<br />
127.0.0.1 www.your-domain.com<br />
<br />
If your using a wildcard certificate *.your-domain.com you can simply add this domain to your /etc/hosts file:<br />
<br />
127.0.0.1 *.your-domain.comAnonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com5tag:blogger.com,1999:blog-2918922772328840300.post-66892980200811771022014-04-09T04:11:00.003-07:002014-04-09T04:12:48.386-07:00socket.io.js, line 1641 character 7 Access denied<div style="background-color: white; box-sizing: border-box; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 23.799999237060547px; margin-bottom: 15px; margin-top: 15px;">
SCRIPT5: Access is denied.<br />
socket.io.js, line 1641 character 7</div>
<div>
This error happens under IE 10, if nodejs and you webpage runs on a different port. You should ensure that your webserver and your nodejs server are running on the same port with the same protocol.</div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-60315269336262787372014-02-17T04:58:00.001-08:002014-03-17T14:29:08.911-07:00Chrome Browser: How to emulate a touch screenThe Chrome Browser integrates a nice feature to simulate multiple mobile devices or a touch screen.<br />
<br />
First of all you have to enable the "Emulation" view in the console drawer. Open the Developer Tools and click the settings icon:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2hjF9Gxd6gzVWHR1-DvIPc2-cu2bkTA6Ioo-mlgaoezLCmOxC-d_ITfz3OEAlUiLo0hgWK4Kr_KqTDYsPyo3hFjCS55S-FEUMd0WDs63L24NhsrCwxv1COMC-QBLQmK74LI_9feaLw4wA/s1600/sc1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2hjF9Gxd6gzVWHR1-DvIPc2-cu2bkTA6Ioo-mlgaoezLCmOxC-d_ITfz3OEAlUiLo0hgWK4Kr_KqTDYsPyo3hFjCS55S-FEUMd0WDs63L24NhsrCwxv1COMC-QBLQmK74LI_9feaLw4wA/s1600/sc1.png" width="100%" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both;">
Next, switch to the "General" panel and enable "Show emulation view in console drawer"</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Now close the settings and press the ESC (Escape Key) and switch to the "Emulation" Panel (2). The "Sensors" menu (3) let's you enable the "Emulate touch screen" (4) checkbox. That's it!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi08VYMgm5OlC4XJvcEAq4o8vHuScmUXFkYZbGBoKsFQ8bP9MsR-nRsXhrW0yXRYI0m5nEfNmC5OunVVg5xJNmS34FOVbLfrcgYLu0EjaX7Ev6k0Dcj-bgNR6-5ycjEFEqkCUVgQKpEO9Xv/s1600/sc3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi08VYMgm5OlC4XJvcEAq4o8vHuScmUXFkYZbGBoKsFQ8bP9MsR-nRsXhrW0yXRYI0m5nEfNmC5OunVVg5xJNmS34FOVbLfrcgYLu0EjaX7Ev6k0Dcj-bgNR6-5ycjEFEqkCUVgQKpEO9Xv/s1600/sc3.png" width="100%" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com5tag:blogger.com,1999:blog-2918922772328840300.post-78245854620222324102014-02-07T02:41:00.000-08:002014-02-10T00:35:23.232-08:00Git Dropbox Remote Repo<br />
With git you can easily use any directory as an remote repo. Dropbox offers a lot of free space and automatically backups files so why not using dropbbox as a git remote repo :-)<br />
<br />
This tutorial should also works with Google Drive and Microsoft SkyDrive. Please make sure that the paths provided below match your local Dropbox / Google Drive / Skydrive folder.<br />
<br />
<pre class="brush: bash">mkdir -p ~/Dropbox/git/my-project
</pre><br />
Initialize Git:<br />
<br />
<pre class="brush: bash">git init --bare ~/Dropbox/git/my-project
</pre><br />
Go to your project and add the new created dir as remote:<br />
<br />
<pre class="brush: bash">git remote add origin ~/Dropbox/git/my-project
</pre><br />
That's it! Now you can push your repo to your dropbox folder:<br />
<br />
<pre class="brush: bash">git push origin master
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-586709073784407662014-02-06T07:24:00.001-08:002014-02-06T11:45:08.457-08:00PHP Memcache list / get keys<pre class="brush: php">/**
* @param string $server
* @param int $port
* @param int $limit
* @return array
*/
public function getMemcacheKeys ($server, $port, $limit = 10000)
{
$keysFound = array();
$options = $this->_options;
$server = $options['servers'][0];
$memcache = new Memcache;
$memcache->connect($server, $port = 11211, 5);
$slabs = $memcache->getExtendedStats('slabs');
foreach ($slabs as $serverSlabs) {
foreach ($serverSlabs as $slabId => $slabMeta) {
try {
$cacheDump = $memcache->getExtendedStats('cachedump', (int) $slabId, 1000);
} catch (Exception $e) {
continue;
}
if (!is_array($cacheDump)) {
continue;
}
foreach ($cacheDump as $dump) {
if (!is_array($dump)) {
continue;
}
foreach ($dump as $key => $value) {
$keysFound[] = $key;
if (count($keysFound) == $limit) {
return $keysFound;
}
}
}
}
}
return $keysFound;
}
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-58467251670093682792014-02-04T02:30:00.002-08:002014-02-05T04:46:28.832-08:00Must Have Git Aliases<h2>Git Shortcut</h2><div>This is first thing you should do. Aliasing git as `g` will save you a lot of typing. After this symlink creation you can access git with only typing `g` in the command line.</div><pre class="brush: cpp">$ sudo ln -s `which git` /usr/bin/g</pre>I'm using git now for some years and over the time I came up with a long list of git aliases. Git is great and can give you a great coding experience with it's customizable shortcuts.<br />
<br />
Your .gitconfig file is located in your home dir. All examples can be added to the [alias] section in this file.<br />
<pre class="brush: cpp">$ nano ~/.gitconfig
</pre><h2>Basic Aliases</h2><pre class="brush: cpp"> co = checkout
cp = cherry-pick
p = pull
squash = merge --squash
st = status
df = diff
b = branch
</pre><h2>Advanced Usage</h2><h3>Revert a file</h3><pre class="brush: cpp"> rv = checkout --
</pre><h3>Merging</h3><pre class="brush: cpp"> ours = checkout --ours --
theirs = checkout --theirs --
</pre><h3>Stashing</h3><pre class="brush: cpp"> sl = stash list
sa = stash apply
ss = stash save
</pre><h3>Danger! Cleanup working dir</h3><div>This alias will reset all modified files!</div><div></div><pre class="brush: cpp">cleanup = !git reset --hard && git clean -f
</pre><h3>List all aliases</h3><pre class="brush: cpp">alias = config --get-regexp 'alias.*'
</pre><h3>Log One Line</h3><pre class="brush: cpp">logol = log --pretty=format:"%h\\ %s\\ [%cn]"
</pre><h3>Search in files</h3><pre class="brush: cpp">search = "grep -Iin"
</pre><br />
<h3>Vagrant</h3><pre class="brush: cpp">vup = !vagrant up
vsu = !vagrant suspend
vss = !vagrant ssh
vde = !vagrant destroy
vpr = !vagrant provision
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-13984631757737815002014-02-02T03:10:00.000-08:002014-02-02T03:10:44.088-08:00PHP Segmentation faultThis is the worst case for every php developer when hacking some code - your script runs not as expected and you get a simple message saying "Segmentation fault".<br />
<br />
Here are the steps you can do, to track down this error.<br />
<br />
<br />
<h2>Some simple tips to start</h2><br />
- Use a debugger like <a href="https://www.zend.com/de/products/studio/downloads">ZendDebugger</a> or <a href="http://xdebug.org/">XDebug</a> to find the line of code causing the error.<br />
<br />
- Disable PHP's internal garbage collector. The garbage collector is known to often cause segmentation faults. If disabling will help you are probably found an internal reference counting bug in the garbage collector<br />
<pre class="brush: cpp">ini_set('zend.enable_gc', 0);</pre>- Look for recursion in your code. PHP throws a segmentation fault if you have a infinite recursion in your code<br />
<br />
- If you have apc installed sometimes it helps to empty the cache or disable the cache<br />
<br />
<h2>Use strace</h2><p>If php runs on Linux or Mac OS you can use strace/dtruss to hook into the process and see what's happening. Strace can be installed on Debian by running <br />
<pre class="brush: cpp">apt-get install strace
</pre></p><h3>Run phpunit with strace</h3><pre class="brush: cpp">$ strace phpunit
</pre><h3>Attach strace to a already running process</h3><pre class="brush: cpp">$ sudo strace -s 256 -p <PID>
</pre><h3>Run any php script with strace</h3><pre class="brush: cpp">$ strace php index.php
</pre><h3>Attach strace to a running cgi process</h3><pre class="brush: cpp">$ ps axf | grep php5-cgi # lists all running processes
#If more than one process is found you can use the tool php-strace (see below) to trace all processes at the same time. If only one process is found you can use the following command to trace:
$ sudo strace -s 256 -p <PID>
#For debugging purposes I recommend to limit the cgi processes running to one, so you can be sure to hook into the right process which is serving your browser.
# The number of running cgi processes can be edited by editing the file /etc/php5/fpm/pool.d/www.conf .
</pre><br />
<h3>Gdb</h3><p>Also you can try to run the script inside of gdb. On Debian gdb can be installed using the command "apt-get install gdb"</p><pre class="brush: cpp">gdb --args php /usr/bin/phpunit
#inside gdb enter:
set env MALLOC_CHECK_=3
#then enter:
r
</pre><br />
<h2>php-strace</h2><p>I wrote a tool for easy monitoring running cgi proccesses on a server or a developer box.</p><p>php-strace helps to track down segfaults in running php processes. It starts a new strace instance for every running php5-cgi or php-fpm process to monitor whether a segfault happened.</p><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://github.com/markus-perl/php-strace/blob/master/readme.files/php-strace.png?raw=true" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="php-strace" border="0" src="https://github.com/markus-perl/php-strace/blob/master/readme.files/php-strace.png?raw=true" /></a></div><br />
To get started, visit my github page. <a href="https://github.com/markus-perl/php-strace">https://github.com/markus-perl/php-strace</a><br />
<br />
<h3>Update</h3>php-strace V0.3 available: <br />
<a href="https://dl.dropboxusercontent.com/u/32252351/github/php-strace-0.3.tar.gz">https://dl.dropboxusercontent.com/u/32252351/github/php-strace-0.3.tar.gz</a><br />
<br />
<p></p><br />
Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com9tag:blogger.com,1999:blog-2918922772328840300.post-80080649958956774882014-02-01T07:16:00.002-08:002014-02-01T07:16:56.828-08:00How to change the terminal title with a script<br />
Save the following lines in a file called title.sh:<br />
<pre class="brush: c"> #!/bin/zsh -f
echo -ne "\033]0;$@\007"
</pre>and make it executable: <br />
<pre class="brush: c"> $ chmod +x title.sh
</pre>To change the title simply call <br />
<pre class="brush: c"> $ ./title.sh “New Title”
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-24093628843109784552014-01-30T01:50:00.000-08:002014-01-30T01:50:16.855-08:00Git Jira commit Message<br />
It's easy to commit a jira task without entering the complete task title in the command line. Initially I wrote a simple script for my <a href="https://gender-api.com">gender detection</a> project that uses the jira api to fetch the required fields from the Jira server to generate a meaningful commit message but this script can simply be used for any other project.<br />
<br />
Link to the script: <a href="https://github.com/markus-perl/git-jira-commit-message/blob/master/git-jira-commit-message">https://github.com/markus-perl/git-jira-commit-message/blob/master/git-jira-commit-message</a><br />
<br />
Edit the script and enter your credentials:<br />
<pre class="brush: php"> #!/usr/bin/php
<?php
$username = 'Jira username';
$password = 'jira password';
$api = 'http://my.jira.url/rest/api/2/';
</pre><br />
Now add the following line to the alias section in your .gitconfig file which is located in your home dir:<br />
<br />
<pre class="brush: c">[alias]
c = !sh -c 'git-jira-commit-message "$0"'
</pre><br />
<br />
To commit a task just enter the task id. The script the title of the task to the commit message:<br />
<br />
<pre class="brush: c">$ git c PR-1201
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com1tag:blogger.com,1999:blog-2918922772328840300.post-55083440517818988172014-01-29T02:32:00.001-08:002014-01-30T01:51:12.788-08:00PHP get class name without the namespaceThis is the easiest way to get the name of the current class without the namespace:<br />
<br />
<pre class="brush: php">public function getName() {
$path = explode('\\', __CLASS__);
return array_pop($path);
}
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-71818159641803891762014-01-28T00:56:00.002-08:002014-01-28T01:04:53.771-08:00Bash endless loop one line<pre class="brush: c">while true; sleep 2; done
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-5537400170143734832014-01-16T07:43:00.000-08:002014-01-16T07:45:41.277-08:00Gender Detection API<br />
To improve the conversions of our registration form we developed a <a href="https://gender-api.com/">gender detection</a> api. The gender checker only requires a first name or an e-mail address containing a first name. 1000 requests to the gender api are free every month. <br />
<br />
<h2>What if a name can be male as well as female?</h2><br />
If a country code is provided, the gender detection can be improved. For example: While Andrea is male in Italy, Andrea is a female name in the US and can even be both in Germany. With every query a accuracy value is provided how sure the api is to match the right gender. <a href="https://gender-api.com/en/frequently-asked-questions/which-countries-are-supported">Here</a> is a list of supported countries.<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw9Rw5nTPOTn4MnlW-AV3AfddyqsJs1y11vXbcKVe4q1t2TIgIR-g0bUvS7vQtBo1bKa6we7EzL_yKwEgUFbK4DwBhpLgAXSUVLPEen1sXCUSowejYWKYncbpFlWn3GGjYiDlRrUgzWJpo/s1600/Screenshot-en.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw9Rw5nTPOTn4MnlW-AV3AfddyqsJs1y11vXbcKVe4q1t2TIgIR-g0bUvS7vQtBo1bKa6we7EzL_yKwEgUFbK4DwBhpLgAXSUVLPEen1sXCUSowejYWKYncbpFlWn3GGjYiDlRrUgzWJpo/s320/Screenshot-en.png" /></a><br />
<br />
<h2>Is ssl supported?</h2>Yes, to give you the best possible privacy protection ssl up to TLS 1.2 is supported<br />
<br />
<h2>Which countries are supported?</h2>The API supports currently 105 countries. If a name is not found in the given country the complete database will be crawled.<br />
<br />
An <a href="https://gender-api.com/">accurate gender predictor</a> needs to have multiple decision paths to determine the best gender. Therefore the api uses every data provided by the browser to fetch the best possible result. The API is under heavy development and we try to improve it's quality every month.Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com4tag:blogger.com,1999:blog-2918922772328840300.post-19896302556757101552013-09-23T07:37:00.001-07:002013-09-23T07:37:49.649-07:00Howto install webp on debian squeeze<pre class="brush: c"> sudo apt-get install build-essential
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libtiff-dev
wget https://code.google.com/p/webp/downloads/detail?name=libwebp-0.3.1.tar.gz&can=2&q=
tar -xvf libwebp-0.3.1.tar.gz
cd libwebp-0.3.1
./configure --libdir=/usr/lib
make
sudo make install
</pre>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-39061584221597447632013-04-15T17:05:00.000-07:002014-01-31T04:50:40.791-08:00Playing MP3's on a Navigation Business Radio (BMW E60/E61) - Fixing the skip issueAfter burning my first MP3 CD for my BMW e60 I was wondering why some titles play flawless and some other files are skipped permanently. So I decided to investigate some time in this issue and create some test to identify which files are playing and which files not.<br />
<br />
First of all I googled that issue and found some tips to convert the files to 192 kbps and 44.1 khz. This solution did the trick for some files but the most files still refused to playback so I took a deeper look into it.<br />
<br />
For my first test, I took a file which doesn't playback in my car but works great on all other MP3 players and cellphones and converted it with lame (LAME 64bits version 3.99.5) with the following settings:<br />
<br />
<br />
<table style="width: 100%;"><tbody>
<tr> <th>kbps/quality</th> <th>mode</th> <th>khz</th> <th>works</th> </tr>
<tr> <td>320</td> <td>cbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>192</td> <td>cbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>128</td> <td>cbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>0</td> <td>vbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>4</td> <td>vbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>320</td> <td>cbr</td> <td>44.1</td> <td>no</td> </tr>
<tr> <td>192</td> <td>cbr</td> <td>44.1</td> <td>no</td> </tr>
<tr> <td>128</td> <td>cbr</td> <td>44.1</td> <td>no</td> </tr>
<tr> <td>0</td> <td>vbr</td> <td>44.1</td> <td>no</td> </tr>
<tr> <td>4</td> <td>vbr</td> <td>44.1</td> <td>no</td> </tr>
</tbody></table><br />
So what's wrong? Inspecting the file I noticed that in this file a cover image is embedded. Maybe such content causes the player to skip the file? Next, I used the command line tool eyeD3 (<a href="http://eyed3.nicfit.net/">http://eyed3.nicfit.net/</a>) to remove the embedded content from this file but keep the ID3-Tag. Now it's getting really weird. The file plays now with different bitrates, but only sometimes :-) Most times the file is still skipped but some times it plays correctly. For my next test, I <b>removed the ID3-Tag</b> completely from the file and these are the results:<br />
<br />
<table style="width: 100%;"><tbody>
<tr> <th>kbps/quality</th> <th>mode</th> <th>khz</th> <th>works</th> </tr>
<tr> <td>320</td> <td>cbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>192</td> <td>cbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>128</td> <td>cbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>0</td> <td>vbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>4</td> <td>vbr</td> <td>48</td> <td>no</td> </tr>
<tr> <td>320</td> <td>cbr</td> <td>44.1</td> <td>yes</td> </tr>
<tr> <td>192</td> <td>cbr</td> <td>44.1</td> <td>yes</td> </tr>
<tr> <td>128</td> <td>cbr</td> <td>44.1</td> <td>yes</td> </tr>
<tr> <td>0</td> <td>vbr</td> <td>44.1</td> <td>yes</td> </tr>
<tr> <td>4</td> <td>vbr</td> <td>44.1</td> <td>yes</td> </tr>
</tbody></table><br />
<br />
After a lot more toasted cd's I can present you my final results, playing MP3 files on a navigation business:<br />
<br />
- The bitrate doesn't matter. Everything between 128 and 320 kbps works well<br />
- Either a variable bitrate (vbr) or a constant bitrate (cbr) works<br />
- khz must be 44.1<br />
- Either CD's or DVD's can be used<br />
- Remove all ID3 v1.x/v2.x tags. The player try's to skip this data, but mostly fails und than skips the whole file ($ eyeD3 --remove-all *.mp3).<br />
- only 500 MP3's per disc are recognized. If there are more than 500 files on a disc, even if they are in subfolders, they won't be played<br />
<br />
Please don't ask me how the tags can be removed on windows. I have no Windows but I think google can help you or someone can post a comment with a how-to :-)Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com19tag:blogger.com,1999:blog-2918922772328840300.post-88940911368336248172012-10-31T02:32:00.001-07:002012-10-31T02:34:53.388-07:00Fine tune your mac volume with shift-option keys in OSX Mountain Lion<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixsl7Sv61h1Jgr37WJifrra0PasJNeMeZq-_OVb_Mwq3iEH5rOg560jiyebLCWEgnW3loX2AyVClXDR1LIgZ4_QxFSMJ5MqGqIHPx_s1plFoZ2p2jOZA4ShMIIaGsh6Ehu1XsIebUDUMq6/s1600/volume.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixsl7Sv61h1Jgr37WJifrra0PasJNeMeZq-_OVb_Mwq3iEH5rOg560jiyebLCWEgnW3loX2AyVClXDR1LIgZ4_QxFSMJ5MqGqIHPx_s1plFoZ2p2jOZA4ShMIIaGsh6Ehu1XsIebUDUMq6/s1600/volume.png" /></a></div>
<br />
<br />
To fine tune your volume on mac osx mountain lion with your keyboard hold down the <b>shift and the option key (alt) while pressing the volume up and down buttons</b>.<br />
<br />
This feature also works with the brightness keys.Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-12230897179562745462012-09-28T00:35:00.000-07:002012-09-28T00:36:37.106-07:00My new project is now online: www.seniorbook.deVisit <a href="http://www.seniorbook.de/">www.seniorbook.de</a> to review my new project.<br />
<br />
Also there are some press related informations in german available:<br />
<a href="http://www.seniorbook.de/inhalt/pressemeldungen">http://www.seniorbook.de/inhalt/pressemeldungen</a><br />
<br />
<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="http://www.youtube.com/embed/MdmzUwIBz48" width="560"></iframe>Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com1tag:blogger.com,1999:blog-2918922772328840300.post-3378642937029354142012-07-17T12:28:00.001-07:002012-07-17T12:30:19.219-07:00Upgrade Linux Mint to Maya failsIf Linux Mint Upgrade to Maya fails with the following reason:<br />
<br />
<blockquote>/usr/bin/locale: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by /usr/bin/locale)<br />
/usr/bin/locale: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /usr/bin/locale)<br />
whiptail: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by whiptail)<br />
debconf: whiptail output the above errors, giving up!<br />
dpkg: error processing /var/cache/apt/archives/libc6_2.15-0ubuntu10_i386.deb (--install):<br />
subprocess new pre-installation script returned error exit status 1<br />
Preparing to replace libc6-dev 2.15-0ubuntu10 (using .../libc6-dev_2.15-0ubuntu10_amd64.deb) ...<br />
Unpacking replacement libc6-dev ...<br />
Preparing to replace libc6-i386 2.15-0ubuntu10 (using .../libc6-i386_2.15-0ubuntu10_amd64.deb) ...<br />
Unpacking replacement libc6-i386 ...<br />
Replaced by files in installed package libc6:i386 ...<br />
dpkg: dependency problems prevent configuration of libc6-dev:<br />
libc6-dev depends on libc6 (= 2.15-0ubuntu10); however:<br />
Version of libc6 on system is 2.13-20ubuntu5.1.<br />
libc6-dev depends on libc-dev-bin (= 2.15-0ubuntu10); however:<br />
Version of libc-dev-bin on system is 2.13-20ubuntu5.1.<br />
dpkg: error processing libc6-dev (--install):<br />
dependency problems - leaving unconfigured<br />
dpkg: dependency problems prevent configuration of libc6-i386:<br />
libc6-i386 depends on libc6 (= 2.15-0ubuntu10); however:<br />
Version of libc6 on system is 2.13-20ubuntu5.1.<br />
dpkg: error processing libc6-i386 (--install):<br />
dependency problems - leaving unconfigured<br />
Errors were encountered while processing:<br />
/var/cache/apt/archives/libc6_2.15-0ubuntu10_amd64.deb<br />
/var/cache/apt/archives/libc6_2.15-0ubuntu10_i386.deb<br />
libc6-dev<br />
libc6-i386<br />
</blockquote><br />
<ol><li>Downgrade the following packages<br />
<pre class="brush: c">cd /tmp
wget http://ftp.halifax.rwth-aachen.de/ubuntu//pool/main/n/newt/libnewt0.52_0.52.11-2ubuntu8_amd64.deb
wget http://ftp.halifax.rwth-aachen.de/ubuntu//pool/main/n/newt/whiptail_0.52.11-2ubuntu8_amd64.deb
wget http://ftp.halifax.rwth-aachen.de/ubuntu//pool/main/p/popt/libpopt0_1.16-1_amd64.deb
sudo dpkg -i libnewt0.52_0.52.11-2ubuntu8_amd64.deb whiptail_0.52.11-2ubuntu8_amd64.deb libpopt0_1.16-1_amd64.deb
</pre></li>
<li>Install libc6 and after that resume installation<br />
<pre class="brush: c">dpkg -i /var/cache/apt/archives/libc6*
apt-get -f install
</pre></li>
<li><br />
That's it<br />
</li>
</ol><br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com3tag:blogger.com,1999:blog-2918922772328840300.post-41277925900410471322010-05-30T04:49:00.000-07:002010-05-31T03:15:36.878-07:00IPC 2010 Berlin Wifi fix1. Download: <a href="http://launchpadlibrarian.net/33927923/rtl8192se_linux_2.6.0010.1012.2009.tar.gz">http://launchpadlibrarian.net/33927923/rtl8192se_linux_2.6.0010.1012.2009.tar.gz</a><br /><br />2. Extract archive<br /><br />3. open a shell and change to root (pw intellibook): $sudo su<br /><br />4. $make<br /><br />5. $make install<br /><br />6. $modprobe r8192se_pci<br /><br />7. That's it!Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com0tag:blogger.com,1999:blog-2918922772328840300.post-39400894175733288702010-05-01T04:09:00.000-07:002014-04-23T02:00:05.326-07:00HowTo install ZendDebugger for PHP 5.3.1 and 5.3.2 on Linux<b><span style="color: red; font-size: large;">This article is deprecated. Please refer to <a href="https://markusperl.blogspot.com/2014/04/howto-install-zenddebugger-for-php-54.html">HowTo install ZendDebugger for PHP 5.4 or PHP 5.5 on Debian</a></span></b><br />
<br />
<br />
If you try to <a href="http://downloads.zend.com/pdt/debugger/org.zend.php.debug_feature-I20081217.zip">download</a> a current build of the ZendDebugger from Zend.com you probably get the following error:<br />
<blockquote>
<pre>Zend Debugger requires Zend Engine API version 220060519.The Zend
Engine API version 220090626 which is installed, is newer.Contact
Zend Technologies at <a class="postlink" href="http://www.zend.com/">http://www.zend.com/</a> for a later version of Zend Debugger.</pre>
</blockquote>
This happens because there is no Build for PHP 5.3.2 or 5.3.1 available.<br />
But if you take a look at the <a href="http://static.zend.com/topics/ZS-501-ReleaseNotes-20100415.txt">Zend Server release notes</a> you will see, that Zend Server is shipped with PHP 5.3.2 and an enabled debugging runtime environment.<br />
<br />
So if you use debian or ubuntu you can simply add the Zend-Server deb repository to your apt/sources.lit<br />
<br />
<ol>
<li>copy the following line into /etc/apt/sources.list <br />
<pre class="brush: c">deb http://repos.zend.com/zend-server/deb server non-free</pre>
</li>
<li>update your local package list:<br />
<pre class="brush: c">$: sudo aptitude update </pre>
</li>
<li>install the debugger<br />
<pre class="brush: c">$: sudo aptitude install php-5.3-debugger-zend-server </pre>
</li>
<li>The ZendDebugger is now located under /usr/local/zend/lib/debugger/php-5.3.x/ZendDebugger.so</li>
<li>Now create a new ini file under /etc/php5/conf.d/ and add the following lines:<br />
<pre>zend_extension=/usr/lib/php5/20060613/ZendDebugger.so
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always</pre>
</li>
<li>call the following command in your console to see if everything works:<br />
<pre>$: php -i | grep "Zend Debug"
<pre><b>Output: </b><i>"with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies"</i></pre>
</pre>
</li>
</ol>
Anonymoushttp://www.blogger.com/profile/04244174509402147526noreply@blogger.com2