Manipulating a specific bit on the Hard Drive [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've recently started looking into low level bit manipulation.
http://bits.stephan-brumme.com/
and
http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetNaive
I understand the concept of how to clear/set/toggle/check etc., a bit within an integer or a byte. (Get a specific bit from byte)
I cannot however seem to find how to change the value of a bit at a specific location in my hard drive.
I would be attempting to do this in Ubuntu 14.04 LTS. I am most familiar with Python and C++ but i'll take answers in any language.

It would go like this:
Open the drive for read/write, as root. (ex: /dev/sda)
Mmap the drive (or you can seek and read/write)
find the byte, modify the bits you want, flush and unmmap (or close).
Someone else would probably provide the code version of this.

Related

adding index "abality" to mysql data base (im not a programmer take it easy) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
Improve this question
i gave my project to a noob programmer which i've been told "he has not used indexing database" and this is using massive cpu from my server
and this is right , my sql consumption is massive for such an small project with maximum of 300 requests/s
is it possible to convert that database somehow to a more efficent version?
if it is may you help me with this?
(project is a python telegram robot and i already know basics of python)
i used to load everything from database to a varriable in python and then process things a lot faster nd with less cpu usage and update the varriable everytime that data base changes
but i need more efficiency and also this is very hard if i want to do for all parts of robot(I've done this only for a few commands of the robot)

SFTP with python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Does anybody know of a methodology to get a remote file from a server using a python script, that will work suitably well for very large files?
I'm currently using Paramiko, and it works quite well, however i'm concerned that the target use case for this will be .bag files of considerable size, potentially around 10 gig. My limited understanding of this is that the downloaded file will be stored in RAM rather than on the drive, until I store it onto the drive.
Or am I loking at optimising a problem that doesn't exist?
Is there a way to save the data as it is being downloaded?
I had thought about just using a bash script, which i suppose would work, but there's a lot of additional functionality that is required. Hence my use of python.
Another option would be to use OS library to simply run SFTP.
I'd appreciate anyones thoughts on this.
Thanks!
It would seem my understanding of Paramiko and SCP / SFTP was flawed.
The default way to do it, does not store it in RAM, and i'd misread code that I'd written last year - we're all guilty of that!
A minimum working example -
def DownloadSFTP(self):
self.sftp.get(self.remotepath, self.localpath)
self.sftp.close()

How to find computer specs in Python? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am somewhat a beginner in Python, and want to make a script that would evaluate how much the users PC is worth. For this, I need to have a way to find out what the users computer specs would be.
Some things that I need to know about would be:
CPU
GPU
How much RAM
How much Storage
I have heard that there is a way to find the cpu, but how about a way to find out any of the remaining parts.
Check this question:
How to get current CPU and RAM usage in Python?
Specs is a really general question. You're better off searching for each specific thing you want to find. I think psutil will give you some of what you need.

what language do I need to write macros in LIbre Office Calc? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've written a bunch of VBA code for various things in Excel. I'm looking at migrating to libreOffice. Under Tool->Macros->Organize Macros: the two choices are LibreOffice Basic and Python.
Should I learn one of those, both, or something else. Am I wasting my time altogether? Any suggestions appreciated.
Python is the way to go.
Start here: http://wiki.python.org/moin/BeginnersGuide
And no, you're not wasting time.
You'll look back and say, why didn't I do it sooner.
Python's a great skill to learn - I use it for everything. It's the glue language for virtually every tool out there (you can even use it with .Net).
Documentation for Python + LibreOffice is however a bit sketchy currently, although I don't have much experience with Calc.
There is some work-in-progress documentation at http://documenthacker.wordpress.com (or soon www.documenthacker.com). It has examples for working with Writer, rather than Calc, but you might still find it useful.

Image Recognition using Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have an idea, that is, I want to identify the letters in an image which may be .bmp or .jpg.
For example, here is an .bmp image with a letter 'S' in it. What I want to do is to identify the letter using Python.
It's kinda similar with those Questions about auth code recognition, and I read some of those Q's, but still can't figure what to do.
Any advice is appreciated.
You're probably looking for the OpenCV toolkit; it is commonly used for tasks where software must "recognize" some contents or features from images.
Also there is whole blown system Ocropus which has Python bindings or perhaps better Python bindings to tesseract

Categories