471 stories
·
0 followers

Morale BOR-owca za kierownicą. Wybór mniejszego zła czy obrona VIP-a do końca

1 Share

Co robić, jeśli na twojej drodze trafisz na przejazd kolumny rządowej wiozącej Ważną Ochranianą Osobę? Uciekać czy popatrzeć spokojnie i ewentualnie pomachać? To nie jest pytanie żartem. Wypadek pani premier Szydło 10 lutego w okolicach Oświęcimia zaniepokoił OKO.press: jakimi zasadami kierują się kierujący rządowymi pojazdami BOR-wcy . Życzymy oczywiście zdrowia pani Beacie Szydło, rannemu funkcjonariuszowi […]

Artykuł Morale BOR-owca za kierownicą. Wybór mniejszego zła czy obrona VIP-a do końca pochodzi z serwisu oko.press.

Read the whole story
jpol
3 hours ago
reply
Share this story
Delete

Why Is Cancer More Common in Men?

1 Share

Oncologists know that men are more prone to cancer than women; one in two men will develop some form of the disease in a lifetime, compared with one in three women.

But until recently, scientists have been unable to pinpoint why. In the past, they theorized that men were more likely than women to encounter carcinogens through factors such as cigarette smoking and factory work. Yet the ratio of men with cancer to women with cancer remained largely unchanged across time, even as women began to smoke and enter the workforce in greater numbers. Pediatric cancer specialists also noted a similar “male bias to cancer” among babies and very young children with leukemia. “It’s not simply exposures over a lifetime,” explains Andrew Lane, assistant professor of medicine and a researcher at the Dana-Farber Cancer Institute. “It’s something intrinsic in the male and female system.”

Now, discoveries by Lane and the Broad Institute of Harvard and MIT reveal that genetic differences between males and females may account for some of the imbalance.

A physician-researcher who studies the genetics of leukemia and potential treatments, Lane says that he and others noted that men with certain types of leukemia often possess mutations on genes located on the X chromosome. These mutations damage tumor-suppressor genes, which normally halt the rampant cell division that triggers cancer.

Lane initially reasoned that females, who have two X chromosomes, would be less prone to these cancers because they have two copies of each tumor suppressor gene. In contrast, men have an X and a Y chromosome—or just one copy of the protective genes, which could be “taken out” by mutation. But the problem with that hypothesis, Lane says, was a “fascinating phenomenon from basic undergraduate biology called X-inactivation.” In a female embryo, he explains, cells randomly inactivate one of the two X chromosomes. “When a female cell divides, it remembers which X chromosome is shut down, and it keeps it shut down for all of its progeny.”

If female cells have only one X chromosome working at a time, then they should be just as likely as male cells to experience cancer-causing gene mutations. So Lane and his team dug deeper into existing studies and encountered a little-known and surprising finding: “There are about 800 genes on the X chromosome,” he says, “and for reasons that are still unclear, about 50 genes on that inactive X chromosome stay on.”

In a “big Aha! moment,” Lane’s group realized that those gene mutations common in men with leukemia were located on genes that continue to function on women’s inactive chromosome. The researchers dubbed those genes EXITS for “Escape from X-Inactivation Tumor Suppressors.” Women, Lane explains, thus have some relative protection against cancer cells becoming cancer because they, unlike men, do have two copies of these tumor-suppressor genes functioning at all times.

To determine whether this model applied to multiple cancers, Lane partnered with Gad Getz, director of the cancer genome computational analysis group at the Broad Institute, to comb through gene-sequencing data for more than 4,000 tumors that included 21 different cancers (but omitted cancers such as prostate and ovarian, which occur only in males or females). Their results were startlingly clear: of the approximately 800 genes located on the X chromosome, the scientists identified six genes more frequently mutated in men than in women—and five fell into the subset of genes that escape X-inactivation in women.

Lane says this points to the need for medical research to pay closer attention to the differences between men and women. Since these findings were published in Nature Genetics last fall, he has heard from researchers who have run clinical trials in which male and female subjects responded differently to treatments, and now wonder if factors like the EXITS genes in women might have played a role. “It’s possible,” Lane says. “This tells us that at the fundamental level of the cell itself, there may be differences simply  based on the genetics.” It also suggests that cancers thought to be the same in women and men actually develop differently. “This could have implications for the behavior of the disease or treatment,” he adds. “To me, the coolest thing about this work is that it opens people’s eyes to the possibilities.”

Let's block ads! (Why?)

Read the whole story
jpol
8 hours ago
reply
Share this story
Delete

How we built a back end system for Uber-like maps with animated cars

1 Share

Hello there. It’s my first blog post in English and I’m going to tell you how we built simple in-memory storage for animated cars. We show animated cars on the main screen of “Namba Taxi for clients” applications. This post is about the completed journey, algorithms and not about Go.

The beginning

The story begins in 2015 with the graduation work of our mobile developer. The work topic was ‘Driver application for taxi service’. In the application, he animated the car. It looked like this.

We thought. Why not using this on the screen when the client can track driver location. And our first challenge was a lack of data. We get new driver location every 15 seconds. We can’t just decrease update interval, because when driver mobile application sends data to us it gets the current order, next order and if there are any open alerts. Alert works like SOS button. When the driver presses it other drivers are in hurry to help him. And when we decrease update interval we can get more traffic to our systems. We weren’t sure that we can handle it.

First steps

Our first try was simple and stupid:

  1. Make the request and save coordinates.
  2. Make another request and animate the car.

As you can guess there were problems with it. We can’t animate car properly and it moves through fields, forests, lakes and quarters. It looks like this

The Cab Is Waiting screen

As the solution of the problem, we used OpenStreetMap Routing Machine (OSRM) for building routes and our algorithm improved. We have the same timeout.

  1. We make a request.
  2. Save coordinates.
  3. Send saved coordinates to the backend.
  4. Build route via OSRM.
  5. Return it to client app and animate marker.

It seems that it works now, but we faced with different problem with one-way roads

For instance, driver stays at the intersection at red point. But his device has bad accuracy and on location update driver stay on the opposite side of the crossroad. At client app we get these coordinates, save them and send to the backend. OSRM build a legit route and returns to the app and it looks ridiculous. Because marker moves very fast.

We solved this problem in a naive way. We check the shortest distance between two points and not build a route for distances less than 20 meters. With that algorithm after few days of testing, we decided to release our application and get feedback from customers.

And you know, we live in not ideal world so we decided to go to second iteration, because several things needed improvements.

  1. First thing was a trip cost calculator. All calculations were on the driver side. In this case we save server resources because we don’t send useless requests. On the another hand we have only one trust point. It’s a driver’s mobile app. So we need to duplicate data and save It on the server side.
  2. Furthermore, we realized that 1 track per 15 seconds it’s so little and lots of customers don’t get sight of new feature because car starts moving In 15 seconds after the screen is opened. I know not so many people, who can look at the screen where nothing is going on for 15 seconds.
  3. Moreover, we have lots of problems with GPS module on the driver side. GPS problems are associated with driver’s device.
  4. Finally, we wanted animated cars on the main screen.

Now we have several issues to solve:

  1. Start to collect more tracks from drivers
  2. Show animated cars on the main screen
  3. Store intermediate trip cost on the server side
  4. Save mobile data
  5. Collect each track per one second

I want to tell a few words about saving mobile data. We need it because in our country we have a very cheap taxi receipt. We use taxi like public transport. For instance, you can get from one side of the city to another just for 2 euros. It’s like metro in Paris. Also mobile internet cost is too high. If we save 100 bytes per second, then we’ll save 2000$ at company scale.

What the data in track?

  1. Driver location (Latitude, Longitude)
  2. Driver session that we give upon login
  3. Order information (OrderID and trip cost)

We decided that one track should be less than 100 bytes. And we started to look transport protocol to solve this issue

As you can see we watched for several protocols:

  1. HTTP
  2. WebSockets
  3. TCP
  4. UDP

And for us ideal option was UDP, because:

  1. We send only datagrams
  2. We don’t need guarantees
  3. Minimalism
  4. Save lots of data
  5. We have only 20 bytes overhead
  6. Not blocked in mobile networks in our country

As for data serialization, we watched on:

  1. JSON
  2. MsgPack
  3. Protobuf

We chose protocol buffers because it’s so efficient on little data.

And as you can see the nearest competitor is heavier twice.

What do we have in total?

  1. We have 42 bytes of payload
  2. + 20 bytes of IP headers
  3. = 62 bytes per track.
  4. PROFIT.

But when we get data also we need to store it, right?

Data storage

We need to store this data:

  1. Driver’s session to identify driver
  2. Cab number to perform search for client’s mobile application
  3. Order id and trip cost to save trip data from driver’s mobile application on server
  4. Last location to perform search
  5. N last locations to build route

Used storages

  1. Percona — to store all data. We store drivers, orders, fares and everything.
  2. Redis as key-value storage for caching purposes.
  3. Elasticsearch for geocoding

As mentioned above we have 600 online drivers and using these storages to save data seems non-expedient. So we need geo index

We watched for two geo indices:

  1. KD-tree
  2. R-tree.

We had requirements for geo index:

  1. We need to search N nearest points.
  2. We need a balanced tree to provide the best search in the worst scenario

KD-tree

And KD-tree doesn’t fit our needs because it’s unbalanced and can search only one nearest point. We can implement k-nearest neighbors over kd-tree, but we won’t reinvent the wheel because R-tree already solves this issue.

R-tree

It looks like this. We can perform search N nearest points and it’s balanced tree. We chose this one

You can get it there for Go programming language. https://github.com/dhconnelly/rtreego.

Also we need an expire mechanism because we need to invalidate drivers and show actual information to operators. For instance, remove driver via 900 seconds of inactivity. And also we need LRU data structure for storing last locations. Because we initialize storage for N items. When we try to add an item, when storage already filled. We remove the least recently used item and we add a new one. So here is our storage architecture

  1. We store all data in-memory.
  2. We use R-tree to perform a search of nearest drivers.
  3. Also we use two maps for storing drivers and perform search by cab number or by session

Final algorithm.

Here is the final algorithm on the backend:

  1. Get data by UDP
  2. Try to get driver from storage
  3. If doesn’t exist — get driver from redis
  4. Check and validate data
  5. Set driver to storage
  6. If doesn’t exist — initialize LRU
  7. Update r-tree

HTTP Endpoints

We implemented these endpoints to integrate to our systems

  1. Return nearest drivers
  2. Remove driver from storage(by cab number or session)
  3. Get information about trip
  4. Get information about driver

Conclusion:

In the end, I want to give these conclusions that we used in our backend system:

  1. UDP+Protobuf for data savings
  2. In-memory storage
  3. R-tree for nearest drivers
  4. LRU cache for storing last locations
  5. OSRM for map matching and building routes

As the example, you can watch on https://github.com/maddevsio/openfreecab-storage. It’s too simple but implements lots of features described in the article.

Let's block ads! (Why?)

Read the whole story
jpol
8 hours ago
reply
Share this story
Delete

JPS+: Over 100x Faster than A* (2015)

1 Share
You've been logged out of GDC Vault since the maximum users allowed for this account has been reached. To access Members Only content on GDC Vault, please log out of GDC Vault from the computer which last accessed this account.

Click here to find out about GDC Vault Membership options for more users.

close

Let's block ads! (Why?)

Read the whole story
jpol
8 hours ago
reply
Share this story
Delete

The Programming Interview from Hell

1 Share

Interviewer: Welcome, Mr X. Thanks for dropping by. We like to keep our interviews informal. And even though I have all the power here, and you are nothing but a cretin, let’s pretend we are going to have fun here.

Mr X: Sure, man, whatever.

I: Let’s start with the technical stuff, shall we? Do you know what a linked list is?

X: (Tells what it is).

I: Great. Can you tell me where linked lists are used?

X:: Sure. In interview questions.

I: What?

X: The only time linked lists come up is in interview questions.

I:: That’s not true. They have lots of real world applications. Like, like…. (fumbles)

X:: Like to implement memory allocation in operating systems. But you don’t sell operating systems, do you?

I:: Well… moving on. Do you know what the Big O notation is?

X: Sure. It’s another thing used only in interviews.

I: What?! Not true at all. What if you want to sort a billion records a minute, like Google has to?

X: But you are not Google, are you? You are hiring me to work with 5 year old PHP code, and most of the tasks will be hacking HTML/CSS. Why don’t you ask me something I will actually be doing?

I: (Getting a bit frustrated)  Fine. How would you do FooBar in version X of PHP?

X: I would, er, Google that.

I: And how do you call library ABC in PHP?

X: Google?

I: (shocked) OMG. You mean you don’t remember all the 97 million PHP functions, and have to actually Google stuff? What if the Internet goes down?

X: Does it? We’re in the 1st world, aren’t we?

I: Tut, tut. Kids these days. Anyway,looking at your resume, we need at least 7 years of ReactJS. You don’t have that.

X: That’s great, because React came out last year.

I: Excuses, excuses. Let’s ask some lateral thinking questions. How would you go about finding how many piano tuners there are in San Francisco?

X: 37.

I: What?!

X: 37. I googled before coming here. Also Googled other puzzle questions. You can fit 7,895,345 balls in a Boeing 747. Manholes covers are round because that is the shape that won’t fall in. You ask the guard what the other guard would say. You then take the fox across the bridge first, and eat the chicken. As for how to move Mount Fuji, you tell it a sad story. [Source]

I: Ooooooooookkkkkaaaayyyyyyy. Right, tell me a bit about yourself.

X: Everything is there in the resume.

I: I mean other than that. What sort of a person are you? What are your hobbies?

X: Japanese culture.

I: Interesting. What specifically?

X: Hentai.

I: What’s hentai?

X: It’s an televised art form.

I: Ok. Now, can you give me an example of a time when you were really challenged?

X: Well, just the other day, a few pennies from my pocket fell behind the sofa. Took me an hour to take them out. Boy was it challenging.

I: I meant technical challenge.

X: I once spent 10 hours installing Windows 10 on a Mac.

I: Why did you do that?

X: I had nothing better to do.

I: Why did you decide to apply to us?

X: The voices in my head told me.

I: What?

X: You advertised a job, so I applied.

I: And why do you want to change your job?

X: Money, baby!

I: (shocked)

X: I mean, I am looking for more lateral changes in a fast moving cloud connected social media agile web 2.0 company.

I: Great. That’s the answer we were looking for.  What do you feel about constant overtime?

X: I don’t know. What do you feel about overtime pay?

I: What is your biggest weakness?

X: Kryptonite. Also, ice cream.

I: What are your salary expectations?

X: A million dollars a year, three months paid vacation on the beach, stock options, the lot. Failing that, whatever you have.

I: Great. Any questions for me?

X: No.

I: No? You are supposed to ask me a question, to impress me with your knowledge. I’ll ask you one. Where do you see yourself in 5 years?

X: Doing your job, minus the stupid questions.

I: Get out. Don’t call us, we’ll call you.

Related:

Your Favorite Programming Language Sucks

Stupid answers to stupid puzzle interview questions

PS: My book Python for Hackers is FREE for a short time (normally sells for $39). If you want it, enter your email below.

Subscribers will also get exclusive content I won't share on my blog.

Let's block ads! (Why?)

Read the whole story
jpol
9 hours ago
reply
Share this story
Delete

Fasting Reduces IGF-1/PKA to Promote Hematopoietic-Stem-Cell-Based Regeneration

1 Share

Abstract

Immune system defects are at the center of aging and a range of diseases. Here, we show that prolonged fasting reduces circulating IGF-1 levels and PKA activity in various cell populations, leading to signal transduction changes in long-term hematopoietic stem cells (LT-HSCs) and niche cells that promote stress resistance, self-renewal, and lineage-balanced regeneration. Multiple cycles of fasting abated the immunosuppression and mortality caused by chemotherapy and reversed age-dependent myeloid-bias in mice, in agreement with preliminary data on the protection of lymphocytes from chemotoxicity in fasting patients. The proregenerative effects of fasting on stem cells were recapitulated by deficiencies in either IGF-1 or PKA and blunted by exogenous IGF-1. These findings link the reduced levels of IGF-1 caused by fasting to PKA signaling and establish their crucial role in regulating hematopoietic stem cell protection, self-renewal, and regeneration.

Copyright © 2014 Elsevier Inc. All rights reserved.

Let's block ads! (Why?)

Read the whole story
jpol
9 hours ago
reply
Share this story
Delete
Next Page of Stories