Content type for the audio files aac - extension m4a
audio/mp4
If you have access to webserver's conf/mime.types file add this line
audio/mpeg mpga mp2 mp3 m4a
Web Development, Problems and Solutions, Marketing, Business. Overall this blog is dedicated to daily challenges that developers meet during their day.
audio/mpeg mpga mp2 mp3 m4a
Have you seen this ugly error where is is totally not supposed to be there?
Error: AndroidRuntime android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
I was working on an app about local restaurants in Niagara and had an about window.
Solution:
error
...
private static Context context;
....
MainActivity.context = getApplicationContext(); // this was causing some nasty errors.
correct
MainActivity.context = this;
Related
http://www.mkyong.com/android/android-alert-dialog-example/
http://stackoverflow.com/questions/1561803/android-progressdialog-show-crashes-with-getapplicationcontext
This is an error when you try to call a URL containing {} or [] at NN position.
curl: (3) [globbing] error: bad range specification after pos NNN
how I used it
/usr/bin/curl -s http://somesite.ca/api?filter[date]=last_12_hours
solution: by using --globoff
/usr/bin/curl -s --globoff http://somesite.ca/api?filter[date]=last_12_hours
Credit:
https://bbs.archlinux.org/viewtopic.php?id=74675
Do you want to see shorter log messages from git ?
example
5441641 fixed support.php : wasn't validating
25af6d5 updated background
a3v0a49 enabled the backup
solution
git log --pretty=oneline --abbrev-commit
if you want to logs to be between certain date you can do this
git log --since=2012-04-20 --until=2012-04-30 --pretty=oneline --abbrev-commit
Credit:
Gauthier - http://stackoverflow.com/questions/4479225/how-to-output-git-log-with-the-first-line-only
Keyword: git, git-log, git log --quiet
Have you seen this annoying JavaScript error message ?
$("#some_id").someplugin is not a function
I bet you have!
in most cases the plugin is not loaded but when everything is loaded fine then you should check if jquery is loaded more than once.
It turned out that if there are multiple copies of jquery loaded this causes the jquery extensions not to work.
Just lost a few hours troubleshooting this.
put this in a file called common.
Class App_Util {
function is_old_browser() {
$old = 0;
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
// IE <= 7
// User Agent: Opera/9.80 (Windows NT 6.1; U; en) Presto/2.10.229 Version/11.61
if (preg_match('#msie\s+(\d+)\.(\d+)#si', $_SERVER['HTTP_USER_AGENT'], $matches)) {
if ($matches[1] <= 7) {
$old = 1;
}
}
// Firefox <= 7
// User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
elseif (preg_match('#Firefox/(\d+)\.(\d+)[\.\d]+#si', $_SERVER['HTTP_USER_AGENT'], $matches)) {
if ($matches[1] <= 7) {
$old = 1;
}
}
// Safari < 5
// User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7
elseif (preg_match('#Version/(\d+)[\.\d]+ Safari/[\.\d]+#si', $_SERVER['HTTP_USER_AGENT'], $matches)) {
if ($matches[1] < 5) {
$old = 1;
}
}
// opera < 11
// User Agent: Opera/9.80 (Windows NT 6.1; U; en) Presto/2.10.229 Version/11.61
elseif (preg_match('#Opera/[\.\d]+.*?Version/(\d+)[\.\d]+#si', $_SERVER['HTTP_USER_AGENT'], $matches)) {
if ($matches[1] < 11) {
$old = 1;
}
}
}
return $old;
}
}
How to perform the check
file: block_old_browser.php
<?php if (App_Util::is_old_browser()) : ?>
<div class="app_old_browser_notice">
<h2>Old Browser</h2>
<p>Please consider upgrading your browser. Doing so will improve experience with the site. <br/>
Please click one of them below.</p>
<ul>
<li><a href="http://www.mozilla.org/en-US/firefox/fx/" target="_blank">Mozilla Firefox</a></li>
<li><a href="https://www.google.com/chrome" target="_blank">Google Chrome</a></li>
<li><a href="http://www.apple.com/safari/" target="_blank">Safari</a></li>
<li><a href="http://www.opera.com/download/" target="_blank">Opera</a></li>
<li><a href="http://www.microsoft.com/windows/ie/" target="_blank">Internet Explorer (Windows)</a></li>
</ul>
</div>
<?php endif; ?>
Include the file above in all the files that you need to the noticed displayed.
<?php include('block_old_browser.php'); ?>
css styles
<style>
.app_old_browser_notice {
background-color:#ff0000;
color: white;
margin:20px;
padding:10px;
}
.app_old_browser_notice a {
color: white;
}
</style>
Free e-book: How to Build a Website Using WordPress: Beginners Guide
Affordable WordPress Themes (77 themes for $39/year)
(c) Svetoslav Marinov and 2006-. All Rights Reserved.