text:
In love signs
Love In White - Qualität ist kein Zufal
Super-Angebote für Love In White hier im Preisvergleich bei Preis.de! Love In White zum kleinen Preis. In geprüften Shops bestellen Love is an equal partnership, but you'll find someone's happiness becomes really important to you when you're falling for them. So-called compassionate love can be one of the biggest signs of a healthy relationship, according to research. This means that you're willing to go out of your way to make your partner's life easier and happier Having these signs of love appear in your life is one of the greatest things ever! Reply Link. Thomas Stuass May 18, 2015, 9:26 am. This is a great list. I think that anyone that sees it would agree that these are the best signs that point to love. I had a relationship that started with many of these signs, however, it did not turn out to be something that I even bring up to this day. You. It's no secret that men and women express their feelings differently. While a woman is expecting an avalanche of love confessions, a man is gently brushing a strand of hair out of her eyes. That's why it's easy to get tangled in them. Bright Side collected the true signs that show he is in love with you. Which points matched with yours Basically, he found out I googled the signs he is in love with me. Here is in detail: I think I've been reading this article more than 10 times for the past 2 months. Well, I read basically most articles online related of signs he is in love with me. I've only been with the guy I'm dating now for nearly 5 months, though we.
11 signs that you are in love with someone - Inside
However you may be, here are 30 for-sure signs that you're falling in love (whether you want to admit it or not): This content is imported from {embed-name}. You may be able to find the same.
Studies led by anthropologist Helen Fisher have revealed that the brain's in love phase is a unique and well-defined period of time, and there are 13 telltale signs that you're in it
11 signs that you're falling in love, according to science If you're stressed out or suddenly trying yoga, you may just be falling in love Kristin Salaky INSIDE
We thought it would be fair if we did one for 6 clear signs a man is interested in love with you as well. Here are 6 ways to tell if a man is really in love with you. 1) He enjoys poking fun at.
If he loves you, his body language and behaviors will give him away. Here are the 12 science-backed signs a man is falling in love..It's difficult —if not impossible —to gauge how someone else is feeling in a relationship.But if you're considering whether you're falling in love with your partner, you're probably wondering if they are, too. . Fortunately, .science has actually pin-pointed.
A sign someone may be in love with you includes their ability to have fun with you even during mundane tasks, Dr. Flores said. If they are happy to see you, no matter what the two of you are. Seven signs you're falling in love (according to science) Long the domain of poets, artists, and philosophers, love is a fairly new topic in the world of scientific study. However, despite being late to party, science has provided some excellent insights into why romance makes us act the way we do This could be a sign that he is in love with you. 10. An Aquarius man in love will let you into his thoughts. If an Aquarius man is in love with you, he will open up to you and start sharing his deepest thoughts and parts of his life which he might have never done before. He might even cry in front of you which is a rarity for an Aquarius man. This shows that he has true feelings for you and. The search for love is one of our greatest life tasks, reports Psychology Today magazine. Everyone experiences love in a unique way that's difficult to catalog. However, most people can divide love into three categories: physical love, or lust; attraction, or romantic love; and long-term.
23 Surprising Signs That Prove You're In Love
Zodiac Love Signs Lidschatten- und Highlighter-Palette mit 25 galaktischen und sonnengeküssten Farben in matt oder schimmernd. Jetzt online entdecken 15 Signs He's Already In Love With You. Saying I love you is sometimes the hardest three words for a guy to blurt out. Maybe he's holding off on saying it because of the emotional scars that are still healing from a past relationship, or . by Stassi Reid; Nov 11, 2016; Share Tweet Email Comment Share. Saying I love you is sometimes the hardest three words for a guy to blurt out. 12 Signs He's Seriously In Love With You Love and Relationship Tips. Loading... Unsubscribe from Love and Relationship Tips? Cancel Unsubscribe. Working... Subscribe Subscribed Unsubscribe 418K. Get free Outlook email and calendar, plus Office Online apps like Word, Excel and PowerPoint. Sign in to access your Outlook, Hotmail or Live email account Small signs of care - love - show how much a person is into you. Small signs of jealousy and even arguments prove how much a person loves you. If she passes every test, and if you notice all these signs in your girlfriend, never lose her. The fact is that she just can't resist loving you, nor can she imagine herself without you
Men Reveal 13 Signs That Show They Are in Love
Learn the whole truth about this often contradictory sign Read more of this article : Aquarius - Marching to Their Own Drummer in Life and Love. Aquarius people don't fall in love easily. But count yourself lucky if one falls for you, because Aquarius tends to be the most fiercely loyal of all the signs. And if you're chummy with an.
You searched for: love signs! Etsy is the home to thousands of handmade, vintage, and one-of-a-kind products and gifts related to your search. No matter what you're looking for or where you are in the world, our global marketplace of sellers can help you find unique and affordable options. Let's get started
Some guidance—according to your zodiac sign, what else!—that can help decipher if you are in fact falling in love with that someone special! (Or, LOL, not!
Sign In with your Microsoft account. One account. One place to manage it all. Welcome to your account dashboard
Here are eight important signs you're in love: 1. You don't feel pain. And yes, I mean physical pain. (And yes, this is actually true!) Studies have shown that love really is a bit of a drug, and intense love actually has the ability to relieve pain. As written in the New York Times, a study at Stanford University showed that there's a major link between love and pain. After studying the. Login to OneDrive with your Microsoft or Office 365 account. Sign in - Microsoft OneDrive Learn how Microsoft uses ads to create a more customized online experience tailored for you Signs of true love from a man can also be very subtle. When a man loves you for real, he will remember, even the tiniest of things that are important to you. He will always remember your birthday and he'll do his best to remember anniversaries too. He will also know all your likes and dislikes, and you'll be quite often surprised by the little things that he has made a mental note of
Falling in love with the person that is your perfect fit is one of the best feelings in the world. Although it's not uncommon to find yourself falling in love (or simply, lust) with the wrong. Sign in - Google Account While the sensations may vary by person and relationship, here are some telltale signs that you are, indeed, falling in love. Don't say we didn't warn you. You want to share your world with them. Dawoon Kang, Cofounder and Co-CEO of online dating platform Coffee Meets Bagel, says Falling in love is different for everyone, adding she believes in the Triangular Theory of Love, which is. While early signs of a good relationship are sometimes difficult to define, luckily, a few are obvious enough to decode. You can determine these by understanding what makes a man commit to a long-term partnership and what keeps his interest over many decades, trials and experiences. As love and dating author John Gray, Ph.D. explains, ultimately what men and women want is the same: they. I love you, You're beautiful). It's much easier to decipher the man's behavior. We call these love signs, or secret signs. Here are 25 such signs that a man is confessing his love for you: 1. In a social setting, the man will most often give you more attention than anyone else in the room. 2
11 Undeniable Signs He's In Love With You - a new mod
Über 80% neue Produkte zum Festpreis; Das ist das neue eBay. Finde Love Signs
When these two signs fall in love it is nothing short of intense and the love light up just like a flame. They have a lot of chemistry that will boil up to all types of excitement and thrills
22. The love seems to last forever. The love you feel with each other still remains a mystery. It's like it was formed even before you were born. It seems that it doesn't have a beginning and also an ending. ALSO READ: 12 Tips to Make Your Love Last Forever. So how many of the signs of true love above can you see or feel in your relationship
All this is in love. And the smallest triangle of such an unstable state can cause people to feel distressed, panic or despair. The same mood swings occur in drug addicts. That's why love is one of the forms of addiction. Further Reading: Love vs. Infatuation - 21 Tell-Tale Signs . Obsession with him/he
According to astrologers, your zodiac sign can reveal a lot about you — from how intelligent you are to what grocery store you should shop in — so it makes sense to Zodiac fans that the personality traits of your zodiac sign would also dictate how you act when you're in love. From the romantic Leo to the closed-off Capricorn, the love languages of the Zodiac could make Gary Chapman's head.
So, what are the signs of TRUE love from a man? Watch the video to find out: Watch the video to find out: The interesting thing about love is that we all communicate and receive it in our own.
A N E W A P P R O A C H TO T H E H U M A N HEART. LINDA GOODMAN'S LOVE SIGNS. author of LINDA GOODMAN'S SUN SIGNS Publishing's. First -. Astrological NEWSWEEK. Blockbuster..
While you may feel the cliché butterflies in your stomach, there are some physical signs you're falling in love. And sometimes, you just know Read detailed analysis of your zodiac sign compatibility with your partner's sun sign. Have a glance at unique compatibility meter with love, communication, sex and all over compatibility percentage. Find most and least compatible zodiac signs Aquarius is lucky in love - Aquarians are one of the luckier signs in love and find it easy to meet partners, thanks to their laidback and friendly personalities. But, Aquarians need to bear in. Log in to get Netflix movies by mail, plus instantly watch some movies online on your PC, Mac, or right on your TV
Love compatibility Chinese sign compatibility Work compatibility Book of Love Daily Karmic Number. Find out if you and your love interest or partner are soul mates, best friends, or a recipe for disaster. But no fear - even opposites can attract. Find out how you fare now. Please select your sign: aries. Mar 21 - Apr 19. taurus. Apr 20 - May 20. gemini. May 21 - Jun 20. cancer. Jun 21 - Jul 22. Check out top 4 signs a Libra man is falling in love with you HERE! This guy is secretive when it comes to his feelings, especially in love relationships. Getting to know his love signs is really a challenge; yet, it doesn't mean you cannot figure out his inner emotions at all In Love Signs, Goodman writes, Like a human infant totally self-absorbed, the Aries soul discovers with delight his own or her own toes and fingers -- its own physical beingness. To satisfy all needs, only a loud cry is necessary, heard and answered instantly by elders. The real infant doubts or fears nothing or no one, simply because it has never experienced denial. Likewise, the Aries. Zodiac Signs Compatibility Love Chart. There are no incompatible zodiac signs in astrology, which means that any two signs are more or less compatible. Two people whose zodiac signs are highly compatible will get along very easily because they are on the same wavelength. But, people whose zodiac signs are less compatible, will need to be more. 12 Invisible Signs of Love. Sometimes we have to look for love...not from strangers but from the people already around us, the ones who show it in unexpected, wonderful but slightly weird ways. By Leigh Newman. Sign #1: Your annoying talking pumpkin-head key chain shows up in their junk drawer. Or your broken pen or ancient bowling scorecard. None of these are items that anybody in their right.
This is a sign of true love but also a sign that he still feels nervous around you. I bet you know some good tactics to make him relax, right? 15. He doesn't ask you out. You are probably thinking how this can be a sign that he likes me, right? Well, dear girls you must understand that sometimes the best guys are those shy ones. Maybe he has been trying to ask you out for days, but somehow. Discovering what the best love language is with every zodiac sign can be fascinating. In fact, a person's astrology sign can reveal much more than just the top traits. By and large, the knowledge can be quite powerful. It can help make relationships last longer and also help you avoid inappropriate relationships If you're presently dating an Aries man and wish to know if his heart beats for you, then there are a number of signs you should always be on the look-out for. When it comes to falling in love, the Aries man isn't the easiest customer unless you intend to win his heart with any [
Falling in Love Signs - 30 Subtle Signs You're Falling in Love
d, here are some generic behavioral signs that indicate a man is in love with you. Top 10 Behavioral Signs of a Man in Love. Listed below are 10 behaviors men exhibit when they are in love. These are signs that are apparent in most guys. No one guy is going to exhibit all these signs, but you can find one or more signs in his behavior. It is important to note here that you.
In unserer Collection Signs of Love haben wir die Symbolik des Ringes mit Symbolen der Liebe kombiniert: auf neun Ringpaaren läuft jeweils ein spezielles Liebeszeichen über beide Ringe, es wird aber erst eindeutig erkennbar, wenn beide Ringe nebeneinander gehalten werden
Create account Use a phone number instead. Get a new email address.
The signs are also available for delivery or porch pickup, according to a Facebook post by Gallagher. I think it's just one of those things that keeps giving, you know, so I love it, Beers.
Wondering if he's falling in love with you? There are body language you should look for in a man, these signs are not very obvious but if you pay keen attention you will find the out. Here are 11 body language signs to look out for if you want to be sure he's really into you
True love is about meeting each other's expectations and loving each other with trust, acceptance, and support. True love is about treating someone with the kind of respect that they deserve because you view them in a loving manner. 11 Signs That You Have Found True Love � One of the signs an INTP likes you may be in the humor they use. Although they may have a taste for dark humor, INTPs are not typically given towards crass or gratuitously rude jokes. They love clever puns though and they are known to crack a few, perhaps to the chagrin of their audience. When they want to drop some subtle hints to someone they fancy, they might try to woo them with some. Signs of Love Ringe: Unter Designer Hand entworfen, in der Goldschmiede gefertigtSchenke allem was du tust, die ganze Aufmerksamkeit, nichts wäre wohl treffender für die Brüder Nowotny KG, die sich in dem kurzen Zeitraum von 1965 bis 1980 in die Avantgarde der Österreichischen Goldschmiedeproduzenten einreihen konnte. Denn hinter jedem einzelnen Arbeitsschritt hin zu den verzaubernden. The only reasons you stay with him have nothing to do with love. Maybe you have kids together or you can't afford a place of your own. In your mind, you're sticking around until the situation changes. If love isn't one of the main reasons you stay with him, then you're definitely falling out love
13 Scientifically Proven Signs You're in Love Live Scienc
ute events are.
Signs that you're probably not in love: 1. You're not being your authentic self . You shouldn't hide yourself or compromise on your values in order to be with someone, explains Pharaon
Guys don't run their problems past people who they don't respect and trust to help them solve the issue. If he carefully considers your input, this is a good sign he is in love with you. 8. That look of love. Men in love have a way that they look at you. Sometimes it's hard to see it yourself, but when your friends meet him, they will.
But the truth of the matter is that it's often the little, everyday things that are actually the signs of falling in love. And if you're still waiting around for everything to go slow motion and for your favorite Ed Sheeran song to start playing as the soundtrack to your life, our advice would be to pay attention to adjustments you've made in your day-to-day life that may be an indication that.
Top 10 Signs You're In Love Are You Really In Love? You'll Recognize These Signs For Sure. Madeleine Holden . October 17, 2015 . Share Tweet Flip. 0. Shares. Most people know the feeling of.
True love is not only felt, it's visible to the naked eye. But if you are one of those people who look for proof in every situation and prefer facts to deductions, arm your eyes and pay attention to the following signs
Leo in Love - Sign Compatibility. Leo is born between July 23 to August 22. Leo Love Compatibility . Leo is traditionally represented as the Lion and is the fifth sign of the zodiac. Here you will find indepth personality information about Leos, what they are like in love, their weaknesses and strengths, and how to attract a Leo girlfriend or boyfriend. The Authority Symbol: The Lion Key.
11 signs that you're falling in love, according to science
So as you get to know your particular guy more, you will begin to understand how he shows his love for you better. Take every day as it comes and make sure to note down some of these signs if you're curious. Here are the signs: He's respectful - he may not directly say he respects you, but he definitely loves you if he shows how much respect he has through his actions
Falling in love is scary. It can feel like a sudden realisation that sends a jolt to the pit of your stomach or a slow wash of contentment that spreads to your fingertips. Sometimes it takes only.
If you've seen Netflix's Love Is Blind, you may be familiar with Jessica's infamous quote (that she jacked from the Olsen twins' hit movie, It Takes Two). I want that can't eat, can't sleep.
Love Sign, Champaign, Illinois. 950 likes. Love Sign! A harmonic, love-tastic musical experience playing a variety of modern, classic country oldies, pop and rockabilly favorites! The ONLY band in..
This weeks Top 10 Signs post has a bit of a romantic twist. Not sure if your man is into you or not? See if he stacks up to these Top 10 Signs He's in Love With You
6 Clear Signs He's in Love with You - YouTub
Like it not, we all exhibit certain signs when we fall in love. Read through my list of signs of being in love to see if you recognize some of these signs in yourself. Some of it is tongue in the cheek, but most of the signs of being in love in my list will (un)fortunately be true and yes, falling in love turns most of us into (happy) fools 10 Signs of True Love You can't find true love by yourself. Posted Apr 14, 2015 . SHARE. TWEET. EMAIL. 6 COMMENTS. THE BASICS . Why Relationships Matter; Find a therapist to strengthen.
12 Signs a Man is Falling In Love - How to Tell if He
15 signs that prove someone is falling in love with you. 400 Shares. Her What's love got to do, got to do with it Everything Tina, everything. Ladies, we are always reading and hearing. If that's the case, there's a good chance that you were confusing infatuation with love. The sooner you notice this, the better, particularly if you're actively in search of real love . So, let's talk about a few signs you should look for if you're still unsure about whether you're feeling the real thing Signs of Love aus dem Hause Brüder Nowotny sagen mehr als tausend Worte. In zweigeteilter Manier, verdeutlichen die Ringe der Kollektion Signs of Love aus dem Hause Brüder Nowotny die unabdingliche Zusammengehörigkeit der Träger.Dabei setzt die Marke Nowotny durch kontinuierliche Unterschiedlichkeit in der Veredelung der Gold- sowie Silberringe auf die Vielseitigkeit der. 5 Zodiac signs will find love in 2020 The beautifully romantic nights and gorgeous 2020 dates are getting us excited and we cannot wait a minute longer! 2020 is going to be one to remember for 5 zodiac signs, although don't despair if your zodiac sign isn't one of the lucky 5 because anything could happen in 2020 Create an account or log in to Instagram - A simple, fun & creative way to capture, edit & share photos, videos & messages with friends & family
7 signs someone is in love with you — even if it doesn't
Venus in Cancer: Love Signs and Traits Share PINTEREST Email Print i love images / Getty Images Astrology. Love & Compatibility Basics 12 Signs of the Zodiac Trends & Horoscopes The Sun & Sun Signs The Moon & Moon Signs The Houses By. Molly Hall. Molly Hall is an astrologer, tarot reader, and author of Astrology: A Complete Illustrated Guide to the Zodiac. our editorial process. Molly Hall. Relationships characterized by consummate love, the kind of mutual love that will last, often share certain features. Turning to the research, here are six central signs of being in love Love is one of the strongest emotions. But there are some people who do not see the signs of love. The other person who has fallen for you might have stoned you with these signs, but you would have looked right through it. The signs of love can at times be very direct or vice versa depending on the nature of the person
Video: 24 weird but unmistakable signs you're falling in love
Stream ad-free, family-friendly nature documentaries on demand. Discover more about Love Nature shows and start your free trial Viele übersetzte Beispielsätze mit signs of love - Deutsch-Englisch Wörterbuch und Suchmaschine für Millionen von Deutsch-Übersetzungen If there's one sign that's most likely to fall in love at first sight, it's Pisces. As Hale says, This sign falls in love quickly and is prone to getting hurt more often than others as a result. Venus in the Signs . Where is Venus placed by zodiacal sign in your chart? Learn what Venus, the planet of luck, vision, expansion, and plenty, means in each sign of the zodiac. Don't know your Venus sign? See the Venus Sign Lookup page. See also: Love Signs in Astrology. Venus in Aries. Venus in Aries people flirt by being up-front, direct, and even daring. They try to win you over by.
By Devil's Horns, I assume you mean the fist with just the index and pinky fingers sticking straight out. The American Sign Language sign I love you extends the thumb as well, combining the American fingerspelled letters I , L, and Y. L.. In Love Signs - If you are looking for someone to make your life complete then our online dating service can bring you a step closer to finding happiness
In her book The Anatomy of Love, biological anthropologist Helen Fisher reveals the most obvious signs that you're falling in love with someone Pisces in love are at the core the most emotional of all the signs. Extremely intuitive and sensitive, they seek romantic love and need a soulmate more than most. This can be very beautiful for the partner of a Pisces, as their deep love and empathy makes for a very spiritual bond. A union with a Pisces automatically makes their partner feel special and cherished solely because Pisces are so. 30 Sure-Shot Signs She's Secretly In Love With You Ankush Bahuguna Updated: Jan 25, 2019, 14:00 IST You're 'just friends', but there's something strange between you two that you just cannot stop.
Signs He Doesn't Love You Sign One. Thought Catalog studies show a man doesn't love you if she isn't showing any interest in the smaller details in your life. If he doesn't want to hear about how crazy your cat has been acting or about how embarrassed you were at work because you forgot a meeting, then you better think about whether he. Making love implies a mental connection. This heightens the overall experience, says Candice Smith, a sex expert and educator and also co-founder of the KinkKit, a quarterly sexperience box. Making love indicates that both partners are fully connected and present with each other. They're invested in each other's pleasure and feel a sensory connection that goes beyond physical.
Road signs in Germany. Jump to navigation Jump to search. These road signs are used in Germany. Warning signs. General Danger or Traffic Control. Gefahrstelle Danger Point (a supplementary sign may explain the danger) Traffic signals Primary Priority Stop and give way. Right on red Only after a complete stop. 4 Signs You're Falling In Love With Your Best Friend, According To Experts. By Sarah Ellis. Jan. 17, 2019. OK, I'll say it — sometimes best friends are way better than significant others. Lust on its own is quick and temporary, while love comes slowly, but is more permanent and steady. Signs that it's lust and not love. If you're feeling confused over what you're feeling, and wondering if it's love or lust, just use these 10 signs to understand your mind and heart better. #1 Every aspect of the relationship revolves.
Video: Aquarius Man In Love: 10 Behavioral Signs To Tel
Enter your Badoo account details to sign in and chat with new people around you In Love Signs - Join one of best online dating sites for single people. You will meet single, smart, beautiful men and women in your city! men with hairy backs is love an addiction women from honduras >> >>. 25 Signs You're Really, Really in Love. How to know if your special human is the PB to your J. By Elisa. Feb 14, 2019 It can be hard to determine the difference between like and love, but there.
Because picking up on signs someone is in love with you isn't a science or easy to do with any semblance of confidence, the act of saying it can feel like a game of chicken—but that doesn't. Free Printable Love Signs. Today I'm super excited to share this fun collection of Printable Romantic Quotes just in time to get your Valentine's Day decorating under way! The best thing about these love signs is that you can print and frame them and hang them anywhere in your home. These quotes are perfect for him or her and not just for Valentine's Day but for any occasion. If you are.
A Virgo in love wants your brain. Virgos are known for being intellectual in the sexiest of terms. It is said that the mind is the sexiest organ in the body and this is most evident when dealing with the seriously brainiac Virgo. All this sharp intelligence make them keen conversationalists. They enjoy a partner that can hold their own on subjects of interest. This 'smartness' makes them. Watch out for these signs and get out of that dead end relationship ASAP
Linda Goodman's Love Signs offers compelling insight and advice for every zodiac sign—and the compatibility of each with all eleven others. Lively, entertaining, and informative, this book will help you better understand your mate and your relationship. From your finances to your lover's secret hopes, from your quirky habits to what you'll fight about, from avoiding war to making peace, this. Gmail is email that's intuitive, efficient, and useful. 15 GB of storage, less spam, and mobile access Love Sign is a song by American musician Prince, from the 1-800-NEW-FUNK compilation album released by his independent record label NPG Records in 1994. Love Sign was the most successful song released from the album, and it is a duet with Nona Gaye, although Prince (known as The Artist Formerly Known as Prince at the time because of his name change to an unpronounceable symbol) is. You might finally be in love. Here are all the signs you're falling in love. 1. You're happy and just a little bit nervous. When you're in love, you're genuinely a happier person. It's like. Log into Facebook to start sharing and connecting with your friends, family, and people you know
Psoriasis nägel biologika.
Lachmann immobilien erkelenz.
Hecht schleimhaut.
Audio französisch.
Canon EOS 70D Kit.
Lol clash rewards.
Peggy carter verheiratet.
Unalome female.
Islamische traumdeutung lexikon.
Detektiv mainz.
Wie häufig wurde das deutsche grundgesetz bereits abgeändert.
Ausbildung auf see.
Downhill bike stuttgart.
Antje traue freund.
Spinnrad mit kugellager.
Isotope technologies.
Carl thiem klinikum cottbus babygalerie.
Sonnenuntergang oslo august.
Judo rei.
Stephen merchant filme & fernsehsendungen.
Chris kläfford.
Osobaya sayanskaya vodka.
Weihnachtspralinen kaufen.
Handy reparatur samsung.
Klettern gefährlich.
Hard skills informatiker.
Schichtdickenartefakt.
Automarkt schweden.
Vestiaire collective usa.
Hyperraum Geschwindigkeit.
Code blocks download.
Glasfaser internet wien.
Audi a5 gebraucht benzin.
Ewig während synonym.
Paraplegie bedeutung.
Planetarium nrw.
Sara canning alter.
Fernsehturm riga besichtigen.
3ds roms deutsch.
Geburtstagswünsche wellness.
Allianz arena alkohol bundesliga.


The actor playing Meghan Markle is practically her twin.
Our invite to Prince Harry and Meghan Markle's wedding this spring must have gotten lost in the mail, but at least we have "Harry & Meghan: The Royal Love Story" to look forward to on Lifetime.
Fraser, meanwhile, while lesser known by American audiences, rose to prominence as PC Jason Denny in the Scottich TV mini-series, "The Loch." While his likeness with Harry isn't quite as noteworthy as his counterpart and Markle, the dashing actor certainly has some similarities; see below in a side-by-side posted by a Markle fan account.
The movie will take viewers on a whirlwind romance chronicling the duo's love from first date to their November engagement. Is it too early to say we're already hoping for a sequel?


Among the products and blessings of Saint Andrew's existence have been the significant number of our congregation called to the ministry. In about the last 30 years at Saint Andrew's, where in our beginning Lutherans were so rare that neighbors once asked the late Pastor Morris Niedenthal if his church was to be a new sect or cult, nine of us have been inspired to study and spread the Gospel as ordained Lutheran ministers around the world. They worshiped with us, they communed with us, and they prayed with us. The Reverends Garrett Struessel, Steve Sylvester, Cathy Rosenholtz, Melissa Afdahl and Anna Murphy Ballan, grew up and were confirmed at St. Andrew's. Reverend Chad Langdon became a part of St. Andrew's while attending college and the Reverends Maureen Howard, Scott Simmons and Ted Carnahan began attending and became an integral part of our congregation a bit later in life before taking the next step toward the ministry.
The Apostle Andrew – it seems – was just a bit player. In the drama of Jesus' earthly ministry and of the early church, he does not get top billing. Even so… In the three stories where he does have a role [John 1, 6, 12] significant results follow his bit part. Of the thousands of people who have entered our congregation for worship and then re-entered the world for service, most of us may seem only bit part players in the world's drama. Even so, these are the people, the hands and the voices God has used, and will continue to use to bring to reality Jesus' words: I came that they may have life, and have it abundantly. [John 10:10] We praise God for all who have shared their unique parts, contributing to the ministry of Saint Andrew's, to the abundant joy that many have and will continue to receive.


text:
Q: Django-models. Complex request to database I need to make special request to database through django.
For example:
class Model(models.Model):
     name=models.CharField()
     date=models.DateTimeField()
     other=models.TextField()

How do I ask for row which name containe word 'Hello' (it shoul ignor register of first letter)
end it is must be in diapason of date, for example between 2005.08.09 and 2005.08.11?

A: Try the following:
start_date = datetime.date(2005, 8, 9)
end_date = datetime.date(2005, 8, 11)
Model.objects.filter(name__icontains="hello").filter(date__range(start_date,end_date))

You can stack as many filters as you like and it will be built into a single SQL Query (or whatever database system you use)

redpajama_set_name: RedPajamaStackExchange


Mazda customers rejoice! If you own a Mazda manufactured from 2014 onwards and if its equipped with Mazda's MZD Connect infotainment system, you're able to purchase a retrofitted kit which adds Apple CarPlay and Android Auto smartphone mirroring interfaces for a recommended price of $494.98, inclusive of labour.
The upgrade will allow customers to integrate their phones seamlessly with the infotainment system, along with being able to compose and listen to text messages on the move, make calls and browse music libraries without taking their hands off the steering wheel. Convenient and safe.
Customers who would like to have the system retrofitted can visit their local Mazda dealer who can complete the process in a number of hours.
All new Mazdas are now available with Apple CarPlay and Android Auto as standard, with the systems debuting on the revised BT-50 and CX-9 SUV ranges.
"The ability to fully integrate this technology into our existing offering will give Australians another reason to choose Mazda, but we are especially happy that it is something we can offer to our existing community of customers" said Managing Director of Mazda Australia, Vinesh Bhindi.


A Tractor Beam replacement where the cargo does not move like the tail of a rabid mad cow.
The target is always the current target of your ship.
You can however order another ship to tow this target.
Every object you can target from your ship can be towed.
A Jumpdrive can be used when towing ships or asteroids. Yes, the cargo will jump with your ship.
If your tow ship does not have enough EC a log book message will tell you how much it would have needed.
The smaller your tug is compared to the cargo, the higher the cost in EC.
Any ship with laser or turret capability and a tractor beam on board qualifies.
I never saw the reasoning behind only letting military ships tow stuff.
Your car breaks down. Do you call a tow truck or a battle tank?
Firing any laser disengages the Tractor Beam.
Executing the menu command again disengages the Tractor Beam.
If the tow ship is in the same sector as the towee it will fly to this target and leash it. That is all the navigation this script will do.
After the cargo is on the hook you may issue any nav command you want.
The alignment of the cargo is exactly the same as the tow ship. You can move and rotate a station as accurately as you can move or rotate a ship.
The freight is towed with 1km distance to the ship.
The tow ship is completely safe from the cargo. The rest of the sector is not.
Target the object from your ship.
Last edited by Gazz on Thu, 25. Dec 08, 00:55, edited 3 times in total.
Great, I thought about this yesterday and hoped for a TC version soon. Thanks!
Now they'll learn how much i was grateful for that crappy unfocused jumpdrive!
So....... what happen when the tow ships docks somewhere?? Does the towee disconnect, or does something magical happen.
If the towing ship docks, the towee is boarded by pink gremlins who then proceed to paint a big red bullseye on the hull.
When they are done a pentagram shaped pattern of xenon lasertowers spawns and reduces the towee to rubble.
Then a soft and wet pattern of squash mines spawns and destroys the rubble.
When all this has been completed, a construction crew of green gremlins builds a ship that is identical to the previous towee and places it at the same coordinates.
I omitted a few minor steps but basically that's it.
Gazz wrote: If the towing ship docks, the towee is boarded by pink gremlins who then proceed to paint a big red bullseye on the hull.
My green gremlins failed to show up so i'm left with a pile of rubble, did i do something wrong ?
Other than that, this is yet another great script Gazz, many thanks.
Is it possible to tow a complex or an enemy ship with that ?
Last edited by TemplarThano on Tue, 3. Mar 09, 19:46, edited 1 time in total.
I tried using this script, I have a tractor beam on board, and the command shows up in the menu, but regardless of what I target, when I run the command, I get a verbal notification of 'malfunction'. Is something wrong? does anyone else get this problem?
All in all, I actually like the stock tractor beam better. It has the benefit of a sort of clumsy majesty. But there are times when you just feel the need to slam a gigantic asteroid into an unwitting station, you know? And the stock tractor beam has the unfortunate indignity of not being able to tow anything you don't own. Silly, silly, silly. It should at least be able to snag asteroids.
Actually, it doesn't matter whether the tractor beam is installed or not, I've tried it both ways and it works just fine. Make sure that you do not fire any weapons while towing or you'll lose the object you're towing, tho.


Cross Plains was Robertson County's first settlement, visited in 1779 by Revolutionary War pensioner Thomas Kilgore. Visitors to Cross Plains are treated to a taste of history with several historic buildings and a host of locally-owned shops and restaurants eager to serve visitors.
Cross Plains hosts Trash & Treasures yard sale on Friday and Saturday of the last full weekend in June each year. April brings the Kilgore Station Bluegrass Festival and Christmas is celebrated with a parade and other events sponsored by the Cross Plains Community Chamber.
Here are some scenes our professional videographer shot around the Cross Plains community.


text:
package org.gnucash.android.db.adapter;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.Log;

import org.gnucash.android.R;
import org.gnucash.android.app.GnuCashApplication;
import org.gnucash.android.db.DatabaseSchema;
import org.gnucash.android.model.Account;
import org.gnucash.android.model.AccountType;
import org.gnucash.android.model.Commodity;
import org.gnucash.android.model.Money;
import org.gnucash.android.model.Split;
import org.gnucash.android.model.Transaction;
import org.gnucash.android.model.TransactionType;
import org.gnucash.android.util.TimestampHelper;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Currency;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;

import static org.gnucash.android.db.DatabaseSchema.AccountEntry;
import static org.gnucash.android.db.DatabaseSchema.SplitEntry;
import static org.gnucash.android.db.DatabaseSchema.TransactionEntry;

/**
 * Manages persistence of {@link Account}s in the database
 * Handles adding, modifying and deleting of account records.
 * @author Ngewi Fet <ngewif@gmail.com>
 * @author Yongxin Wang <fefe.wyx@gmail.com>
 * @author Oleksandr Tyshkovets <olexandr.tyshkovets@gmail.com>
 */
public class AccountsDbAdapter extends DatabaseAdapter<Account> {
    /**
     * Separator used for account name hierarchies between parent and child accounts
     */
    public static final String ACCOUNT_NAME_SEPARATOR = ":";

    /**
     * ROOT account full name.
     * should ensure the ROOT account's full name will always sort before any other
     * account's full name.
     */
    public static final String ROOT_ACCOUNT_FULL_NAME = " ";

	/**
	 * Transactions database adapter for manipulating transactions associated with accounts
	 */
    private final TransactionsDbAdapter mTransactionsAdapter;

    /**
     * Commodities database adapter for commodity manipulation
     */
    private final CommoditiesDbAdapter mCommoditiesDbAdapter;

    /**
     * Overloaded constructor. Creates an adapter for an already open database
     * @param db SQliteDatabase instance
     */
    public AccountsDbAdapter(SQLiteDatabase db, TransactionsDbAdapter transactionsDbAdapter) {
        super(db, AccountEntry.TABLE_NAME, new String[]{
                AccountEntry.COLUMN_NAME         ,
                AccountEntry.COLUMN_DESCRIPTION  ,
                AccountEntry.COLUMN_TYPE         ,
                AccountEntry.COLUMN_CURRENCY     ,
                AccountEntry.COLUMN_COLOR_CODE   ,
                AccountEntry.COLUMN_FAVORITE     ,
                AccountEntry.COLUMN_FULL_NAME    ,
                AccountEntry.COLUMN_PLACEHOLDER  ,
                AccountEntry.COLUMN_CREATED_AT   ,
                AccountEntry.COLUMN_HIDDEN       ,
                AccountEntry.COLUMN_COMMODITY_UID,
                AccountEntry.COLUMN_PARENT_ACCOUNT_UID,
                AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID
        });
        mTransactionsAdapter = transactionsDbAdapter;
        mCommoditiesDbAdapter = new CommoditiesDbAdapter(db);
    }

    /**
     * Convenience overloaded constructor.
     * This is used when an AccountsDbAdapter object is needed quickly. Otherwise, the other
     * constructor {@link #AccountsDbAdapter(SQLiteDatabase, TransactionsDbAdapter)}
     * should be used whenever possible
     * @param db Database to create an adapter for
     */
    public AccountsDbAdapter(SQLiteDatabase db){
        super(db, AccountEntry.TABLE_NAME, new String[]{
                AccountEntry.COLUMN_NAME         ,
                AccountEntry.COLUMN_DESCRIPTION  ,
                AccountEntry.COLUMN_TYPE         ,
                AccountEntry.COLUMN_CURRENCY     ,
                AccountEntry.COLUMN_COLOR_CODE   ,
                AccountEntry.COLUMN_FAVORITE     ,
                AccountEntry.COLUMN_FULL_NAME    ,
                AccountEntry.COLUMN_PLACEHOLDER  ,
                AccountEntry.COLUMN_CREATED_AT   ,
                AccountEntry.COLUMN_HIDDEN       ,
                AccountEntry.COLUMN_COMMODITY_UID,
                AccountEntry.COLUMN_PARENT_ACCOUNT_UID,
                AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID
        });

        mTransactionsAdapter = new TransactionsDbAdapter(db, new SplitsDbAdapter(db));
        mCommoditiesDbAdapter = new CommoditiesDbAdapter(db);
    }

    /**
     * Returns an application-wide instance of this database adapter
     * @return Instance of Accounts db adapter
     */
    public static AccountsDbAdapter getInstance(){
        return GnuCashApplication.getAccountsDbAdapter();
    }

    /**
	 * Adds an account to the database.
	 * If an account already exists in the database with the same GUID, it is replaced.
	 * @param account {@link Account} to be inserted to database
	 */
    @Override
	public void addRecord(@NonNull Account account, UpdateMethod updateMethod){
        Log.d(LOG_TAG, "Replace account to db");
        //in-case the account already existed, we want to update the templates based on it as well
        List<Transaction> templateTransactions = mTransactionsAdapter.getScheduledTransactionsForAccount(account.getUID());
        super.addRecord(account, updateMethod);
        String accountUID = account.getUID();
		//now add transactions if there are any
		if (account.getAccountType() != AccountType.ROOT){
            //update the fully qualified account name
            updateRecord(accountUID, AccountEntry.COLUMN_FULL_NAME, getFullyQualifiedAccountName(accountUID));
            for (Transaction t : account.getTransactions()) {
                t.setCommodity(account.getCommodity());
		        mTransactionsAdapter.addRecord(t, updateMethod);
			}
            for (Transaction transaction : templateTransactions) {
                mTransactionsAdapter.addRecord(transaction, UpdateMethod.update);
            }
        }
	}

    /**
     * Adds some accounts and their transactions to the database in bulk.
     *
If an account already exists in the database with the same GUID, it is replaced.
     * This function will NOT try to determine the full name
     * of the accounts inserted, full names should be generated prior to the insert.
     *
All or none of the accounts will be inserted;

     * @param accountList {@link Account} to be inserted to database
     * @return number of rows inserted
     */
    @Override
    public long bulkAddRecords(@NonNull List<Account> accountList, UpdateMethod updateMethod){
        //scheduled transactions are not fetched from the database when getting account transactions
        //so we retrieve those which affect this account and then re-save them later
        //this is necessary because the database has ON DELETE CASCADE between accounts and splits
        //and all accounts are editing via SQL REPLACE

        //// TODO: 20.04.2016 Investigate if we can safely remove updating the transactions when bulk updating accounts
        List<Transaction> transactionList = new ArrayList<>(accountList.size()*2);
        for (Account account : accountList) {
            transactionList.addAll(account.getTransactions());
            transactionList.addAll(mTransactionsAdapter.getScheduledTransactionsForAccount(account.getUID()));
        }
        long nRow = super.bulkAddRecords(accountList, updateMethod);

        if (nRow > 0 && !transactionList.isEmpty()){
            mTransactionsAdapter.bulkAddRecords(transactionList, updateMethod);
        }
        return nRow;
    }

    @Override
    protected @NonNull SQLiteStatement setBindings(@NonNull SQLiteStatement stmt, @NonNull final Account account) {
        stmt.clearBindings();
        stmt.bindString(1, account.getName());
        if (account.getDescription() != null)
            stmt.bindString(2, account.getDescription());
        stmt.bindString(3, account.getAccountType().name());
        stmt.bindString(4, account.getCommodity().getCurrencyCode());
        if (account.getColor() != Account.DEFAULT_COLOR) {
            stmt.bindString(5, convertToRGBHexString(account.getColor()));
        }
        stmt.bindLong(6, account.isFavorite() ? 1 : 0);
        stmt.bindString(7, account.getFullName());
        stmt.bindLong(8, account.isPlaceholderAccount() ? 1 : 0);
        stmt.bindString(9, TimestampHelper.getUtcStringFromTimestamp(account.getCreatedTimestamp()));
        stmt.bindLong(10, account.isHidden() ? 1 : 0);
        stmt.bindString(11, account.getCommodity().getUID());

        String parentAccountUID = account.getParentUID();
        if (parentAccountUID == null && account.getAccountType() != AccountType.ROOT) {
            parentAccountUID = getOrCreateGnuCashRootAccountUID();
        }
        if (parentAccountUID != null) {
            stmt.bindString(12, parentAccountUID);
        }
        if (account.getDefaultTransferAccountUID() != null) {
            stmt.bindString(13, account.getDefaultTransferAccountUID());
        }
        stmt.bindString(14, account.getUID());

        return stmt;
    }

    private String convertToRGBHexString(int color) {
        return String.format("#%06X", (0xFFFFFF & color));
    }

    /**
     * Marks all transactions for a given account as exported
     * @param accountUID Unique ID of the record to be marked as exported
     * @return Number of records marked as exported
     */
    public int markAsExported(String accountUID){
        ContentValues contentValues = new ContentValues();
        contentValues.put(TransactionEntry.COLUMN_EXPORTED, 1);
        return mDb.update(
                TransactionEntry.TABLE_NAME,
                contentValues,
                TransactionEntry.COLUMN_UID + " IN ( " +
                        "SELECT DISTINCT " + TransactionEntry.TABLE_NAME + "." + TransactionEntry.COLUMN_UID +
                        " FROM " + TransactionEntry.TABLE_NAME + " , " + SplitEntry.TABLE_NAME + " ON " +
                        TransactionEntry.TABLE_NAME + "." + TransactionEntry.COLUMN_UID + " = " +
                        SplitEntry.TABLE_NAME + "." + SplitEntry.COLUMN_TRANSACTION_UID + " , " +
                        AccountEntry.TABLE_NAME + " ON " + SplitEntry.TABLE_NAME + "." +
                        SplitEntry.COLUMN_ACCOUNT_UID + " = " + AccountEntry.TABLE_NAME + "." +
                        AccountEntry.COLUMN_UID + " WHERE " + AccountEntry.TABLE_NAME + "." +
                        AccountEntry.COLUMN_UID + " = ? "
                        + " ) ",
                new String[]{accountUID}
        );
    }

    /**
     * This feature goes through all the rows in the accounts and changes value for columnKey to newValue

     * The newValue parameter is taken as string since SQLite typically stores everything as text.
     *
This method affects all rows, exercise caution when using it

     * @param columnKey Name of column to be updated
     * @param newValue New value to be assigned to the columnKey
     * @return Number of records affected
     */
    public int updateAllAccounts(String columnKey, String newValue){
        ContentValues contentValues = new ContentValues();
        if (newValue == null) {
            contentValues.putNull(columnKey);
        } else {
            contentValues.put(columnKey, newValue);
        }
        return mDb.update(AccountEntry.TABLE_NAME, contentValues, null, null);
    }

    /**
     * Updates a specific entry of an account
     * @param accountId Database record ID of the account to be updated
     * @param columnKey Name of column to be updated
     * @param newValue  New value to be assigned to the columnKey
     * @return Number of records affected
     */
    public int updateAccount(long accountId, String columnKey, String newValue){
        return updateRecord(AccountEntry.TABLE_NAME, accountId, columnKey, newValue);
    }

    /**
     * This method goes through all the children of {@code accountUID} and updates the parent account
     * to {@code newParentAccountUID}. The fully qualified account names for all descendant accounts will also be updated.
     * @param accountUID GUID of the account
     * @param newParentAccountUID GUID of the new parent account
     */
    public void reassignDescendantAccounts(@NonNull String accountUID, @NonNull String newParentAccountUID) {
        List<String> descendantAccountUIDs = getDescendantAccountUIDs(accountUID, null, null);
        if (descendantAccountUIDs.size() > 0) {
            List<Account> descendantAccounts = getSimpleAccountList(
                    AccountEntry.COLUMN_UID + " IN ('" + TextUtils.join("','", descendantAccountUIDs) + "')",
                    null,
                    null
            );
            HashMap<String, Account> mapAccounts = new HashMap<>();
            for (Account account : descendantAccounts)
                mapAccounts.put(account.getUID(), account);
            String parentAccountFullName;
            if (getAccountType(newParentAccountUID) == AccountType.ROOT) {
                parentAccountFullName = "";
            } else {
                parentAccountFullName = getAccountFullName(newParentAccountUID);
            }
            ContentValues contentValues = new ContentValues();
            for (String acctUID : descendantAccountUIDs) {
                Account acct = mapAccounts.get(acctUID);
                if (accountUID.equals(acct.getParentUID())) {
                    // direct descendant
                    acct.setParentUID(newParentAccountUID);
                    if (parentAccountFullName == null || parentAccountFullName.isEmpty()) {
                        acct.setFullName(acct.getName());
                    } else {
                        acct.setFullName(parentAccountFullName + ACCOUNT_NAME_SEPARATOR + acct.getName());
                    }
                    // update DB
                    contentValues.clear();
                    contentValues.put(AccountEntry.COLUMN_PARENT_ACCOUNT_UID, newParentAccountUID);
                    contentValues.put(AccountEntry.COLUMN_FULL_NAME, acct.getFullName());
                    mDb.update(
                            AccountEntry.TABLE_NAME, contentValues,
                            AccountEntry.COLUMN_UID + " = ?",
                            new String[]{acct.getUID()}
                    );
                } else {
                    // indirect descendant
                    acct.setFullName(
                            mapAccounts.get(acct.getParentUID()).getFullName() +
                                    ACCOUNT_NAME_SEPARATOR + acct.getName()
                    );
                    // update DB
                    contentValues.clear();
                    contentValues.put(AccountEntry.COLUMN_FULL_NAME, acct.getFullName());
                    mDb.update(
                            AccountEntry.TABLE_NAME, contentValues,
                            AccountEntry.COLUMN_UID + " = ?",
                            new String[]{acct.getUID()}
                    );
                }
            }
        }
    }

    /**
     * Deletes an account and its transactions, and all its sub-accounts and their transactions.
     *
Not only the splits belonging to the account and its descendants will be deleted, rather,
     * the complete transactions associated with this account and its descendants
     * (i.e. as long as the transaction has at least one split belonging to one of the accounts).
     * This prevents an split imbalance from being caused.

     *
If you want to preserve transactions, make sure to first reassign the children accounts (see {@link #reassignDescendantAccounts(String, String)}
     * before calling this method. This method will however not delete a root account.

     *
This method does a thorough delete, use with caution!!!

     * @param accountId Database record ID of account
     * @return true if the account and subaccounts were all successfully deleted, false if
     * even one was not deleted
     * @see #reassignDescendantAccounts(String, String)
     */
    public boolean recursiveDeleteAccount(long accountId){
        String accountUID = getUID(accountId);
        if (getAccountType(accountUID) == AccountType.ROOT) {
            // refuse to delete ROOT
            return false;
        }

        Log.d(LOG_TAG, "Delete account with rowId with its transactions and sub-accounts: " + accountId);

        List<String> descendantAccountUIDs = getDescendantAccountUIDs(accountUID, null, null);
        mDb.beginTransaction();
        try {
            descendantAccountUIDs.add(accountUID); //add account to descendants list just for convenience
            for (String descendantAccountUID : descendantAccountUIDs) {
                mTransactionsAdapter.deleteTransactionsForAccount(descendantAccountUID);
            }

            String accountUIDList = "'" + TextUtils.join("','", descendantAccountUIDs) + "'";

            // delete accounts
            long deletedCount = mDb.delete(
                    AccountEntry.TABLE_NAME,
                    AccountEntry.COLUMN_UID + " IN (" + accountUIDList + ")",
                    null
            );

            //if we delete some accounts, reset the default transfer account to NULL
            //there is also a database trigger from db version > 12
            if (deletedCount > 0){
                ContentValues contentValues = new ContentValues();
                contentValues.putNull(AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID);
                mDb.update(mTableName, contentValues,
                        AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID + " IN (" + accountUIDList + ")",
                        null);
            }

            mDb.setTransactionSuccessful();
            return true;
        }
        finally {
            mDb.endTransaction();
        }
    }

	/**
	 * Builds an account instance with the provided cursor and loads its corresponding transactions.
	 *
	 * @param c Cursor pointing to account record in database
	 * @return {@link Account} object constructed from database record
	 */
    @Override
    public Account buildModelInstance(@NonNull final Cursor c){
        Account account = buildSimpleAccountInstance(c);
        account.setTransactions(mTransactionsAdapter.getAllTransactionsForAccount(account.getUID()));

        return account;
	}

    /**
     * Builds an account instance with the provided cursor and loads its corresponding transactions.
     *
The method will not move the cursor position, so the cursor should already be pointing
     * to the account record in the database

     * Note Unlike {@link  #buildModelInstance(android.database.Cursor)} this method will not load transactions

     *
     * @param c Cursor pointing to account record in database
     * @return {@link Account} object constructed from database record
     */
    private Account buildSimpleAccountInstance(Cursor c) {
        Account account = new Account(c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_NAME)));
        populateBaseModelAttributes(c, account);

        String description = c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_DESCRIPTION));
        account.setDescription(description == null ? "" : description);
        account.setParentUID(c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_PARENT_ACCOUNT_UID)));
        account.setAccountType(AccountType.valueOf(c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_TYPE))));
        Currency currency = Currency.getInstance(c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_CURRENCY)));
        account.setCommodity(mCommoditiesDbAdapter.getCommodity(currency.getCurrencyCode()));
        account.setPlaceHolderFlag(c.getInt(c.getColumnIndexOrThrow(AccountEntry.COLUMN_PLACEHOLDER)) == 1);
        account.setDefaultTransferAccountUID(c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID)));
        String color = c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_COLOR_CODE));
        if (color != null)
            account.setColor(color);
        account.setFavorite(c.getInt(c.getColumnIndexOrThrow(AccountEntry.COLUMN_FAVORITE)) == 1);
        account.setFullName(c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_FULL_NAME)));
        account.setHidden(c.getInt(c.getColumnIndexOrThrow(AccountEntry.COLUMN_HIDDEN)) == 1);
        return account;
    }

    /**
	 * Returns the  unique ID of the parent account of the account with unique ID uid
	 * If the account has no parent, null is returned
	 * @param uid Unique Identifier of account whose parent is to be returned. Should not be null
	 * @return DB record UID of the parent account, null if the account has no parent
	 */
    public String getParentAccountUID(@NonNull String uid){
		Cursor cursor = mDb.query(AccountEntry.TABLE_NAME,
                new String[]{AccountEntry.COLUMN_PARENT_ACCOUNT_UID},
                AccountEntry.COLUMN_UID + " = ?",
                new String[]{uid},
                null, null, null, null);
        try {
            if (cursor.moveToFirst()) {
                Log.d(LOG_TAG, "Found parent account UID, returning value");
                return cursor.getString(cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_PARENT_ACCOUNT_UID));
            } else {
                return null;
            }
        } finally {
            cursor.close();
        }
	}

    /**
     * Returns the color code for the account in format #rrggbb
     * @param accountId Database row ID of the account
     * @return String color code of account or null if none
     */
    public String getAccountColorCode(long accountId){
        Cursor c = mDb.query(AccountEntry.TABLE_NAME,
                new String[]{AccountEntry._ID, AccountEntry.COLUMN_COLOR_CODE},
                AccountEntry._ID + "=" + accountId,
                null, null, null, null);
        try {
            if (c.moveToFirst()) {
                return c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_COLOR_CODE));
            }
            else {
                return null;
            }
        } finally {
            c.close();
        }
    }

    /**
     * Overloaded method. Resolves the account unique ID from the row ID and makes a call to {@link #getAccountType(String)}
     * @param accountId Database row ID of the account
     * @return {@link AccountType} of the account
     */
    public AccountType getAccountType(long accountId){
        return getAccountType(getUID(accountId));
    }

    /**
     * Returns a list of all account entries in the system (includes root account)
     * No transactions are loaded, just the accounts
     * @return List of {@link Account}s in the database
     */
    public List<Account> getSimpleAccountList(){
        LinkedList<Account> accounts = new LinkedList<>();
        Cursor c = fetchAccounts(null, null, AccountEntry.COLUMN_FULL_NAME + " ASC");

        try {
            while (c.moveToNext()) {
                accounts.add(buildSimpleAccountInstance(c));
            }
        }
        finally {
            c.close();
        }
        return accounts;
    }

    /**
     * Returns a list of all account entries in the system (includes root account)
     * No transactions are loaded, just the accounts
     * @return List of {@link Account}s in the database
     */
    public List<Account> getSimpleAccountList(String where, String[] whereArgs, String orderBy){
        LinkedList<Account> accounts = new LinkedList<>();
        Cursor c = fetchAccounts(where, whereArgs, orderBy);
        try {
            while (c.moveToNext()) {
                accounts.add(buildSimpleAccountInstance(c));
            }
        }
        finally {
            c.close();
        }
        return accounts;
    }
	/**
	 * Returns a list of accounts which have transactions that have not been exported yet
     * @param lastExportTimeStamp Timestamp after which to any transactions created/modified should be exported
	 * @return List of {@link Account}s with unexported transactions
	 */
    public List<Account> getExportableAccounts(Timestamp lastExportTimeStamp){
        LinkedList<Account> accountsList = new LinkedList<>();
        Cursor cursor = mDb.query(
                TransactionEntry.TABLE_NAME + " , " + SplitEntry.TABLE_NAME +
                        " ON " + TransactionEntry.TABLE_NAME + "." + TransactionEntry.COLUMN_UID + " = " +
                        SplitEntry.TABLE_NAME + "." + SplitEntry.COLUMN_TRANSACTION_UID + " , " +
                        AccountEntry.TABLE_NAME + " ON " + AccountEntry.TABLE_NAME + "." +
                        AccountEntry.COLUMN_UID + " = " + SplitEntry.TABLE_NAME + "." +
                        SplitEntry.COLUMN_ACCOUNT_UID,
                new String[]{AccountEntry.TABLE_NAME + ".*"},
                TransactionEntry.TABLE_NAME + "." + TransactionEntry.COLUMN_MODIFIED_AT + " > ?",
                new String[]{TimestampHelper.getUtcStringFromTimestamp(lastExportTimeStamp)},
                AccountEntry.TABLE_NAME + "." + AccountEntry.COLUMN_UID,
                null,
                null
        );
        try {
            while (cursor.moveToNext()) {
                accountsList.add(buildModelInstance(cursor));
            }
        }
        finally {
            cursor.close();
        }
        return accountsList;
	}

    /**
     * Retrieves the unique ID of the imbalance account for a particular currency (creates the imbalance account
     * on demand if necessary)
     * @param commodity Commodity for the imbalance account
     * @return String unique ID of the account
     */
    public String getOrCreateImbalanceAccountUID(Commodity commodity){
        String imbalanceAccountName = getImbalanceAccountName(commodity);
        String uid = findAccountUidByFullName(imbalanceAccountName);
        if (uid == null){
            Account account = new Account(imbalanceAccountName, commodity);
            account.setAccountType(AccountType.BANK);
            account.setParentUID(getOrCreateGnuCashRootAccountUID());
            account.setHidden(!GnuCashApplication.isDoubleEntryEnabled());
            account.setColor("#964B00");
            addRecord(account, UpdateMethod.insert);
            uid = account.getUID();
        }
        return uid;
    }

    /**
     * Returns the GUID of the imbalance account for the currency
     *
This method will not create the imbalance account if it doesn't exist

     * @param currency Currency for the imbalance account
     * @return GUID of the account or null if the account doesn't exist yet
     * @see #getOrCreateImbalanceAccountUID(Commodity)
     */
    public String getImbalanceAccountUID(Currency currency){
        String imbalanceAccountName = getImbalanceAccountName(currency);
        return findAccountUidByFullName(imbalanceAccountName);
    }

    /**
     * Returns the GUID of the imbalance account for the commodity
     *
     *
This method will not create the imbalance account if it doesn't exist

     *
     * @param commodity Commodity for the imbalance account
     * @return GUID of the account or null if the account doesn't exist yet
     * @see #getOrCreateImbalanceAccountUID(Commodity)
     */
    public String getImbalanceAccountUID(Commodity commodity){
        String imbalanceAccountName = getImbalanceAccountName(commodity);
        return findAccountUidByFullName(imbalanceAccountName);
    }

    /**
     * Creates the account with the specified name and returns its unique identifier.
     *
If a full hierarchical account name is provided, then the whole hierarchy is created and the
     * unique ID of the last account (at bottom) of the hierarchy is returned

     * @param fullName Fully qualified name of the account
     * @param accountType Type to assign to all accounts created
     * @return String unique ID of the account at bottom of hierarchy
     */
    public String createAccountHierarchy(String fullName, AccountType accountType) {
        if ("".equals(fullName)) {
            throw new IllegalArgumentException("fullName cannot be empty");
        }
        String[] tokens = fullName.trim().split(ACCOUNT_NAME_SEPARATOR);
        String uid = getOrCreateGnuCashRootAccountUID();
        String parentName = "";
        ArrayList<Account> accountsList = new ArrayList<>();
        for (String token : tokens) {
            parentName += token;
            String parentUID = findAccountUidByFullName(parentName);
            if (parentUID != null) { //the parent account exists, don't recreate
                uid = parentUID;
            } else {
                Account account = new Account(token);
                account.setAccountType(accountType);
                account.setParentUID(uid); //set its parent
                account.setFullName(parentName);
                accountsList.add(account);
                uid = account.getUID();
            }
            parentName += ACCOUNT_NAME_SEPARATOR;
        }
        if (accountsList.size() > 0) {
            bulkAddRecords(accountsList, UpdateMethod.insert);
        }
        // if fullName is not empty, loop will be entered and then uid will never be null
        //noinspection ConstantConditions
        return uid;
    }

    /**
     * Returns the unique ID of the opening balance account or creates one if necessary
     * @return String unique ID of the opening balance account
     */
    public String getOrCreateOpeningBalanceAccountUID() {
        String openingBalanceAccountName = getOpeningBalanceAccountFullName();
        String uid = findAccountUidByFullName(openingBalanceAccountName);
        if (uid == null) {
            uid = createAccountHierarchy(openingBalanceAccountName, AccountType.EQUITY);
        }
        return uid;
    }

    /**
     * Finds an account unique ID by its full name
     * @param fullName Fully qualified name of the account
     * @return String unique ID of the account or null if no match is found
     */
    public String findAccountUidByFullName(String fullName){
        Cursor c = mDb.query(AccountEntry.TABLE_NAME, new String[]{AccountEntry.COLUMN_UID},
                AccountEntry.COLUMN_FULL_NAME + "= ?", new String[]{fullName},
                null, null, null, "1");
        try {
            if (c.moveToNext()) {
                return c.getString(c.getColumnIndexOrThrow(AccountEntry.COLUMN_UID));
            } else {
                return null;
            }
        } finally {
            c.close();
        }
    }

	/**
	 * Returns a cursor to all account records in the database.
     * GnuCash ROOT accounts and hidden accounts will not be included in the result set
	 * @return {@link Cursor} to all account records
	 */
    @Override
	public Cursor fetchAllRecords(){
		Log.v(LOG_TAG, "Fetching all accounts from db");
        String selection =  AccountEntry.COLUMN_HIDDEN + " = 0 AND " + AccountEntry.COLUMN_TYPE + " != ?" ;
        return mDb.query(AccountEntry.TABLE_NAME,
                null,
                selection,
                new String[]{AccountType.ROOT.name()},
                null, null,
                AccountEntry.COLUMN_NAME + " ASC");
	}

    /**
     * Returns a cursor to all account records in the database ordered by full name.
     * GnuCash ROOT accounts and hidden accounts will not be included in the result set.
     * @return {@link Cursor} to all account records
     */
    public Cursor fetchAllRecordsOrderedByFullName(){
        Log.v(LOG_TAG, "Fetching all accounts from db");
        String selection =  AccountEntry.COLUMN_HIDDEN + " = 0 AND " + AccountEntry.COLUMN_TYPE + " != ?" ;
        return mDb.query(AccountEntry.TABLE_NAME,
                null,
                selection,
                new String[]{AccountType.ROOT.name()},
                null, null,
                AccountEntry.COLUMN_FULL_NAME + " ASC");
    }

    /**
     * Returns a Cursor set of accounts which fulfill where
     * and ordered by orderBy
     * @param where SQL WHERE statement without the 'WHERE' itself
     * @param whereArgs args to where clause
     * @param orderBy orderBy clause
     * @return Cursor set of accounts which fulfill where
     */
    public Cursor fetchAccounts(@Nullable String where, @Nullable String[] whereArgs, @Nullable String orderBy){
        if (orderBy == null){
            orderBy = AccountEntry.COLUMN_NAME + " ASC";
        }
        Log.v(LOG_TAG, "Fetching all accounts from db where " + where + " order by " + orderBy);

        return mDb.query(AccountEntry.TABLE_NAME,
                null, where, whereArgs, null, null,
                orderBy);
    }

    /**
     * Returns a Cursor set of accounts which fulfill where
     *
This method returns the accounts list sorted by the full account name

     * @param where SQL WHERE statement without the 'WHERE' itself
     * @param whereArgs where args
     * @return Cursor set of accounts which fulfill where
     */
    public Cursor fetchAccountsOrderedByFullName(String where, String[] whereArgs) {
        Log.v(LOG_TAG, "Fetching all accounts from db where " + where);
        return mDb.query(AccountEntry.TABLE_NAME,
                null, where, whereArgs, null, null,
                AccountEntry.COLUMN_FULL_NAME + " ASC");
    }

    /**
     * Returns a Cursor set of accounts which fulfill where
     *
This method returns the favorite accounts first, sorted by name, and then the other accounts,
     * sorted by name.

     * @param where SQL WHERE statement without the 'WHERE' itself
     * @param whereArgs where args
     * @return Cursor set of accounts which fulfill where
     */
    public Cursor fetchAccountsOrderedByFavoriteAndFullName(String where, String[] whereArgs) {
        Log.v(LOG_TAG, "Fetching all accounts from db where " + where + " order by Favorite then Name");
        return mDb.query(AccountEntry.TABLE_NAME,
                null, where, whereArgs, null, null,
                AccountEntry.COLUMN_FAVORITE + " DESC, " + AccountEntry.COLUMN_FULL_NAME + " ASC");
    }

    /**
     * Returns the balance of an account while taking sub-accounts into consideration
     * @return Account Balance of an account including sub-accounts
     */
    public Money getAccountBalance(String accountUID){
        return computeBalance(accountUID, -1, -1);
    }

    /**
     * Returns the balance of an account within the specified time range while taking sub-accounts into consideration
     * @param accountUID the account's UUID
     * @param startTimestamp the start timestamp of the time range
     * @param endTimestamp the end timestamp of the time range
     * @return the balance of an account within the specified range including sub-accounts
     */
    public Money getAccountBalance(String accountUID, long startTimestamp, long endTimestamp) {
        return computeBalance(accountUID, startTimestamp, endTimestamp);
    }

    /**
     * Compute the account balance for all accounts with the specified type within a specific duration
     * @param accountType Account Type for which to compute balance
     * @param startTimestamp Begin time for the duration in milliseconds
     * @param endTimestamp End time for duration in milliseconds
     * @return Account balance
     */
    public Money getAccountBalance(AccountType accountType, long startTimestamp, long endTimestamp){
        Cursor cursor = fetchAccounts(AccountEntry.COLUMN_TYPE + "= ?",
                new String[]{accountType.name()}, null);
        List<String> accountUidList = new ArrayList<>();
        while (cursor.moveToNext()){
            String accountUID = cursor.getString(cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_UID));
            accountUidList.add(accountUID);
        }
        cursor.close();

        boolean hasDebitNormalBalance = accountType.hasDebitNormalBalance();
        String currencyCode = GnuCashApplication.getDefaultCurrencyCode();

        Log.d(LOG_TAG, "all account list : " + accountUidList.size());
        SplitsDbAdapter splitsDbAdapter = mTransactionsAdapter.getSplitDbAdapter();

        return (startTimestamp == -1 && endTimestamp == -1)
                ? splitsDbAdapter.computeSplitBalance(accountUidList, currencyCode, hasDebitNormalBalance)
                : splitsDbAdapter.computeSplitBalance(accountUidList, currencyCode, hasDebitNormalBalance, startTimestamp, endTimestamp);
    }

    /**
     * Returns the account balance for all accounts types specified
     * @param accountTypes List of account types
     * @param start Begin timestamp for transactions
     * @param end End timestamp of transactions
     * @return Money balance of the account types
     */
    public Money getAccountBalance(List<AccountType> accountTypes, long start, long end){
        Money balance = Money.createZeroInstance(GnuCashApplication.getDefaultCurrencyCode());
        for (AccountType accountType : accountTypes) {
            balance = balance.add(getAccountBalance(accountType, start, end));
        }
        return balance;
    }

    private Money computeBalance(String accountUID, long startTimestamp, long endTimestamp) {
        Log.d(LOG_TAG, "Computing account balance for account ID " + accountUID);
        String currencyCode = mTransactionsAdapter.getAccountCurrencyCode(accountUID);
        boolean hasDebitNormalBalance = getAccountType(accountUID).hasDebitNormalBalance();

        List<String> accountsList = getDescendantAccountUIDs(accountUID,
                null, null);

        accountsList.add(0, accountUID);

        Log.d(LOG_TAG, "all account list : " + accountsList.size());
        SplitsDbAdapter splitsDbAdapter = mTransactionsAdapter.getSplitDbAdapter();
        return (startTimestamp == -1 && endTimestamp == -1)
                ? splitsDbAdapter.computeSplitBalance(accountsList, currencyCode, hasDebitNormalBalance)
                : splitsDbAdapter.computeSplitBalance(accountsList, currencyCode, hasDebitNormalBalance, startTimestamp, endTimestamp);

    }

    /**
     * Returns the balance of account list within the specified time range. The default currency
     * takes as base currency.
     * @param accountUIDList list of account UIDs
     * @param startTimestamp the start timestamp of the time range
     * @param endTimestamp the end timestamp of the time range
     * @return Money balance of account list
     */
    public Money getAccountsBalance(@NonNull  List<String> accountUIDList, long startTimestamp, long endTimestamp) {
        String currencyCode = GnuCashApplication.getDefaultCurrencyCode();
        Money balance = Money.createZeroInstance(currencyCode);

        if (accountUIDList.isEmpty())
            return balance;

        boolean hasDebitNormalBalance = getAccountType(accountUIDList.get(0)).hasDebitNormalBalance();

        SplitsDbAdapter splitsDbAdapter = mTransactionsAdapter.getSplitDbAdapter();
        Money splitSum = (startTimestamp == -1 && endTimestamp == -1)
                ? splitsDbAdapter.computeSplitBalance(accountUIDList, currencyCode, hasDebitNormalBalance)
                : splitsDbAdapter.computeSplitBalance(accountUIDList, currencyCode, hasDebitNormalBalance, startTimestamp, endTimestamp);

        return balance.add(splitSum);
    }

    /**
     * Retrieve all descendant accounts of an account
     * Note, in filtering, once an account is filtered out, all its descendants
     * will also be filtered out, even they don't meet the filter where
     * @param accountUID The account to retrieve descendant accounts
     * @param where      Condition to filter accounts
     * @param whereArgs  Condition args to filter accounts
     * @return The descendant accounts list.
     */
    public List<String> getDescendantAccountUIDs(String accountUID, String where, String[] whereArgs) {
        // accountsList will hold accountUID with all descendant accounts.
        // accountsListLevel will hold descendant accounts of the same level
        ArrayList<String> accountsList = new ArrayList<>();
        ArrayList<String> accountsListLevel = new ArrayList<>();
        accountsListLevel.add(accountUID);
        for (;;) {
            Cursor cursor = mDb.query(AccountEntry.TABLE_NAME,
                    new String[]{AccountEntry.COLUMN_UID},
                    AccountEntry.COLUMN_PARENT_ACCOUNT_UID + " IN ( '" + TextUtils.join("' , '", accountsListLevel) + "' )" +
                            (where == null ? "" : " AND " + where),
                    whereArgs, null, null, null);
            accountsListLevel.clear();
            if (cursor != null) {
                try {
                    int columnIndex = cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_UID);
                    while (cursor.moveToNext()) {
                        accountsListLevel.add(cursor.getString(columnIndex));
                    }
                } finally {
                    cursor.close();
                }
            }
            if (accountsListLevel.size() > 0) {
                accountsList.addAll(accountsListLevel);
            }
            else {
                break;
            }
        }
        return accountsList;
    }

    /**
     * Returns a cursor to the dataset containing sub-accounts of the account with record ID accoundId
     * @param accountUID GUID of the parent account
     * @return {@link Cursor} to the sub accounts data set
     */
    public Cursor fetchSubAccounts(String accountUID) {
        Log.v(LOG_TAG, "Fetching sub accounts for account id " + accountUID);
        String selection = AccountEntry.COLUMN_HIDDEN + " = 0 AND "
                + AccountEntry.COLUMN_PARENT_ACCOUNT_UID + " = ?";
        return mDb.query(AccountEntry.TABLE_NAME,
                null,
                selection,
                new String[]{accountUID}, null, null, AccountEntry.COLUMN_NAME + " ASC");
    }

    /**
     * Returns the top level accounts i.e. accounts with no parent or with the GnuCash ROOT account as parent
     * @return Cursor to the top level accounts
     */
    public Cursor fetchTopLevelAccounts() {
        //condition which selects accounts with no parent, whose UID is not ROOT and whose type is not ROOT
        return fetchAccounts("(" + AccountEntry.COLUMN_PARENT_ACCOUNT_UID + " IS NULL OR "
                        + AccountEntry.COLUMN_PARENT_ACCOUNT_UID + " = ?) AND "
                        + AccountEntry.COLUMN_HIDDEN + " = 0 AND "
                        + AccountEntry.COLUMN_TYPE + " != ?",
                new String[]{getOrCreateGnuCashRootAccountUID(), AccountType.ROOT.name()},
                AccountEntry.COLUMN_NAME + " ASC");
    }

    /**
     * Returns a cursor to accounts which have recently had transactions added to them
     * @return Cursor to recently used accounts
     */
    public Cursor fetchRecentAccounts(int numberOfRecent) {
        return mDb.query(TransactionEntry.TABLE_NAME
                        + " LEFT OUTER JOIN " + SplitEntry.TABLE_NAME + " ON "
                        + TransactionEntry.TABLE_NAME + "." + TransactionEntry.COLUMN_UID + " = "
                        + SplitEntry.TABLE_NAME + "." + SplitEntry.COLUMN_TRANSACTION_UID
                        + " , " + AccountEntry.TABLE_NAME + " ON " + SplitEntry.TABLE_NAME + "." + SplitEntry.COLUMN_ACCOUNT_UID
                        + " = " + AccountEntry.TABLE_NAME + "." + AccountEntry.COLUMN_UID,
                new String[]{AccountEntry.TABLE_NAME + ".*"},
                AccountEntry.COLUMN_HIDDEN + " = 0",
                null,
                SplitEntry.TABLE_NAME + "." + SplitEntry.COLUMN_ACCOUNT_UID, //groupby
                null, //haveing
                "MAX ( " + TransactionEntry.TABLE_NAME + "." + TransactionEntry.COLUMN_TIMESTAMP + " ) DESC", // order
                Integer.toString(numberOfRecent) // limit;
        );
    }

    /**
     * Fetches favorite accounts from the database
     * @return Cursor holding set of favorite accounts
     */
    public Cursor fetchFavoriteAccounts(){
        Log.v(LOG_TAG, "Fetching favorite accounts from db");
        String condition = AccountEntry.COLUMN_FAVORITE + " = 1";
        return mDb.query(AccountEntry.TABLE_NAME,
                null, condition, null, null, null,
                AccountEntry.COLUMN_NAME + " ASC");
    }

    /**
     * Returns the GnuCash ROOT account UID if one exists (or creates one if necessary).
     *
In GnuCash desktop account structure, there is a root account (which is not visible in the UI) from which
     * other top level accounts derive. GnuCash Android also enforces a ROOT account now

     * @return Unique ID of the GnuCash root account.
     */
    public String getOrCreateGnuCashRootAccountUID() {
        Cursor cursor = fetchAccounts(AccountEntry.COLUMN_TYPE + "= ?",
                new String[]{AccountType.ROOT.name()}, null);
        try {
            if (cursor.moveToFirst()) {
                return cursor.getString(cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_UID));
            }
        } finally {
            cursor.close();
        }
        // No ROOT exits, create a new one
        Account rootAccount = new Account("ROOT Account", new CommoditiesDbAdapter(mDb).getCommodity("USD"));
        rootAccount.setAccountType(AccountType.ROOT);
        rootAccount.setFullName(ROOT_ACCOUNT_FULL_NAME);
        rootAccount.setHidden(true);
        rootAccount.setPlaceHolderFlag(true);
        ContentValues contentValues = new ContentValues();
        contentValues.put(AccountEntry.COLUMN_UID, rootAccount.getUID());
        contentValues.put(AccountEntry.COLUMN_NAME, rootAccount.getName());
        contentValues.put(AccountEntry.COLUMN_FULL_NAME, rootAccount.getFullName());
        contentValues.put(AccountEntry.COLUMN_TYPE, rootAccount.getAccountType().name());
        contentValues.put(AccountEntry.COLUMN_HIDDEN, rootAccount.isHidden() ? 1 : 0);
        String defaultCurrencyCode = GnuCashApplication.getDefaultCurrencyCode();
        contentValues.put(AccountEntry.COLUMN_CURRENCY, defaultCurrencyCode);
        contentValues.put(AccountEntry.COLUMN_COMMODITY_UID, getCommodityUID(defaultCurrencyCode));
        Log.i(LOG_TAG, "Creating ROOT account");
        mDb.insert(AccountEntry.TABLE_NAME, null, contentValues);
        return rootAccount.getUID();
    }

    /**
     * Returns the number of accounts for which the account with ID accoundId is a first level parent
     * @param accountUID String Unique ID (GUID) of the account
     * @return Number of sub accounts
     */
    public int getSubAccountCount(String accountUID){
        //TODO: at some point when API level 11 and above only is supported, use DatabaseUtils.queryNumEntries

        String queryCount = "SELECT COUNT(*) FROM " + AccountEntry.TABLE_NAME + " WHERE "
                + AccountEntry.COLUMN_PARENT_ACCOUNT_UID + " = ?";
        Cursor cursor = mDb.rawQuery(queryCount, new String[]{accountUID});
        cursor.moveToFirst();
        int count = cursor.getInt(0);
        cursor.close();
        return count;
    }

    /**
	 * Returns currency code of account with database ID id
	 * @param uid GUID of the account
	 * @return Currency code of the account
	 */
	public String getCurrencyCode(String uid){
		return getAccountCurrencyCode(uid);
	}

    /**
     * Returns the simple name of the account with unique ID accountUID.
     * @param accountUID Unique identifier of the account
     * @return Name of the account as String
     * @throws java.lang.IllegalArgumentException if accountUID does not exist
     * @see #getFullyQualifiedAccountName(String)
     */
    public String getAccountName(String accountUID){
        return getAttribute(accountUID, AccountEntry.COLUMN_NAME);
    }

    /**
     * Returns the default transfer account record ID for the account with UID accountUID
     * @param accountID Database ID of the account record
     * @return Record ID of default transfer account
     */
    public long getDefaultTransferAccountID(long accountID){
        Cursor cursor = mDb.query(AccountEntry.TABLE_NAME,
                new String[]{AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID},
                AccountEntry._ID + " = " + accountID,
                null, null, null, null);
       try {
            if (cursor.moveToNext()) {
                String uid = cursor.getString(
                        cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID));
                if (uid == null)
                    return 0;
                else
                    return getID(uid);
            } else {
                return 0;
            }
        } finally {
            cursor.close();
        }
    }

    /**
     * Returns the full account name including the account hierarchy (parent accounts)
     * @param accountUID Unique ID of account
     * @return Fully qualified (with parent hierarchy) account name
     */
    public String getFullyQualifiedAccountName(String accountUID){
        String accountName = getAccountName(accountUID);
        String parentAccountUID = getParentAccountUID(accountUID);

        if (parentAccountUID == null || parentAccountUID.equalsIgnoreCase(getOrCreateGnuCashRootAccountUID())){
            return accountName;
        }

        String parentAccountName = getFullyQualifiedAccountName(parentAccountUID);

        return parentAccountName + ACCOUNT_NAME_SEPARATOR + accountName;
    }

    /**
     * get account's full name directly from DB
     * @param accountUID the account to retrieve full name
     * @return full name registered in DB
     */
    public String getAccountFullName(String accountUID) {
        Cursor cursor = mDb.query(AccountEntry.TABLE_NAME, new String[]{AccountEntry.COLUMN_FULL_NAME},
                AccountEntry.COLUMN_UID + " = ?", new String[]{accountUID},
                null, null, null);
        try {
            if (cursor.moveToFirst()) {
                return cursor.getString(cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_FULL_NAME));
            }
        }
        finally {
            cursor.close();
        }
        throw new IllegalArgumentException("account UID: " + accountUID + " does not exist");
    }

    /**
     * Returns true if the account with unique ID accountUID is a placeholder account.
     * @param accountUID Unique identifier of the account
     * @return true if the account is a placeholder account, false otherwise
     */
    public boolean isPlaceholderAccount(String accountUID) {
        String isPlaceholder = getAttribute(accountUID, AccountEntry.COLUMN_PLACEHOLDER);
        return Integer.parseInt(isPlaceholder) == 1;
    }

    /**
     * Convenience method, resolves the account unique ID and calls {@link #isPlaceholderAccount(String)}
     * @param accountUID GUID of the account
     * @return true if the account is hidden, false otherwise
     */
    public boolean isHiddenAccount(String accountUID){
        String isHidden = getAttribute(accountUID, AccountEntry.COLUMN_HIDDEN);
        return Integer.parseInt(isHidden) == 1;
    }

    /**
     * Returns true if the account is a favorite account, false otherwise
     * @param accountUID GUID of the account
     * @return true if the account is a favorite account, false otherwise
     */
    public boolean isFavoriteAccount(String accountUID){
        String isFavorite = getAttribute(accountUID, AccountEntry.COLUMN_FAVORITE);
        return Integer.parseInt(isFavorite) == 1;
    }

    /**
     * Updates all opening balances to the current account balances
     */
    public List<Transaction> getAllOpeningBalanceTransactions(){
        Cursor cursor = fetchAccounts(null, null, null);
        List<Transaction> openingTransactions = new ArrayList<>();
        try {
            SplitsDbAdapter splitsDbAdapter = mTransactionsAdapter.getSplitDbAdapter();
            while (cursor.moveToNext()) {
                long id = cursor.getLong(cursor.getColumnIndexOrThrow(AccountEntry._ID));
                String accountUID = getUID(id);
                String currencyCode = getCurrencyCode(accountUID);
                ArrayList<String> accountList = new ArrayList<>();
                accountList.add(accountUID);
                Money balance = splitsDbAdapter.computeSplitBalance(accountList,
                        currencyCode, getAccountType(accountUID).hasDebitNormalBalance());
                if (balance.asBigDecimal().compareTo(new BigDecimal(0)) == 0)
                    continue;

                Transaction transaction = new Transaction(GnuCashApplication.getAppContext().getString(R.string.account_name_opening_balances));
                transaction.setNote(getAccountName(accountUID));
                transaction.setCommodity(Commodity.getInstance(currencyCode));
                TransactionType transactionType = Transaction.getTypeForBalance(getAccountType(accountUID),
                        balance.isNegative());
                Split split = new Split(balance.abs(), accountUID);
                split.setType(transactionType);
                transaction.addSplit(split);
                transaction.addSplit(split.createPair(getOrCreateOpeningBalanceAccountUID()));
                transaction.setExported(true);
                openingTransactions.add(transaction);
            }
        } finally {
            cursor.close();
        }
        return openingTransactions;
    }

    public static String getImbalanceAccountPrefix() {
         return GnuCashApplication.getAppContext().getString(R.string.imbalance_account_name) + "-";
    }

    /**
     * Returns the imbalance account where to store transactions which are not double entry
     * @param currency Currency of the transaction
     * @return Imbalance account name
     */
    public static String getImbalanceAccountName(Currency currency){
        return getImbalanceAccountPrefix() + currency.getCurrencyCode();
    }

    /**
     * Returns the imbalance account where to store transactions which are not double entry.
     *
     * @param commodity Commodity of the transaction
     * @return Imbalance account name
     */
    public static String getImbalanceAccountName(Commodity commodity){
        return getImbalanceAccountPrefix() + commodity.getCurrencyCode();
    }

    /**
     * Get the name of the default account for opening balances for the current locale.
     * For the English locale, it will be "Equity:Opening Balances"
     * @return Fully qualified account name of the opening balances account
     */
    public static String getOpeningBalanceAccountFullName(){
        Context context = GnuCashApplication.getAppContext();
        String parentEquity = context.getString(R.string.account_name_equity).trim();
        //German locale has no parent Equity account
        if (parentEquity.length() > 0) {
            return parentEquity + ACCOUNT_NAME_SEPARATOR
                    + context.getString(R.string.account_name_opening_balances);
        } else
            return context.getString(R.string.account_name_opening_balances);
    }

    /**
     * Returns the account color for the active account as an Android resource ID.
     *

     * Basically, if we are in a top level account, use the default title color.
     * but propagate a parent account's title color to children who don't have own color
     *

     * @param accountUID GUID of the account
     * @return Android resource ID representing the color which can be directly set to a view
     */
    public static int getActiveAccountColorResource(@NonNull String accountUID) {
        AccountsDbAdapter accountsDbAdapter = getInstance();

        String colorCode = null;
        int iColor = -1;
        String parentAccountUID = accountUID;
        while (parentAccountUID != null ) {
            colorCode = accountsDbAdapter.getAccountColorCode(accountsDbAdapter.getID(parentAccountUID));
            if (colorCode != null) {
                iColor = Color.parseColor(colorCode);
                break;
            }
            parentAccountUID = accountsDbAdapter.getParentAccountUID(parentAccountUID);
        }

        if (colorCode == null) {
            iColor = GnuCashApplication.getAppContext().getResources().getColor(R.color.theme_primary);
        }

        return iColor;
    }

    /**
     * Returns the list of currencies in use in the database.
     *
This is not the same as the list of all available commodities

     * @return List of currencies in use
     */
    public List<Currency> getCurrenciesInUse(){
        Cursor cursor = mDb.query(true, AccountEntry.TABLE_NAME, new String[]{AccountEntry.COLUMN_CURRENCY},
                null, null, null, null, null, null);
        List<Currency> currencyList = new ArrayList<>();
        try {
            while (cursor.moveToNext()) {
                String currencyCode = cursor.getString(cursor.getColumnIndexOrThrow(AccountEntry.COLUMN_CURRENCY));
                currencyList.add(Currency.getInstance(currencyCode));
            }
        } finally {
            cursor.close();
        }
        return currencyList;
    }

    /**
	 * Deletes all accounts, transactions (and their splits) from the database.
     * Basically empties all 3 tables, so use with care ;)
	 */
    @Override
	public int deleteAllRecords() {
        // Relies "ON DELETE CASCADE" takes too much time
        // It take more than 300s to complete the deletion on my dataset without
        // clearing the split table first, but only needs a little more that 1s
        // if the split table is cleared first.
        mDb.delete(DatabaseSchema.PriceEntry.TABLE_NAME, null, null);
        mDb.delete(SplitEntry.TABLE_NAME, null, null);
        mDb.delete(TransactionEntry.TABLE_NAME, null, null);
        mDb.delete(DatabaseSchema.ScheduledActionEntry.TABLE_NAME, null, null);
        mDb.delete(DatabaseSchema.BudgetAmountEntry.TABLE_NAME, null, null);
        mDb.delete(DatabaseSchema.BudgetEntry.TABLE_NAME, null, null);
        mDb.delete(DatabaseSchema.RecurrenceEntry.TABLE_NAME, null, null);

        return mDb.delete(AccountEntry.TABLE_NAME, null, null);
    }

    @Override
    public boolean deleteRecord(@NonNull String uid) {
        boolean result = super.deleteRecord(uid);
        if (result){
            ContentValues contentValues = new ContentValues();
            contentValues.putNull(AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID);
            mDb.update(mTableName, contentValues,
                    AccountEntry.COLUMN_DEFAULT_TRANSFER_ACCOUNT_UID + "=?",
                    new String[]{uid});
        }
        return result;
    }

    public int getTransactionMaxSplitNum(@NonNull String accountUID) {
        Cursor cursor = mDb.query("trans_extra_info",
                new String[]{"MAX(trans_split_count)"},
                "trans_acct_t_uid IN ( SELECT DISTINCT " + TransactionEntry.TABLE_NAME + "_" + TransactionEntry.COLUMN_UID +
                        " FROM trans_split_acct WHERE " + AccountEntry.TABLE_NAME + "_" + AccountEntry.COLUMN_UID +
                        " = ? )",
                new String[]{accountUID},
                null,
                null,
                null
                );
        try {
            if (cursor.moveToFirst()) {
                return (int)cursor.getLong(0);
            } else {
                return 0;
            }
        }
        finally {
            cursor.close();
        }
    }
}

redpajama_set_name: RedPajamaGithub


Manufacturer of Laundry Boiler - Electrical Steam Generator, ... The Laundry Steam Boiler offered by us is made up of excellent quality ... Industrial Laundry Machines.
steam boiler for laundry machine application. Steam boilers are used where steam and hot steam is needed. Hence, steam boilers are used as generators to produce electricity in the energy business.
Manufacturer of Laundry Equipments - Legger Press Laundry ... Machine and Commercial Laundry Washing Machine offered by ... spectrum of Diesel Steam Boiler.
Alibaba.com offers 957 laundry steam boiler products. About 99% of these are boilers. A wide variety of laundry steam boiler options are available to you, such as horizontal, vertical.
For all of your hot water and steam needs, Parker Boiler delivers industrial boilers that keep your on-premise and industrial laundry performing efficiently.
Laundry Boiler Machine, Wholesale Various High Quality Laundry Boiler Machine Products from Global Laundry Boiler Machine Suppliers and Laundry Boiler Machine Factory,Importer,Exporter at Alibaba.com.
Laundry Washing Machine. Washing Machine ( Side Loading ) Centrifugal Cloth Drier ... Steam Boiler Water Boiler . Water Boiler Stain Removing Mechine.
LTD - We are renowned manufacturer, exporter & supplier of laundry machine, laundry washing machine, etc. ... steam boiler, tumbler dryer and other equipment.