--- layout: page title: "Photon: A simple light follower" subtitle: "A beginners guide to build a light follower." date: 2018-03-21 background: "/img/Photon/photon.jpg" categories: robots ---
This article was contibuted by C.V.Hariharan
Photon is a simple creature. It follows light, imitating insects. Photon is based on a 555 timer chip circuit for a light activated switch, that was later modified. This is mostly a visual guide to build Photon that anyone can follow, even if they have never built a circuit before. Let's get started!
The materials required to build Photon are easily available.
Insert the chips as shown in the figure. There will be a small notch on the IC. Make sure the the notches face forward if you are going to use the layout specified in the images. Connect pins 8 and 4 on both the chips. Connect 6 and 2 together on both the chips.
Connect pin 1 to the negative rail on the breadboard. Connect pin 8 to the positive rail on the breadboard. Do the same with the second chip.
Now comes the tricky part. Connect a 10k (brown, black and orange) resistor between the pins 8 and 6. Connect another 10k resistor between the pins 7 and 6. Do the same with the next chip.
Now connect 0.01uf capacitors between pins 1 and 5 on both the chips.
Our bot uses LDRs to detect light. These are light dependent resistors, their resistance changes according the intensity of light incident on them. Connect the LDRs between pins 1 and 2 on both the chips. LDRs do not have polarity.
Connect the motors between pin 3 and the negative rail on the breadboard. Do the same with the second chip and VOILA! You have made your very first light follower! Check the direction of rotation of the motors and change the motor connections if neccesary to achieve a "towards light" motion. Assemble the bot such that the LDR and the motor it is connected to are diagonal. Connect the power supply, in this case a 9v battery, to the positive and negative rails of the breadboard. Connect the black wire (negative terminal) to the negative rail and the red wire (positive terminal) to the positive rail on the breadboard.
Originally posted on Instructables by C.V.Hariharan


2nd edition
8:30 AM
Registration
9:00 AM
Key Note
9:15 AM
Project Management, is it an Art or Science?
Ganesh Kandasamy
10:15 AM
Coffee Break
10:30 AM
How an XD and a BA managed running a critical project playing four roles
Archana & Kavitha
11:30 AM
How to breakdown policies in public space as an analyst
Pranjal Dube
12:30 PM
Networking Lunch
*Subject to change
A graduate from BITS Pilani, Ganesh has 17 years of industry experience. He specialises in providing Technology solutions to Business Problems and help achieve Business growth
An MBA from Great Lakes Institute of Management, Pranjal has close to 3 years of experience in Thoughtworks as a Business Analyst. He is also a policy wonk.
Archie has been with ThoughtWorks for 5.5 years now, playing various roles such as Business Analyst, Project Manager and Product Owner. She is Masters of Business and IT graduate from the University of Melbourne.
Kavitha is a Product owner and XD at TW with 9 years of experience in designing services, products & applications. Being an architect in her past life, she loves geometric shapes and forms which is often reflected in her simple solutions to complex problems.


Instructor:Xuebin Wei
Websitelbsocial
| date | content |
|---|---|
| week1 | Intro to AWS and cloud computing |
| week2 | Networking and compute |
| week3 | Security and management |
| week4 | Storage and databases |
| week5 | Data analytics and visualization |
| week6 | Machine learning and AI |
| week7 | Serverless computing |


--- layout: post title: "Boost, RSS Feeds, and Google Reader" date: 2011-09-19 22:30:27 +0000 permalink: /2011/09/19/boost-rss-feeds-and-google-reader/ category: Drupal tags: - Drupal - RSS - Boost redirect_from: - /blog/boost-rss-feeds-and-google-reader/ ---
For a while now, I've struggled with an issue on this site. Google Reader would sometimes show items that had already been displayed in the reader. They would be shown as new unread items, regardless of whether the "original" copy of that item had been read. I'm sure this irritated many readers, and I tried several times to fix the issue.
I set up a cron job to pull a copy of my RSS feed regularly and save copies. I figured I could see if anything changed between versions. At first, the differing versions showed no significant changes. (Other than new posts where expected.)
At one point, I got a clue from a fellow ALE-NW organizer that the feed was showing duplicate items. Looking at the view that generated the feed, I realized each tag was causing a duplicate entry. I deleted the offending relationship, and the number of entries got better. I figured I had the Google Reader issue fixed.
This weekend, it sprung its head again -- duplicate entries! I looked back at my cron-based RSS archive and discovered that there were differences in some of the files!
The first file contained: <guid ispermalink="false">149 at https://systemoverlord.com</guid>
.
Another file contained: <guid ispermalink="false">149 at http://tuxteam.com</guid>
.
I realized, as I read the differences, that Drupal bases its "base URL" on the URL that is used to access the site. (I used to use tuxteam.com.) This isn't normally a problem, because the RSS reader would be accessing it via the same domain every time, but once you're running Boost, you can get different domains from the cached copies of the files! So, if the cached RSS feed expires and Boost builds a new one on an access from tuxteam.com, the subsequent systemoverlord.com access by Google Reader returns a feed with tuxteam.com-based URLs. These guids are different, and so Google Reader believes they're different articles!
I've now set $base_url = 'http://systemoverlord.com';
in my settings.php. I believe this should finally, permanently, put the duplicate item bug to rest.


👋 Welcome!
Taask Core is an open source system for running arbitrary jobs on any infrastructure. In other words, cloud native tasks-as-a-service
.
What does Taask Core do?
- ✅ Runs arbitrary workloads (tasks) written in any language
- ✅ Runs those tasks in a fault tolerant way
- ✅ Operates with no single point of failure
- ✅ Operates on any infrastructure
- ✅ Keeps task data encrypted, end to end
What doesn’t it do?
- 🚫 Act as a message bus
- 🚫 Replace Kubernetes
- 🚫 Orchestrate servers
Project status
⚠ Taask is in Alpha (v0.0.4) and should not be used for critical workloads


  But ye did think that Allah knew not many of the things that ye used to do! |
Concepts/Themes Covered: أركان الإسلام > التوحيد > الكافرون > صفات الكفار Pillars of Islam> Islamic> The Disbelievers> The Characteristics of the Disbelievers الإيمان > اليوم الآخر > شهادة الأعضاء Faith> The Hereafter> The Organs' Testimony
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


Members generally meet informally at the club track every Sunday morning throughout the year and on Wednesday evenings (from 7pm) between May and September at our club track site in the Ridgeway Park, Chingford.
The track meetings are informal and include general maintenance of the site track and rolling stock and members running their own or club Locomotives. We also have B.B.Q’s and special running evenings.
As we need qualified drivers to operate the Locomotives on our public running days, Wednesday Evenings are also used for Driver Training.
From September to May our Wednesday Night meetings are held at St. Edmunds Church Hall, Larkswood Road, Chingford, from 7.30pm until 9pm. These meetings are slightly more formal, with film shows, lectures, demonstrations and discussions on a wide variety of subjects.
Dates the Railway will be running
For members to access there email
See current and upcoming events


18-24 February
This week will involve more work on the
knedv.ru website, to fill up the realty catalogue, enable the search via synchronising
MongoDB with
ElasticSearch and building and documenting the admin front-end. There is a plan to start the
contexttesting.com website and write articles describing how to use
Zoroaster for context testing.
18 Monday
Today I've spent some time on testing the new
Splendid components that were translated from RegExp rules with
Zoroaster. This required an update to the latter as well to pass the mask properties not only to fork configurators (as last week), but to all constructors, including
getResults,
getTransform and others. This was needed to set the
page properties on the test to enable rendering of the
<PageTitle> component that accessed
splendid.page property, so that when set within the mask result and not the mask itself, tests become much more flexible since the input properties can be controlled from each test case rather than the mask constructor.
export default makeTestSuite('test/result/components/index.html', {
getTransform() {
const { page } = this
const comps = getRules(Components)
const rs = new Replaceable(comps)
rs.splendid = { config: { pretty: true }, page },
rs.cache = {}
return rs
},
jsonProps: ['page'],
})
<PageTitle />
{ "title": "Page" }
<title>Page</title>
I've also tested the
<File> component with
TempContext which wrote the specified file into the
test/temp directory and read it at the end of the test to make sure that the file is correctly copied. Meanwhile, I worked on the
zavr.co.uk website to catch up with the writing for the previous week. I've been sloppy on blogging last week however it's become really important to see what I've done rather than to just allow work to silently accumulated. It also helps to accumulate new use-cases and features for
Splendid.


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Posting Comments
In order to post comments to stories, you will have to
create an account.
Accounts will generally be validated within 24 hours, and of
course will be disabled if there is abuse.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Rate My Poo
Rate My Kitten
Rate My Finger
Penny Postcards
Phallic
Boners
Home
Make Dailyrotten your start page
|
|
|
September 26, 2002
Sara Conner? No? Mary Morris? Close enough
ABC News | Submitted by: matt
"The victims' families fear that the fact that both women were named
Mary Morris may have sealed their fates. Though police say they have no
evidence to support the theory, the families are speculating that a
sloppy hit man hired to kill one of them may have initially
killed the wrong woman."
|
|
Read article...
|
|
Hey, didn't I see Grandma at the rave last Friday?
Canadian Press | Submitted by: Gorg
"Prison officials have suspended use of a high-tech drug detection machine
after it found speed and ecstacy residues on a woman in her 80s who wanted to
visit her inmate grandson. Patricia Lockhart, assistant warden at William
Head Institution, said Wednesday the medium-security prison's ion scanner
itemizer will be shut down until it is inspected by its Manitoba-based
manufacturer."
|
|
Read article...
|
|
Teen starved, sent off to wander
NEPA News | Submitted by: D'Bryn
"A Pennsylvania teen who authorities said was being starved by his mother
and stepfather died Wednesday, four days after he was found wandering a
Florida town weighing just 62 pounds. Chester Lee Miller, 18, told police
his stepfather in Hazleton, Pa., had put him on a bus to Florida and told
him to go look for his real dad."
|
|
Read article... and
This article...
|
|
Woman in labour catches fire
Sydney Morning Herald | Submitted by: Ross
"The woman was having a caesarean delivery in Waitakere Hospital in west
Auckland last month when an electric cauterising machine ignited vapour
from an alcohol-based solution, which had collected under a medical drape.
Theatre staff used water to extinguish the fire, but not before the woman
suffered third degree burns. Her baby was delivered safely."
|
|
Read article...
|
|
Man suicides by venomous snakes
KFOX-TV 14 El Paso | Submitted by: Boat6float
What do you do when you are depressed and have lots of dangerous animals?
Well as one man did, he let his pets do the work for him, He "let the snakes
loose and allowed the venomous ones to bite him, including a rattlesnake
and two cobras." Try for dramatic.
|
|
Read article...
|
|
Man builds U-Boat in garage
Halifax Daily News | Submitted by: Gorg
"A Fall River man who spent more than two decades building a working model
of a Second World War German U-boat has left the amazing vessel to the navy’s
submarine school. Harold Eckhardt died of a heart attack July 3 at 71. But
after being diagnosed with kidney cancer in 1981, he took up a project that
would keep him alive for another 21 years."
|
|
Read article...
|
|
State at fault for Hiker ineptness
The Hawaii Channel | Submitted by: HawaiianAtheist
While the state has been deemed liable for the deaths of 4 hikers and the
injuries of 27 of the hikers, it should be noted that one piece of crucial
edvidence was a kid mentioning a sign at the head of the trail caught on
videotape. The "Man Recalls Sacred Falls Tragedy" link at the bottom of
the story attest to this.
|
|
Read article...
|
|
Man uses stun gun to discipline child
Houston Chronicle | Submitted by: AllNeonLike
"Child welfare officials removed the boy and three other children from
Moody's home near this Brazoria County town after learning that he had been
disciplining the boy with the battery-powered device... District Attorney
Jeri Yenne, who tested the device on herself to understand what the boy
felt, said she is awaiting the outcome of an investigation before
deciding whether to file charges."
|
|
Read article...
|
|
Woman fights back over 18 cent lawsuit, wins
Seattle Times | Submitted by: lyxxdevil
"Though the collection agency's single-page lawsuit showed she owed
$0.00 for the bounced check, ACS now was claiming she owed 18 cents
interest because the money order arrived a day or two past the
deadline. Not only that, the lawsuit said she owed $311.26 in attorney's
fees and other charges... "When I saw I was being sued for 18 cents,
I was outraged. Then I realized they wanted an additional $311. I said,
you've got to be kidding me. At that point, I knew there was no
stopping this train." She won $500 plus $7600 attorney costs.
|
|
Read article...
|
|
Surprise package
WOKR-TV 13 Rochester | Submitted by: Captain Prozac
With all the negative press involving religious leaders, it is good to see
this Reverend has the balls to go public with his...well, balls:
"For years, the Rev. Kenneth Fox ran the Open Door Mission, feeding the
hungry and sheltering them from the cold. On Wednesday, Fox shared more
personal news with the community. Rev. Fox is now living his life as a woman
with the legal name of Kaye Stockton Fox."
|
|
Read article...
|
|
Alien overlords on trial
Court TV | Submitted by: Son of Benway
"Henning, who has said she believes that the U.S. and other world
governments are run by puppets controlled by reptilian-alien masters,
was indicted by a grand jury on 20 counts, including first-degree
murder, kidnapping, tampering with evidence and perjury... "It's a
fascinating story. It's a bizarre story with alien queens and other
sensational elements," said Mark Horner, an Albuquerque television
news reporter who became so immersed in the case that he created
an Internet site about it."
|
|
Read article...
|
|
Spain mulls poo tax repeal
New Jersey Online | Submitted by: Son of Benway
"Opposition lawmakers called on Spain's government Wednesday to stop
taxing diapers at 16 percent, the same rate as cigarettes and alcohol...
Federation President Jose Ramon Losana, who estimates his 12 children
have gone through 84,000 diapers, says big families should be rewarded
for stimulating the economy. "When kids use diapers, they are generating
gross domestic product."
|
|
Read article...
|
|
Pennsylvania cons were lab rats
Wire Services | Submitted by: Son of Benway
"Many of the tests were harmless, but at city hearings conducted earlier
this year, one former prisoner said his hands and feet swelled grotesquely.
Others said they lost feeling in limbs or had bad reactions to psychotropic
drugs... "Some of the people were tested with LSD. Some were tested with
dioxin. They didn't know what they were getting into," said the attorney
for the prisoners, Thomas Nocella."
|
|
Read article...
|
|
Dog sodomy follow-up
Tucson Citizen | Submitted by: Son of Benway
A 14-year-old boy was arrested on a felony animal cruelty charge yesterday
in connection with the mutilation of a blind poodle last week... Prince, a 7
year old toy poodle, was found Friday bleeding on the floor of his owner's
home at Davis-Monthan Air Force Base. The dog was euthanized because the
sodomy caused damage to his anus and internal organs."
Heart-wrenching photo of victim.
|
|
Read article...
|
|
Uptight in New Brunswick
Canadian Press | Submitted by: Son of Benway
"Moosehead was left holding about 100,000 colourful, beach-scene
brochures after the head of the liquor corporation, Barbara Winsor,
said they were too risque and banned them from corporation outlets.
Winsor bluntly told the Moncton Times and Transcript in an interview
that although the women in the promotional brochures were beautiful,
"their big boobies are hanging out."
|
|
Read article...
|
|
Hooters Air bid fails
CNN Money | Submitted by: Rufferto
"Bankrupt Vanguard Airlines rejected late Wednesday a buyout offer
for some of its assets from a group of investors headed by Robert H. Brooks,
chairman of the Hooters chain of restaurants known for their curvaceous
waitresses. Brooks had proposed to establish a new airline called Hooters Air."
|
|
Read article...
|
|
Housewives turning to raunchy comic books
Mainichi Daily News | Submitted by: LucrezaBorgia
"Firstly, you have your rape types. These aren't like guys comics,
where the woman is brutally violated.  Following that are the S&M stories.
Again, they lack the violence of men's S&M comics, and usually
focus only on soft stuff, like blindfolding or binding the hands...
Finally, you have the incest types. These are either loved or hated,
but they often tell the story of a married woman falling for
stepbrothers or brothers-in-law."
|
|
Read article...
|
|
The rabbit died
Sun | Submitted by: D. Rango
The manufacturer of the Rampant Rabbit sex toy is recalling 150,000
vibrators. "A middle-aged customer was hopping mad after her UKP 29.99
Rabbit went haywire at the crucial moment. A latex covering on the base
split and 'sensual beads' that rattle up and down inside the shaft fell out."
|
|
Read article...
|
|
Dueling Peruvians
UPI | Submitted by: Crampon
"A Peruvian congressman has challenged Vice President David Waisman to
a duel in the latest twist in the saga over whether Peru's first lady should
get involved in politics. Waisman had described Congressman Eittel Ramos'
criticisms of the first lady as "cowardly." In response, the congressman
immediately challenged him to a duel with pistols...He noted that it was his
right to choose the weapons and the location of the duel as he was the injured
party, and subsequently appointed a doctor to be his second."
|
|
Read article...
|
|
Taxicab Confessions gone terribly wrong
Toronto Sun | Submitted by: fwankie poo
"Two teenaged girls bent on terror left no doubt what they had in store
for cabbie Mahd Hawari. 'We're going to have to kill him,' Hawari remembers
one of the girls saying as they tried to slash his throat late Tuesday...
Shortly after, a police dog found the teens, age 16 and 17, hiding in a
wooded area of Mississauga's Birchwood Park."
|
|
Read article...
|
|
|
|
|


What is strawberry in Spanish?
fresa
https://loremflickr.com/320/240/strawberry
https://loremflickr.com/320/240/food
speak
What is food in Spanish?
comida
persona
What is person in Spanish?
https://loremflickr.com/320/240/manequin
-------------------------------------


Abbas Chambers, plot 27 surulere Lagos, Nigeria. Tel : +234-805-823-3576 Email<EMAIL_ADDRESS>Dear Friend, Compliments of the day, I hope that this letter will not constitute a sort of embarrasement to you. Please bear with me let me introduce myself. I am Barrister Tony Abbas, the attorney to Late Engr Alex, a National of your country, who owned a metal producing factory (Metalco Enterprise) in Nigeria and a personal friend died and left behind his deposit in a finance house (GLOBAL SECURITIES & FINANCE COMPANY) valued at $14.5Millon (Fourteen Million Five Hundred Thousand United States Dollars Only). My relationship with Engr.Alex started in 1999 when I was working with the security company as a Legal Adviser, Marina branch. We met in my social club's annual end of the year party and I introduced him to the said security company where he deposit most of his treasures some few weeks later,making me the Legal officer to the account which he operated until his unfortunate demise.On the 31st of March 2001, Engr.Alex, his wife and their two children were involved in a car accident. All occupants of the vehicle unfortunately lost their lives. After the incident i contacted Engr.Alex sister (Ms Martha Stevens) which was his beneficiary/next of kin but unfortunately before she could claim his estate she too died in September 11, 2001 terrorist attack at the world trade center in the United State Of America. See http://edition.cnn.com/SPECIALS/2001/memorial/lists/by-name/page95.html Since then I have made several enquiries to locate any of Engr.Alex extended relatives this has also proved unsuccessful. After these several unsuccessful attempts, I decided to track his last name over the Internet, to locate any member of his family or anyone related to him hence I contacted you . Since I have been unsuccessful in locating the relatives for over 2 years now I seek your consent to present you as the next of kin to the deceased so that the proceeds of this account valued at US$14.500,000 (Fourteen Million Five Hundred Thousand United States Dollars Only) can be paid to you and then you and I can sharethe money.70% to me and 30% to you.The request of a foreigner as next of kin in this business is occasioned by the fact that My client was a foreigner and a Nigerian cannot stand as a next of kin to a foreigner. I am ready to re-negotiate the mode of sharing with you.Thereafter I will visit your country for the disbursement/investing of my share according to the percentages we agreed upon.If you find this proposal suitable for you do get back to me with the following informations Your full Name and Contact Address,Your private telephone Number Your Age Your Occupation and Position. All I require is your honest cooperation to enable us see this deal through.I guarantee that this will be executed under a legitimate arrangement that will protect you from any breach of the law. Please for the sake of confidentiality send your reply to my private email<EMAIL_ADDRESS>or call +234-805-823-3576. Hoping to receive a positive response from you. Best regards, Barrister Tony Abbas.


The increase of material amounts for the next cycle of use by following the 2018 EU waste hierarchy with the preference starting from the top, namely through
preserving materials and products (extending lifetimes),
reusing products or materials (i.e. use of the same product and function by another user),
repairing products (as to maintain its original function),
repurposing products (using products or their components in a new product with different function), through
refurbishing or
remanufacturing, and
recycling of products or materials (obtaining higher or lower grade recycled materials for the same function or for inferior products (backfilling)).


Create Your Own Quiz...
|
Quizzy is an online portal for creating quizzes and distributing them.
LOGIN
✖
Username :
Password :
CANCEL
REGISTER
✖
First Name :
Last Name :
Username
*
:
Password
*
:
Email :
CANCEL
{% if success is not 'try' %}
✖
{{success}}
CANCEL
{% end %}


-    ☰
-
-
- Contact Us
- About Us
- Register
AQUARIUS SYMBOL AND RULER
Aquarius Symbol
The symbol for Aquarius is an old glyph that represents ripples of water. The fact that there is two of them speaks about waters above and waters below, representing our common and our divine natures as they communicate to one another. This is a symbol that speaks of passive dualism and the flow of communication one has with God.
Aquarius Ruler
The sign of Aquarius is ruled by Uranus in modern interpretations and is traditionally ruled by Saturn. Uranus was a primal god, called also Father sky. He was the son and husband of Gaia, Mother Earth, and the two of them were the parents of the first generation of Titans. He hated his children and was eventually overthrown by one of his sons, Cronus, who castrated him and took his place. By one version of the myth, his genitals fell into the sea, and thanks to this Venus was born, out of sea foam.
Aquarius Ruler
There are two symbols that represent Uranus and both of them are widely used. The first one is derived from the combination of symbols for Mars and the Sun. It is an astronomical glyph that is often used in astrology, and it represents drive (arrow) over a divine spirit (circle) surrounding seed of potential.
Aquarius Ruler
The second symbol is supposed to represent the letter “H” from its discoverer’s last name, Herschel. In it we can see the circle of spirit and a dominant cross of matter, in a form of an antenna that uses matter as a way to insight. Notice that the circle and the cross actually represent Venus turned upside down. On both sides on the cross there are crescents, denoting different uses of the mind, thoughts that go in two opposite directions and make us receptive to surrounding signals


Contains the tools to screen grouped variables, and select screened grouped variables afterwards. The main function grpss() can perform the grouped variables screening as well as selection for ultra-high dimensional data with group structure. The screening step is primarily used to reduce the dimensions of data so that the selection procedure can easily handle the moderate or low dimensions instead of ultra-high dimensions.
| Version: | 3.0.1 |
| Imports: | MASS, doParallel, foreach, grpreg |
| Published: | 2016-01-03 |
| Author: | Debin Qiu, Jeongyoun Ahn |
| Maintainer: | Debin Qiu <debinqiu at uga.edu> |
| License: | GPL-2 | GPL-3 |
| NeedsCompilation: | no |
| CRAN checks: | grpss results |
| Reference manual: | grpss.pdf |
| Package source: | grpss_3.0.1.tar.gz |
| Windows binaries: | r-devel: grpss_3.0.1.zip, r-release: grpss_3.0.1.zip, r-oldrel: grpss_3.0.1.zip |
| OS X binaries: | r-release: grpss_3.0.1.tgz, r-oldrel: grpss_3.0.1.tgz |
Please use the canonical form https://CRAN.R-project.org/package=grpss to link to this page.


My plan is a revamping of my blogging website complete with w wireframed plan. The page will include buttons with links to my blog posts and I will apply my improved HTML and CSS skills for a much improved presentation. Here is a link to the drawing of my wireframe.


Another article to cover a very common topic. Often questions come up like:
- What IDE can I use?
- What compilers are there?
- What <insert> is the best?
Let's start with:
Compilers:
A compiler is a command line application (in most cases) that takes your source code files and generates an executable. The methods used to do this and the resulting size/optimized executable will vary based on compiler.
A compiler does not help you write code, it's not a development environment where you can type code. It's sole purpose is to take code already written and build an executable.
No one compiler is better than any other. They all have their pros and cons. If you wish to compare compilers, please do so from the technical specifications on their own websites. In most cases, this is not going to serve you any great purpose. If optimization is your concern, your best bet is to follow standard coding techniques when developing highly optimized code.
Some common compilers are:
- MS Visual C++ Compiler (Windows) -
http://www.microsoft.com/express/vc/
- GCC (Linux) -
http://gcc.gnu.org/
- MingW (Windows) -
http://www.mingw.org/
- Intel C++ Compiler (Linux, Windows, OS X) -
http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284132.htm
- Borland C++ Compiler (Windows) -
http://www.borland.com
Integrated Development Environments (IDE)
An IDE is a full suite for software development. Typically they come bundled with a text editor, a compiler and a debugger. The text editors are the main component as they offer functionality like Syntax highlighting, project management, source-control integration etc.
An IDE is not a compiler, but most IDEs will come with one of the compilers listed in the previous section.
e.g Dev-C++ comes with MingW, Code::Blocks comes with GCC.
The complexity of IDEs will vary greatly, while some are better suited for new developers and some for advanced/professional developers.
Note: Dev-C++ is no longer recommended on their official forum. wxDev-C++ should be used instead.
Some common IDEs:
Easy to Use
wxDev-C++ (Windows) -
http://wxdsgn.sourceforge.net/
Anjuta (Linux) -
http://anjuta.sourceforge.net/
Medium
Code::Blocks (Windows/Linux) -
http://www.codeblocks.org/
MS Visual C++ Express (Windows) -
http://www.microsoft.com/express/vc/
NetBeans (All) -
http://www.netbeans.org/
KDevelop (Linux) -
http://www.kdevelop.org/
Borland C++ (Windows) -
http://www.borland.com
Difficult
Eclipse CDT (All) -
http://www.eclipse.org/
Note: You are also free to write code in any of your favorite text editors then compile it manually.
Debuggers
Debuggers are used to analyze your application while it's running. You are able to pause your application at selected points (breakpoints) and view information such as variable values etc.
Currently, there only seems to be 2 major debuggers in use.
Microsoft Visual Studio Debugger (Windows)
This is a high quality debugger. It's easy to use and integrates seemlessly into the visual studio IDE. It does have some slight problems when dealing with multiple threads, but generally works very well.
GDB (All)
This is an open source debugger often run alongside GCC/MingW. It's also a good quality debugger, but unfortunately it's multi-threaded debugger is considerably behind the visual studio equal.
Fortunately, GDB is platform independent and will integrate with numerous IDEs. Unfortunately, this integration is sometimes very difficult to work with and not intuitive.
Please post corrects/comments or questions below.
Justification for that is that Visual Studio offers more functionality. Especially when working in .NET. You can link assemblies from different languages, it has proper integrated source-control and you can use other plugins (e.g SVN). You can also have multiple projects per solution etc.
It's considerably more complicated than Dev-C++(wxDev-C++)
Eclipse (with CDT plugin).
I use this because my development is for both Windows and Linux systems. So I prefer to have an IDE I can use across multiple platforms. Eclipse also has a good plugin framework, so I am able to use the same SubVersion plugin on both my installations.
I also use it because it has other plugins I like (PHP, Database, Modelling etc)
My compiler is GCC (Linux) and Mingw(Windows). I use GDB on both platforms.
MingW is a patched version of GCC. And you'd expect the source to come with no compiler. That's typical of any application you build from source.


QDBusReply Class
The QDBusReply class stores the reply for a method call to a remote object. More...
| Header: | #include <QDBusReply> |
| qmake: | QT += dbus |
| Since: | Qt 4.2 |
Public Functions
| QDBusReply(const QDBusMessage &reply) | |
| QDBusReply(const QDBusPendingCall &pcall) | |
| QDBusReply(const QDBusPendingReply<T> &reply) | |
| QDBusReply(const QDBusError &error = QDBusError()) | |
| const QDBusError & | error() const |
| const QDBusError & | error() |
| bool | isValid() const |
| Type | value() const |
| operator Type() const | |
| QDBusReply & | operator=(const QDBusMessage &message) |
| QDBusReply & | operator=(const QDBusPendingCall &pcall) |
| QDBusReply & | operator=(const QDBusError &error) |
| QDBusReply & | operator=(const QDBusReply &other) |
Detailed Description
The QDBusReply class stores the reply for a method call to a remote object.
A QDBusReply object is a subset of the QDBusMessage object that represents a method call's reply. It contains only the first output argument or the error code and is used by QDBusInterface-derived classes to allow returning the error code as the function's return argument.
It can be used in the following manner:
QDBusReply<QString> reply = interface->call("RemoteMethod"); if (reply.isValid()) // use the returned value useValue(reply.value()); else // call failed. Show an error condition. showError(reply.error());
If the remote method call cannot fail, you can skip the error checking:
QString reply = interface->call("RemoteMethod");
However, if it does fail under those conditions, the value returned by QDBusReply::value() is a default-constructed value. It may be indistinguishable from a valid return value.
QDBusReply objects are used for remote calls that have no output arguments or return values (i.e., they have a "void" return type). Use the isValid() function to test if the reply succeeded.
See also QDBusMessage and QDBusInterface.
Member Function Documentation
QDBusReply::QDBusReply(const QDBusMessage &reply)
Automatically construct a QDBusReply object from the reply message reply, extracting the first return value from it if it is a success reply.
QDBusReply::QDBusReply(const QDBusPendingCall &pcall)
Automatically construct a QDBusReply object from the asynchronous pending call pcall. If the call isn't finished yet, QDBusReply will call QDBusPendingCall::waitForFinished(), which is a blocking operation.
If the return types patch, QDBusReply will extract the first return argument from the reply.
QDBusReply::QDBusReply(const QDBusPendingReply<T> &reply)
Constructs a QDBusReply object from the pending reply message, reply.
QDBusReply::QDBusReply(const QDBusError &error = QDBusError())
Constructs an error reply from the D-Bus error code given by error.
const QDBusError &QDBusReply::error() const
Returns the error code that was returned from the remote function call. If the remote call did not return an error (i.e., if it succeeded), then the QDBusError object that is returned will not be a valid error code (QDBusError::isValid() will return false).
See also isValid().
const QDBusError &QDBusReply::error()
This is an overloaded function.
bool QDBusReply::isValid() const
Returns true
if no error occurred; otherwise, returns false
.
See also error().
Type QDBusReply::value() const
Returns the remote function's calls return value. If the remote call returned with an error, the return value of this function is undefined and may be undistinguishable from a valid return value.
This function is not available if the remote call returns void
.
QDBusReply::operator Type() const
Returns the same as value().
This function is not available if the remote call returns void
.
QDBusReply &QDBusReply::operator=(const QDBusMessage &message)
Makes this object contain the reply specified by message message. If message is an error message, this function will copy the error code and message into this object
If message is a standard reply message and contains at least one parameter, it will be copied into this object, as long as it is of the correct type. If it's not of the same type as this QDBusError object, this function will instead set an error code indicating a type mismatch.
QDBusReply &QDBusReply::operator=(const QDBusPendingCall &pcall)
Makes this object contain the reply specified by the pending asynchronous call pcall. If the call is not finished yet, this function will call QDBusPendingCall::waitForFinished() to block until the reply arrives.
If pcall finishes with an error message, this function will copy the error code and message into this object
If pcall finished with a standard reply message and contains at least one parameter, it will be copied into this object, as long as it is of the correct type. If it's not of the same type as this QDBusError object, this function will instead set an error code indicating a type mismatch.
QDBusReply &QDBusReply::operator=(const QDBusError &error)
Sets this object to contain the error code given by error. You can later access it with error().
QDBusReply &QDBusReply::operator=(const QDBusReply &other)
Makes this object be a copy of the object other.


Petr Cech sends message to Jose Mourinho after Tottenham appointment
Chelsea legend Petr Cech has joined skipper Cesar Azpilicueta in wishing Jose Mourinho good luck in his new managerial role despite moving to London rivals Tottenham.
The Portuguese coach, who won three Premier League titles in two spells at Stamford Bridge, was officially announced as Mauricio Pochettino’s successor on Wednesday after the Argentine was axed only five months on from reaching the Champions League final.
Mourinho previously claimed he could never manage Spurs because of his ties to Chelsea, but Cech has no qualms about his former boss moving to a rival.
‘He’s a great manager,’ said the former keeper, who played under Mourinho for all three of his title wins and is now technical and performance advisor at the club.
‘Obviously it’s great for the Premier League to welcome back one of the most successful managers in the Premier League in the past 15 years. Obviously we wish him well.’
Advertisement Advertisement
Azpilicueta was similarly gracious, telling Sky Sports: ‘I can talk only when Jose was here at Chelsea with us. We won trophies, and now football moves on.
‘I wish him all the best even though he goes to a rival. I have good memories with him and I have played many times under him and against him.
‘Obviously when we play against each other we both want to win for our teams, but this is football. I wish him well.’
Mourinho took charge of his first training session as Spurs boss on Wednesday afternoon having been handed by far the biggest contract in the club’s history.
He starts his reign away at West Ham on Saturday with Tottenham ranked 14th in the Premier League table and 11 points adrift of the top four, while he will face off against Chelsea for the first time on December 22.


Tablet of Vision:
The tablet is inscribed with indecipherable hieroglyphs. The letters emit a dim light and the tablet seems to manifest strong magical powers.
Use the Stone of Commune.


fun u(): Unit
This is a test of Dokka's code blocks. Here is a blank line. The previous line was blank.


The Mock Turtle sighed deeply, and drew the back of one flapper across his
eyes. He looked at Alice, and tried to speak, but for a minute or two sobs
choked his voice. 'Same as if he had a bone in his throat,' said the
Gryphon: and it set to work shaking him and punching him in the back. At
last the Mock Turtle recovered his voice, and, with tears running down his
cheeks, he went on again:—
'You may not have lived much under the sea—' ('I haven't,' said
Alice)—'and perhaps you were never even introduced to a lobster—'
(Alice began to say 'I once tasted—' but checked herself hastily,
and said 'No, never') '—so you can have no idea what a delightful
thing a Lobster Quadrille is!'
'No, indeed,' said Alice. 'What sort of a dance is it?'
'Why,' said the Gryphon, 'you first form into a line along the sea-shore—'
'Two lines!' cried the Mock Turtle. 'Seals, turtles, salmon, and so on;
then, when you've cleared all the jelly-fish out of the way—'
'That generally takes some time,' interrupted the Gryphon.
'—you advance twice—'
'Each with a lobster as a partner!' cried the Gryphon.
'Of course,' the Mock Turtle said: 'advance twice, set to partners—'
'—change lobsters, and retire in same order,' continued the Gryphon.
'Then, you know,' the Mock Turtle went on, 'you throw the—'
'The lobsters!' shouted the Gryphon, with a bound into the air.
'—as far out to sea as you can—'
'Swim after them!' screamed the Gryphon.
'Turn a somersault in the sea!' cried the Mock Turtle, capering wildly
about.
'Change lobsters again!' yelled the Gryphon at the top of its voice.
'Back to land again, and that's all the first figure,' said the Mock
Turtle, suddenly dropping his voice; and the two creatures, who had been
jumping about like mad things all this time, sat down again very sadly and
quietly, and looked at Alice.
'It must be a very pretty dance,' said Alice timidly.
'Would you like to see a little of it?' said the Mock Turtle.
'Very much indeed,' said Alice.
'Come, let's try the first figure!' said the Mock Turtle to the Gryphon.
'We can do without lobsters, you know. Which shall sing?'
'Oh, you sing,' said the Gryphon. 'I've forgotten the words.'
So they began solemnly dancing round and round Alice, every now and then
treading on her toes when they passed too close, and waving their forepaws
to mark the time, while the Mock Turtle sang this, very slowly and sadly:—
'"Will you walk a little faster?" said a whiting to a snail.
"There's a porpoise close behind us, and he's treading on my tail."
See how eagerly the lobsters and the turtles all advance!
They are waiting on the shingle—will you come and join the dance?

"You can really have no notion how delightful it will be
When they take us up and throw us, with the lobsters, out to sea!"
But the snail replied "Too far, too far!" and gave a look askance—
Said he thanked the whiting kindly, but he would not join the dance.
Would not, could not, would not, could not, would not join the dance.
Would not, could not, would not, could not, could not join the dance.
'"What matters it how far we go?" his scaly friend replied.
"There is another shore, you know, upon the other side.
The further off from England the nearer is to France—
Then turn not pale, beloved snail, but come and join the dance.

Will you, won't you, will you, won't you, won't you join the dance?"'
'Thank you, it's a very interesting dance to watch,' said Alice, feeling
very glad that it was over at last: 'and I do so like that curious song
about the whiting!'
'Oh, as to the whiting,' said the Mock Turtle, 'they—you've seen
them, of course?'
'Yes,' said Alice, 'I've often seen them at dinn—' she checked
herself hastily.
'I don't know where Dinn may be,' said the Mock Turtle, 'but if you've
seen them so often, of course you know what they're like.'
'I believe so,' Alice replied thoughtfully. 'They have their tails in
their mouths—and they're all over crumbs.'
'You're wrong about the crumbs,' said the Mock Turtle: 'crumbs would all
wash off in the sea. But they have their tails in their mouths; and the
reason is—' here the Mock Turtle yawned and shut his eyes.—'Tell
her about the reason and all that,' he said to the Gryphon.
'The reason is,' said the Gryphon, 'that they would go with the lobsters
to the dance. So they got thrown out to sea. So they had to fall a long
way. So they got their tails fast in their mouths. So they couldn't get
them out again. That's all.'
'Thank you,' said Alice, 'it's very interesting. I never knew so much
about a whiting before.'
'I can tell you more than that, if you like,' said the Gryphon. 'Do you
know why it's called a whiting?'
'I never thought about it,' said Alice. 'Why?'
'It does the boots and shoes,' the Gryphon replied very solemnly.
Alice was thoroughly puzzled. 'Does the boots and shoes!' she repeated in
a wondering tone.
'Why, what are your shoes done with?' said the Gryphon.
Alice looked down at them, and considered a little before she gave her
answer. 'They're done with blacking, I believe.'
'Boots and shoes under the sea,' the Gryphon went on in a deep voice, 'are
done with a whiting. Now you know.'
'And what are they made of?' Alice asked in a tone of great curiosity.
'Soles and eels, of course,' the Gryphon replied rather impatiently: 'any
shrimp could have told you that.'
'If I'd been the whiting,' said Alice, whose thoughts were still running
on the song, 'I'd have said to the porpoise, "Keep back, please: we don't
want you with us!"'
'They were obliged to have him with them,' the Mock Turtle said: 'no wise
fish would go anywhere without a porpoise.'
'Wouldn't it really?' said Alice in a tone of great surprise.
'Of course not,' said the Mock Turtle: 'why, if a fish came to me, and
told me he was going a journey, I should say "With what porpoise?"'
'Don't you mean "purpose"?' said Alice.
'I mean what I say,' the Mock Turtle replied in an offended tone. And the
Gryphon added 'Come, let's hear some of your adventures.'
'I could tell you my adventures—beginning from this morning,' said
Alice a little timidly: 'but it's no use going back to yesterday, because
I was a different person then.'
'Explain all that,' said the Mock Turtle.
'No, no! The adventures first,' said the Gryphon in an impatient tone:
'explanations take such a dreadful time.'
So Alice began telling them her adventures from the time when she first
saw the White Rabbit. She was a little nervous about it just at first, the
two creatures got so close to her, one on each side, and opened their eyes
and mouths so very wide, but she gained courage as she went on. Her
listeners were perfectly quiet till she got to the part about her
repeating 'You are old, Father William,' to the Caterpillar, and the words
all coming different, and then the Mock Turtle drew a long breath, and
said 'That's very curious.'
'It's all about as curious as it can be,' said the Gryphon.
'It all came different!' the Mock Turtle repeated thoughtfully. 'I should
like to hear her try and repeat something now. Tell her to begin.' He
looked at the Gryphon as if he thought it had some kind of authority over
Alice.
'Stand up and repeat "'Tis the voice of the sluggard,"' said the Gryphon.
'How the creatures order one about, and make one repeat lessons!' thought
Alice; 'I might as well be at school at once.'
As a duck with its eyelids, so he with his nose
Trims his belt and his buttons, and turns out his toes.'
[later editions continued as follows
When the sands are all dry, he is gay as a lark,
And will talk in contemptuous tones of the Shark,
But, when the tide rises and sharks are around,
His voice has a timid and tremulous sound.]
'That's different from what I used to say when I was a child,' said the
Gryphon.
'Well, I never heard it before,' said the Mock Turtle; 'but it sounds
uncommon nonsense.'
Alice said nothing; she had sat down with her face in her hands, wondering
if anything would ever happen in a natural way again.
'I should like to have it explained,' said the Mock Turtle.
'She can't explain it,' said the Gryphon hastily. 'Go on with the next
verse.'
'But about his toes?' the Mock Turtle persisted. 'How could he turn them
out with his nose, you know?'
'It's the first position in dancing.' Alice said; but was dreadfully
puzzled by the whole thing, and longed to change the subject.
'Go on with the next verse,' the Gryphon repeated impatiently: 'it begins
"I passed by his garden."'
Alice did not dare to disobey, though she felt sure it would all come
wrong, and she went on in a trembling voice:—
'I passed by his garden, and marked, with one eye,
How the Owl and the Panther were sharing a pie—'
[later editions continued as follows
The Panther took pie-crust, and gravy, and meat,
While the Owl had the dish as its share of the treat.
When the pie was all finished, the Owl, as a boon,
Was kindly permitted to pocket the spoon:
While the Panther received knife and fork with a growl,
And concluded the banquet—]
'What is the use of repeating all that stuff,' the Mock Turtle
interrupted, 'if you don't explain it as you go on? It's by far the most
confusing thing I ever heard!'
'Yes, I think you'd better leave off,' said the Gryphon: and Alice was
only too glad to do so.
'Shall we try another figure of the Lobster Quadrille?' the Gryphon went
on. 'Or would you like the Mock Turtle to sing you a song?'
'Oh, a song, please, if the Mock Turtle would be so kind,' Alice replied,
so eagerly that the Gryphon said, in a rather offended tone, 'Hm! No
accounting for tastes! Sing her "Turtle Soup," will you, old fellow?'
The Mock Turtle sighed deeply, and began, in a voice sometimes choked with
sobs, to sing this:—
'Beautiful Soup, so rich and green,
Waiting in a hot tureen!
Who for such dainties would not stoop?
Soup of the evening, beautiful Soup!
Soup of the evening, beautiful Soup!
Beau—ootiful Soo—oop!
Beau—ootiful Soo—oop!
Soo—oop of the e—e—evening,
Beautiful, beautiful Soup!
'Beautiful Soup! Who cares for fish,
Game, or any other dish?
Who would not give all else for two
Pennyworth only of beautiful Soup?
Pennyworth only of beautiful Soup?
Beau—ootiful Soo—oop!
Beau—ootiful Soo—oop!
Soo—oop of the e—e—evening,
Beautiful, beauti—FUL SOUP!'
'Chorus again!' cried the Gryphon, and the Mock Turtle had just begun to
repeat it, when a cry of 'The trial's beginning!' was heard in the
distance.
'Come on!' cried the Gryphon, and, taking Alice by the hand, it hurried
off, without waiting for the end of the song.
'What trial is it?' Alice panted as she ran; but the Gryphon only answered
'Come on!' and ran the faster, while more and more faintly came, carried
on the breeze that followed them, the melancholy words:—
'Soo—oop of the e—e—evening,
Beautiful, beautiful Soup!'


{% extends "base.html" %} {% load i18n %} {% load staticfiles %} {% load crispy_forms_tags %} {% load thumbnail %} {% block title %}{{ block.super }}Mercado artesanal{% endblock %} {% block navbar-brand %} {% include "_brandname.html" %} {% endblock %} {% block navbar-left %}
Sitio en construcción
{% trans 'Käay is a platform where you can find a community of mexican craftsmen, Who show and share with us a bit of their work ... a bit of their life. '%}
{% trans 'Sudden stimulus that makes someone want to do or create something' %}
{% trans 'New concepts for design and creation of artworks'%}
{% trans ' Tendency to generate or perceive new ideas and concepts'%}


Memory Management in Android
Blog by theDroidLady
Introduction
Android uses paging and mmap instead of providing swap space, which means any memory your application touches cannot be paged out unless you release all references.
The Dalvik* Virtual Machine’s heap size for application processes is limited. Applications start up with 2 MB, and the maximum allocation, marked as “largeHeap,” is limited to 36 MB (depending on the specific device configuration).
Examples of large heap applications are Photo/Video Editor, Camera, Gallery, and Home Screen.
Android stores background application processes in a LRU cache.
When the system runs low on memory, it will kill processes according to the LRU strategy, but it will also consider which application is the largest memory consumer. Currently the maximum background process count is 20 (depending on the specific device configuration). If you need your app to live longer in the background, de-allocate unnecessary memory before moving to the background and the Android system will less likely generates error message or even terminates the app.
Garbage collection
A managed memory environment, like the ART or Dalvik virtual machine, keeps track of each memory allocation.
Once it determines that a piece of memory is no longer being used by the program, it frees it back to the heap, without any intervention from the programmer.
The mechanism for reclaiming unused memory within a managed memory environment is known as garbage collection. Garbage collection has two goals: find data objects in a program that cannot be accessed in the future; and reclaim the resources used by those objects.
Android’s memory heap is a generational one, meaning that there are different buckets of allocations that it tracks, based on the expected life and size of an object being allocated. For example, recently allocated objects belong in the Young generation.
When an object stays active long enough, it can be promoted to an older generation, followed by a permanent generation.
Each heap generation has its own dedicated upper limit on the amount of memory that objects there can occupy. Any time a generation starts to fill up, the system executes a garbage collection event in an attempt to free up memory.
The duration of the garbage collection depends on which generation of objects it’s collecting and how many active objects are in each generation.
Even though garbage collection can be quite fast, it can still affect your app’s performance.  The system has a running set of criteria for determining when to perform garbage collection.
When the criteria are satisfied, the system stops executing the process and begins garbage collection. If garbage collection occurs in the middle of an intensive processing loop like an animation or during music playback, it can increase processing time. This increase can potentially push code execution in your app past the recommended 16ms threshold for efficient and smooth frame rendering.
Additionally, your code flow may perform kinds of work that force garbage collection events to occur more often or make them last longer-than-normal.
For example, if you allocate multiple objects in the innermost part of a for-loop during each frame of an alpha blending animation, you might pollute your memory heap with a lot of objects.
In that circumstance, the garbage collector executes multiple garbage collection events and can degrade the performance of your app.
DDMS
Android studio includes a debugging tool called the Dalvik Debug Monitor Service (DDMS). DDMS provides services like screen capture on the device, threading, heap information on the device, logcat, processes, incoming calls, SMS checking, location, data spoofing, and many other things related to testing your Android application.
DDMS connects the IDE to the applications running on the device. On Android, every application runs in its own process, each of which hosts its own virtual machine (VM). And each process listens for a debugger on a different port.
When it starts, DDMS connects to ADB (Android Debug Bridge which is a command-line utility included with Google’s Android SDK.). An Android Debugger is used for debugging the Android app and starts a device monitoring service between the two. This will notify DDMS when a device is connected or disconnected. When a device is connected, a VM monitoring service is created between ADB and DDMS, which will notify DDMS when a VM on the device is started or terminated.
How to Improve Memory Usage
Android is a worldwide mobile platform and millions of Android developers are dedicated to building stable and scalable applications. Here is a list of tips and best practices for improving memory usage in Android applications:
1) Be careful about using a design pattern with “abstraction”. Although from the point of view of design pattern, abstraction can help to build more flexible software architect. In mobile world, abstraction may involve side effect for its extra code to be executed, which will cost more time and memory. Unless abstraction can provide your application a significant benefit, you would be better not to use it.
2) Avoid using “enum”. Enum will double memory allocation than ordinary static constant, so do not use it.
3) Try to use the optimized SparseArray, SparseBooleanArray, and LongSparseArray containers instead of HashMap. HashMap allocates an entry object during every mapping which is a memory inefficient action, also the low performance behavior — “autoboxing/unboxing” is spread all over the usage. Instead, SparseArray-like containers map keys into plain array. But please remember that these optimized containers are not suitable for large numbers of items, when executing add/remove/search actions, they are slower than Hashmap if your data set is over thousands of records.
4) Avoid creating unnecessary objects. Do not allocate memory especially for short-term temporary objects if you can avoid it, and garbage collection will occur less when fewer objects are created.
5) Check the available heap of your application. Invoke ActivityManager::getMemoryClass() to query how many heap(MB) is available for your application. OutofMemory Exception will occur if you try to allocate more memory than is available. If your application declares a “largeHeap” in AndroidManifest.xml, you can invoke ActivityManager::getLargeMemoryClass() to query an estimated large heap size.
6) Coordinate with the system by implementing onTrimMemory() callback. Implement ComponentCallbacks2::onTrimMemory(int) in your Activity/Service/ContentProvider to gradually release memory according to latest system constraints. The onTrimMemory(int) helps overall system response speed, but alsokeep your process alive longer in the system.
7) When TRIM_MEMORY_UI_HIDDEN occurs, it means all the UI in your application has been hidden and you need to free UI resources. When your application is foreground, you may receive TRIM_MEMORY_RUNNING[MODERATE/LOW/CRITICAL], or in the background you may receive TRIM_MEMORY_[BACKGROUND/MODERATE/COMPLETE]. You can free non-critical resources based on the strategy to release memory when system memory is tight.
8) External libraries should be used carefully. External libraries are often written for non-mobile device and can be inefficient in Android. You must take into account the effort in porting and optimizing the library for mobile before you decide to use it. If you are using a library for only one or two features from its thousands of other uses, it may be best to implement it by yourself.
9) Services should be used with caution. If you need a service to run a job in the background, avoid keeping it running unless it’s actively performing a task. Try to shorten its lifespan by using an IntentService, which will finish itself when it’s done handling the intent. Services should be used with the caution to never leave one running when it’s not needed. Worst case, the overall system performance will be poor and users will find your app and uninstall it (if possible).
10) But if you are building an app that needs to run for a long period of time, e.g., a music player service, you should split it into two processes: one for the UI and the other for the background service by setting the property “android:process” for your Service in AndroidManifest.xml. The resources in the UI process can be released after hidden, while the background playback service is still running. Keep in mind that the background service process MUST NOT touch any UI; otherwise, the memory allocation will be doubled or tripled!
How to Avoid Memory Leaks
Use memory carefully with above tips can bring benefit for your application incrementally, and make your application stay longer in system. But all benefit will lost if memory leakage happens. Here are some familiar potential leakage that developer needs to keep in mind.
1) Remember to close the cursor after querying the database. If you want to keep the cursor open long-term, you must use it carefully and close it as soon as the database task finished.
2) Remember to call unregisterReceiver() after calling registerReceiver().
3) Avoid Context leakage. If you declare a static member variable “Drawable” in your Activity, and then call view.setBackground(drawable) in onCreate(), after screen rotate, a new Activity instance will be created and the old Activity instance can never be de-allocated because drawable has set the view as callback and view has a reference to Activity (Context). A leaked Activity instance means a significant amount of memory, which will cause OOM easily.
4) There are two ways to avoid this kind of leakage:
-
Do not keep long-lived references to a context-activity. A reference to an activity should have the same life cycle as the activity itself.
-
Try using the context-application instead of a context-activity.
5) Be careful about using Threads. Threads in Java are garbage collection roots; that is, the Dalvik Virtual Machine (DVM) keeps hard references to all active threads in the runtime system, and as a result, threads that are left running will never be eligible for garbage collection. Java threads will persist until either they are explicitly closed or the entire process is killed by the Android system. Instead, the Android application framework provides many classes designed to make background threading easier for developers:
- Use Loader instead of a thread for performing short-lived asynchronous background queries in conjunction with the Activity lifecycle.
- Use Service and report the results back to the Activity using a BroadcastReceiver.
- Use AsyncTask for short-lived operations.
Android Profiling Tools
Android Profiling Tool will help you in managing your memory on the Android device. The Android SDK provides two ways of profiling app memory:
1) Using Allocation Tracker
2) Using Heap Dump
Using Allocation Tracker:
Allocation Tracker records each memory allocation that your application performs during the profiling cycle. The Allocation Tracker is useful when you want to find out which type of memory allocation is taking place. But it does not give you any information about the application’s heap which is the memory set aside for dynamic memory allocation.
The Allocation Tracker displays the memory allocation for the selected process. It shows the specific objects that are being allocated along with the thread, method and the line code that allocated them.
DDMS provides a feature to track objects that are being allocated to memory and to see which classes and threads are allocating the objects. This allows you to track where the objects are being allocated in real time, when you perform certain actions in your application. This data is valuable for measuring memory usage that can otherwise affect application performance.
Steps for starting Allocation Tracker in Android DDMS
1) Install your app in Android emulator or device. Click on Android button available at the bottom of the Android Studio.
2) Start allocation tracking.
3) Play around with app for some time.
4) Stop allocation tracking.
Refer to the Figure below:
5) After a few seconds, a pane with your recorded data opens.
Heap Dumps
A Heap Dump is a snapshot of an application’s heap, which is stored in a binary format called HPROF. The Dalvik virtual machine can produce a complete dump of the contents of the virtual heap. This is very useful for debugging memory usage and looking for memory leaks.
Note :
I would say developing an android application is easy but optimization and memory management requires time and work. Developer should focus on these parameters.


???
- 0
- 0
- 0
- 0
- 0
- 0
Pokémon Team Planner
Use this tool to plan your team for an in-game run. Click on a Pokémon below to add it to your team, and click on it again to remove it. Have fun and share with your friends and neighbors!


In this vignette, we will explore the data set provided here in data(tb_clean)
, which is a data set originally collected and analyzed in Xie et al. (2018).
The data tb_clean
has 389 rows and 8 columns, where each row in the data corresponds to an individual with a detected case of Tuberculosis (TB).
The columns include demographic characteristics about the patients as well as two diagnostic tests of the disease, including a AFB sputum smear test, which we analyze here.
tb_sub <- tb_clean %>%
mutate(cluster_id = group) %>%
group_by(cluster_id) %>%
mutate(cluster_size = n()) %>%
ungroup()
This data has 158 clusters with the following distribution of cluster sizes:
sizes <- tb_sub %>% group_by(cluster_id) %>%
summarize(cluster_size = n()) %>%
ungroup() %>%
group_by(cluster_size) %>%
summarize(freq = n())
sizes %>%
kable() %>%
kable_styling(bootstrap_options = c("condensed", "hover", "striped", "responsive"),
full_width = FALSE, position = "center")
| cluster_size | freq |
|---|---|
| 1 | 75 |
| 2 | 41 |
| 3 | 20 |
| 4 | 5 |
| 5 | 4 |
| 6 | 3 |
| 7 | 3 |
| 8 | 2 |
| 9 | 1 |
| 10 | 1 |
| 16 | 1 |
| 17 | 1 |
| 25 | 1 |
This means that 47.5% of the clusters are singletons and 86.1% of the clusters have size at most 3.
A single cluster of individuals looks like the following:
tb_sub %>% filter(group == "27") %>%
arrange(rel_time) %>%
select(group, rel_time, everything()) %>%
kable() %>%
kable_styling(bootstrap_options = c("condensed", "hover", "striped", "responsive"),
full_width = FALSE, position = "center")
| group | rel_time | sex | county | race | spsmear | hivstatus | homeless | cluster_id | cluster_size |
|---|---|---|---|---|---|---|---|---|---|
| 27 | 0 days | Male | MONTGOMERY | Black or African American | Positive | Negative | No | 27 | 7 |
| 27 | 442 days | Female | MONTGOMERY | Black or African American | Positive | Negative | No | 27 | 7 |
| 27 | 805 days | Female | MONTGOMERY | Black or African American | Positive | Negative | No | 27 | 7 |
| 27 | 834 days | Female | MONTGOMERY | Black or African American | Positive | Negative | No | 27 | 7 |
| 27 | 941 days | Male | PRINCE GEORGES | Black or African American | Positive | Negative | No | 27 | 7 |
| 27 | 1015 days | Male | PRINCE GEORGES | Black or African American | Positive | Positive | No | 27 | 7 |
| 27 | 1167 days | Male | PRINCE GEORGES | Black or African American | Positive | Negative | No | 27 | 7 |
In our data set of 389 individuals, 56 or 14% of individuals are HIV+. In the clusters with more than 3 individuals, 37 of 172 or 22% of individuals are HIV+.


High quality image resize in browser. Click on resized images to reload, or click on original to upload new image


My First Bootstrap Page
Resize this responsive page to see the effect!
Column 1
Column 2
Column 3
Column 4


#445464
$marengo-light
$marengo-light
#394656
$marengo
$marengo
#2c3846
$marengo-dark
$marengo-dark
#269af1
$blue-dodger
$blue-dodger
#1d84d1
$blue-curious
$blue-curious
#0b75c1
$blue-denim
$blue-denim
#f48221
$orange-light
$orange-light
#e77c1a
$orange-zest
$orange-zest
#e56b08
$orange-dark
$orange-dark
#35ae47
$green-apple
$green-apple
#1f9a0e
$green-lapalma
$green-lapalma
#1a7808
$green-dark
$green-dark
#eb3b48
$coral-amaranth
$coral-amaranth
#e02b34
$coral-crimson
$coral-crimson
#cb2529
$coral-cardinal
$coral-cardinal
#f4f5f8
$gray-athens
$gray-athens
#e9ecf1
$gray-athens-dark
$gray-athens-dark
#ffffff
$white
$white
#111
$black
$black