text:
#ifndef MUPDF_PDF_OBJECT_H
#define MUPDF_PDF_OBJECT_H

typedef struct pdf_document_s pdf_document;

/*
 * Dynamic objects.
 * The same type of objects as found in PDF and PostScript.
 * Used by the filters and the mupdf parser.
 */

typedef struct pdf_obj_s pdf_obj;

pdf_obj *pdf_new_null(pdf_document *doc);
pdf_obj *pdf_new_bool(pdf_document *doc, int b);
pdf_obj *pdf_new_int(pdf_document *doc, int i);
pdf_obj *pdf_new_real(pdf_document *doc, float f);
pdf_obj *pdf_new_name(pdf_document *doc, const char *str);
pdf_obj *pdf_new_string(pdf_document *doc, const char *str, int len);
pdf_obj *pdf_new_indirect(pdf_document *doc, int num, int gen);
pdf_obj *pdf_new_array(pdf_document *doc, int initialcap);
pdf_obj *pdf_new_dict(pdf_document *doc, int initialcap);
pdf_obj *pdf_new_rect(pdf_document *doc, const fz_rect *rect);
pdf_obj *pdf_new_matrix(pdf_document *doc, const fz_matrix *mtx);
pdf_obj *pdf_copy_array(pdf_obj *array);
pdf_obj *pdf_copy_dict(pdf_obj *dict);

pdf_obj *pdf_new_obj_from_str(pdf_document *doc, const char *src);

pdf_obj *pdf_keep_obj(pdf_obj *obj);
void pdf_drop_obj(pdf_obj *obj);

/* type queries */
int pdf_is_null(pdf_obj *obj);
int pdf_is_bool(pdf_obj *obj);
int pdf_is_int(pdf_obj *obj);
int pdf_is_real(pdf_obj *obj);
int pdf_is_number(pdf_obj *obj);
int pdf_is_name(pdf_obj *obj);
int pdf_is_string(pdf_obj *obj);
int pdf_is_array(pdf_obj *obj);
int pdf_is_dict(pdf_obj *obj);
int pdf_is_indirect(pdf_obj *obj);
int pdf_is_stream(pdf_document *doc, int num, int gen);

int pdf_objcmp(pdf_obj *a, pdf_obj *b);

/* obj marking and unmarking functions - to avoid infinite recursions. */
int pdf_obj_marked(pdf_obj *obj);
int pdf_mark_obj(pdf_obj *obj);
void pdf_unmark_obj(pdf_obj *obj);

/* obj memo functions - allows us to secretly remember "a memo" (a bool) in
 * an object, and to read back whether there was a memo, and if so, what it
 * was. */
void pdf_set_obj_memo(pdf_obj *obj, int memo);
int pdf_obj_memo(pdf_obj *obj, int *memo);

/* obj dirty bit support. */
int pdf_obj_is_dirty(pdf_obj *obj);
void pdf_dirty_obj(pdf_obj *obj);
void pdf_clean_obj(pdf_obj *obj);

/* safe, silent failure, no error reporting on type mismatches */
int pdf_to_bool(pdf_obj *obj);
int pdf_to_int(pdf_obj *obj);
float pdf_to_real(pdf_obj *obj);
char *pdf_to_name(pdf_obj *obj);
char *pdf_to_str_buf(pdf_obj *obj);
pdf_obj *pdf_to_dict(pdf_obj *obj);
int pdf_to_str_len(pdf_obj *obj);
int pdf_to_num(pdf_obj *obj);
int pdf_to_gen(pdf_obj *obj);

int pdf_array_len(pdf_obj *array);
pdf_obj *pdf_array_get(pdf_obj *array, int i);
void pdf_array_put(pdf_obj *array, int i, pdf_obj *obj);
void pdf_array_push(pdf_obj *array, pdf_obj *obj);
void pdf_array_push_drop(pdf_obj *array, pdf_obj *obj);
void pdf_array_insert(pdf_obj *array, pdf_obj *obj, int index);
void pdf_array_insert_drop(pdf_obj *array, pdf_obj *obj, int index);
void pdf_array_delete(pdf_obj *array, int index);
int pdf_array_contains(pdf_obj *array, pdf_obj *obj);

int pdf_dict_len(pdf_obj *dict);
pdf_obj *pdf_dict_get_key(pdf_obj *dict, int idx);
pdf_obj *pdf_dict_get_val(pdf_obj *dict, int idx);
pdf_obj *pdf_dict_get(pdf_obj *dict, pdf_obj *key);
pdf_obj *pdf_dict_gets(pdf_obj *dict, const char *key);
pdf_obj *pdf_dict_getp(pdf_obj *dict, const char *key);
pdf_obj *pdf_dict_getsa(pdf_obj *dict, const char *key, const char *abbrev);
void pdf_dict_put(pdf_obj *dict, pdf_obj *key, pdf_obj *val);
void pdf_dict_puts(pdf_obj *dict, const char *key, pdf_obj *val);
void pdf_dict_puts_drop(pdf_obj *dict, const char *key, pdf_obj *val);
void pdf_dict_putp(pdf_obj *dict, const char *key, pdf_obj *val);
void pdf_dict_putp_drop(pdf_obj *dict, const char *key, pdf_obj *val);
void pdf_dict_del(pdf_obj *dict, pdf_obj *key);
void pdf_dict_dels(pdf_obj *dict, const char *key);
void pdf_sort_dict(pdf_obj *dict);

/*
	Recurse through the object structure setting the node's parent_num to num.
	parent_num is used when a subobject is to be changed during a document edit.
	The whole containing hierarchy is moved to the incremental xref section, so
	to be later written out as an incremental file update.
*/
void pdf_set_obj_parent(pdf_obj *obj, int num);

int pdf_obj_refs(pdf_obj *ref);

int pdf_obj_parent_num(pdf_obj *obj);

int pdf_sprint_obj(char *s, int n, pdf_obj *obj, int tight);
int pdf_fprint_obj(FILE *fp, pdf_obj *obj, int tight);
int pdf_output_obj(fz_output *out, pdf_obj *obj, int tight);

#ifndef NDEBUG
void pdf_print_obj(pdf_obj *obj);
void pdf_print_ref(pdf_obj *obj);
#endif

char *pdf_to_utf8(pdf_document *doc, pdf_obj *src);
unsigned short *pdf_to_ucs2(pdf_document *doc, pdf_obj *src);
pdf_obj *pdf_to_utf8_name(pdf_document *doc, pdf_obj *src);
char *pdf_from_ucs2(pdf_document *doc, unsigned short *str);
void pdf_to_ucs2_buf(unsigned short *buffer, pdf_obj *src);

fz_rect *pdf_to_rect(fz_context *ctx, pdf_obj *array, fz_rect *rect);
fz_matrix *pdf_to_matrix(fz_context *ctx, pdf_obj *array, fz_matrix *mat);

pdf_document *pdf_get_indirect_document(pdf_obj *obj);
void pdf_set_str_len(pdf_obj *obj, int newlen);
void pdf_set_int(pdf_obj *obj, int i);

#endif


Woo Park, Sang Wook Jin, Woo Jin Jeong, Long Yu Jin, Seon Tae Kim, Seung Yoon Noh, Seoung Hyun An; Clinical performance of multifocal scleral lens for presbyopia correction. Invest. Ophthalmol. Vis. Sci. 2018;59(9):247.
Purpose : To assess the clinical performance of multifocal scleral lens for correction of presbyopia.
Methods : A prospective clinical trial of Onefit-A multifocal scleral lens (Blanchard Contact Lens INC.) was conducted on 30 participants with presbyopia. At 4 weeks after scleral lens wear, change of far, intermediate, and near visual acuity was evaluated. For evaluation of scleral lens safety, conjunctival hyperemia, corneal staining, corneal neovascularization, central corneal thickness (CCT), corneal endothelial cell count, tear film break-up time (BUT), and binocular stereopsis were examined. Subjective questionnaires for satisfaction (point rated 1 to 5) and discomfort (point rated 0 to 4) were quantified.
Results : Among 30 participants, 24 participants were enrolled in this study. Six participants were drop out because of poor compliance of lens fitting (4) and follow up loss (2). At 4 weeks after scleral lens wear, far, intermediate and near logMAR visual acuity was 0.08 ± 0.11, 0.10 ± 0.12, 0.01 ± 0.12. This results were significantly improved from baseline uncorrected visual acuity (far: p = 0.004; intermediate: p = 0.004; near: p = 0.002) and were not significantly different from baseline best corrected visual acuity. Conjunctival hyperemia, corneal staining, corneal neovascularization, central corneal thickness (CCT), corneal endothelial cell count, tear film break-up time (BUT), and binocular stereopsis was not significantly different between before and after scleral lens wear. Each average point of satisfaction questionnaires for comfort, corrected far, intermediate, near visual acuity, and handling was 4.1, 3.4, 3.5, 3.5, and 3.4. Each average point of discomfort questionnaires for dryness, irritation, foreign body sensation, redness, fogging, and halo was 0.7, 0.8, 1.0, 0.7, 0.7 and 1.3.
Conclusions : This multifocal scleral lens offers to presbyops an improvement in far, intermediate, and near visual acuity without serious ocular adverse effect. Therefore it endorses the approach as a safe and effective option for the correction of presbyopia.


text:
Larry Buker, Golf Instructor
Saralisa Ortega, Golf Shop Assistant
"Lefty" Larry Buker is a native of Boston, Massachusetts and moved to Santa Barbara in 1970. He earned a Business Administration Bachelor's Degree, with a focus on Office Systems Management, at CSUN in 1996. Larry began playing golf at the age of 33. During his beginning years in learning to play the game, his passion and desire grew immensely. Larry began working in the Golf Shop at Santa Barbara Golf Club in 2005. His passion to teach the game has continued to grow and is lead by the desire to help golfers of all levels, especially juniors. Currently, he is the program coordinator and lead Coach with The Russ Morrison Junior Golf Program which he has been involved as an Instructor since 2005. Larry's passion to help others is proven by being the Instructor for Cottage Rehabilitation Hospital (CRH) "Adaptive Golf Program" since 2004. Other past experiences include: junior volunteer coach with the First Tee Program from 2006-2008, Pro Advisor for SBJGA 2014-2016, and being a golf instructor for UCSB Recreational Sports beginning & intermediate program 2007-2010. "Lefty" Larry has proven his playing skills by successfully passing the PGA's Players Ability Test in 2008. He teaches basic fundamentals and works with all ages and abilities of golfers to improve their mental game skills and promote positive reinforcement.
Contact: (805) 705-8787 | lbuker@playsantabarbara.com
Saralisa Ortega was born and raised in Santa Barbara, California and started playing golf with her father at the age of 5 years old. Saralisa went to Santa Barbara High School and played on the Girls Golf Varsity team all four years. She was Most Improved Player in 2009, Most Valuable Player in 2012, Athlete of the Year at the Santa Barbara Athletic Round Table (SBART) Hall of Fame for High School Girls Golf in 2012-2013, Channel League Champion, and was also athlete of the week. Saralisa graduated from Santa Barbara High School in 2013 and went to Santa Barbara City College and played two years on the Girls Golf Team. In Fall of 2013, Saralisa and her team won the State Championship. In 2014, Saralisa was Athlete of the Year for SBART - College Women's Golf 2014-2015, and also received the Vaquero Award for Women's Golf. After playing for two year at SBCC, in March of 2015, she started working at the Santa Barbara Golf Club in the Golf Shop as a Golf Shop Assistant. The following spring, she began working with The Russ Morrison Junior Golf program and is now an Assistant Coach to over 100+ juniors. Her passion is working with kids and teaching them the fundamentals of golf. Saralisa continues to be an avid golfer and is a big part of the growth of junior golf within the region.

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Path to a PHP file in symfony I am practicing unit test for AJAX call in Symfony 2.8.
Here is my code in a .js file. I call it in my TWIG :
<script>
QUnit.test("test dynamic fill", function (assert) {
            var ajax = $("#ajax"); //my div to fill
            $("#feed_the_ajax").click(function () {
                $.ajax({
                    url: "echo.php",
                    type: "POST",
                    data: {text: "Hello world !"},
                    success: function (data) {
                        ajax.text(data);
                    },
                    error: function () {
                    }
                });
                assert.ok(!ajax.text() == "Hello world !", "Hello !");
            });
            assert.ok(!ajax.text() == "Hello world !", "Answer me ...");
        });
</script>

echo.php file is just like this :
<?php
if($_POST['text'] != ""){
    return $_POST['text'];
}

When I run the code, it tells me that "echo.php" is not found.
I guess that I have to specify the route for the file.
I didn't modify anything in the server configuration.
Here is my config.yml file :
imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }

# Put parameters here that don't need to change on each machine where the app is deployed
# http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: en

framework:
    #esi:             ~
    #translator:      { fallbacks: ["%locale%"] }
    secret:          "%secret%"
router:
    resource: "%kernel.root_dir%/config/routing.yml"
    strict_requirements: ~
form:            ~
csrf_protection: ~
validation:      { enable_annotations: true }
#serializer:      { enable_annotations: true }
templating:
    engines: ['twig']
default_locale:  "%locale%"
trusted_hosts:   ~
trusted_proxies: ~
session:
    # handler_id set to null will use default session handler from php.ini
    handler_id:  ~
fragments:       ~
http_method_override: true

# Twig Configuration
twig:
debug:            "%kernel.debug%"
strict_variables: "%kernel.debug%"

# Doctrine Configuration
doctrine:
dbal:
    driver:   pdo_mysql
    host:     "%database_host%"
    port:     "%database_port%"
    dbname:   "%database_name%"
    user:     "%database_user%"
    password: "%database_password%"
    charset:  UTF8
    # if using pdo_sqlite as your database driver:
    #   1. add the path in parameters.yml
    #     e.g. database_path: "%kernel.root_dir%/data/data.db3"
    #   2. Uncomment database_path in parameters.yml.dist
    #   3. Uncomment next line:
    #     path:     "%database_path%"

orm:
    auto_generate_proxy_classes: "%kernel.debug%"
    naming_strategy: doctrine.orm.naming_strategy.underscore
    auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host:      "%mailer_host%"
username:  "%mailer_user%"
password:  "%mailer_password%"
spool:     { type: memory }

Thanks for your answers,
Telest

A: If it's a sf2 route (to access echo.php) you can use this.
Else your path to echo.php should be relative to web folder or absolute

A: Your server does not allow anything else as app.php or app_dev.php.
For example if your server is NginX and you use the recommanded NginX configuration :
http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html#nginx
You have this block, which throws your 404 error ... :
# return 404 for all other php files not matching the front controller
# this prevents access to other php files you don't want to be accessible.
location ~ \.php$ {
  return 404;
}

redpajama_set_name: RedPajamaStackExchange


text:
fall entertainment guide
A Female Doctor Isn't The Only Huge 'Doctor Who' Change This Season
After a long 15 months, the doctor is officially back in. Doctor Who Season 11 hits screens Oct. 7, and it ushers in an exciting new era: Jodie Whittaker will be the show's first female doctor in its 55-year history. There are plenty questions…
By Tai Gooden
Here's Why Chef Adam Won't Be On 'Below Deck' This Season
Bravo's reality TV series Below Deck is coming back for more peeks into the lives of crew members who keep fancy yachts pristine. Season 6 pulls into port on October 2 and there will be some returning cast members as well as a few new faces, which…
Here's Who Gabriel Maddox' Dad Might Be On 'HTGAWM'
Annalise and the Keating Four are finally back! How to Get Away with Murder is kicking off on Season 5 on Sept. 27 and there's one major question on everyone's mind – Who is Gabriel Maddox? He was introduced during Season 4's final minutes and…
These Gabriel Maddox Theories Will Make You Question Everything You Know About 'HTGAWM'
Grab the wine and popcorn, because How to Get Away with Murder is back for more twisty drama and heart-stopping action on Sept. 27. In case you forgot, Season 4 ended with Frank Delfino spotting Gabriel Maddox (Rome Flynn), a mysterious new college…
The True Story Behind This 'New Amsterdam' Doctor Will Make You Happy-Cry
Fall TV season is finally here, and with it brings New Amsterdam, a new NBC drama following hotshot doctor Max Goodwin. As the new medical director of an underfunded hospital, he comes in swinging big, wanting to prioritize patient care in a system…
Serious 'Law & Order' Fans Will Be Way Into Dick Wolf's New Series About The FBI
Police-centric shows often play a major role in fall TV lineups, and this year is no different with CBS' FBI. The show was created by producer Dick Wolf, who has mastered the genre with the Law & Order and Chicago franchises. This new show follows…
How Being On 'Transparent' Has Made Its Cast Question Their Own Assigned Identities
The Pfeffermans' return to screens in Transparent Season 4 likely feels like coming home again for many viewers, which incidentally is a theme on which the new episodes touch. It's hard not to watch the show without being affected by it, but…
Women-Led TV Shows To Watch This Fall
Olympic fever may be in the air right now, but soon there will be something else for everyone to get excited about: the premiere of the 2016 fall TV lineup. While there are a whole slew of great shows returning from last year, there are also a lot…
By Shannon Carlin
These Memes Perfectly Call Out Bi Erasure
What do Buffy the Vampire Slayer's Willow, The L Word's Alice, and the title character of Constantine all have in common? If you're familiar with the concept of bi erasure, you know exactly where this is going: All three characters have clearly…
By Claire Warner
9 Free Printables Your Fall Decor Needs
Fall has arrived, and it is making itself right at home — but what about your home? These free fall printables, created by Hometalk bloggers, are the easiest ways to dress up your living space for the coziest season of them all. That's right — these…
By Hometalk


I have always had excellent service and he always does what he says he will do. I always recommend bravos.
Was pleased that these guys were open when all other salvage yards within 100 mile radius were closed. I needed a seat for 93 truck, and he was professional by all means, honest & respectful. Said he'd check on condition and call me back.
That's all a guy asks for, is honesty.


Top 5 Reasons to Hire a Personal Injury Attorney – This video explains common reasons why it may be in your best interest to hire an attorney if you are injured in an automobile accident. McMullin Legal Group is located in St. George, Utah. We're in Your Community, and on Your Side.
This article will help explain the top 5 reasons why hiring a personal injury attorney is a good idea after a car accident. When an individual is involved in an accident they may not only be physically injured but also worried about how to even begin the process of taking care of themselves and handling all of the inconveniences and financial worries that can come with an accident. An accident is just that, an accident. It is something that one is unprepared for. This article will break down the 5 reasons to seek an attorney's help when you are involved with an accident to make sure you take care of yourself and your family the best way possible.
The first reason might surprise you because it's not about the money. The most important reason to hire an attorney is to allow you to focus on you and your loved ones. You need to worry about getting better. Let someone else worry about dealing with all of the other things, the medical records and bills, the insurance companies, and talking with the doctors, and the financials. When you get in a car accident, you may not even know where to begin with all that should be done. You have paperwork and bills stacking up, you have your own insurance company to deal with, the PIP (personal injury protection),the at-fault liability carriers bodily injury policy, and maybe also property damage concerns. All of these parties will be sending you letters, asking you questions that you may not know how to answer. All of this can be extremely confusing and stressful and can take valuable energy away from the work of getting healthy and healing.
An effective way to relieve this pressure is to hire an expert. An experienced, qualified attorney handles this kind of paperwork every day. They have a system to deal with all of it that is streamlined and effective. They can handle it all properly so you can focus on getting better.
People may think that if they hire an attorney they are being aggressive or greedy. The truth is that your insurance company as well as the other guys insurance company, has teams of attorneys working on their side to minimize the effects of the accident and the impact your claim has on their pocket-books. Their job is to pay you as little as possible. From the moment your accident is reported to your insurance company, you can be sure that they will begin their research and investigations to assure that their cost will be minimized. That is their business. You need to level the playing field by having an advocate on your side that is experienced and understands the law to ensure that your rights are maintained and the effects of the accident on you and your lifestyle are considered. You need someone to make sure that the insurance company deals with you in a fair and timely manner.
Oftentimes, no one gets sued, but you need to be aware that you may have only a limited time to sue for your injuries or damages after a crash. It is critical for you to know what those time limits are. Your attorney will know the statute of limitation laws for filing car accident claims and can help you meet those deadlines.
You don't know what you don't know when you don't know it. There are things that come up during the pursuit of a case that will trap you or that will allow the insurance company to ding you and not fairly compensate you for an injury or even for the repair or value of a car or property that is damaged after a car accident. These are things that you just may not be aware of because you have never dealt with a situation like this before. There are many pitfalls when you are pursuing a personal injury claim. There are many ways that you could get into trouble, a lot of ways that you could make a mistake that could cost you money that you need to recover fully or restore what should be restored. The insurance company will use a mistake that you make against you in order to minimize the value of your claim. For example, you may use the phrase, "Oh, I'm ok." When in your mind you mean, "Well, I hurt, but I mean I'm not dead, I'm going to be fine." The insurance company takes that statement to mean that you you are ok and therefore uninjured in any way. Later, when you have to deal with medical bills from your injury, they will deny the bills and claim that you must have been hurt doing something else.
An insurance company may also dispute the fact that their client was at fault. In this situation, they are basically saying that you don't have enough proof to show that their client is responsible for your expenses. An accident attorney will assist you in providing the proof to show that the other party was indeed at fault. It can be complex to prove the liability of the other party involved. Even if there were witnesses and a police report that states the other party was at fault, even when a citation was given, it can sometimes prove difficult to show that they were negligent. With so many elements involved in a personal injury case, it would be wise to have someone on your team that understands the law and can provide references to previous cases and citations from other sources of the law that will support your position.
When deciding if you need an attorney, you need to consider the severity of the injuries you or your family member sustained as well as the damage to your property. Ask yourself how long it will take to recover, how much time off of work will your recovery cost you as well as the long term repercussions of your injuries.
Now we talk about the money. Statistically, an attorney is going to get you more money in your case than you will be awarded should you handle your claim on your own. Obviously, the smaller the case, the less an attorney will be able to help with. But the bigger the case, the more an attorney will be able to assist you in collecting more money. Compensation means money. It's called "damages" in legal terms. What that means is the insurance company for the at-fault driver, owes you an amount of money that makes you whole under the law. In order to get you compensated fairly, we have to be able to explain and show and prove through written documentation, why your case is worth what it is worth, both with special damages and general damages. When you don't understand all of the various things that entitle you to compensation under the law, there is just no way for you to get compensated fairly. And again, an attorney is not looking to get you a compensation amount that is crazy, or above and beyond or frivolous. What we look to get you is the full amount that is fair and reasonable under the parameters of Utah law.
As mentioned above, when you ask yourself how long will recovery take, an attorney will be able to help you come to a realistic answer to this question. His expertise in this area will aide you in making an informed decision. If you have sustained a long-term injury, one that last a year or longer, your physical therapy, time away from work, medical expenses, etc. will continue to mount up. The financial loss in an injury like this can be devastating if the proper steps were not taken to protect you and your ability to recover. You may even have an injury that disables you for life, in this situation you definitely need a legal professional on your side. In this case, a personal injury attorney will consult with each medical professional involved in your care to assess what your medical care and recovery will entail and what projected expenses for that care will be.
Reason #5 Why have insurance if you can't use it?
People might hesitate to make a claim because they think that would be greedy or that it may drive their insurance premiums up. Insurance premiums are assessed based on future risk and future risk is based on fault. If you are at fault, it is possible that your insurance rate will go up. If you are not at fault, it is highly unlikely that your insurance company will raise your premium going forward because it was not your fault. The risk of you being in an accident in the future has not gone up. They will continue to charge you the same premium that you have been paying.
So why have insurance if you can't use it? Why continue to pay premiums every single month when even when facts arise to where you have a valid claim under your policy that you have been paying for, that you're not even going to make that claim? If that's the case, why have insurance at all. It is a pretty profitable deal for insurance companies if you are the type of person that they can just charge every month indefinitely, for your entire life and no matter what happens, even if the terms of this policy, this contract that you pay for with them is triggered by some car accident or something else happening and they know that you are not even going to make a claim. That is a pretty imbalanced equation for them. That would make anyone want to start an insurance company, because why not right? If people are willing to pay every month for a service that they will never use, literally paying for the insurance company to do nothing for them. That is a pretty lucrative business model.
You need to be able to get yourself better and make yourself whole. You have insurance for this very reason. A dependable personal injury attorney can mean the difference between a fair outcome for you and your loved ones or more stress that only compounds your worries and health concerns. Time is of the essence in many cases involving injuries. The insurance companies may interpret your silence or the length of the time it takes you to see a medical professional or to seek legal counsel as a sign that you were not in pain or not initially hurt in the accident. At least consult an attorney that has experience and legal knowledge that will help you determine the best course of action that will lead to the fairest outcome for you and your family. Remember the collision itself is not the only danger of a car accident. The legal ramifications and the financial cost to you and possibly your family may not end with the car repairs and a visit to a medical professional.
Seeking good legal counsel will help you to understand what other dangers may come up in a case such as yours. Consulting with an attorney about your case will allow you to ask questions and get reliable answers that can help guide the crucial decisions that you will need to make. Your attorney can help you decide if you have a viable case and determine what rights you have. At this point, it may be determined that you do not have a case, if this happens, you will have saved yourself a lot of stress, time, and money by taking the time to let a professional help you determine that.
So to sum up, there are many good reasons to consult an attorney when you or a family member is involved in a car accident. You need a professional to answer your important questions and guide you through the process of making a claim when injuries have occurred. This information will allow you to make important, timely decisions that will impact you and your family. For more free information, call McMullin Legal Group at 435-673-9990.


Lyons Truck Parts of Kenosha, Wisconsin has been a family-owned truck parts & repair business since 1959.
Lyons Truck Parts customers benefit from our quick turnaround service from in-house machine shop.
For over 50 years, Lyons has been provided top-quality truck parts, accessories and services at great prices.
Lyons Truck Parts offers you a complete line of new & used truck parts & repair services at great prices. We specialize in transmissions, differentials & gear boxes, and offer you fast, professional on-site installation.
We are located in Kenosha, WI, conveniently located between Milwaukee and Chicago, & just a short distance from Racine. We pride ourselves in offering our parts & installation service with the quickest turnaround time possible, all at affordable prices to get you back in gear and on the road ASAP. Our staff has over 50 years of experience & deliver reliability you can count on.
Contact us here or call 1-800-870-5060 for any questions regarding our products or services.
We Provide a Full Range of Truck Repair Services!


There are several things employers can do to encourage their employees to follow proper safety precautions. Forklift accidents are a major concern in most companies as they end up resulting in serious injuries. More importantly, inexperienced forklift drivers are often the cause of most common form of injuries, but there are several other reasons these accidents occur. What can you do about these concerns and ensure your staff and warehouse is safe? Here are some tips to follow for proper forklift safety.
Several forklift concerns occur because drivers are not properly educated. If you are not taking the time to educate your staff on the serious risks associated with forklifts, they can easily become vulnerable to an accident. Accidents can occur when people are failing to pay attention; others happen simply due to a lack of experience and knowledge. If there ever comes a time when your machine starts to malfunction, you'll want to make sure you have someone at the wheel who is confident in their knowledge and lift truck abilities.
While an experienced forklift driver may have several years operating machinery, the forklifts you use could be completely different than what they are normally accustomed to. It helps to have forklift machinery training so everyone knows how to manage the forklifts and use them appropriately. Employees must be aware of the different mechanical parts of the forklift, and most importantly, they need to know the ins and outs of every single control. Have each forklift operator spend a certain number of hours with the forklift before they are allowed to operate it on their own. Training with a manager is a great way to make sure they know what they are doing, and can handle the forklift if there is a problem.
Collisions with pedestrians are a major cause of accidents in the workplace as well. A forklift operator must be conscious of the people around them at all times. Everyone must attend safety courses where they can learn how to operate the machine, but to also learn how to be aware of their environment. Given that a warehouse can be, at times, a very hectic and busy place, safety training is an essential part of forklift operations to avoid any accidents involving your fellow co-workers. It helps to have safety training so people learn how to be aware of pedestrians, and know what to do in the event of someone getting injured by the forklift.
Plan on having your employees attend safety and training courses yearly. This is the best way to help people become aware of things they can forget over the years. It helps them to learn about the equipment they have been using as some people can easily forget how things are supposed to work.
A great way to train people on safety is by implementing and utilizing signage. The right signs will help a forklift operator go in the right direction when they are driving, and it helps the pedestrians to know where they need to go to stay out of the way of the forklift. Use these five tips to make sure your forklift operators and pedestrians stay safe. With the right training, you can drastically reduce workplace accidents related to forklifts.
On December 1999, OSHA released a new regulation instructing all employers to provide training for their forklift operators. The training must composed of classroom lecture, practical test and evaluation.
Who's covered? Operators of powered industrial trucks in general industry, and construction and maritime industries, must be trained. OSHA estimates the new rules will cover more than 1.5 million operators.
OSHA has revised its existing general industry standard ? 1910.178(l) ? and added for shipyards a new standard ? 1915.120(l) ? with a cross-reference to 1910.178(l). For construction, a new standard has been added ? 1926.602(d) ? with a cross-reference to 1910.178(l). OSHA defines powered industrial trucks as forklifts and other vehicles that carry, push, pull, lift, stack, or tier material. The standard does not apply to vehicles used for earth moving or over-the-road hauling.


Obama honours Ghani's request weeks before launch of the Taliban's traditional 'spring offensive'.
ISLAMABAD: US President Barack Obama's decision to abandon plans to downsize military contingents in Afghanistan this year is being seen as a setback for reconciliation prospects.
Afghan President Ashraf Ghani had requested President Obama to reconsider the withdrawal of 9,800 troopers as he believes the law and order situation is still too volatile for local forces to take over. Ghani cited the emergence of the self-proclaimed Islamic State as another threat to Afghanistan's sovereignty. American forces will now inevitably stay put well into 2016.
The Taliban were quick to respond to the decision and called it "America's announcement for the elongation of occupation" and expressed the desire to wage "holy Jihad against all forms of invasion".
"America has achieved none of its manifest or latent objectives in Afghanistan during the past 13 years," they retorted in a statement, adding a few thousand troops do not threaten their cause in any way. The Taliban said Afghans will continue to struggle until the very last foreign trooper exits their homeland.
Defence experts claim the Ghani administration did breathe a sigh of relief following Obama's announcement during the Afghan President's visit to the US. Former Afghan defence minister Shahnawaz Tanai declared it a blessing in disguise for Afghan security forces and law-enforcement agencies.
"They will have two additional years to train under the umbrella of foreign troops," he told The Express Tribune, adding on the flipside it will also reinforce the resolve of the Taliban and add weight to their narrative of war. Tanai opined the Taliban will plausibly respond with all guns blazing, but doubted if they will be able to inflict substantial damage.
Obama's announcement has come at a time when the Taliban's traditional 'spring offensive' is only a few weeks away. Requesting anonymity, a Taliban official said fighters have started preparations to intensify attacks in the coming months. "They suffered heavy losses at our hands in the winter. We will come down even harder in the summer," he claimed.
So it seems the Taliban still mean business and a few encouraging statements from President Ghani have done little to soften their stance. During his visit to the US, Ghani called the Taliban a "political opposition" and expressed desire to address their "genuine concerns".
"Some of their grievances are legitimate. The brutal treatment of detainees has fuelled their emotions," he noted during a discussion at the Institute of Peace, Washington, on Wednesday. The Afghan President also underscored Pakistan's role in the peace process.
"The fundamental problem is peace between Pakistan and Afghanistan. For the past 13 years, we have upheld hostile positions against each other," he maintained, declaring the realisation of the issue is a major breakthrough.
Political analysts argue President Ghani and his Chief Executive Dr Abdullah Abdullah will not be able to orchestrate a positive-sum game in the given circumstances. They say a working relationship with the Taliban is only possible in the absence of American soldiers and interests.
Nazar Mutmaeen, an expert on Afghan security issues, said the Taliban will by no means become party to negotiations with a government that is in need of foreign patronage. "I believe the words and actions of President Ghani and Dr Abdullah are self-contradictory," he told The Express Tribune from Kabul on Friday, adding the delay in American withdrawal will only further validate the stand of the Taliban.
Published in The Express Tribune, March 28th, 2015.


text:
Holiday Inn Hotel & Suites Rochester - Marketplace
800 Jefferson Rd, Rochester, NY 14623, USA Henrietta New York State United States - 14623
**Property Location**.When you stay at Holiday Inn Hotel & Suites Rochester - Marketplace in Rochester, you'll be in the business district, within a 15-minute drive of Rochester Institute of Technology and University of Rochester. This hotel is 6.5 mi (10.5 km) from Strong Memorial Hospital and 8.7 mi (14 km) from Nazareth College. Distances are displayed to the nearest 0.1 mile and kilometer. .Marketplace Mall - 0.7 km / 0.4 mi Veterans Memorial Park - 3 km / 1.8 mi Bill Gray's Regional Iceplex - 3.2 km / 2 mi Fair and Expo Center - 4.2 km / 2.6 mi URMC Women's Health Center - 4.2 km / 2.6 mi Rochester Institute of Technology - 4.3 km / 2.7 mi Strong Memorial Hospital - 4.9 km / 3 mi Genesee Valley Park - 5.2 km / 3.3 mi Tinker Nature Park - 6.5 km / 4 mi Frederick Douglass Statue - 6.6 km / 4.1 mi Highland Hospital - 6.8 km / 4.3 mi Kings Bend Park - 7.8 km / 4.9 mi Mary Jemison Landing - 8.1 km / 5 mi Geva Theatre Center - 8.7 km / 5.4 mi Manhattan Square Park and Ice Rink - 9.2 km / 5.7 mi .The preferred airport for Holiday Inn Hotel & Suites Rochester - Marketplace is Greater Rochester Intl. Airport (ROC) - 15.2 km / 9.4 mi. **Rooms**.Make yourself at home in one of the 120 air- conditioned rooms featuring refrigerators and microwaves. Wired and wireless Internet access is complimentary, while 37-inch flat-screen televisions with cable programming provide entertainment. Private bathrooms with shower/tub combinations feature complimentary toiletries and hair dryers. Conveniences include desks and coffee/tea makers, as well as phones with free local calls.**Dining**.Enjoy a meal at the restaurant, or stay in and take advantage of the hotel's room service (during limited hours). Wrap up your day with a drink at the bar/lounge. Buffet breakfasts are available daily from 6:30 AM to 9:30 AM for a fee.**Business, Other Amenities**.Featured amenities include complimentary wired Internet access, a business center, and express check-out. Free self parking is available onsite.


im not able ton install the nvidia driver for my 9800 Gtx !
what version of the driver are you trying to install?
thank's for the solution and thank's to all the team of Kali !
Long life to Kali !!!
thank you that is gret news !
One of the user on the bt-fr just installed in dual boot an report that the resolution is perfect !!
Again ... thank's Kali Linux team for a so great Os !
PS : Proud user since Back | Track 4 !
by the way ... oclhashcat+ is now ok !
Thanks mate. It works like a charm simple by following the steps described here, http://wiki.debian.org/NvidiaGraphicsDrivers.
Nvidia Control panel shows up nice and easy by typing nvidia-settings. Despite the fact that I can't find it under menu I'm fine with accessing it from the console though.
hello, i try to install nvidia drivers but it fails. i did apt-get install linux-headers-`uname -r` then i tried to install driver from nvidia bin. any help please? here is the nvidia install log.
-> Installing NVIDIA driver version 173.14.35.
in '/lib/modules/3.7-trunk-686-pae/build' have not been configured.
I can't be more happy than I'm now! And I thanks God and you guys for this.
1 - Used this (http://wiki.debian.org/NvidiaGraphicsDrivers) steps to install nVidia driver with DKMS as I couldn't make it to work as the message "No headers found" was appearing and even installing the headers, it wasn't working. And to install the :i386 headers, it would uninstall MANY stuff so I proceeded with the DKMS part.
2 - Skipped the part to configure nVidia with XORG as it just won't work as the primary driver is the Intel and since I didn't want GNOME to start with nVidia (which would be impossible), I've skipped the XORG part to let Intel deals with that so I wouldn't have problems starting the graphic interface. In noob terms: I haven't touch the XORG config files.
3 - Then I used this (http://wiki.debian.org/Bumblebee) steps to install the Bumblebee from the Suwako repository to make things WAAY easier, after reboot, my "optirun glxgears -info" worked like a charm and showed my nVidia card working!
Again, thank you all. Kali Linux rocks!
PS: after rebooting the machine , the screen goes into very low pixels, everything will show large ! just type : nvidia-xconfig .
Ctrl+o & Ctrl+x to confirm and save.
That's it , everything worked wonders for me this way . Hope it does for you.
my graphic driver is installed for my gtx 660m, i can adjust all graphic setting on nvidia setting, but i having trouble with my pyrit and oclhashcat.plus, pyrit doesnt show cuda gtx 660m on and oclhashcat.plus saying, my gpu card driver is not installed, now i dont know what to do, all the solution here doesnt work for me... i've install cuda toolkit already but still have same result..... btw im using kali linux amd64..
│ Please see the package documentation for instructions.
when i reboot i get black screen , i re installed kali , what do i do ???
I just wanted to confirm that I managed to install the non-free Nvidia binary driver using the DKMS method with the addition of installing the nvidia-xconfig util as well which wrote a new xorg.conf. So far I've experienced no problem, on the contrary! The Nouveau driver did more harm than good. It was very very unstable (3-4 crashes a day) which is unacceptable on a professional pentest system used on a daily basis. Lots of logs, hours of scans and such lost. The Nouveau driver also caused some other odd problems. I could'nt start graphical Java based tools like Burp Suite Pro, NeXpose GUI installed etc. Basically anything using AWT/Swing. This was due to that Java was not able to find the default display. All resolved using the non-free Nvidia driver.
I don't get things to work here. Actually I'm afraid to screw up if something goes wrong. But lets put that on the shelf for now.
I first of all want to know if it's safe to install drivers straight from Nvidia?
It found a driver that supports my card (295.33 Certified) but in the information they clearly stated that certain dislltros may already have better suited drivers.
One of the last installation steps will offer to update your X configuration file. Either accept that offer, edit your X configuration file manually so that the NVIDIA X driver will be used, or run nvidia-xconfig"
So my question is could this work? Because many of you have come accross different results doing bacially the same installations?
Noob here with a GTX 680. I finally figured out how to install the nvidia driver without it complaining about nouveau, kernel-headers, nvidia config files, or getting that nasty black screen of death upon reboot.
Please note: I did this from a fresh install of Kali 1.01 (if you are having apt-get errors of it not finding repositories, reinstall with network mirroring enabled).
Problem: Black screen after installation of nvidia drivers while invoking gdm3.
Neither worked out for me.
[ 127.575] (==) Using config file: "/etc/X11/xorg.conf"
[ 127.575] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 127.575] (==) ServerLayout "Layout0"
[ 127.575] (**) | |-->Monitor "Monitor0"
[ 127.576] (**) | |-->Device "Device0"
[ 127.576] (**) |-->Input Device "Keyboard0"
[ 127.576] (**) |-->Input Device "Mouse0"
[ 127.576] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 127.576] Entry deleted from font path.
[ 127.576] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[ 127.576] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[ 127.576] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[ 127.576] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[ 127.576] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.
[ 127.576] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 127.576] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 127.578] (II) LoadModule: "extmod"
[ 127.579] (II) Module extmod: vendor="X.Org Foundation"
[ 127.579] (II) LoadModule: "dbe"
[ 127.579] (II) Module dbe: vendor="X.Org Foundation"
[ 127.579] (II) LoadModule: "glx"
[ 127.594] (II) Module glx: vendor="NVIDIA Corporation"
[ 127.594] (II) LoadModule: "record"
[ 127.594] (II) Module record: vendor="X.Org Foundation"
[ 127.594] (II) LoadModule: "dri"
[ 127.595] (II) Module dri: vendor="X.Org Foundation"
[ 127.595] (II) LoadModule: "dri2"
[ 127.595] (II) Module dri2: vendor="X.Org Foundation"
[ 127.595] (II) LoadModule: "nvidia"
[ 127.595] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 127.600] (EE) No devices detected.
[ 127.600] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
Switched to X86. Gave it a shot. Still No luck. Same errors. No screen found.
then run apt-get update again.
a fresh install of Kali 1.03 , accroding the doc , install nvidia go black and no respon, you work step is awesome!


text:
The Sino-Soviet conflict of 1929 (, ) was an armed conflict between the Soviet Union and the Chinese warlord Zhang Xueliang of the Republic of China over the Chinese Eastern Railway (also known as the CER).

The conflict was the first major combat test of the reformed Soviet Red Army, which was organized along the latest professional lines, and ended with the mobilization and deployment of 156,000 troops to the Manchurian border. Combining the active-duty strength of the Red Army and border guards with the call-up of the Far East reserves, approximately one in five Soviet soldiers was sent to the frontier, the largest Red Army combat force to be fielded between the Russian Civil War (1917–1922) and the Soviet Union's entry to the Second World War.

In 1929, the Chinese Northeastern Army took over the Chinese Eastern Railway to regain solo control of the railway. The Soviet Union quickly responded with a military intervention and eventually forced the Chinese to return the railway to the previous format of joint administration. During the conflict, the Soviets gained full control of Bolshoy Ussuriysky Island () from China, and the military occupation remained on the island until the 1991 Sino-Soviet Border Agreement in which Russia decided to return the western half of the island to China in 2004.

Background
On 25 July 1919, the Soviet government's Assistant Commissar of Foreign Affairs, Lev Karakhan, had issued a manifesto to the Chinese government that promised the return of the Chinese Eastern Railway (CER) to Chinese control at no financial cost. On 26 August, the Karakhan Manifesto was published by the Soviet press, but the document mentioned neither the return of CER to the Chinese nor the lack of financial compensation.

Along with the original Karakhan telegram, the Chinese had the Vilenski pamphlet as evidence. The Vilenski pamphlet also showed the Chinese that the Soviets were willing to transfer the CER to the Chinese without compensation. The July 25 Karakhan telegram showed that the Soviets' original intention was to return the CER to Chinese control without compensation. The July 25 telegram satisfied the diplomatic requirements for the Chinese government, but the August 26 one was published to uphold Soviet propaganda requirements.

The first major step in uncovering the hostile takeover of the CER by the Chinese in 1929 started with the understanding of the Secret Protocol of March 14, 1924 and the Secret Agreement of September 20, 1924. The Secret Protocol stated that all former conventions, treaties, protocols, contracts, and documents between the Soviet and China would be annulled until a conference could convene. That made all treaties, border relations, and commercial relations dependent on the upcoming conference. That in turn gave the Soviets time to turn to Zhang Xueliang in Manchuria, who was the strongest warlord there. He had control of the Mukden government in the city that is now known as Shenyang. The Soviets were the first to propose joint management of the CER with the Chinese, but Zhang stood in the way of the joint management. The Soviets decided to make a deal with Zhang.

On May 31, 1924, Lev Karakhan and Dr. V. K. Wellington Koo, the Minister of Foreign Affairs for the Republic of China, signed a Sino-Soviet treaty that included multiple articles, which played right into the Soviets' hands because Article V it stated that "the employment of persons in the various departments of the railway shall be in accordance with the principle of equal representation between the nationals of the Union of Soviet Socialist Republics and those of the Republic of China." The Soviets added, " In carrying out the principle of equal representation the normal course of life and activities of the Railway shall in no case be interrupted or injured, that is to say the employment of both nationalities shall be in accordance with experience, personal qualifications and fitness of applicants."

While negotiations had been concluded with the Chinese, the Soviets turned to make a deal with Zhang. They promised him full control of choosing the Chinese officials who would be on the board in the joint Chinese-Soviet management of the CER, which would give him half control of CER. On September 20, 1924, he signed the Secret Agreement without knowing the Chinese government had signed the Secret Protocol earlier in the year. Since the CER was originally controlled by the Soviets, most of the positions would be under Soviet control. The Soviets then claimed they should keep majority control because any other solution would interrupt or injure the railway.

The Soviets were also the puppet master of the President for the CER. They regained majority control of the CER by playing the secret protocols off one another and by outmaneuvering the Chinese. The Soviets allowed the Chinese to think they were adding workers loyal to their government. However, in reality, the Soviets were creating more jobs on the railway and hiring Soviet workers. In the end, the Soviets controlled 67% of all positions on the CER.

The Chinese entertained joint management until mid-1929. The change from Soviet to Chinese control started when the Chinese authorities made a radical move to try to remove Soviet management. Chinese authorities stormed the Soviet consulate in Harbin and arrested the General Manager of the CER, his assistant, and other Soviet citizens and removed them from power in the CER. The Soviets retaliated by arresting Chinese citizens in the Soviet Union. On July 13, 1929, the Soviets sent their formal demands to the Chinese on what was happening on the CER.

On July 19, the Soviets discontinued their diplomatic relations with the Chinese, suspended railway communication, and demanded for all Chinese diplomats to leave Soviet territory.

By July 20, the Soviets were transferring their funds to New York. In the cities of Suifenhe and Lahususa, the Soviets were terrorizing the Chinese civilians by having their warships' guns pointed at the city and by having their planes make flybys. Many members of the Soviet leadership such as Kliment Voroshilov urged for a military intervention, but General Secretary Joseph Stalin initially hesitated for fear a Japanese reaction to a Soviet invasion of Manchuria. However, the Soviet consul general in Tokyo obtained information according to which Japan would stay out of the conflict if the Soviets limited any invasions to northern Manchuria and so Stalin decided to act.

On 6 August, the Soviet Union created the Special Red Banner Far Eastern Army, commanded by Vasily Blyukher, with the assistance of Voroshilov. Around a fifth of the entire Soviet Armed Forces was mobilized to participate or assist the operation. By doing so, they were willing to do whatever it took to return the CER back to their control. The Chinese leadership was surprised by that turn of events, as it had not expected the Soviets to react so aggressively.

Zhang quickly enlisted more troops, most importantly thousands of anticommunist Russians who lived as White émigrés in Manchuria. Some of the White Russians even organized guerrilla groups to carry the war into the Soviet Union.

Conflict

Small skirmishes had broken out in July but would not be considered the first major military action. The first battle happened on August 17, 1929, when the Soviets attacked Chalainor. Chinese troops retreated to an entrenchment, which was supported by machine guns. The Soviets suffered heavy losses in the battle, the only one in which the Soviets would incur such casualties.

Blyukher consequently developed a plan for an offensive in two rapid operations, the first targeting Chinese naval forces and the second destroying the Chinese ground forces by rapid encirclement operations. The naval attack began in October, as the Soviets forced their naval fleets up the Amur and Songhua Rivers and captured Lahasusu. The maneuver caused the Chinese to move to a different location. On their way to Fujin, Chinese troops killed any civilian they met and raided any store.

The Soviets stated that they would not touch the civilian population and encouraged Chinese civilians to fight alongside them against the Chinese Army. They also denied killing civilians and were said to take only military goods. All civilian personal items were to be left in place, a stipulation that was strictly enforced.

On November 17, the Soviets decided to take ten divisions and split their attack into two stages. The first stage was to go past Manzhouli and to attack the region of Chalainor. After capturing the region, Soviet troops set their sights on Manzhouli.

When they reached Manzhouli, they found that the Chinese were not prepared for battle and that the Chinese forces were looting houses and stores, stealing civilian clothes, and trying to escape. The Soviet strategy was a success. On November 26, the Chinese were ready to sign a treaty with the Soviets. On December 13, after much debate, the Chinese signed the Khabarovsk Protocol, which restored peace and the status quo ante bellum, the Sino-Soviet treaty of 1924.

The victory over China was an eyeopener for the world. During the conflict, the Soviets used propaganda to help spread communist ideology and to confuse the Chinese Army by using radio and leaflets. They did so by deceiving the Chinese command on the town that was the Soviets' next target: "Its military forces combined carefully measured use of depth and variety, coordinated in the fashion of a swift action design to achieve the precise goal of annihilating offensive under complex conditions' against enemy forces."

Stalin boasted to Vyacheslav Molotov that "our fellows from the Far East Army gave [the Chinese] a good scare." The conflict brought a sense of military prestige back into the Asian region. The Soviet victory was also applauded by such Western nations as the United States, France, and the United Kingdom. It showed the West that the Soviets could use both diplomacy and military might to achieve its goal.

However, while some might have applauded the Soviets for using those techniques, others feared them in a legitimate concern. The Western nations were frightened that might mean the Soviet Union might one day be able to beat a Western nation at its own game.

The impact of the conflict left the region in a power vacuum, which left the door wide open for the Japanese to take control of the region. After observing how easily Soviet forces had beaten the Chinese, the Japanese used a similar technique to defeat the Chinese and occupied Manchuria after the Mukden Incident in 1931.

Aftermath
When Japan invaded Manchuria in 1931 and occupied the Soviet zone of influence, the Soviet Union was still not strong enough in the East to oppose the Japanese. Stalin adopted a policy of strict neutrality, and the Soviet Union sold its rights to the Chinese Eastern Railway to the Manchukuo government on 23 March 1935.

Deportation of Chinese

In 1928, Arsenyev Mikhail Mikhailovich (), Staff Colonel of Red Army Headquarter, submitted a report to the Far Eastern Bureau that advised that free migration from China and Korea in the areas bordering the countries should be stopped and that the area should be filled with migrants from Siberia and Europe instead.

As the Sino-Soviet conflict over the Chinese Eastern Railway worsened bilateral relations, the Soviet government began to stop Chinese crossing the border since 1931. All Soviet diplomats in China were called back, all Chinese diplomats to Soviet Union were expelled, and trains between both countries  were forced out of service.

The Soviets forced the Chinese to move to Northeast China. Thousands of Chinese in Irkutsk, Chita, and Ulan-Ude were arrested for breach of local orders, tax evasion, and other reasons. When they left Russia, any Chinese to cross the border with more than 30 rubles in cash had to pay the surplus to the authorities. If they had at least 1,000 rubles in cash, they would arrested and have all of their money confiscated.

Large numbers of Chinese were detained, according to the Shanghai-based newspaper Shen Bao on 24 July 1929, which said that "around a thousand Chinese who lived in Vladivostok were detained by the Soviet authorities. They were all said to be bourgeoisie." On 12 August, the newspaper stated that there were still 1,600-1,700 Chinese in jail in Vladivostok, who were supplied with a piece of rye bread daily and suffered various forms of torture. On 26 August, the newspaper stated that those detained in Khabarovsk had only a bread soup for meal daily, and many people had hanged themselves because of unbearable starvation. On 14 September, the newspaper stated that 1,000 of Chinese in Vladivostok had been arrested, with almost no Chinese remaining in the city. On 15 September, the newspaper continued that Vladivostok had arrested more than 1,000 Chinese during the 8 and 9 September and that there were more than 7,000 Chinese in prison in the city. On 21st September, the newspaper said that "the government in Russian Far East cheated the arrested Chinese, and forced them to construct the railway between Heihe and Khabarovsk. The forced workers had only two pieces of rye bread to eat daily. If they work with any delay, they will be whipped, making them at the edge of living and dead."

Although after signing the , the Soviet government released most of the arrested Chinese. The Chinese had been severely tortured by the Soviet government, the confiscated possessions of the Chinese were not returned, difficult situations had arisen among the workers and the businessmen, and there were high prices of goods and unaffordable living costs. Those factors caused all of the released Chinese to return to China.

See also
 Kumul Rebellion
 Soviet invasion of Xinjiang
 Islamic rebellion in Xinjiang (1937)
 Ili Rebellion

References

Sources

 Elleman; Bruce A.; The Soviet Union's Secret Diplomacy Concerning the Chinese Eastern Railway, 1924–1925; Journal of Asian Studies, Vol. 53 (1994), S. 459–68.

 Lensen, George Alexander; The Damned Inheritance. The Soviet Union and the Manchurian Crises. 1924–1935, Ann Arbor 1974.
 Patrikeeff, Felix; Elleman, Bruce A.; Kotkin, Stephen; Railway as Political Catalyst: The Chinese Eastern Railway and the 1929 Sino-Soviet Conflict, in: Manchurian Railways and the Opening of China: An International History Basingstoke 2002,
 Patrikeeff, Felix; Russian Politics in Exile: The Northeast Asian Balance of Power, 1924–1931, in: Manchurian Railways and the Opening of China: An International History, Basingstoke 2002,
 Walker, Michael; The 1929 Sino-Soviet War; Lawrence Ka. 2017 (University Press of Kansas).

Time Magazine

"C.E.R. Seized" (July 22, 1929)
"Growling & Hissing" (July 29, 1929)
"Imposing Peace" (August 5, 1929)
"Growing Graver" (August 26, 1929)
"Blucher v. Chiang" (September 2, 1929)

"Peace" (September 9, 1929)
"Manchuria in the Vise" (December 2, 1929)
"'Not One Square Inch!'" (December 9, 1929)
"400 Million Humiliations" (December 16, 1929)

1929 in the Soviet Union
China–Soviet Union relations
Conflicts in 1929
Military history of Manchuria
Military history of the Republic of China (1912–1949)
Military history of the Soviet Union
Wars involving the Republic of China
Wars involving the Soviet Union
1929 in China

redpajama_set_name: RedPajamaWikipedia


No new posts this weekend. I'm coordinating a conference this weekend, so there won't be much time to post.
On Monday I'll dive into a review of my Midwest Theological Forum Daily Roman Missal. Also sometime next week I'd like to explore the debate of whether or not to mark in your bible.
Have a great Divine Mercy Sunday, or if you celebrate in the Extraordinary form, Low Sunday.
« Happy Birthday Papa B!!!!!


Exhausted of playing the common, boring games? Want to do something difficult and exciting? Why not look into the paranormals and see what is in store for you? You do not have to be a skeptic or a believer to play these sort of games. All you need is false bravery and foolishness to put yourself in unforeseen trouble.
Also Read: 13 Places Around The World Where You Can See A Real Ghost!
This creepy game is about risking your life. Your destiny will be re-written. The toy`s face will transform. The fact that it's a game from Japan does not make it any less terrifying. You call spirits to own the toy and will kill you if it finds you.
It was formed as a penalty and it is the most unreasonable of all the games. It originates from Japan and it involves to summon gross spirits that will go after you. The purpose is escaping from the ghost and avoiding it from catching you. It's thought that playing it will cause bad things to happen in your life.
The game is only played by yourself, it rises on top of the rest on the scale. When this ritual completes, get yourself in an elevator properly and you will go to another world.
It is one of the most exceptional games. The one-man hide-n-seek is a ritual for communicating with the dead. They are impatient spirits on Earth looking for bodies to possess. This ritual you call spirits by offering dolls as alternatives of human bodies. Just the consideration of being alone with a possessed toy is horrifying.
If you wish to be terrified for all of your life try this game. "PLAY by yourself". When playing this, you'll see the face of the Devil in the mirror; it's as if seeing Bloody Mary.
Want guests? It's perfect for you. This game involves inviting three spirits to party in the hosting space you select. To be honest, it's bad enough with the fact that you have to be by yourself in your shady house but not inviting one but three ghosts is worse.
It is too bad this one is not as trendy as the others but deserves credits. Visualize asking spirits to play music; this game is so creepy on its own and the fact that a spirit is playing a horrifying song.
This Game is the most frightening out there that anyone can play with their friends. Many consider this game an old Pagan ritual that was used as a penalty to those that disobeyed the faith.
It is parallel to the Elevator because it basically takes you to a different world. Although, you have to perform a cleansing before starting the actual game throwing salt on your door. When night time approaches, be in a dark room.
This is one of the most mysterious games known; however, persons sometimes do not understand how risky this "game" is. The plan of Ouija game is to communicate with ghosts that cross over to the other dimension, and someway demons utilize this board as a method to come into our world and own the people playing or haunt their homes.
In this game you aren't just calling spirits to you, you're calling the devil. To do it, you need to stand in the closet and make sure all the lights off, you're in an absolute darkness. Once you're in the dark, you need to hold up a darkened match and say "show me the light or leave me in the darkness".
Which one of these horrifying games have you played? If there are other such games, name them.
Previous article 13 Unique and Romantic Ways To Propose A Girl For Marriage!
Next article 13 Awkward Situations People Wearing Glasses Get Into!
Biggest LEGO Set In The World? The Top 11 List Has a Lot Of Surprises For You!


text:
#include <dvr/dvr_api.h>
#include <gui/BufferHubProducer.h>
#include <inttypes.h>
#include <log/log.h>
#include <system/window.h>
#include <ui/BufferHubBuffer.h>

namespace android {

using namespace dvr;

/* static */
sp<BufferHubProducer> BufferHubProducer::Create(const std::shared_ptr<ProducerQueue>& queue) {
    sp<BufferHubProducer> producer = new BufferHubProducer;
    producer->queue_ = queue;
    return producer;
}

/* static */
sp<BufferHubProducer> BufferHubProducer::Create(ProducerQueueParcelable parcelable) {
    if (!parcelable.IsValid()) {
        ALOGE("BufferHubProducer::Create: Invalid producer parcelable.");
        return nullptr;
    }

    sp<BufferHubProducer> producer = new BufferHubProducer;
    producer->queue_ = ProducerQueue::Import(parcelable.TakeChannelHandle());
    return producer;
}

status_t BufferHubProducer::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
    ALOGV("requestBuffer: slot=%d", slot);

    std::unique_lock<std::mutex> lock(mutex_);

    if (connected_api_ == kNoConnectedApi) {
        ALOGE("requestBuffer: BufferHubProducer has no connected producer");
        return NO_INIT;
    }

    if (slot < 0 || slot >= max_buffer_count_) {
        ALOGE("requestBuffer: slot index %d out of range [0, %d)", slot, max_buffer_count_);
        return BAD_VALUE;
    } else if (!buffers_[slot].mBufferState.isDequeued()) {
        ALOGE("requestBuffer: slot %d is not owned by the producer (state = %s)", slot,
              buffers_[slot].mBufferState.string());
        return BAD_VALUE;
    } else if (buffers_[slot].mGraphicBuffer != nullptr) {
        ALOGE("requestBuffer: slot %d is not empty.", slot);
        return BAD_VALUE;
    } else if (buffers_[slot].mProducerBuffer == nullptr) {
        ALOGE("requestBuffer: slot %d is not dequeued.", slot);
        return BAD_VALUE;
    }

    const auto& producer_buffer = buffers_[slot].mProducerBuffer;
    sp<GraphicBuffer> graphic_buffer = producer_buffer->buffer()->buffer();

    buffers_[slot].mGraphicBuffer = graphic_buffer;
    buffers_[slot].mRequestBufferCalled = true;

    *buf = graphic_buffer;
    return NO_ERROR;
}

status_t BufferHubProducer::setMaxDequeuedBufferCount(int max_dequeued_buffers) {
    ALOGV("setMaxDequeuedBufferCount: max_dequeued_buffers=%d", max_dequeued_buffers);

    std::unique_lock<std::mutex> lock(mutex_);

    if (max_dequeued_buffers <= 0 ||
        max_dequeued_buffers >
                int(BufferHubQueue::kMaxQueueCapacity - kDefaultUndequeuedBuffers)) {
        ALOGE("setMaxDequeuedBufferCount: %d out of range (0, %zu]", max_dequeued_buffers,
              BufferHubQueue::kMaxQueueCapacity);
        return BAD_VALUE;
    }

    // The new dequeued_buffers count should not be violated by the number
    // of currently dequeued buffers.
    int dequeued_count = 0;
    for (const auto& buf : buffers_) {
        if (buf.mBufferState.isDequeued()) {
            dequeued_count++;
        }
    }
    if (dequeued_count > max_dequeued_buffers) {
        ALOGE("setMaxDequeuedBufferCount: the requested dequeued_buffers"
              "count (%d) exceeds the current dequeued buffer count (%d)",
              max_dequeued_buffers, dequeued_count);
        return BAD_VALUE;
    }

    max_dequeued_buffer_count_ = max_dequeued_buffers;
    return NO_ERROR;
}

status_t BufferHubProducer::setAsyncMode(bool async) {
    if (async) {
        // TODO(b/36724099) BufferHubQueue's consumer end always acquires the buffer
        // automatically and behaves differently from IGraphicBufferConsumer. Thus,
        // android::BufferQueue's async mode (a.k.a. allocating an additional buffer
        // to prevent dequeueBuffer from being blocking) technically does not apply
        // here.
        //
        // In Daydream, non-blocking producer side dequeue is guaranteed by careful
        // buffer consumer implementations. In another word, BufferHubQueue based
        // dequeueBuffer should never block whether setAsyncMode(true) is set or
        // not.
        //
        // See: IGraphicBufferProducer::setAsyncMode and
        // BufferQueueProducer::setAsyncMode for more about original implementation.
        ALOGW("BufferHubProducer::setAsyncMode: BufferHubQueue should always be "
              "asynchronous. This call makes no effact.");
        return NO_ERROR;
    }
    return NO_ERROR;
}

status_t BufferHubProducer::dequeueBuffer(int* out_slot, sp<Fence>* out_fence, uint32_t width,
                                          uint32_t height, PixelFormat format, uint64_t usage,
                                          uint64_t* /*outBufferAge*/,
                                          FrameEventHistoryDelta* /* out_timestamps */) {
    ALOGV("dequeueBuffer: w=%u, h=%u, format=%d, usage=%" PRIu64, width, height, format, usage);

    status_t ret;
    std::unique_lock<std::mutex> lock(mutex_);

    if (connected_api_ == kNoConnectedApi) {
        ALOGE("dequeueBuffer: BufferQueue has no connected producer");
        return NO_INIT;
    }

    const uint32_t kLayerCount = 1;
    if (int32_t(queue_->capacity()) < max_dequeued_buffer_count_ + kDefaultUndequeuedBuffers) {
        // Lazy allocation. When the capacity of |queue_| has not reached
        // |max_dequeued_buffer_count_|, allocate new buffer.
        // TODO(jwcai) To save memory, the really reasonable thing to do is to go
        // over existing slots and find first existing one to dequeue.
        ret = AllocateBuffer(width, height, kLayerCount, format, usage);
        if (ret < 0) return ret;
    }

    size_t slot = 0;
    std::shared_ptr<ProducerBuffer> producer_buffer;

    for (size_t retry = 0; retry < BufferHubQueue::kMaxQueueCapacity; retry++) {
        LocalHandle fence;
        auto buffer_status = queue_->Dequeue(dequeue_timeout_ms_, &slot, &fence);
        if (!buffer_status) return NO_MEMORY;

        producer_buffer = buffer_status.take();
        if (!producer_buffer) return NO_MEMORY;

        if (width == producer_buffer->width() && height == producer_buffer->height() &&
            uint32_t(format) == producer_buffer->format()) {
            // The producer queue returns a producer buffer matches the request.
            break;
        }

        // Needs reallocation.
        // TODO(jwcai) Consider use VLOG instead if we find this log is not useful.
        ALOGI("dequeueBuffer: requested buffer (w=%u, h=%u, format=%u) is different "
              "from the buffer returned at slot: %zu (w=%u, h=%u, format=%u). Need "
              "re-allocattion.",
              width, height, format, slot, producer_buffer->width(), producer_buffer->height(),
              producer_buffer->format());
        // Mark the slot as reallocating, so that later we can set
        // BUFFER_NEEDS_REALLOCATION when the buffer actually get dequeued.
        buffers_[slot].mIsReallocating = true;

        // Remove the old buffer once the allocation before allocating its
        // replacement.
        RemoveBuffer(slot);

        // Allocate a new producer buffer with new buffer configs. Note that if
        // there are already multiple buffers in the queue, the next one returned
        // from |queue_->Dequeue| may not be the new buffer we just reallocated.
        // Retry up to BufferHubQueue::kMaxQueueCapacity times.
        ret = AllocateBuffer(width, height, kLayerCount, format, usage);
        if (ret < 0) return ret;
    }

    // With the BufferHub backed solution. Buffer slot returned from
    // |queue_->Dequeue| is guaranteed to avaiable for producer's use.
    // It's either in free state (if the buffer has never been used before) or
    // in queued state (if the buffer has been dequeued and queued back to
    // BufferHubQueue).
    LOG_ALWAYS_FATAL_IF((!buffers_[slot].mBufferState.isFree() &&
                         !buffers_[slot].mBufferState.isQueued()),
                        "dequeueBuffer: slot %zu is not free or queued, actual state: %s.", slot,
                        buffers_[slot].mBufferState.string());

    buffers_[slot].mBufferState.freeQueued();
    buffers_[slot].mBufferState.dequeue();
    ALOGV("dequeueBuffer: slot=%zu", slot);

    // TODO(jwcai) Handle fence properly. |BufferHub| has full fence support, we
    // just need to exopose that through |BufferHubQueue| once we need fence.
    *out_fence = Fence::NO_FENCE;
    *out_slot = int(slot);
    ret = NO_ERROR;

    if (buffers_[slot].mIsReallocating) {
        ret |= BUFFER_NEEDS_REALLOCATION;
        buffers_[slot].mIsReallocating = false;
    }

    return ret;
}

status_t BufferHubProducer::detachBuffer(int slot) {
    ALOGV("detachBuffer: slot=%d", slot);
    std::unique_lock<std::mutex> lock(mutex_);

    return DetachBufferLocked(static_cast<size_t>(slot));
}

status_t BufferHubProducer::DetachBufferLocked(size_t slot) {
    if (connected_api_ == kNoConnectedApi) {
        ALOGE("detachBuffer: BufferHubProducer is not connected.");
        return NO_INIT;
    }

    if (slot >= static_cast<size_t>(max_buffer_count_)) {
        ALOGE("detachBuffer: slot index %zu out of range [0, %d)", slot, max_buffer_count_);
        return BAD_VALUE;
    } else if (!buffers_[slot].mBufferState.isDequeued()) {
        ALOGE("detachBuffer: slot %zu is not owned by the producer (state = %s)", slot,
              buffers_[slot].mBufferState.string());
        return BAD_VALUE;
    } else if (!buffers_[slot].mRequestBufferCalled) {
        ALOGE("detachBuffer: buffer in slot %zu has not been requested", slot);
        return BAD_VALUE;
    }
    std::shared_ptr<ProducerBuffer> producer_buffer = queue_->GetBuffer(slot);
    if (producer_buffer == nullptr || producer_buffer->buffer() == nullptr) {
        ALOGE("detachBuffer: Invalid ProducerBuffer at slot %zu.", slot);
        return BAD_VALUE;
    }
    sp<GraphicBuffer> graphic_buffer = producer_buffer->buffer()->buffer();
    if (graphic_buffer == nullptr) {
        ALOGE("detachBuffer: Invalid GraphicBuffer at slot %zu.", slot);
        return BAD_VALUE;
    }

    // Remove the ProducerBuffer from the ProducerQueue.
    status_t error = RemoveBuffer(slot);
    if (error != NO_ERROR) {
        ALOGE("detachBuffer: Failed to remove buffer, slot=%zu, error=%d.", slot, error);
        return error;
    }

    // Here we need to convert the existing ProducerBuffer into a DetachedBufferHandle and inject
    // the handle into the GraphicBuffer object at the requested slot.
    auto status_or_handle = producer_buffer->Detach();
    if (!status_or_handle.ok()) {
        ALOGE("detachBuffer: Failed to detach from a ProducerBuffer at slot %zu, error=%d.", slot,
              status_or_handle.error());
        return BAD_VALUE;
    }

    // TODO(b/70912269): Reimplement BufferHubProducer::DetachBufferLocked() once GraphicBuffer can
    // be directly backed by BufferHub.
    return INVALID_OPERATION;
}

status_t BufferHubProducer::detachNextBuffer(sp<GraphicBuffer>* out_buffer, sp<Fence>* out_fence) {
    ALOGV("detachNextBuffer.");

    if (out_buffer == nullptr || out_fence == nullptr) {
        ALOGE("detachNextBuffer: Invalid parameter: out_buffer=%p, out_fence=%p", out_buffer,
              out_fence);
        return BAD_VALUE;
    }

    std::unique_lock<std::mutex> lock(mutex_);

    if (connected_api_ == kNoConnectedApi) {
        ALOGE("detachNextBuffer: BufferHubProducer is not connected.");
        return NO_INIT;
    }

    // detachNextBuffer is equivalent to calling dequeueBuffer, requestBuffer, and detachBuffer in
    // sequence, except for two things:
    //
    // 1) It is unnecessary to know the dimensions, format, or usage of the next buffer, i.e. the
    // function just returns whatever ProducerBuffer is available from the ProducerQueue and no
    // buffer allocation or re-allocation will happen.
    // 2) It will not block, since if it cannot find an appropriate buffer to return, it will return
    // an error instead.
    size_t slot = 0;
    LocalHandle fence;

    // First, dequeue a ProducerBuffer from the ProducerQueue with no timeout. Report error
    // immediately if ProducerQueue::Dequeue() fails.
    auto status_or_buffer = queue_->Dequeue(/*timeout=*/0, &slot, &fence);
    if (!status_or_buffer.ok()) {
        ALOGE("detachNextBuffer: Failed to dequeue buffer, error=%d.", status_or_buffer.error());
        return NO_MEMORY;
    }

    std::shared_ptr<ProducerBuffer> producer_buffer = status_or_buffer.take();
    if (producer_buffer == nullptr) {
        ALOGE("detachNextBuffer: Dequeued buffer is null.");
        return NO_MEMORY;
    }

    // With the BufferHub backed solution, slot returned from |queue_->Dequeue| is guaranteed to
    // be available for producer's use. It's either in free state (if the buffer has never been used
    // before) or in queued state (if the buffer has been dequeued and queued back to
    // BufferHubQueue).
    if (!buffers_[slot].mBufferState.isFree() && !buffers_[slot].mBufferState.isQueued()) {
        ALOGE("detachNextBuffer: slot %zu is not free or queued, actual state: %s.", slot,
              buffers_[slot].mBufferState.string());
        return BAD_VALUE;
    }
    if (buffers_[slot].mProducerBuffer == nullptr) {
        ALOGE("detachNextBuffer: ProducerBuffer at slot %zu is null.", slot);
        return BAD_VALUE;
    }
    if (buffers_[slot].mProducerBuffer->id() != producer_buffer->id()) {
        ALOGE("detachNextBuffer: ProducerBuffer at slot %zu has mismatched id, actual: "
              "%d, expected: %d.",
              slot, buffers_[slot].mProducerBuffer->id(), producer_buffer->id());
        return BAD_VALUE;
    }

    ALOGV("detachNextBuffer: slot=%zu", slot);
    buffers_[slot].mBufferState.freeQueued();
    buffers_[slot].mBufferState.dequeue();

    // Second, request the buffer.
    sp<GraphicBuffer> graphic_buffer = producer_buffer->buffer()->buffer();
    buffers_[slot].mGraphicBuffer = producer_buffer->buffer()->buffer();

    // Finally, detach the buffer and then return.
    status_t error = DetachBufferLocked(slot);
    if (error == NO_ERROR) {
        *out_fence = new Fence(fence.Release());
        *out_buffer = graphic_buffer;
    }
    return error;
}

status_t BufferHubProducer::attachBuffer(int* out_slot, const sp<GraphicBuffer>& buffer) {
    // In the BufferHub design, all buffers are allocated and owned by the BufferHub. Thus only
    // GraphicBuffers that are originated from BufferHub can be attached to a BufferHubProducer.
    ALOGV("queueBuffer: buffer=%p", buffer.get());

    if (out_slot == nullptr) {
        ALOGE("attachBuffer: out_slot cannot be NULL.");
        return BAD_VALUE;
    }
    if (buffer == nullptr) {
        ALOGE("attachBuffer: invalid GraphicBuffer.");
        return BAD_VALUE;
    }

    std::unique_lock<std::mutex> lock(mutex_);

    if (connected_api_ == kNoConnectedApi) {
        ALOGE("attachBuffer: BufferQueue has no connected producer");
        return NO_INIT;
    }

    // Before attaching the buffer, caller is supposed to call
    // IGraphicBufferProducer::setGenerationNumber to inform the
    // BufferHubProducer the next generation number.
    if (buffer->getGenerationNumber() != generation_number_) {
        ALOGE("attachBuffer: Mismatched generation number, buffer: %u, queue: %u.",
              buffer->getGenerationNumber(), generation_number_);
        return BAD_VALUE;
    }

    // TODO(b/70912269): Reimplement BufferHubProducer::DetachBufferLocked() once GraphicBuffer can
    // be directly backed by BufferHub.
    return INVALID_OPERATION;
}

status_t BufferHubProducer::queueBuffer(int slot, const QueueBufferInput& input,
                                        QueueBufferOutput* output) {
    ALOGV("queueBuffer: slot %d", slot);

    if (output == nullptr) {
        return BAD_VALUE;
    }

    int64_t timestamp;
    bool is_auto_timestamp;
    android_dataspace dataspace;
    Rect crop(Rect::EMPTY_RECT);
    int scaling_mode;
    uint32_t transform;
    sp<Fence> fence;

    input.deflate(&timestamp, &is_auto_timestamp, &dataspace, &crop, &scaling_mode, &transform,
                  &fence);

    // Check input scaling mode is valid.
    switch (scaling_mode) {
        case NATIVE_WINDOW_SCALING_MODE_FREEZE:
        case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW:
        case NATIVE_WINDOW_SCALING_MODE_SCALE_CROP:
        case NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP:
            break;
        default:
            ALOGE("queueBuffer: unknown scaling mode %d", scaling_mode);
            return BAD_VALUE;
    }

    // Check input fence is valid.
    if (fence == nullptr) {
        ALOGE("queueBuffer: fence is NULL");
        return BAD_VALUE;
    }

    std::unique_lock<std::mutex> lock(mutex_);

    if (connected_api_ == kNoConnectedApi) {
        ALOGE("queueBuffer: BufferQueue has no connected producer");
        return NO_INIT;
    }

    if (slot < 0 || slot >= max_buffer_count_) {
        ALOGE("queueBuffer: slot index %d out of range [0, %d)", slot, max_buffer_count_);
        return BAD_VALUE;
    } else if (!buffers_[slot].mBufferState.isDequeued()) {
        ALOGE("queueBuffer: slot %d is not owned by the producer (state = %s)", slot,
              buffers_[slot].mBufferState.string());
        return BAD_VALUE;
    } else if ((!buffers_[slot].mRequestBufferCalled || buffers_[slot].mGraphicBuffer == nullptr)) {
        ALOGE("queueBuffer: slot %d is not requested (mRequestBufferCalled=%d, "
              "mGraphicBuffer=%p)",
              slot, buffers_[slot].mRequestBufferCalled, buffers_[slot].mGraphicBuffer.get());
        return BAD_VALUE;
    }

    // Post the producer buffer with timestamp in the metadata.
    const auto& producer_buffer = buffers_[slot].mProducerBuffer;

    // Check input crop is not out of boundary of current buffer.
    Rect buffer_rect(producer_buffer->width(), producer_buffer->height());
    Rect cropped_rect(Rect::EMPTY_RECT);
    crop.intersect(buffer_rect, &cropped_rect);
    if (cropped_rect != crop) {
        ALOGE("queueBuffer: slot %d has out-of-boundary crop.", slot);
        return BAD_VALUE;
    }

    LocalHandle fence_fd(fence->isValid() ? fence->dup() : -1);

    DvrNativeBufferMetadata meta_data;
    meta_data.timestamp = timestamp;
    meta_data.is_auto_timestamp = int32_t(is_auto_timestamp);
    meta_data.dataspace = int32_t(dataspace);
    meta_data.crop_left = crop.left;
    meta_data.crop_top = crop.top;
    meta_data.crop_right = crop.right;
    meta_data.crop_bottom = crop.bottom;
    meta_data.scaling_mode = int32_t(scaling_mode);
    meta_data.transform = int32_t(transform);

    producer_buffer->PostAsync(&meta_data, fence_fd);
    buffers_[slot].mBufferState.queue();

    output->width = producer_buffer->width();
    output->height = producer_buffer->height();
    output->transformHint = 0; // default value, we don't use it yet.

    // |numPendingBuffers| counts of the number of buffers that has been enqueued
    // by the producer but not yet acquired by the consumer. Due to the nature
    // of BufferHubQueue design, this is hard to trace from the producer's client
    // side, but it's safe to assume it's zero.
    output->numPendingBuffers = 0;

    // Note that we are not setting nextFrameNumber here as it seems to be only
    // used by surface flinger. See more at b/22802885, ag/791760.
    output->nextFrameNumber = 0;

    return NO_ERROR;
}

status_t BufferHubProducer::cancelBuffer(int slot, const sp<Fence>& fence) {
    ALOGV(__FUNCTION__);

    std::unique_lock<std::mutex> lock(mutex_);

    if (connected_api_ == kNoConnectedApi) {
        ALOGE("cancelBuffer: BufferQueue has no connected producer");
        return NO_INIT;
    }

    if (slot < 0 || slot >= max_buffer_count_) {
        ALOGE("cancelBuffer: slot index %d out of range [0, %d)", slot, max_buffer_count_);
        return BAD_VALUE;
    } else if (!buffers_[slot].mBufferState.isDequeued()) {
        ALOGE("cancelBuffer: slot %d is not owned by the producer (state = %s)", slot,
              buffers_[slot].mBufferState.string());
        return BAD_VALUE;
    } else if (fence == nullptr) {
        ALOGE("cancelBuffer: fence is NULL");
        return BAD_VALUE;
    }

    auto producer_buffer = buffers_[slot].mProducerBuffer;
    queue_->Enqueue(producer_buffer, size_t(slot), 0U);
    buffers_[slot].mBufferState.cancel();
    buffers_[slot].mFence = fence;
    ALOGV("cancelBuffer: slot %d", slot);

    return NO_ERROR;
}

status_t BufferHubProducer::query(int what, int* out_value) {
    ALOGV(__FUNCTION__);

    std::unique_lock<std::mutex> lock(mutex_);

    if (out_value == nullptr) {
        ALOGE("query: out_value was NULL");
        return BAD_VALUE;
    }

    int value = 0;
    switch (what) {
        case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS:
            // TODO(b/36187402) This should be the maximum number of buffers that this
            // producer queue's consumer can acquire. Set to be at least one. Need to
            // find a way to set from the consumer side.
            value = kDefaultUndequeuedBuffers;
            break;
        case NATIVE_WINDOW_BUFFER_AGE:
            value = 0;
            break;
        case NATIVE_WINDOW_WIDTH:
            value = int32_t(queue_->default_width());
            break;
        case NATIVE_WINDOW_HEIGHT:
            value = int32_t(queue_->default_height());
            break;
        case NATIVE_WINDOW_FORMAT:
            value = int32_t(queue_->default_format());
            break;
        case NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND:
            // BufferHubQueue is always operating in async mode, thus semantically
            // consumer can never be running behind. See BufferQueueCore.cpp core
            // for more information about the original meaning of this flag.
            value = 0;
            break;
        case NATIVE_WINDOW_CONSUMER_USAGE_BITS:
            // TODO(jwcai) This is currently not implement as we don't need
            // IGraphicBufferConsumer parity.
            value = 0;
            break;
        case NATIVE_WINDOW_DEFAULT_DATASPACE:
            // TODO(jwcai) Return the default value android::BufferQueue is using as
            // there is no way dvr::ConsumerQueue can set it.
            value = 0; // HAL_DATASPACE_UNKNOWN
            break;
        case NATIVE_WINDOW_STICKY_TRANSFORM:
            // TODO(jwcai) Return the default value android::BufferQueue is using as
            // there is no way dvr::ConsumerQueue can set it.
            value = 0;
            break;
        case NATIVE_WINDOW_CONSUMER_IS_PROTECTED:
            // In Daydream's implementation, the consumer end (i.e. VR Compostior)
            // knows how to handle protected buffers.
            value = 1;
            break;
        default:
            return BAD_VALUE;
    }

    ALOGV("query: key=%d, v=%d", what, value);
    *out_value = value;
    return NO_ERROR;
}

status_t BufferHubProducer::connect(const sp<IProducerListener>& /* listener */, int api,
                                    bool /* producer_controlled_by_app */,
                                    QueueBufferOutput* output) {
    // Consumer interaction are actually handled by buffer hub, and we need
    // to maintain consumer operations here. We only need to perform basic input
    // parameter checks here.
    ALOGV(__FUNCTION__);

    if (output == nullptr) {
        return BAD_VALUE;
    }

    std::unique_lock<std::mutex> lock(mutex_);

    if (connected_api_ != kNoConnectedApi) {
        return BAD_VALUE;
    }

    if (!queue_->is_connected()) {
        ALOGE("BufferHubProducer::connect: This BufferHubProducer is not "
              "connected to bufferhud. Has it been taken out as a parcelable?");
        return BAD_VALUE;
    }

    switch (api) {
        case NATIVE_WINDOW_API_EGL:
        case NATIVE_WINDOW_API_CPU:
        case NATIVE_WINDOW_API_MEDIA:
        case NATIVE_WINDOW_API_CAMERA:
            connected_api_ = api;

            output->width = queue_->default_width();
            output->height = queue_->default_height();

            // default values, we don't use them yet.
            output->transformHint = 0;
            output->numPendingBuffers = 0;
            output->nextFrameNumber = 0;
            output->bufferReplaced = false;

            break;
        default:
            ALOGE("BufferHubProducer::connect: unknow API %d", api);
            return BAD_VALUE;
    }

    return NO_ERROR;
}

status_t BufferHubProducer::disconnect(int api, DisconnectMode /*mode*/) {
    // Consumer interaction are actually handled by buffer hub, and we need
    // to maintain consumer operations here.  We only need to perform basic input
    // parameter checks here.
    ALOGV(__FUNCTION__);

    std::unique_lock<std::mutex> lock(mutex_);

    if (kNoConnectedApi == connected_api_) {
        return NO_INIT;
    } else if (api != connected_api_) {
        return BAD_VALUE;
    }

    FreeAllBuffers();
    connected_api_ = kNoConnectedApi;
    return NO_ERROR;
}

status_t BufferHubProducer::setSidebandStream(const sp<NativeHandle>& stream) {
    if (stream != nullptr) {
        // TODO(jwcai) Investigate how is is used, maybe use BufferHubBuffer's
        // metadata.
        ALOGE("SidebandStream is not currently supported.");
        return INVALID_OPERATION;
    }
    return NO_ERROR;
}

void BufferHubProducer::allocateBuffers(uint32_t /* width */, uint32_t /* height */,
                                        PixelFormat /* format */, uint64_t /* usage */) {
    // TODO(jwcai) |allocateBuffers| aims to preallocate up to the maximum number
    // of buffers permitted by the current BufferQueue configuration (aka
    // |max_buffer_count_|).
    ALOGE("BufferHubProducer::allocateBuffers not implemented.");
}

status_t BufferHubProducer::allowAllocation(bool /* allow */) {
    ALOGE("BufferHubProducer::allowAllocation not implemented.");
    return INVALID_OPERATION;
}

status_t BufferHubProducer::setGenerationNumber(uint32_t generation_number) {
    ALOGV(__FUNCTION__);

    std::unique_lock<std::mutex> lock(mutex_);
    generation_number_ = generation_number;
    return NO_ERROR;
}

String8 BufferHubProducer::getConsumerName() const {
    // BufferHub based implementation could have one to many producer/consumer
    // relationship, thus |getConsumerName| from the producer side does not
    // make any sense.
    ALOGE("BufferHubProducer::getConsumerName not supported.");
    return String8("BufferHubQueue::DummyConsumer");
}

status_t BufferHubProducer::setSharedBufferMode(bool shared_buffer_mode) {
    if (shared_buffer_mode) {
        ALOGE("BufferHubProducer::setSharedBufferMode(true) is not supported.");
        // TODO(b/36373181) Front buffer mode for buffer hub queue as ANativeWindow.
        return INVALID_OPERATION;
    }
    // Setting to default should just work as a no-op.
    return NO_ERROR;
}

status_t BufferHubProducer::setAutoRefresh(bool auto_refresh) {
    if (auto_refresh) {
        ALOGE("BufferHubProducer::setAutoRefresh(true) is not supported.");
        return INVALID_OPERATION;
    }
    // Setting to default should just work as a no-op.
    return NO_ERROR;
}

status_t BufferHubProducer::setDequeueTimeout(nsecs_t timeout) {
    ALOGV(__FUNCTION__);

    std::unique_lock<std::mutex> lock(mutex_);
    dequeue_timeout_ms_ = static_cast<int>(timeout / (1000 * 1000));
    return NO_ERROR;
}

status_t BufferHubProducer::getLastQueuedBuffer(sp<GraphicBuffer>* /* out_buffer */,
                                                sp<Fence>* /* out_fence */,
                                                float /*out_transform_matrix*/[16]) {
    ALOGE("BufferHubProducer::getLastQueuedBuffer not implemented.");
    return INVALID_OPERATION;
}

void BufferHubProducer::getFrameTimestamps(FrameEventHistoryDelta* /*outDelta*/) {
    ALOGE("BufferHubProducer::getFrameTimestamps not implemented.");
}

status_t BufferHubProducer::getUniqueId(uint64_t* out_id) const {
    ALOGV(__FUNCTION__);

    *out_id = unique_id_;
    return NO_ERROR;
}

status_t BufferHubProducer::getConsumerUsage(uint64_t* out_usage) const {
    ALOGV(__FUNCTION__);

    // same value as returned by querying NATIVE_WINDOW_CONSUMER_USAGE_BITS
    *out_usage = 0;
    return NO_ERROR;
}

status_t BufferHubProducer::TakeAsParcelable(ProducerQueueParcelable* out_parcelable) {
    if (!out_parcelable || out_parcelable->IsValid()) return BAD_VALUE;

    if (connected_api_ != kNoConnectedApi) {
        ALOGE("BufferHubProducer::TakeAsParcelable: BufferHubProducer has "
              "connected client. Must disconnect first.");
        return BAD_VALUE;
    }

    if (!queue_->is_connected()) {
        ALOGE("BufferHubProducer::TakeAsParcelable: This BufferHubProducer "
              "is not connected to bufferhud. Has it been taken out as a "
              "parcelable?");
        return BAD_VALUE;
    }

    auto status = queue_->TakeAsParcelable();
    if (!status) {
        ALOGE("BufferHubProducer::TakeAsParcelable: Failed to take out "
              "ProducuerQueueParcelable from the producer queue, error: %s.",
              status.GetErrorMessage().c_str());
        return BAD_VALUE;
    }

    *out_parcelable = status.take();
    return NO_ERROR;
}

status_t BufferHubProducer::AllocateBuffer(uint32_t width, uint32_t height, uint32_t layer_count,
                                           PixelFormat format, uint64_t usage) {
    auto status = queue_->AllocateBuffer(width, height, layer_count, uint32_t(format), usage);
    if (!status) {
        ALOGE("BufferHubProducer::AllocateBuffer: Failed to allocate buffer: %s",
              status.GetErrorMessage().c_str());
        return NO_MEMORY;
    }

    size_t slot = status.get();
    auto producer_buffer = queue_->GetBuffer(slot);

    LOG_ALWAYS_FATAL_IF(producer_buffer == nullptr,
                        "Failed to get the producer buffer at slot: %zu", slot);

    buffers_[slot].mProducerBuffer = producer_buffer;

    return NO_ERROR;
}

status_t BufferHubProducer::RemoveBuffer(size_t slot) {
    auto status = queue_->RemoveBuffer(slot);
    if (!status) {
        ALOGE("BufferHubProducer::RemoveBuffer: Failed to remove buffer at slot: %zu, error: %s.",
              slot, status.GetErrorMessage().c_str());
        return INVALID_OPERATION;
    }

    // Reset in memory objects related the the buffer.
    buffers_[slot].mProducerBuffer = nullptr;
    buffers_[slot].mBufferState.detachProducer();
    buffers_[slot].mFence = Fence::NO_FENCE;
    buffers_[slot].mGraphicBuffer = nullptr;
    buffers_[slot].mRequestBufferCalled = false;
    return NO_ERROR;
}

status_t BufferHubProducer::FreeAllBuffers() {
    for (size_t slot = 0; slot < BufferHubQueue::kMaxQueueCapacity; slot++) {
        // Reset in memory objects related the the buffer.
        buffers_[slot].mProducerBuffer = nullptr;
        buffers_[slot].mBufferState.reset();
        buffers_[slot].mFence = Fence::NO_FENCE;
        buffers_[slot].mGraphicBuffer = nullptr;
        buffers_[slot].mRequestBufferCalled = false;
    }

    auto status = queue_->FreeAllBuffers();
    if (!status) {
        ALOGE("BufferHubProducer::FreeAllBuffers: Failed to free all buffers on "
              "the queue: %s",
              status.GetErrorMessage().c_str());
    }

    if (queue_->capacity() != 0 || queue_->count() != 0) {
        LOG_ALWAYS_FATAL("BufferHubProducer::FreeAllBuffers: Not all buffers are freed.");
    }

    return NO_ERROR;
}

status_t BufferHubProducer::exportToParcel(Parcel* parcel) {
    status_t res = TakeAsParcelable(&pending_producer_parcelable_);
    if (res != NO_ERROR) return res;

    if (!pending_producer_parcelable_.IsValid()) {
        ALOGE("BufferHubProducer::exportToParcel: Invalid parcelable object.");
        return BAD_VALUE;
    }

    res = parcel->writeUint32(USE_BUFFER_HUB);
    if (res != NO_ERROR) {
        ALOGE("BufferHubProducer::exportToParcel: Cannot write magic, res=%d.", res);
        return res;
    }

    return pending_producer_parcelable_.writeToParcel(parcel);
}

IBinder* BufferHubProducer::onAsBinder() {
    ALOGE("BufferHubProducer::onAsBinder: BufferHubProducer should never be used as an Binder "
          "object.");
    return nullptr;
}

} // namespace android

redpajama_set_name: RedPajamaGithub