« first day (962 days earlier)      last day (3987 days later) » 

9:00 PM
Database.
 
Yes that is the end goal
But i need it if the database goes down
 
Locally, I mean. In addition to the remote one.
Oh, you mean the database you're eventually logging everything to is also running locally?
In that case, I'd say failure is perfectly appropriate. Don't take that kind of crap from the user.
 
Yes the local storage is for if it cant get a connection to the database
DDoS or something
 
If your database is out of commission because of a DDoS, you aren't going to be able to keep data locally either, if it's on the same machine.
 
DDoS is only network
the machine will still run
 
9:05 PM
DDoS on a database isn't typically network. It's disk access and memory.
If it's network, you can still access the database locally.
 
database is remote
On the machines network
It will still process python scripts
 
Then my original suggestion applies and run a secondary database locally.
 
Okay and then get the data to the remote one
by reading the local and moving it all
When the connection is back up
 
If your database doesn't support direct merging of some kind. Which it admittedly probably won't.
If it doesn't, you don't even need the same database. SQLite will probably do.
If you don't have multiple concurrent writers, that is.
 
So the answer isnt a queue
Because what im building here
Is a web front end, which is available on my servers
And then a package type thing, people can upload to their servers to track all types of usage
Which then polls and writes to the database every 10 seconds
However, primary to track DDoS, i wanted to be able to continue logging network, even when the DDoS is happening
 
9:19 PM
I was trying to post a question but I get this message: "Sorry, we are no longer accepting questions from this account. See goo.gl/C1Kwu to learn more." anyone can help?
 
If you know your data can fit into memory (keeping in mind that per-process memory limits can be very strict on web servers) and you don't mind losing that data when your process dies unexpectedly, a queue is fine.
 
Hmm okay and pickle and json are not the answer?
 
They're fine, but I feel that if you're going to format your data to fit into a database anyway, you might as well do it immediately.
 
Yeah true
 
@Stefanos: have you considered reading the information at goo.gl/C1Kwu?
 
9:24 PM
can somebody try to upvote me?
 
Post good answers and people will upvote those.
Fix your bad questions and people may or may not upvote those too.
Begging for upvotes in chat is probably just a good way to turn your automatic ban on asking questions into a deliberate ban on doing anything at all.
 
Hmm im still really confused on what to do
I dont really want users logging the data themselves
So maybe if database connection can't be made, i could write like json dump?
Would that write it to file?
 
Well, yes, if you pass it an open file in write mode.
Not so much if you pass it a StringIO instance.
 
9:40 PM
Ugh im really not sure what to do
I need a lightweight method
For temp storage
That can be read and written to the remote database later on
 
bsddb might be worth looking into if you want a built-in no-SQL database.
I guess that's been removed in Python 3, though.
 
Having issues trying to get a script to send specifically what I want it to.
 
Huh. What's the canonical way of using Berkeley DB in Python now, then?
jcea.es/programacion/pybsddb.htm, apparently. It's not even on PyPI.
 
Ugh, I can't actually find a way to explain the problem.
Essentially it has to do with sending a list of connections information. Except I can never get the script to send it to everybody because of the way it is setup. I have to use conn.send(1024)
Except conn = self.conn
Lol, this information means nothing to other people.
Okay
conn = self.conn
script does the following: if somebody connects, send this list to everybody.
But if two people connect, it only sends the new list to the second person. Because conn.send refers to sending it to self.conn, which means only a specific socket.
Forget it.
Can't explain.
 
Already forgotten.
I think I'm going to write a requests equivalent for gopher.
 
9:52 PM
Whatever. Goodbye
 
Now that gopherlib has been callously removed.
 
10:04 PM
I have question
timeit.timeit(stmt='pass', setup='pass', timer=<default timer>, number=1000000)

Is any sense to use default value of number (1000000) instead of simply number=1 ?
When number=1000000 and then result will be divided (/100000) result will be more precise?
why default value of number is 1000000 !
 
Any number of things can affect how long it takes to execute something. Process preemption, page faults, etc. None of these are strictly relevant when you're timing a piece of code, and timing the same thing repeatedly helps paper over the effect of these irrelevant details.
Just try timing something with number=1 a bunch of times in a row, and compare the values you get back. They'll differ by so much your tests are basically meaningless.
 
Cabbage all.
And meep, websockets are down.
At least for me.
[23:13:25.268] Firefox can't establish a connection to the server at ws://sockets.ny.stackexchange.com/. @ cdn.sstatic.net/js/full.js?v=4890977376c7:13
 
10:49 PM
rhubarb all!
~
 
@PeterVaro: Rhubarb.
 
php is better than python
 
@sonics876 Are you attempting to cause outrage?
 
@sonics876 I pity your lack of judgement..
But perhaps you have a point; PHP is better at confusing you, at letting you create hard-to-read and hard-to-maintain sites, etc. Everything can be better than something else given the right criteria.
 
agreed. python sucks
 
10:58 PM
It sucks at sucking, at least.
 
also javascript is a superior language
 
Do you expect that one day python will be more popular than php ? ;) In Poland most job offers is related with php or java, for the time being python is not such popular ...
;)
 
11:21 PM
It largely depends on context - Python may not be more prominent for web development, but overall, it's probably used more than PHP
(pulling that out of my ass)
 
The TIOBE index disagrees with your ass.
Not everyone agrees with the index methodology, but it is a datapoint.
Then again, PHP is dropping in the index, and Python has been ranked higher once already.
As far as I am concerned, I don't want no stinkin' PHP kiddies in my Python field, where we can do proper professional work.
 
real men use python?
 
Popularity isn't everything. A person typically only holds one job at a time, and Python jobs are of a much higher average quality than PHP jobs.
 
Anywho, sonic is just trolling (doing the opposite in the PHP room), so I put him on ignore.
 
I'm surprised NoSQL isn't on the TIOBE yet.
 
11:31 PM
The day NoSQL becomes a programming language I am sure it'll be listed.
 
you know what I mean. I think if you put all of them together it would be on there.
 
Oops... I am getting "Process finished with exit code -1073741571" in my PyCharm 2.7.2 during my code execution. Have you any idea what happend?
but I didn't want interrupt your discussion... go on, it is interesting :)
 
I'm going to guess what happened is that your process finished with exit code -1073741571.
 
I got it during execution my quick sort function for 10 000 items.
for 1000 items everything was great
 
11:41 PM
Recursive?
 
yes
 
What happens if you ran it on the command line instead of in PyCharm?
I suspect you got a 'maximum recursion depth exceeded' RunTimeError.
3
Q: Python: Maximum recursion depth exceeded

find-missing-semicolonI have the following recursion code, at each node I call sql query to get the nodes belong to the parent node. here is the error: Exception RuntimeError: 'maximum recursion depth exceeded' in <bound method DictCursor.__del__ of <MySQLdb.cursors.DictCursor object at 0x879768c>> ignored Runtim...

 
I set sys.setrecursionlimit(10000000)
so it is no reason
 
right, that'd exclude that then.
 
I will try run it on the command line ...
 
11:47 PM
The Python interpreter crashing like that is considered a bug outside a few special cases and the obvious extension module causing it to crash
are you using any C extension modules?
as it's far more likely they are causing the problem over Python
 
no i dont
hmm
 
Sounds like it might just be resource exhaustion.
Setting the recursion limit very high is not a great solution in most cases.
You are generally best off just converting your program to a manual stack.
 
A screenshot web service that doesn't understand the difference between PNG and JPG and when which is appropriate?
 

« first day (962 days earlier)      last day (3987 days later) »