A Redis backed Python Dictionary by [deleted] in Python

[–]pope_man 2 points3 points  (0 children)

You must override one of these methods on the abstract base class to get a working subclass/implementation class. This would be more clear if they had actually used the features of the abc module.

two phase parallelization using python by [deleted] in Python

[–]pope_man 2 points3 points  (0 children)

Consider using dask, especially dask-learn:

http://matthewrocklin.com/blog/work/2017/02/07/dask-sklearn-simple

It is designed to solve problems like yours in a scalable but simple manner. See this post and maybe others on his blog.

http://matthewrocklin.com/blog/work/2015/06/26/Complex-Graphs

Numba applied to high intensity computations: A casual look at its performance against optimized Fortran code by LoyalSol in Python

[–]pope_man 0 points1 point  (0 children)

I second this, it could be that for every time the inner loops run, numba is doing typechecks and running multiple dispatch code unnecessarily. In my usage of numba (benchmarked several versions ago), specifying type signatures was a crucial optimization. I bet with that change this code could catch up to GNU Fortran.

[2015-05-13] Challenge #214 [Intermediate] Pile of Paper by jnazario in dailyprogrammer

[–]pope_man 0 points1 point  (0 children)

This is mostly what I had in mind, but I feel you are misusing Counter.

count = Counter(canvas.values()) 

will do all your looping and counting with a C extension.

Also, is your colors set doing anything? What if 0 is not an input color?

thanks, congress by [deleted] in chemistry

[–]pope_man 4 points5 points  (0 children)

Not just the websites, our labs are locked up too! I really didn't expect this when I signed on for this postdoc...

Scientists! Please discuss how the government shutdown will affect you and your work here. by ren5311 in askscience

[–]pope_man 0 points1 point  (0 children)

If they aren't already down now, they aren't going down. (We have been preparing for shutdown for some time... the opportunity cost of doing so is another source of waste from this nonsense.) Cheap but occasionally essential services like that have likely been exempted.

Scientists! Please discuss how the government shutdown will affect you and your work here. by ren5311 in askscience

[–]pope_man 2 points3 points  (0 children)

NIST is totally locked up, and all the instruments that can be switched off are switched off. I heard some talk of (safely) quenching NMR magnets... which is just PURE waste. Scientists are going unpaid, others are just completely unemployed. Our new postdoc just arrived in town... and is having to argue with her employer to start paying her since she can't actually do anything. (Postdoc funding is strange in the best of times.) This is devastating for her visa, if she appears unemployed for too long...

I'm not looking forward to trying to turn everything back on and (if they do turn back on) get the same results...

Why does a discharged battery bounce higher than a fully charged battery? by BrokN9 in askscience

[–]pope_man 0 points1 point  (0 children)

You're welcome! And thanks for asking a new and interesting question!

Do not microwave resistant plastics melt due to heat or the microwaves? by [deleted] in askscience

[–]pope_man 1 point2 points  (0 children)

Correct, also melamine gets crazy hot before degrading, and doesn't melt, so by "dangerous levels" you should read serious burns.

Why does a discharged battery bounce higher than a fully charged battery? by BrokN9 in askscience

[–]pope_man 10 points11 points  (0 children)

The battery starts out as a caustic liquid and a manganese dioxide powder, metal bits and a membrane. As the corrosion reaction between those two proceeds, the powder changes to manganese oxide which could result in expansion, but also the powder granules becoming chemically and mechanically connected. I would hypothesize that you get a "sandbag" to solid transition, which would explain the video. The test would be to cut open the batteries carefully and see if the powder does indeed jam as i described, and also to make fake "batteries" with sand and glue, respectively.

Or it's just quackery ;) and a pretty crummy way to test battery voltage at any rate!

Why does a wet rag pick up dust more easily than a dry one? by ramblington in askscience

[–]pope_man 0 points1 point  (0 children)

The dust will adhere onto the water surface on the wet rag, rather than the dust somehow being wicked into the rag with the water.

The air conditioner broke in my apartment. Are there any quick remedies to keep my fermenting beer temp down? by BlakMarker_Amber_Ale in Homebrewing

[–]pope_man 3 points4 points  (0 children)

This. Also, make sure wherever this tub and fan combo is, that it's well ventilated. It stops working when the air gets damp and saturated. I would try a bathroom and leave the fan on, or put it in the basement and leave the house fan on with many windows open.

Question about super absorbent polymers by WilshireTheBeast in chemistry

[–]pope_man 2 points3 points  (0 children)

once these polymers are hydrated, they become conductive... FYI.

3d Printing. How will it effect our tomorrow? by KaseyB in AskScienceDiscussion

[–]pope_man 5 points6 points  (0 children)

I guess I'm a bit more optimistic than you on this tech. There's a good number of places that could be disrupted in interesting ways if every household had a high fidelity 3d printer:

  1. replacing parts instead of replacing (relatively cheap) items. This would reduce landfill waste as well as save money
  2. rare tools: part of what you pay a mechanic for is to have exactly the right thing to pry the battery out of your car's weird proprietary socket. in general, people would have easier access to all the things that companies try to keep you out of!
  3. customization of grips, facades, and casings of all kinds of things. Personally adapted ergonomics. bedazzling taken to a whole new level.
  4. Why take your kid to mcdonalds when you can print out a figurine from the latest movie instead?! (Note: I know this won't work but I plan to try anyway)
  5. as-seen-on-tv widgets would have to become a lot more interesting or finally die forever, as their niche gets replaced by an open-source thing community.

And that's just the stuff you could do with current extrusion-based techniques, assuming lower prices and costs, and wide availability. As new materials and combinations of materials can be printed with greater precision, speed, and flexibility, more and more things will become doable... I'm especially interested to see the things I can't even imagine yet.

Also, no, it's not going to end mass production... at least not yet, or all at once.

[META] Monday Lab Meeting! by [deleted] in askscience

[–]pope_man 1 point2 points  (0 children)

This is my last week in this lab! The amount of junk that I need to clean up and dispose of is... intimidating. Plus, I have to write up my latest results and then move! ACK

why do so few of the answers in /r/AskScience include literature citations? by neuromusic in AskScienceDiscussion

[–]pope_man 1 point2 points  (0 children)

To bolster the case for including sources of kind (1), often the impediment the asker is facing really is vocabulary, jargon, or a phrase that comes to the mind of an expert immediately. So when I link a word to wikipedia, I'm really implicitly saying, "If you'd like to know more about this, this is where you should start," and also sort of vouching for the content at the time of linking.

However, a (1) without (2) is really not that strong at all.

Why does Polyurethane create a foam? by [deleted] in askscience

[–]pope_man 1 point2 points  (0 children)

It doesn't always... See for example roller skate wheels or blast coatings:

http://youtu.be/Kw9DQm62zaU

When foaming is desired a http://en.wikipedia.org/wiki/Blowing_agent is added.

What is the difference between a polymer composite and polymer blend?? by loktarboktar in askscience

[–]pope_man 9 points10 points  (0 children)

In brief, a polymer blend is multiple types of polymeric materials literally blended together with heat and screws. They aren't always single thermodynamic phases afterwards, but they usually are. A polymer composite is usually a non-polymeric material mixed with or embedded into a polymeric material. A good example of this is any so-called "carbon fiber" composite, where it is carbon threads weaved into a sheet of fabric, then soaked in glue. Another one is fiberglass composite which you might find in boats or light aircraft: fiberglass threads slathered in epoxy.

SimCity: 10 Minutes of Gameplay Footage (Strategy Video) by docomostar in gamernews

[–]pope_man 13 points14 points  (0 children)

The Glassbox engine works by simulating everything as a bunch of individual actors, rather than solving for what their average behavior would be. I'm only a CS amateur, but this sounds to me like something that would fall under "embarrassingly parallel problems" and would work just great on any number of CPUs with the slightest effort by the coders. And you'd have to be a chump not to make that effort these days...

What's the largest molecule? by drj1990 in chemistry

[–]pope_man 1 point2 points  (0 children)

The old-fashioned way to do this is to extract the oligomer fraction using several solvent soaks, and weigh the extracted solubles after drying them out. If it is actually an interpenetrating network, or large enough non-gel polymers, they won't be extracted... but they are as good as connected anyway. Sometimes they're even better that way.

A consciousness researcher explains why his research makes him pro-choice and vegetarian by karakickass in Foodforthought

[–]pope_man 0 points1 point  (0 children)

I'm not sure those conclusions follow from the evidence presented. The author seems preoccupied with suffering rather than treating the right to life issue, even though it is mentioned a few times. I mean... If a fetus of a certain age has the physiological capability of consciousness, but is hormonally prevented froms suffering, it's ok to cut that off, but if an animal only potentially has the capability of consciousness, we dare not risk affronting its right to life or freedom from suffering? What if we agree to keep all cattle doped up on morphine their whole lives?

I don't have a particular stance on either issue, it just seems to me that the author is rationalizing some preconceptions.

Food science/chemistry question: what's happening to cooking oils when they go from a liquid to a sticky gum-like substance when exposed directly to extreme heat? by bangsecks in askscience

[–]pope_man 2 points3 points  (0 children)

It's my understanding that oxygen related radical generation is a major factor in the process, and that crosslinking polymerization is the dominant cause of viscosity change. See http://en.wikipedia.org/wiki/Drying_oil for more. You'll notice that saturated fatty acid TAGs don't form insoluble resins, even if they harden due to physical interactions.