<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3884748094508152833</id><updated>2024-10-02T00:54:29.068-07:00</updated><category term="Ubuntu"/><category term="14.04LTS"/><category term="Canon"/><category term="Chat"/><category term="Chrome"/><category term="DSLR"/><category term="Digital Camera"/><category term="EOS"/><category term="EXC_BAD_ACCESS"/><category term="Font"/><category term="Memory warning"/><category term="Nafees"/><category term="Nikon"/><category term="Skype"/><category term="Text"/><category term="UIViewController"/><category term="Urdu"/><category term="Video"/><category term="ViewDidLoad called"/><category term="Web Cam"/><category term="WebCam"/><category term="add ubuntu repository"/><category term="add ubuntu repository key"/><category term="apt-get add repository"/><category term="crash"/><category term="free"/><category term="gTalk"/><category term="gphoto"/><category term="gphoto2"/><category term="iPhone"/><category term="iPod touch"/><category term="install packages from ubuntu repository"/><category term="iphone crash log"/><category term="memory"/><category term="multiple times"/><category term="opensource"/><category term="stack trace"/><category term="symbolicatescrash"/><category term="symbols in crash log"/><category term="vlc"/><category term="warning"/><title type='text'>Sami&#39;s Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-1732631928227813482</id><published>2018-07-03T02:23:00.002-07:00</published><updated>2018-07-03T02:23:49.476-07:00</updated><title type='text'>Highlight Embedded Code on your html page</title><content type='html'>&lt;html&gt;
                 &lt;head&gt;
                   &lt;meta charset=&quot;UTF-8&quot;&gt;
                   &lt;meta name = &quot;viewport&quot; content = &quot;width = device-width, initial-scale = 1, maximum-scale = 1&quot;&gt;
                   &lt;style id=&quot;style&quot;&gt;
@font-face {
  font-family: &#39;Lato&#39;;
  src: url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Regular.woff2&#39;) format(&#39;woff2&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Regular.woff&#39;) format(&#39;woff&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Regular.ttf&#39;) format(&#39;truetype&#39;);
  font-style: normal;
  font-weight: normal;
  text-rendering: optimizeLegibility;
}
@font-face {
  font-family: &#39;Lato&#39;;
  src: url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Black.woff2&#39;) format(&#39;woff2&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Black.woff&#39;) format(&#39;woff&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Black.ttf&#39;) format(&#39;truetype&#39;);
  font-style: normal;
  font-weight: 700;
  text-rendering: optimizeLegibility;
}
@font-face {
  font-family: &#39;Material Icons&#39;;
  font-style: normal;
  font-weight: 400;
  src: local(&#39;Material Icons&#39;),
       local(&#39;MaterialIcons-Regular&#39;),
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/MaterialIcons-Regular.woff2&#39;) format(&#39;woff2&#39;),
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/MaterialIcons-Regular.woff&#39;) format(&#39;woff&#39;),
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/MaterialIcons-Regular.ttf&#39;) format(&#39;truetype&#39;);
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  font-weight: inherit;
  font-style: inherit;
  font-family: inherit;
  font-size: 100%;
  vertical-align: baseline;
}
body {
  line-height: 1;
  color: #000;
  background: #fff;
}
ol,
ul {
  list-style: none;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  vertical-align: middle;
}
caption,
th,
td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle;
}
a img {
  border: none;
}
body {
  font-size: 16px;
  padding: 15px;
  font-family: helvetica, arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background-color: #fff;
}
body .katex {
  font: 400 1.2em &#39;KaTeX_Main&#39;;
  line-height: 1.2em;
  white-space: initial;
  text-indent: 0;
}
body .katex .mfrac&gt;.vlist&gt;span:nth-child(2) {
  top: 0 !important;
}
body .katex-error {
  background-color: #f2dede;
  color: #a64444;
  padding: 5px;
  margin: -5px;
  border-radius: 5px;
}
body .flowchart-error,
body .sequence-error {
  background-color: #f2dede;
  color: #a64444;
  padding: 5px;
  border-radius: 5px;
  -webkit-box-pack: left;
  -moz-box-pack: left;
  -o-box-pack: left;
  -ms-flex-pack: left;
  -webkit-justify-content: left;
  justify-content: left;
}
li label.taskListItem {
  margin-left: -1.8em;
}
li label.taskListItem.checked {
  text-decoration: line-through;
  opacity: 0.5;
  -ms-filter: &quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=50)&quot;;
  filter: alpha(opacity=50);
}
div.math-rendered {
  text-align: center;
}
.math-failed {
  background-color: rgba(255,0,0,0.1);
  color: #d90000;
  padding: 5px;
  margin: 5px 0;
  border-radius: 5px;
}
sup {
  position: relative;
  top: -0.4em;
  font-size: 0.8em;
  vertical-align: top;
}
sub {
  position: relative;
  bottom: -0.4em;
  font-size: 0.8em;
  vertical-align: top;
}
a {
  color: #2bac8f;
  text-decoration: none;
  padding: 5px;
  border-radius: 5px;
  margin: -5px;
  -webkit-transition: 0.1s;
  -moz-transition: 0.1s;
  -o-transition: 0.1s;
  -ms-transition: 0.1s;
  transition: 0.1s;
}
a img {
  vertical-align: sub;
}
a:hover {
  color: #2eb899;
  text-decoration: underline;
  background-color: rgba(255,201,92,0.3);
}
a:visited {
  color: #2bac8f;
}
hr {
  border-top: none;
  border-bottom: solid 1px #d0d0d0;
  margin: 15px 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  word-wrap: break-word;
}
h1 {
  font-size: 2.55em;
  padding-bottom: 0.3em;
  line-height: 1.2em;
  border-bottom: solid 1px #d0d0d0;
  margin: 1em 0 0.44em;
}
h1:first-child {
  margin-top: 0;
}
h2 {
  font-size: 1.75em;
  padding-bottom: 0.3em;
  line-height: 1.225em;
  border-bottom: solid 1px #d0d0d0;
  margin: 1em 0 0.57em;
}
h2:first-child {
  margin-top: 0;
}
h3 {
  font-size: 1.5em;
  line-height: 1.43em;
  margin: 1em 0 0.66em;
}
h4 {
  font-size: 1.25em;
  line-height: 1.4em;
  margin: 1em 0 0.8em;
}
h5 {
  font-size: 1em;
  line-height: 1.4em;
  margin: 1em 0 1em;
}
h6 {
  font-size: 1em;
  line-height: 1.4em;
  margin: 1em 0 1em;
  color: #777;
}
p {
  line-height: 1.6em;
  margin: 0 0 1em;
  white-space: pre-line;
  word-wrap: break-word;
}
img {
  max-width: 100%;
}
strong,
b {
  font-weight: bold;
}
em,
i {
  font-style: italic;
}
s,
del,
strike {
  text-decoration: line-through;
}
u {
  text-decoration: underline;
}
blockquote {
  border-left: solid 4px #3fb399;
  margin: 0 0 1em;
  padding: 0 25px;
}
ul {
  list-style-type: disc;
  padding-left: 2em;
  margin-bottom: 1em;
}
ul li {
  display: list-item;
}
ul li.taskListItem {
  list-style: none;
}
ul li p {
  margin: 0;
}
ul&gt;li&gt;ul,
ul&gt;li&gt;ol {
  margin: 0;
}
ul&gt;li&gt;ul {
  list-style-type: circle;
}
ul&gt;li&gt;ul&gt;li&gt;ul {
  list-style-type: square;
}
ol {
  list-style-type: decimal;
  padding-left: 2em;
  margin-bottom: 1em;
}
ol li {
  display: list-item;
}
ol li p {
  margin: 0;
}
ol&gt;li&gt;ul,
ol&gt;li&gt;ol {
  margin: 0;
}
code {
  padding: 0.2em 0.4em;
  background-color: #f7f7f7;
  border-radius: 3px;
  font-size: 1em;
  text-decoration: none;
  margin-right: 2px;
}
pre {
  padding: 0.5em !important;
  border: solid 1px #d1d1d1;
  border-radius: 5px;
  overflow-x: auto;
  margin: 0 0 1em;
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: box;
  display: flex;
  line-height: 1.4em;
}
pre.flowchart,
pre.sequence {
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: box;
  display: flex;
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -o-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  background-color: #fff;
}
pre.CodeMirror {
  height: initial;
  -webkit-box-lines: multiple;
  -moz-box-lines: multiple;
  -o-box-lines: multiple;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}
pre.CodeMirror&gt;code {
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -o-box-flex: 1;
  box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  overflow-x: auto;
}
pre code {
  background-color: inherit;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
}
pre&gt;span.filename {
  width: 100%;
  border-radius: 5px 0px 0px 0px;
  margin: -8px 100% 8px -8px;
  padding: 0px 6px;
  background-color: #777;
  color: #fff;
}
pre&gt;span.lineNumber {
  display: none;
  font-size: 1em;
  padding: 0.5em 0;
  margin: -0.5em 0.5em -0.5em -0.5em;
  border-right: 1px solid;
  text-align: right;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
pre&gt;span.lineNumber.CodeMirror-gutters {
  position: initial;
  top: initial;
  left: initial;
  min-height: 0 !important;
}
pre&gt;span.lineNumber&gt;span {
  display: block;
  padding: 0 0.5em 0;
}
table {
  display: block;
  width: 100%;
  margin: 0 0 1em;
}
table thead tr {
  background-color: #fff;
}
table thead th {
  border-style: solid;
  padding: 6px 13px;
  line-height: 1.6;
  border-width: 1px 0 2px 1px;
  border-color: #d0d0d0;
  font-weight: bold;
}
table thead th:last-child {
  border-right: solid 1px #d0d0d0;
}
table tbody tr:nth-child(2n + 1) {
  background-color: #f9f9f9;
}
table tbody tr:nth-child(2n) {
  background-color: #fff;
}
table tbody td {
  border-style: solid;
  padding: 6px 13px;
  line-height: 1.6;
  border-width: 0 0 1px 1px;
  border-color: #d0d0d0;
}
table tbody td:last-child {
  border-right: solid 1px #d0d0d0;
}
kbd {
  background-color: #fafbfc;
  border: solid 1px #d0d0d0;
  border-bottom-color: #888;
  border-radius: 3px;
  -webkit-box-shadow: inset 0 -1px 0 #959da5;
  box-shadow: inset 0 -1px 0 #959da5;
  display: inline-block;
  font-size: 0.8em;
  line-height: 1;
  padding: 3px 5px;
}
.admonition.note,
.admonition.hint,
.admonition.danger,
.admonition.caution,
.admonition.error,
.admonition.attention {
  -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);
  box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);
  position: relative;
  margin: 1.5625em 0;
  padding: 0 1.2rem;
  border-left: 0.4rem solid #448aff;
  border-radius: 0.2rem;
  overflow: auto;
}
html .admonition&gt;:last-child {
  margin-bottom: 1.2rem;
}
.admonition .admonition {
  margin: 1em 0;
}
.admonition p {
  margin-top: 0.5em;
}
.admonition.note&gt;.admonition-title:before,
.admonition.hint&gt;.admonition-title:before,
.admonition.danger&gt;.admonition-title:before,
.admonition.caution&gt;.admonition-title:before,
.admonition.error&gt;.admonition-title:before,
.admonition.attention&gt;.admonition-title:before {
  position: absolute;
  left: 1.2rem;
  font-family: &quot;Material Icons&quot;;
  font-size: 24px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
/* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;
/* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;
/* Support for IE. */
  font-feature-settings: &#39;liga&#39;;
}
.admonition.note&gt;.admonition-title,
.admonition.hint&gt;.admonition-title,
.admonition.danger&gt;.admonition-title,
.admonition.caution&gt;.admonition-title,
.admonition.error&gt;.admonition-title,
.admonition.attention&gt;.admonition-title {
  margin: 0 -1.2rem;
  padding: 0.8rem 1.2rem 0.8rem 4rem;
  border-bottom: 0.1rem solid rgba(68,138,255,0.1);
  background-color: rgba(68,138,255,0.1);
  font-weight: 700;
}
.admonition&gt;.admonition-title:last-child {
  margin-bottom: 0;
}
.admonition.note {
  border-left-color: #448aff;
}
.admonition.note&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(68,138,255,0.1);
  background-color: rgba(68,138,255,0.1);
}
.admonition.note&gt;.admonition-title:before {
  color: #448aff;
  content: &quot;note&quot;;
}
.admonition.hint {
  border-left-color: #00bfa5;
}
.admonition.hint&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(0,191,165,0.1);
  background-color: rgba(0,191,165,0.1);
}
.admonition.hint&gt;.admonition-title:before {
  color: #00bfa5;
  content: &quot;info&quot;;
}
.admonition.danger {
  border-left-color: #ff1744;
}
.admonition.danger&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(255,23,68,0.1);
  background-color: rgba(255,23,68,0.1);
}
.admonition.danger&gt;.admonition-title:before {
  color: #ff1744;
  content: &quot;block&quot;;
}
.admonition.caution {
  border-left-color: #ff9100;
}
.admonition.caution&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(255,145,0,0.1);
  background-color: rgba(255,145,0,0.1);
}
.admonition.caution&gt;.admonition-title:before {
  color: #ff9100;
  content: &quot;warning&quot;;
}
.admonition.error {
  border-left-color: #ff1744;
}
.admonition.error&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(255,23,68,0.1);
  background-color: rgba(255,23,68,0.1);
}
.admonition.error&gt;.admonition-title:before {
  color: #ff1744;
  content: &quot;error&quot;;
}
.admonition.attention {
  border-left-color: #64dd17;
}
.admonition.attention&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(100,221,23,0.1);
  background-color: rgba(100,221,23,0.1);
}
.admonition.attention&gt;.admonition-title:before {
  color: #64dd17;
  content: &quot;priority_high&quot;;
}
body[data-theme=&quot;dark&quot;] {
  color: #f9f9f9;
  border-color: #444b59;
  background-color: #2c3033;
}
body[data-theme=&quot;dark&quot;] a:hover {
  background-color: rgba(90,214,186,0.2) !important;
}
body[data-theme=&quot;dark&quot;] code {
  color: #ea6730;
  border-color: #3d4450;
  background-color: #363a3e;
}
body[data-theme=&quot;dark&quot;] pre {
  border-color: #474f5c;
}
body[data-theme=&quot;dark&quot;] pre code {
  background-color: transparent;
}
body[data-theme=&quot;dark&quot;] label.taskListItem {
  background-color: #2c3033;
}
body[data-theme=&quot;dark&quot;] table thead tr {
  background-color: #282b2e;
}
body[data-theme=&quot;dark&quot;] table thead th {
  border-color: #444b59;
}
body[data-theme=&quot;dark&quot;] table thead th:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;dark&quot;] table tbody tr:nth-child(2n + 1) {
  background-color: #2c3033;
}
body[data-theme=&quot;dark&quot;] table tbody tr:nth-child(2n) {
  background-color: #282b2e;
}
body[data-theme=&quot;dark&quot;] table tbody td {
  border-color: #444b59;
}
body[data-theme=&quot;dark&quot;] table tbody td:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;dark&quot;] kbd {
  background-color: #444b59;
  color: #f9f9f9;
}
body[data-theme=&quot;solarized-dark&quot;] {
  color: #93a1a1;
  border-color: #444b59;
  background-color: #073642;
}
body[data-theme=&quot;solarized-dark&quot;] table thead tr {
  background-color: #06313b;
}
body[data-theme=&quot;solarized-dark&quot;] table thead th {
  border-color: #444b59;
}
body[data-theme=&quot;solarized-dark&quot;] table thead th:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody tr:nth-child(2n + 1) {
  background-color: #073642;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody tr:nth-child(2n) {
  background-color: #06313b;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody td {
  border-color: #444b59;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody td:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;monokai&quot;] {
  color: #f8f8f2;
  border-color: #444b59;
  background-color: #272822;
}
body[data-theme=&quot;monokai&quot;] table thead tr {
  background-color: #23241f;
}
body[data-theme=&quot;monokai&quot;] table thead th {
  border-color: #444b59;
}
body[data-theme=&quot;monokai&quot;] table thead th:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;monokai&quot;] table tbody tr:nth-child(2n + 1) {
  background-color: #272822;
}
body[data-theme=&quot;monokai&quot;] table tbody tr:nth-child(2n) {
  background-color: #23241f;
}
body[data-theme=&quot;monokai&quot;] table tbody td {
  border-color: #444b59;
}
body[data-theme=&quot;monokai&quot;] table tbody td:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;monokai&quot;] kbd {
  background-color: #1e2127;
}
/*# sourceMappingURL=browser/components/markdown.css.map */

body {
  font-family: &#39;Lato&#39;,&#39;meiryo&#39;,&#39;Microsoft YaHei&#39;,&#39;helvetica&#39;,&#39;arial&#39;,&#39;sans-serif&#39;;
  font-size: 18px;
  false
}
code {
  font-family: &#39;Monaco&#39;,&#39;Consolas&#39;,&#39;Monaco&#39;,&#39;Menlo&#39;,&#39;Ubuntu Mono&#39;,&#39;Consolas&#39;,&#39;source-code-pro&#39;,&#39;monospace&#39;;
  background-color: rgba(0,0,0,0.04);
}
.lineNumber {
  false
  font-family: &#39;Monaco&#39;,&#39;Consolas&#39;,&#39;Monaco&#39;,&#39;Menlo&#39;,&#39;Ubuntu Mono&#39;,&#39;Consolas&#39;,&#39;source-code-pro&#39;,&#39;monospace&#39;;
}

.clipboardButton {
  color: rgba(147,147,149,0.8);;
  fill: rgba(147,147,149,1);;
  border-radius: 50%;
  margin: 0px 10px;
  border: none;
  background-color: transparent;
  outline: none;
  height: 15px;
  width: 15px;
  cursor: pointer;
}

.clipboardButton:hover {
  transition: 0.2s;
  color: #939395;
  fill: #939395;
  background-color: rgba(0,0,0,0.1);
}

h1, h2 {
  border: none;
}

h1 {
  padding-bottom: 4px;
  margin: 1em 0 8px;
}

h2 {
  padding-bottom: 0.2em;
  margin: 1em 0 0.37em;
}

body p {
  white-space: normal;
}

@media print {
  body[data-theme=&quot;dark&quot;] {
    color: #000;
    background-color: #fff;
  }
  .clipboardButton {
    display: none
  }
}
&lt;/style&gt;
                   &lt;link rel=&quot;stylesheet&quot; href=&quot;css/dracula.css&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;css/katex.min.css&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;css/codemirror.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot;
      href=&quot;http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/default.min.css&quot;&gt;
&lt;script src=&quot;http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;hljs.initHighlightingOnLoad();&lt;/script&gt;
                 &lt;/head&gt;
                 &lt;body&gt;
&lt;p data-line=&quot;3&quot;&gt;Copy following in the head section&lt;/p&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot;
      href=&amp;quot;http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/default.min.css&amp;quot;&amp;gt;
&amp;lt;script src=&amp;quot;http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;hljs.initHighlightingOnLoad();&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p data-line=&quot;14&quot;&gt;The code that needs highlighting should be in the following form,&lt;/p&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;pre class=&amp;quot;language&amp;quot;&amp;gt;&amp;lt;code&amp;gt;
...
code
...
&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/body&gt;
              &lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/1732631928227813482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2018/07/highlight-embedded-code-on-your-html.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/1732631928227813482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/1732631928227813482'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2018/07/highlight-embedded-code-on-your-html.html' title='Highlight Embedded Code on your html page'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-889058694489106729</id><published>2018-06-28T05:13:00.002-07:00</published><updated>2018-06-28T09:13:50.414-07:00</updated><title type='text'>OpenCV V4l2 using Gstreamer</title><content type='html'>&lt;html&gt;
                 &lt;head&gt;
                   &lt;meta charset=&quot;UTF-8&quot;&gt;
                   &lt;meta name = &quot;viewport&quot; content = &quot;width = device-width, initial-scale = 1, maximum-scale = 1&quot;&gt;
                   &lt;style id=&quot;style&quot;&gt;
@font-face {
  font-family: &#39;Lato&#39;;
  src: url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Regular.woff2&#39;) format(&#39;woff2&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Regular.woff&#39;) format(&#39;woff&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Regular.ttf&#39;) format(&#39;truetype&#39;);
  font-style: normal;
  font-weight: normal;
  text-rendering: optimizeLegibility;
}
@font-face {
  font-family: &#39;Lato&#39;;
  src: url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Black.woff2&#39;) format(&#39;woff2&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Black.woff&#39;) format(&#39;woff&#39;), /* Modern Browsers */
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/Lato-Black.ttf&#39;) format(&#39;truetype&#39;);
  font-style: normal;
  font-weight: 700;
  text-rendering: optimizeLegibility;
}
@font-face {
  font-family: &#39;Material Icons&#39;;
  font-style: normal;
  font-weight: 400;
  src: local(&#39;Material Icons&#39;),
       local(&#39;MaterialIcons-Regular&#39;),
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/MaterialIcons-Regular.woff2&#39;) format(&#39;woff2&#39;),
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/MaterialIcons-Regular.woff&#39;) format(&#39;woff&#39;),
       url(&#39;file:///usr/share/boostnote/resources/app/resources/fonts/MaterialIcons-Regular.ttf&#39;) format(&#39;truetype&#39;);
}

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  font-weight: inherit;
  font-style: inherit;
  font-family: inherit;
  font-size: 100%;
  vertical-align: baseline;
}
body {
  line-height: 1;
  color: #000;
  background: #fff;
}
ol,
ul {
  list-style: none;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  vertical-align: middle;
}
caption,
th,
td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle;
}
a img {
  border: none;
}
body {
  font-size: 16px;
  padding: 15px;
  font-family: helvetica, arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background-color: #fff;
}
body .katex {
  font: 400 1.2em &#39;KaTeX_Main&#39;;
  line-height: 1.2em;
  white-space: initial;
  text-indent: 0;
}
body .katex .mfrac&gt;.vlist&gt;span:nth-child(2) {
  top: 0 !important;
}
body .katex-error {
  background-color: #f2dede;
  color: #a64444;
  padding: 5px;
  margin: -5px;
  border-radius: 5px;
}
body .flowchart-error,
body .sequence-error {
  background-color: #f2dede;
  color: #a64444;
  padding: 5px;
  border-radius: 5px;
  -webkit-box-pack: left;
  -moz-box-pack: left;
  -o-box-pack: left;
  -ms-flex-pack: left;
  -webkit-justify-content: left;
  justify-content: left;
}
li label.taskListItem {
  margin-left: -1.8em;
}
li label.taskListItem.checked {
  text-decoration: line-through;
  opacity: 0.5;
  -ms-filter: &quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=50)&quot;;
  filter: alpha(opacity=50);
}
div.math-rendered {
  text-align: center;
}
.math-failed {
  background-color: rgba(255,0,0,0.1);
  color: #d90000;
  padding: 5px;
  margin: 5px 0;
  border-radius: 5px;
}
sup {
  position: relative;
  top: -0.4em;
  font-size: 0.8em;
  vertical-align: top;
}
sub {
  position: relative;
  bottom: -0.4em;
  font-size: 0.8em;
  vertical-align: top;
}
a {
  color: #2bac8f;
  text-decoration: none;
  padding: 5px;
  border-radius: 5px;
  margin: -5px;
  -webkit-transition: 0.1s;
  -moz-transition: 0.1s;
  -o-transition: 0.1s;
  -ms-transition: 0.1s;
  transition: 0.1s;
}
a img {
  vertical-align: sub;
}
a:hover {
  color: #2eb899;
  text-decoration: underline;
  background-color: rgba(255,201,92,0.3);
}
a:visited {
  color: #2bac8f;
}
hr {
  border-top: none;
  border-bottom: solid 1px #d0d0d0;
  margin: 15px 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  word-wrap: break-word;
}
h1 {
  font-size: 2.55em;
  padding-bottom: 0.3em;
  line-height: 1.2em;
  border-bottom: solid 1px #d0d0d0;
  margin: 1em 0 0.44em;
}
h1:first-child {
  margin-top: 0;
}
h2 {
  font-size: 1.75em;
  padding-bottom: 0.3em;
  line-height: 1.225em;
  border-bottom: solid 1px #d0d0d0;
  margin: 1em 0 0.57em;
}
h2:first-child {
  margin-top: 0;
}
h3 {
  font-size: 1.5em;
  line-height: 1.43em;
  margin: 1em 0 0.66em;
}
h4 {
  font-size: 1.25em;
  line-height: 1.4em;
  margin: 1em 0 0.8em;
}
h5 {
  font-size: 1em;
  line-height: 1.4em;
  margin: 1em 0 1em;
}
h6 {
  font-size: 1em;
  line-height: 1.4em;
  margin: 1em 0 1em;
  color: #777;
}
p {
  line-height: 1.6em;
  margin: 0 0 1em;
  white-space: pre-line;
  word-wrap: break-word;
}
img {
  max-width: 100%;
}
strong,
b {
  font-weight: bold;
}
em,
i {
  font-style: italic;
}
s,
del,
strike {
  text-decoration: line-through;
}
u {
  text-decoration: underline;
}
blockquote {
  border-left: solid 4px #3fb399;
  margin: 0 0 1em;
  padding: 0 25px;
}
ul {
  list-style-type: disc;
  padding-left: 2em;
  margin-bottom: 1em;
}
ul li {
  display: list-item;
}
ul li.taskListItem {
  list-style: none;
}
ul li p {
  margin: 0;
}
ul&gt;li&gt;ul,
ul&gt;li&gt;ol {
  margin: 0;
}
ul&gt;li&gt;ul {
  list-style-type: circle;
}
ul&gt;li&gt;ul&gt;li&gt;ul {
  list-style-type: square;
}
ol {
  list-style-type: decimal;
  padding-left: 2em;
  margin-bottom: 1em;
}
ol li {
  display: list-item;
}
ol li p {
  margin: 0;
}
ol&gt;li&gt;ul,
ol&gt;li&gt;ol {
  margin: 0;
}
code {
  padding: 0.2em 0.4em;
  background-color: #f7f7f7;
  border-radius: 3px;
  font-size: 1em;
  text-decoration: none;
  margin-right: 2px;
}
pre {
  padding: 0.5em !important;
  border: solid 1px #d1d1d1;
  border-radius: 5px;
  overflow-x: auto;
  margin: 0 0 1em;
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: box;
  display: flex;
  line-height: 1.4em;
}
pre.flowchart,
pre.sequence {
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: box;
  display: flex;
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -o-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  background-color: #fff;
}
pre.CodeMirror {
  height: initial;
  -webkit-box-lines: multiple;
  -moz-box-lines: multiple;
  -o-box-lines: multiple;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}
pre.CodeMirror&gt;code {
  -webkit-box-flex: 1;
  -moz-box-flex: 1;
  -o-box-flex: 1;
  box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
  overflow-x: auto;
}
pre code {
  background-color: inherit;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
}
pre&gt;span.filename {
  width: 100%;
  border-radius: 5px 0px 0px 0px;
  margin: -8px 100% 8px -8px;
  padding: 0px 6px;
  background-color: #777;
  color: #fff;
}
pre&gt;span.lineNumber {
  display: none;
  font-size: 1em;
  padding: 0.5em 0;
  margin: -0.5em 0.5em -0.5em -0.5em;
  border-right: 1px solid;
  text-align: right;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
pre&gt;span.lineNumber.CodeMirror-gutters {
  position: initial;
  top: initial;
  left: initial;
  min-height: 0 !important;
}
pre&gt;span.lineNumber&gt;span {
  display: block;
  padding: 0 0.5em 0;
}
table {
  display: block;
  width: 100%;
  margin: 0 0 1em;
}
table thead tr {
  background-color: #fff;
}
table thead th {
  border-style: solid;
  padding: 6px 13px;
  line-height: 1.6;
  border-width: 1px 0 2px 1px;
  border-color: #d0d0d0;
  font-weight: bold;
}
table thead th:last-child {
  border-right: solid 1px #d0d0d0;
}
table tbody tr:nth-child(2n + 1) {
  background-color: #f9f9f9;
}
table tbody tr:nth-child(2n) {
  background-color: #fff;
}
table tbody td {
  border-style: solid;
  padding: 6px 13px;
  line-height: 1.6;
  border-width: 0 0 1px 1px;
  border-color: #d0d0d0;
}
table tbody td:last-child {
  border-right: solid 1px #d0d0d0;
}
kbd {
  background-color: #fafbfc;
  border: solid 1px #d0d0d0;
  border-bottom-color: #888;
  border-radius: 3px;
  -webkit-box-shadow: inset 0 -1px 0 #959da5;
  box-shadow: inset 0 -1px 0 #959da5;
  display: inline-block;
  font-size: 0.8em;
  line-height: 1;
  padding: 3px 5px;
}
.admonition.note,
.admonition.hint,
.admonition.danger,
.admonition.caution,
.admonition.error,
.admonition.attention {
  -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);
  box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);
  position: relative;
  margin: 1.5625em 0;
  padding: 0 1.2rem;
  border-left: 0.4rem solid #448aff;
  border-radius: 0.2rem;
  overflow: auto;
}
html .admonition&gt;:last-child {
  margin-bottom: 1.2rem;
}
.admonition .admonition {
  margin: 1em 0;
}
.admonition p {
  margin-top: 0.5em;
}
.admonition.note&gt;.admonition-title:before,
.admonition.hint&gt;.admonition-title:before,
.admonition.danger&gt;.admonition-title:before,
.admonition.caution&gt;.admonition-title:before,
.admonition.error&gt;.admonition-title:before,
.admonition.attention&gt;.admonition-title:before {
  position: absolute;
  left: 1.2rem;
  font-family: &quot;Material Icons&quot;;
  font-size: 24px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
/* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;
/* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;
/* Support for IE. */
  font-feature-settings: &#39;liga&#39;;
}
.admonition.note&gt;.admonition-title,
.admonition.hint&gt;.admonition-title,
.admonition.danger&gt;.admonition-title,
.admonition.caution&gt;.admonition-title,
.admonition.error&gt;.admonition-title,
.admonition.attention&gt;.admonition-title {
  margin: 0 -1.2rem;
  padding: 0.8rem 1.2rem 0.8rem 4rem;
  border-bottom: 0.1rem solid rgba(68,138,255,0.1);
  background-color: rgba(68,138,255,0.1);
  font-weight: 700;
}
.admonition&gt;.admonition-title:last-child {
  margin-bottom: 0;
}
.admonition.note {
  border-left-color: #448aff;
}
.admonition.note&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(68,138,255,0.1);
  background-color: rgba(68,138,255,0.1);
}
.admonition.note&gt;.admonition-title:before {
  color: #448aff;
  content: &quot;note&quot;;
}
.admonition.hint {
  border-left-color: #00bfa5;
}
.admonition.hint&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(0,191,165,0.1);
  background-color: rgba(0,191,165,0.1);
}
.admonition.hint&gt;.admonition-title:before {
  color: #00bfa5;
  content: &quot;info&quot;;
}
.admonition.danger {
  border-left-color: #ff1744;
}
.admonition.danger&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(255,23,68,0.1);
  background-color: rgba(255,23,68,0.1);
}
.admonition.danger&gt;.admonition-title:before {
  color: #ff1744;
  content: &quot;block&quot;;
}
.admonition.caution {
  border-left-color: #ff9100;
}
.admonition.caution&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(255,145,0,0.1);
  background-color: rgba(255,145,0,0.1);
}
.admonition.caution&gt;.admonition-title:before {
  color: #ff9100;
  content: &quot;warning&quot;;
}
.admonition.error {
  border-left-color: #ff1744;
}
.admonition.error&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(255,23,68,0.1);
  background-color: rgba(255,23,68,0.1);
}
.admonition.error&gt;.admonition-title:before {
  color: #ff1744;
  content: &quot;error&quot;;
}
.admonition.attention {
  border-left-color: #64dd17;
}
.admonition.attention&gt;.admonition-title {
  border-bottom-color: 0.1rem solid rgba(100,221,23,0.1);
  background-color: rgba(100,221,23,0.1);
}
.admonition.attention&gt;.admonition-title:before {
  color: #64dd17;
  content: &quot;priority_high&quot;;
}
body[data-theme=&quot;dark&quot;] {
  color: #f9f9f9;
  border-color: #444b59;
  background-color: #2c3033;
}
body[data-theme=&quot;dark&quot;] a:hover {
  background-color: rgba(90,214,186,0.2) !important;
}
body[data-theme=&quot;dark&quot;] code {
  color: #ea6730;
  border-color: #3d4450;
  background-color: #363a3e;
}
body[data-theme=&quot;dark&quot;] pre {
  border-color: #474f5c;
}
body[data-theme=&quot;dark&quot;] pre code {
  background-color: transparent;
}
body[data-theme=&quot;dark&quot;] label.taskListItem {
  background-color: #2c3033;
}
body[data-theme=&quot;dark&quot;] table thead tr {
  background-color: #282b2e;
}
body[data-theme=&quot;dark&quot;] table thead th {
  border-color: #444b59;
}
body[data-theme=&quot;dark&quot;] table thead th:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;dark&quot;] table tbody tr:nth-child(2n + 1) {
  background-color: #2c3033;
}
body[data-theme=&quot;dark&quot;] table tbody tr:nth-child(2n) {
  background-color: #282b2e;
}
body[data-theme=&quot;dark&quot;] table tbody td {
  border-color: #444b59;
}
body[data-theme=&quot;dark&quot;] table tbody td:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;dark&quot;] kbd {
  background-color: #444b59;
  color: #f9f9f9;
}
body[data-theme=&quot;solarized-dark&quot;] {
  color: #93a1a1;
  border-color: #444b59;
  background-color: #073642;
}
body[data-theme=&quot;solarized-dark&quot;] table thead tr {
  background-color: #06313b;
}
body[data-theme=&quot;solarized-dark&quot;] table thead th {
  border-color: #444b59;
}
body[data-theme=&quot;solarized-dark&quot;] table thead th:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody tr:nth-child(2n + 1) {
  background-color: #073642;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody tr:nth-child(2n) {
  background-color: #06313b;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody td {
  border-color: #444b59;
}
body[data-theme=&quot;solarized-dark&quot;] table tbody td:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;monokai&quot;] {
  color: #f8f8f2;
  border-color: #444b59;
  background-color: #272822;
}
body[data-theme=&quot;monokai&quot;] table thead tr {
  background-color: #23241f;
}
body[data-theme=&quot;monokai&quot;] table thead th {
  border-color: #444b59;
}
body[data-theme=&quot;monokai&quot;] table thead th:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;monokai&quot;] table tbody tr:nth-child(2n + 1) {
  background-color: #272822;
}
body[data-theme=&quot;monokai&quot;] table tbody tr:nth-child(2n) {
  background-color: #23241f;
}
body[data-theme=&quot;monokai&quot;] table tbody td {
  border-color: #444b59;
}
body[data-theme=&quot;monokai&quot;] table tbody td:last-child {
  border-right: solid 1px #444b59;
}
body[data-theme=&quot;monokai&quot;] kbd {
  background-color: #1e2127;
}
/*# sourceMappingURL=browser/components/markdown.css.map */

body {
  font-family: &#39;Lato&#39;,&#39;meiryo&#39;,&#39;Microsoft YaHei&#39;,&#39;helvetica&#39;,&#39;arial&#39;,&#39;sans-serif&#39;;
  font-size: 18px;
  false
}
code {
  font-family: &#39;Monaco&#39;,&#39;Consolas&#39;,&#39;Monaco&#39;,&#39;Menlo&#39;,&#39;Ubuntu Mono&#39;,&#39;Consolas&#39;,&#39;source-code-pro&#39;,&#39;monospace&#39;;
  background-color: rgba(0,0,0,0.04);
}
.lineNumber {
  false
  font-family: &#39;Monaco&#39;,&#39;Consolas&#39;,&#39;Monaco&#39;,&#39;Menlo&#39;,&#39;Ubuntu Mono&#39;,&#39;Consolas&#39;,&#39;source-code-pro&#39;,&#39;monospace&#39;;
}

.clipboardButton {
  color: rgba(147,147,149,0.8);;
  fill: rgba(147,147,149,1);;
  border-radius: 50%;
  margin: 0px 10px;
  border: none;
  background-color: transparent;
  outline: none;
  height: 15px;
  width: 15px;
  cursor: pointer;
}

.clipboardButton:hover {
  transition: 0.2s;
  color: #939395;
  fill: #939395;
  background-color: rgba(0,0,0,0.1);
}

h1, h2 {
  border: none;
}

h1 {
  padding-bottom: 4px;
  margin: 1em 0 8px;
}

h2 {
  padding-bottom: 0.2em;
  margin: 1em 0 0.37em;
}

body p {
  white-space: normal;
}

@media print {
  body[data-theme=&quot;dark&quot;] {
    color: #000;
    background-color: #fff;
  }
  .clipboardButton {
    display: none
  }
}
&lt;/style&gt;
                   &lt;link rel=&quot;stylesheet&quot; href=&quot;css/dracula.css&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;css/katex.min.css&quot;&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;css/codemirror.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot;
      href=&quot;http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/default.min.css&quot;&gt;
&lt;script src=&quot;http://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;hljs.initHighlightingOnLoad();&lt;/script&gt;
                 &lt;/head&gt;
                 &lt;body&gt;&lt;h1 data-line=&quot;0&quot; id=&quot;OpenCV-V4l2-using-Gstreamer&quot;&gt;OpenCV V4l2 using Gstreamer&lt;/h1&gt;
&lt;h2 data-line=&quot;2&quot; id=&quot;resize-window&quot;&gt;resize window&lt;/h2&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;python&quot;&gt;cv2.namedWindow(&amp;quot;visiondemo&amp;quot;,cv2.WINDOW_FULLSCREEN)
cv2.resizeWindow(&amp;#39;visiondemo&amp;#39;, 1920,1080)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-line=&quot;9&quot; id=&quot;set-fps&quot;&gt;set fps&lt;/h2&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;python&quot;&gt;cap.set(cv2.CAP_PROP_FRAME_WIDTH,1920)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT,1080)
cap.set(cv2.CAP_PROP_FPS,30)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-line=&quot;17&quot; id=&quot;Setup-Video&quot;&gt;Setup Video&lt;/h2&gt;
&lt;h4 data-line=&quot;19&quot; id=&quot;Normal-Setup&quot;&gt;Normal Setup&lt;/h4&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;python&quot;&gt;cap = cv2.VideoCapture(&amp;quot;v4l2src device=/dev/video0 ! appsink&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 data-line=&quot;24&quot; id=&quot;JPEG-Setup&quot;&gt;JPEG Setup&lt;/h4&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;python&quot;&gt;cap = cv2.VideoCapture(&amp;quot;v4l2src device=/dev/video0 do-timestamp=true ! image/jpeg, width=1920, height=1080, framerate=30/1 ! jpegdec ! videoconvert ! appsink&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 data-line=&quot;29&quot; id=&quot;TEE-Setup&quot;&gt;TEE Setup&lt;/h4&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;python&quot;&gt;cap = cv2.VideoCapture(&amp;quot;v4l2src device=/dev/video0 do-timestamp=true ! image/jpeg, width=1920, height=1080, framerate=30/1 ! jpegdec ! tee name=t ! queue ! videoconvert ! appsink t. ! queue ! videoconvert ! videoscale ! videorate ! video/x-raw,width=640,height=480,framerate=15/1 ! v4l2sink device=/dev/video2&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-line=&quot;34&quot; id=&quot;Play-Video&quot;&gt;Play Video&lt;/h2&gt;
&lt;pre class=&quot;code CodeMirror&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;/span&gt;&lt;span class=&quot;lineNumber CodeMirror-gutters&quot;&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;CodeMirror-linenumber&quot;&gt;12&lt;/span&gt;&lt;/span&gt;&lt;code class=&quot;python&quot;&gt;cap = cv2.VideoCapture(&amp;quot;v4l2src device=/dev/video0 ! appsink&amp;quot;)

while True:
  ret, image = cap.read()
  if ret == True:
    print(&amp;quot;capture not working&amp;quot;)
    break
    
  key = cv2.waitKey(1)
  if (key &amp;amp; 0xFF) == ord(&amp;#39;q&amp;#39;):
    break
    
&lt;/code&gt;&lt;/pre&gt;
&lt;/body&gt;
              &lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/889058694489106729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2018/06/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/889058694489106729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/889058694489106729'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2018/06/blog-post.html' title='OpenCV V4l2 using Gstreamer'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-6503743978026388900</id><published>2018-06-22T06:55:00.000-07:00</published><updated>2018-06-22T06:55:13.324-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="add ubuntu repository"/><category scheme="http://www.blogger.com/atom/ns#" term="add ubuntu repository key"/><category scheme="http://www.blogger.com/atom/ns#" term="apt-get add repository"/><category scheme="http://www.blogger.com/atom/ns#" term="install packages from ubuntu repository"/><title type='text'>How to add get keys for ubuntu repo in another distribution</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;pl-s&quot;&gt;add&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;deb [trusted=yes] http://archive.ubuntu.com/ubuntu trusty universe&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;to /etc/apt/sources.list&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s&quot;&gt;do apt-get update&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;pl-s&quot;&gt;It will complain about non existing public key. Take not of the PUB_KEY and now execute following,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;&lt;span class=&quot;pl-s&quot;&gt;apt-key adv --keyserver keyserver.ubuntu.com --recv-keys &amp;lt;&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-s&quot;&gt;PUB_KEY&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-s&quot;&gt;This should add the key for the said repository.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-s&quot;&gt;Now you can execute following at it should work without any errors.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-s&quot;&gt;sudo apt-get update &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/6503743978026388900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2018/06/how-to-add-get-keys-for-ubuntu-repo-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/6503743978026388900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/6503743978026388900'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2018/06/how-to-add-get-keys-for-ubuntu-repo-in.html' title='How to add get keys for ubuntu repo in another distribution'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-7265998612440312408</id><published>2015-12-19T05:13:00.000-08:00</published><updated>2015-12-19T05:13:45.223-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Canon"/><category scheme="http://www.blogger.com/atom/ns#" term="Chat"/><category scheme="http://www.blogger.com/atom/ns#" term="Digital Camera"/><category scheme="http://www.blogger.com/atom/ns#" term="DSLR"/><category scheme="http://www.blogger.com/atom/ns#" term="EOS"/><category scheme="http://www.blogger.com/atom/ns#" term="free"/><category scheme="http://www.blogger.com/atom/ns#" term="gphoto"/><category scheme="http://www.blogger.com/atom/ns#" term="gphoto2"/><category scheme="http://www.blogger.com/atom/ns#" term="gTalk"/><category scheme="http://www.blogger.com/atom/ns#" term="Nikon"/><category scheme="http://www.blogger.com/atom/ns#" term="opensource"/><category scheme="http://www.blogger.com/atom/ns#" term="Skype"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Video"/><category scheme="http://www.blogger.com/atom/ns#" term="vlc"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Cam"/><category scheme="http://www.blogger.com/atom/ns#" term="WebCam"/><title type='text'>Use your DSLR Camera as a Webcam on Ubuntu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
It is not uncommon that you have a DSLR and you wonder that it would be awesome if you can use it as a webcam. Have video calls with your family and friends using your high definition DSLR camera. Recording videos directly from your DSLR camera into your computer or us it for live view.&lt;br /&gt;
&lt;br /&gt;
I was trying to do the same thing and searched over the internet, found some software that can do that but are not free and/or won&#39;t work on my Linux machine.&lt;br /&gt;
&lt;br /&gt;
But recently found another way of achieving it. Basically making my DSLR work as a capture device, that is /dev/video*.&lt;br /&gt;
&lt;br /&gt;
To do that you need a utility named gphoto2. First you have to check whether your camera is in the supported list of cameras, For that go through the list of supported cameras &lt;a href=&quot;http://gphoto.sourceforge.net/proj/libgphoto2/support.php&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I have a Canon EOS 100D, which is in the list, so it works for me.&lt;br /&gt;
&lt;br /&gt;
Now attach your camera with your machine using the USB cable, and execute the following command in the terminal (linux shell).&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;gphoto2 --abilities&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
This should show you the camera name and abilities and other information, this shows that your camera is detected.&lt;br /&gt;
&lt;br /&gt;
Now to the next step,&lt;br /&gt;
&lt;br /&gt;
You need &quot;v4l2loopback kernel module&quot; to make a virtual device in /dev/video* for your camera. This can be installed by executing the following command,&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;sudo apt-get install v4l2loopback-utils&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
If all goes without any error, you can execute the following command to make a virtual camera device for your DSLR connect to the machine.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;modprobe v4l2loopback&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;gphoto2 --capture-movie --stdout | gst-launch-0.10 videotestsrc ! v4l2sink device=/dev/video1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Now you can use this new device /dev/video1 as your webcam.&lt;br /&gt;
&lt;br /&gt;
For Example you can configure Skype to use this as a Video device for video calls.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/7265998612440312408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2015/12/use-your-dslr-camera-work-as-webcam-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/7265998612440312408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/7265998612440312408'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2015/12/use-your-dslr-camera-work-as-webcam-on.html' title='Use your DSLR Camera as a Webcam on Ubuntu'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-1054605730290830259</id><published>2015-11-30T09:47:00.000-08:00</published><updated>2015-11-30T09:47:47.610-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="14.04LTS"/><category scheme="http://www.blogger.com/atom/ns#" term="Chrome"/><category scheme="http://www.blogger.com/atom/ns#" term="Font"/><category scheme="http://www.blogger.com/atom/ns#" term="Nafees"/><category scheme="http://www.blogger.com/atom/ns#" term="Text"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="Urdu"/><title type='text'>Fix Urdu font rendering in Chrome in ubuntu 14.04</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
You might have faced a problem in Ubuntu using chrome when you visit a website that has text in Urdu and it doesn&#39;t render properly. Mostly the letter &quot;&lt;span style=&quot;background-color: white; color: #141823; font-family: helvetica, arial, sans-serif; font-size: 12px; line-height: 16px; text-align: right; white-space: pre-wrap;&quot;&gt;ے&lt;/span&gt;&quot; is not rendered and connected correctly with other letters.&lt;br /&gt;
&lt;br /&gt;
Now font rendering is a very complex process which involves (but not limited to) positioning (pen algorithm), layout and Bidirectional text processing. The problem mentioned above is related to layout and seems like some layout information in the font being used is wrong or missing.&lt;br /&gt;
&lt;br /&gt;
Now this is very annoying and becomes very difficult, and sometimes you even feel like that you are deciphering an encoded text by analysing the broken Urdu text.&lt;br /&gt;
&lt;br /&gt;
This can be easily fixed by first installing a proper Urdu font by executing the following command,&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;sudo apt-get install fonts-nafees&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #45818e;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
After installing this you have to change the standard font in your browser. Ubuntu by default uses the font &quot;&lt;span style=&quot;color: #45818e;&quot;&gt;Abyssinica SIL&quot;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
To change the font go to Chrome settings, in settings search field search for &quot;&lt;span style=&quot;color: #45818e;&quot;&gt;Web Content&lt;/span&gt;&quot; and client on &quot;&lt;span style=&quot;color: #45818e;&quot;&gt;Customize Fonts&lt;/span&gt;&quot;.&lt;br /&gt;
&lt;br /&gt;
Now change the Standard font to &quot;&lt;span style=&quot;color: #45818e;&quot;&gt;Nafees&lt;/span&gt;&quot;. This &amp;nbsp;should correct the rendering of Urdu text in chrome.&lt;br /&gt;
&lt;br /&gt;
This problem only occurs in the websites which do not explicitly specify the font that they want to use.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/1054605730290830259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2015/11/fix-urdu-font-rendering-in-chrome-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/1054605730290830259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/1054605730290830259'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2015/11/fix-urdu-font-rendering-in-chrome-in.html' title='Fix Urdu font rendering in Chrome in ubuntu 14.04'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-105530947212225783</id><published>2009-07-05T23:18:00.000-07:00</published><updated>2009-07-06T23:51:49.895-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EXC_BAD_ACCESS"/><category scheme="http://www.blogger.com/atom/ns#" term="iphone crash log"/><category scheme="http://www.blogger.com/atom/ns#" term="stack trace"/><category scheme="http://www.blogger.com/atom/ns#" term="symbolicatescrash"/><category scheme="http://www.blogger.com/atom/ns#" term="symbols in crash log"/><title type='text'>Crash Log Symbols</title><content type='html'>A few days ago my application got rejected from AppStore :(&lt;br /&gt;&lt;br /&gt;What they sent me was a crash log. It had a bad access exception and stack traces of a couple of threads. But the poor thing about all this was that there were no symbols in the stack traces. There were only addresses of the methods :S&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I google&#39;d this problem alot and found that there is a script named &lt;span style=&quot;font-weight: bold;&quot;&gt;symbolicatecrash&lt;/span&gt; at this path:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/Resources/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have the .dSYM and .app file of the build you sent to Apple, you can use these two files two generate the symbols in the crashlogs.&lt;br /&gt;&lt;br /&gt;Fortunately I had those files and I used that script but the result was that only iPhone classes were symbolicated.&lt;br /&gt;&lt;br /&gt;I google&#39;d the problem again and found that there is something wrong with the script. By some searching on the internet i was able to find the correct script. Its in perl language.&lt;br /&gt;&lt;br /&gt;using that script i was successfully able to generate symbols of the crash logs.&lt;br /&gt;&lt;br /&gt;You can do it like this (Assume your application name is pingpong):&lt;br /&gt;&lt;br /&gt;1. Copy the .dSYM , .app , the perl script in any folder.&lt;br /&gt;2. open terminal and go to that folder.&lt;br /&gt;3. Execute command:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;perl symbolicatecrash.pl pingpong.crash pingpong.dSYM pingpong.app &gt; sym_pingpong.crash&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After the successful execution of this command your symbolicated crash log will be &lt;span style=&quot;font-weight: bold;&quot;&gt;sym_pingpong.crash&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can get the script from this link:&lt;br /&gt;&lt;br /&gt;&lt;a href=http://gist.github.com/131425 &gt;http://gist.github.com/131425&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sami</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/105530947212225783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2009/07/crash-log-symbols.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/105530947212225783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/105530947212225783'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2009/07/crash-log-symbols.html' title='Crash Log Symbols'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-6628491219458875835</id><published>2009-06-14T20:53:00.000-07:00</published><updated>2009-11-05T04:37:54.395-08:00</updated><title type='text'>How to write your Operating System</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;I was just thinking of sharing my experience of Operating System implementation. So here it is. here i will tell you the steps to implement your Operating System from scratch.&lt;br /&gt;&lt;br /&gt;It will be a small kernel implementation. It will boot and you can run small programs on it. This kernel will run on intel x86 machine.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Tools:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;. DJGPP compiler.&lt;br /&gt;. Virtual machine, I will use Bochs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;MainProgram:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;we will start from a main function. This function will be called when our operating system starts.&lt;br /&gt;In this function you will disable interrupts.&lt;br /&gt;In this function you will initialize the PIC to make first IRQ aligned with int 30 so that it does not mix up with int 1,2 and onwards.&lt;br /&gt;&lt;br /&gt;now you are setup. you can check and execute any helloworld programs here.&lt;br /&gt;&lt;br /&gt;you are ready to move to the next steps.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Memory Initialization&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;When you boot using the grub loader you will be given the start and end address of your kernel.&lt;br /&gt;Now here you have to implement the memory management. first you have to mark all the memory frames as not used. you will use 1 bit per each frame. Allocate byte array equal to:&lt;br /&gt;&lt;br /&gt;size = memory /(4096*8)&lt;br /&gt;&lt;br /&gt;where 4096 is page size.&lt;br /&gt;&lt;br /&gt;This is your frame state array. initialize it with 0 which means all your memory is free. Now mark the frames that fall in your kernel start and end address equal to one to keep record that these frames are already used.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;to be continued..&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/6628491219458875835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2009/06/how-to-write-your-operating-system.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/6628491219458875835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/6628491219458875835'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2009/06/how-to-write-your-operating-system.html' title='How to write your Operating System'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-6524592160466188088</id><published>2009-06-10T05:18:00.000-07:00</published><updated>2009-06-10T05:38:07.292-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Memory warning"/><category scheme="http://www.blogger.com/atom/ns#" term="multiple times"/><category scheme="http://www.blogger.com/atom/ns#" term="UIViewController"/><category scheme="http://www.blogger.com/atom/ns#" term="ViewDidLoad called"/><title type='text'>UIViewController ViewDidLoad</title><content type='html'>I just wanted to share my experience with UIViewController ViewDidLoad method in iPhone SDK.&lt;br /&gt;&lt;br /&gt;Most of the people including me(used to) think that the UIViewController ViewDidLoad method is called only once when the Controller object is created and added in the Super View (or given a tag etc). But what i experienced that this method might get called multiple times. Sorry to disappoint you.&lt;br /&gt;&lt;br /&gt;When &lt;span style=&quot;font-weight:bold;&quot;&gt;ViewDidLoad&lt;/span&gt; method of your &lt;span style=&quot;font-weight:bold;&quot;&gt;UIViewController&lt;/span&gt; is called, it renders your view and saves a copy of it in iPhone cache. This cached view is not removed from cache even you remove your view from the super view. So when you display this view again, it does not call  ViewDidLoad of your UIViewController.&lt;br /&gt;&lt;br /&gt;As you know that there is &lt;span style=&quot;font-weight:bold;&quot;&gt;didReceiveMemoryWarning&lt;/span&gt; method in a UIViewController. When the iPhone gets low in memory it calls this function of the view that is having largest amount of memory. And if you have called the same function of the super class like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;[super didReceiveMemoryWarning];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then your rendered view will be removed from the iPhone cache. &lt;br /&gt;So before your view will appear on the iPhone screen next time, its ViewDidLoad will be called again to render it.&lt;br /&gt;&lt;br /&gt;So you should avoid doing all your initialization and important stuff in the ViewDidLoad otherwise you will have problems in the above mentioned scenario.&lt;br /&gt;&lt;br /&gt;I hope this post helps you during your iPhone development.</content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/6524592160466188088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2009/06/uiviewcontroller-viewdidload.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/6524592160466188088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/6524592160466188088'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2009/06/uiviewcontroller-viewdidload.html' title='UIViewController ViewDidLoad'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3884748094508152833.post-7046691829138635065</id><published>2009-06-07T09:47:00.000-07:00</published><updated>2009-06-07T10:30:27.347-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crash"/><category scheme="http://www.blogger.com/atom/ns#" term="iPhone"/><category scheme="http://www.blogger.com/atom/ns#" term="iPod touch"/><category scheme="http://www.blogger.com/atom/ns#" term="memory"/><category scheme="http://www.blogger.com/atom/ns#" term="warning"/><title type='text'>iPhone Application Memory Management Tips</title><content type='html'>&lt;meta equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;&gt;&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 11&quot;&gt;&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; latentstylecount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:&quot;&quot;; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-fareast-font-family:&quot;Times New Roman&quot;;} span.string 	{mso-style-name:string;} span.keyword 	{mso-style-name:keyword;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:578447081; 	mso-list-type:hybrid; 	mso-list-template-ids:-1541488216 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 	{mso-level-tab-stop:1.25in; 	mso-level-number-position:left; 	margin-left:1.25in; 	text-indent:-.25in;} @list l1 	{mso-list-id:1087455488; 	mso-list-type:hybrid; 	mso-list-template-ids:387464642 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l1:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in; 	font-family:Symbol;} @list l2 	{mso-list-id:1518540532; 	mso-list-type:hybrid; 	mso-list-template-ids:-1728963196 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l2:level1 	{mso-level-number-format:bullet; 	mso-level-text:; 	mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in; 	font-family:Symbol;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:&quot;Table Normal&quot;; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:&quot;&quot;; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:&quot;Times New Roman&quot;; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;Hi,&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;This part of my blog is dedicated to the memory management tips for iPhone application development. In this article I have tried to explain the things I have learnt during my iPhone application development. Any update or comment is highly appreciated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;First of all we start with the simple and most common question,&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;“&lt;b style=&quot;&quot;&gt;How much memory an iPhone application can allocate?&lt;/b&gt;”&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;There is no exact answer to this question because the memory an iPhone application can allocate entirely depend on the current memory state of the iPhone. The most common scenarios are as follows:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ul style=&quot;margin-top: 0in;&quot; type=&quot;disc&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;If you have just restarted your iPhone i.e. it’s      a fresh reboot then you will be able to allocate approximately 35-40 MB      before you receive the memory warning.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;Installing an application in your iPhone through      Xcode is a big task and it takes a lot of memory. So after installing the      application on the device It is more likely to happen that you will not be      able to allocate memory more then 20-25 MB.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;The amount of memory you can allocate also depends      on the background processes currently running. And if there are memory      leaks or extensive object allocation in those processes then your      application will not be able to get much memory.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;So the lesson we have learnt so far from the previous question is that we have to build our application with as much memory optimization as we can. To do this you can follow the following tips.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;Resources:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;By resources I mean the images, Nibs, Web pages and sounds etc. As you load a resource in your iPhone application, iPhone caches that resource in the memory so that next time it loads quickly. So if you have big resource files and you are loading them frequently then what happens is that these pile up in the memory and become the reason of your application crash.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family:Symbol;&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;Avoid use of imageNamed: &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;For images&lt;b style=&quot;&quot;&gt; &lt;/b&gt;we mostly use the &lt;b style=&quot;&quot;&gt;imageNamed:&lt;/b&gt; message to load the image. I agree that its very easy to use but what when you load your image using the &lt;b style=&quot;&quot;&gt;imageNamed: &lt;/b&gt;message, the iPhone caches that image into the memory. So you should only use this message in specific scenarios when you really need image caching, Otherwise you can use the following method to load the image.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;-(UIImage *) myImageLoader:(NSString *) filename&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;                       &lt;/span&gt;NSString *imageFile = [[NSString alloc] initWithFormat:@&lt;span class=&quot;string&quot;&gt;&quot;%@/%@&quot;&lt;/span&gt;,  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;[[NSBundle mainBundle] resourcePath], filename];  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;UIImage *image = nil;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;image = [[[UIImage alloc] initWithContentsOfFile:imageFile] autorelease];  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;[imageFile release];  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in; text-indent: 0.25in;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt; image;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;You can use this method in the same way you use &lt;b style=&quot;&quot;&gt;ImageNamed:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt; &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family:Symbol;&quot;&gt;&lt;span style=&quot;&quot;&gt;·&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;Nibs: &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;When you create a view using the interface builder and load that nib using a UIViewController sub class, all the objects in that view are loaded and all the resources associated to that view are loaded. When you add this view to superView, the retain count of this view is incremented. And when this view is removed from its superView then this view is released and all the objects in it are also released.&lt;b style=&quot;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;When you bind an object in your code with the object in the Nib (using IBOutlet), then it becomes your responsibility to make sure that the object you have binded is released when your view is released. To do this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 1.25in; text-indent: -0.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;1.&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;If you have not defined this IBOutlet as property and have not synthesized it then you have to release this object in the dealloc of your ViewController. Otherwise this object will remain in the memory when your view is removed from the superview.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 1.25in; text-indent: -0.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;2.&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;If you have defined this IBOutlet as a property using &lt;b style=&quot;&quot;&gt;assign &lt;/b&gt;then you have to synthesize it also. Now this object will be automatically released when your view is removed from superview.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 1.25in; text-indent: -0.25in;&quot;&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;3.&lt;span style=&quot;;font-family:&amp;quot;;font-size:7;&quot;  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;If you have defined this IBOutlet as a property using &lt;b style=&quot;&quot;&gt;retain &lt;/b&gt;then you have to synthesize it also and release it in &lt;b style=&quot;&quot;&gt;dealloc&lt;/b&gt; of your ViewController. Now this object will be released when your view is removed from superview.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 1.25in; text-indent: -0.25in;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;                        &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;Static Messages:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;In iphone SDK you find static methods with some classes to create an instance of that class. For Example:&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;[NSString stringWithString:@”Hello Sami”]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;                                                                                                                               &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;[UIImage imageNamed:@”tom.png”]&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;span style=&quot;&quot;&gt;            &lt;/span&gt;When you create an object using these static messages, The object is added in the autorelease pool that is created in the main() function of your application. Using these static functions to create the objects is not reliable because most of the objects remain in that autorelease pool until your application terminates.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;I hope you find this post interesting and of use. I will post more information on this topic soon.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family:Arial;&quot;&gt;Samiullah&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.skhawaja.com/feeds/7046691829138635065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.skhawaja.com/2009/06/iphone-application-memory-management.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/7046691829138635065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3884748094508152833/posts/default/7046691829138635065'/><link rel='alternate' type='text/html' href='http://blog.skhawaja.com/2009/06/iphone-application-memory-management.html' title='iPhone Application Memory Management Tips'/><author><name>Samiullah Khawaja</name><uri>http://www.blogger.com/profile/03557469709623586432</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNbEanQ8mVREUoywOvwJUPhawxNuv0G0Qo_3zGlzSFg7L-VD-Kb0lxPOFfQfHlGbQ01jFPk4p7n-qRBxMDjm_jDu9szJqPoIPjbT5isYRjPylVQ4eck4MGjjRgopPeQ/s220/IMG_0547_crop.JPG'/></author><thr:total>2</thr:total></entry></feed>