Sign Up Now!

Sign up and get personalized intelligence briefing delivered daily.

Sign Up

Articles related to "python"

Show HN: Makesite – Your own static site/blog generator in 125 lines of Python

  • Take full control of your static website/blog generation by writing your own simple, lightweight, and magic-free static site generator in Python.
  • This repository contains the source code of an example website containing two static blogs and a few static pages.
  • Note: In some environments, you may need to use python instead of python3 to invoke Python 3.x. The _site directory contains the entire generated website.
  • To do so, we replace the {{ content }} placeholder in the page layout template with the HTML code in the post layout template to get a final standalone template.
  • To recap quickly, we create a _site directory to write the static site generated, define some default parameters, load all the layout templates, and then call make_pages() to render pages and blog posts with these templates, call make_list() to render blog listing pages and RSS feeds.

save | comments | report | share on

Python Moms Care for Their Young, Surprising Experts

  • Heat-sensing lip scales that can detect warm blood to snack on may not scream maternal instinct, but a new study has revealed the species lays eggs and keeps care of massive, writhing balls of python babies for about two weeks before cutting them loose to the harsh outside world.
  • While live-birth giving vipers have been observed showing maternal behavior, his discovery is the first example of egg-laying snakes caring for their young after hatching.
  • Alexander is also researching how climate change will affect this population range in the future, and he isn't sure whether the maternal behavior represents an adaptation by southern African pythons to cope with cold temperatures at the extreme edge of their range, or whether the whole species (and possibly their northern cousins) carry this motherly instinct.

save | comments | report | share on

Repl.It 1.0: IDE that Grows from Playgrounds to Fullstack Apps

  • If you want to use files, write to files, split your code into modules, etc., you just do that and behinds the scenes the environment will switch to one where you're interacting with the filesystem.
  • You use it to listen on a port, any port you'd like; we'll detect that, host your server/repl on your subdomain (forever!) and that's it you're developing/deploying an application.
  • We also know that not all applications will grow incrementally so in typical one-click-start fashion we've pre-setup a Django, Rails, Express, and Sinatra apps.
  • serverless apps are unique in that they're stateful and that the same repl, same protocol, same everything, that you use in development is deployed and running in production.
  • After getting user-interest @pyelias is starting to explore building a full stack application using Django.

save | comments | report | share on

Memory efficiency of parallel IO operations in Python

  • Python allows for several different approaches to parallel processing.
  • With Python 3.5, it is easily accessible via the ThreadPoolExecutor that provides a very simple API to parallelise existing code.
  • Gevent is an alternative approach to parallelisation and it brings coroutines to pre Python 3.5 code.
  • With asyncio, memory usage is significantly lower compared to the previous methods.
  • Once a code runs in parallel, the difference in speed performance between the parallel methods is very low.
  • The memory footprint is much lower compared to other parallel methods without impacting the overall speed.
  • At we use asyncio in high performing APIs where we want to achieve speed with a low memory footprint on our infrastructure.
  • Several times a year, we organise an intense coding Dojo for anyone who knows a bit about Python and wants to try using it in real applications.

save | comments | report | share on

Attacking Merkle Trees with a second preimage attack

  • It’s very similar yet subtly different to a regular Preimage Attack in that you have a sample of data that you know leads to the target hash value.
  • But as you can see from the diagram, the inputs to the middle layer are the concatenated hashes of the previous layer, and we can just pass those two values directly into the Merkle Tree and get the same root hash value back.
  • The significant limitation and reason that these attacks often aren’t actually of concern in the real world (such as with bitcoin) is that whilst we can find input Y which generates the same hash value as input X, we have zero control over the value of Y or even it’s format, meaning out input will likely not be interpreted in a useful manner to whatever application is relying upon the Merkle Tree for data integrity.

save | comments | report | share on

PyTorch – Internal Architecture Tour

  • As you can see, there is a macro at the beginning of the definition, called PyObject_HEAD, this macro has a goal of standardization of Python objects and will expand to another structure that contains a pointer to a type object (which defines initialization methods, allocators, etc) and also a field with a reference counting.
  • After this line, PyTorch will create a new Tensor object from this Numpy data blob, and in the creation of this new Tensor it passes the memory data pointer, together with the memory size and strides as well as a function that will be used later by the Tensor Storage (we’ll discuss this in the next section) to release the data by decrementing the reference counting to the Numpy array object and let Python take care of this object memory management.
  • This allocator has function pointers to an internal PyTorch library called libshm, that will implement a Unix Domain Socket communication to share the shared memory region handles.

save | comments | report | share on

Contract Simply (S17) is hiring a sr. full stack developer in Austin

  • We’re also YC-backed (S17).TECH WE USEElixir, Python, React/Redux, AWS, Kubernetes, Postgres, Redis, circleciREQUIREMENTS- 4+ years experience in full-stack web development - experience with Elixir and/or React — we don’t mind teaching you one of the two - solid understanding of git - experience with Postgres (or another RDBMS) - can build quickly without creating a horrible messNICE TO HAVE- experience with both Elixir and React - experience with GraphQL APIs - experience with machine learning - experience with KubernetesGET IN TOUCHEmail me at [email protected]

save | comments | report | share on