« first day (3591 days earlier)      last day (1349 days later) » 

7:56 AM
got into this error
```File "E:\Python\lib\site-packages\urllib3\connectionpool.py", line 7, in <module>
from socket import error as SocketError, timeout as SocketTimeout
ImportError: cannot import name 'error' from 'socket' (E:\Rehan\Python\socket.py)```
 
you've named your script the same as a standard library module, thereby shadowing the latter.
rename your script.
 
 
2 hours later…
9:37 AM
I've just flagged a post selling instant curses that work fast with no side effects and no back-fires. My pleb status nearly made me lose the post but I'm clinging on to the faded out version to get the WhatsApp contact details. Beware, all ye that wish to cross me.
Now that I think about it, "instant" curses that "work fast" is not a very effective tagline. I think I'll contact their sales and marketing team
 
But now all my enemies can get the same service :/ It's gonna be a FGITW scenario
 
10:01 AM
Woah, nearly 48k commits to SmokeDetector. I knew it was a thing, but I definitely didn't realise its scale
 
@roganjosh a lot of those are probably dataset/list/etc, updates and privilege updates
48k is still a lot
 
It's quite hard to navigate how it works with little structure in the repo
 
Yeah, each new blacklist feedback pushes a commit.
 
10:20 AM
I also didn't realise that tripleee was so involved in it. I feel like I've been living in a cave
 
well it's not in plain sight
If you're not in a moderation-oriented chatroom you don't even see SD work
 
Isn't it always a FGITW scenario?
> Auto watch of big\s+butts by Mast
The commit history is quite entertaining.
I'm not really sure why they chose to implement blacklist and watch additions as commits.
 
10:37 AM
@AndrasDeak true. I guess I kinda expect these kind of things to be on people's profile and I definitely can't cope with the moderation rooms
 
 
1 hour later…
11:57 AM
Cbg all - I am back from a week of convincing people we don't need to switch all our SQL systems to noSQL just cause the second is "shiny" :/
 
12:29 PM
@khajvah now look what you did ^
 
1:28 PM
Cbg
 
2:01 PM
Hi,when send a dns query by PF_PACKET socket,why kernel send destination unreachable icmp packet after receiving dns response?
(Port unreachable)
(type-3 code-3)
 
2:27 PM
I think an MCVE would be extremely helpful for this kind of question. Knowing the OS could perhaps potentially be useful as well.
 
2:44 PM
:50218262
you mean the code?
import socket
p=socket.socket(socket.PF_PACKET,socket.SOCK_RAW) #root
p.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
p.bind(("eth0",0x0800)) #IPV4
p.send(dnsquery_frame) #dns query frame(ethernat headers+ip headers+udp segment + dns data)
s=p.recv(1024)
p.close()
 
He's trying to indicate that you haven't given us much information to go on. I might add that while you might be using Python to generate the packets you're much more likely to get a sensible answer from a network person.
What ensures that the first frame you receive is the DNS response? And how do you see the ICMP packet? There just isn't enough context there, I'm afraid, to give you a sensible answer. This may well be because you haven't yet learned enough to be able to frame your questions helpfully, in which case we have the choice of quizzing you to find out what the problem really is, or ignoring you. In my case it's 4pm on a peaceful Saturday afternoon, and I was just passing by.
 
3:00 PM
in wireshark ,it show an icmp type 3 code 3 packet
I sent many dns query packets .... for all kernel send icmp packets after receiving dns response....
@holdenweb If you want I can post dns query frame here,but it is useless because your interface ip,mac,default gateway(router interface) mac is different than me...
 
I think holdenweb's comment about it requiring a network person is probably correct and you might not have much luck here. With the snippet you've given, I think it's enough to attract someone who feels able to help and they will ping you. I'm not sure any further info needs to be shared at this point
 
@roganjosh ok no problem.....
 
chat.stackexchange.com probably has a room or two for server fault
sorry, race condition :P
 
3:19 PM
No worries :)
 
@Leroy if your question starts with declaring that it's off-topic, please don't continue
if you have a well-defined python problem we can help with that
 
It's looking perilously close to me having to write some Java :S This is not how I planned my Saturday
 
@roganjosh you mean you don't generally have "torture myself" in your diary for every Saturday?
 
Only occasionally. What's worse is that I had the project all set up in Eclipse on my old laptop which I've given to my mum. So it'll probably take 5 hours to remember how to build my project before I can even start. Poop
 
3:36 PM
Eclipse... wow... that's a blast from the past... I might have used that in 2006? :p
 
It's what the guides told me to use. I have barely any idea what I'm doing, so who am I to argue with the guide? :P
 
3:51 PM
wait wait wait. I can use some trickery in my existing API to get what I want. I just need to open a wormhole between a driver's house and the depot and then put the depot in some alternate dimension that's 100km from every other location. <wipes brow>
 
Seems less hassle than Java :p
 
:P I knew there was a trick to be had that would save me here. Who needs hard constraints when you can just fiddle the numbers in a distance/time matrix?
 
 
1 hour later…
5:38 PM
@roganjosh Elemental Security hired Guido van Rossum, than made him write Java ... true!
 
That's nuts :S
I suppose if you've steered the ship of the fastest growing language for so many years, you know a thing or two about programming. Still seems a little bit of a waste but hopefully he was paid bajillions to go through it
 
 
1 hour later…
7:05 PM
yo andras, don't know if you're there
but I have just implemented the numexpr.evaluate, now doing the test to see if it runs faster :D
 
fingers crossed
How large are your arrays you're plugging into it?
 
not so large
the array has 4 nested arrays, 2 of them have only a few integers, one of them have 1-7 nested arrays with 3 ints each, and the last one has 1-7 * 1-5 nested arrays with 3 ints each
best way I could answer, sry :P
 
what are "nested arrays"?
 
arrays inside arrays?
like this [[1]]
 
those are just multidimensional arrays
 
7:10 PM
should I have used np.arrays or some other data structure instead of normal lists?
lists*, not arrays
was using the wrong word
 
@PedroSpinola that makes a huge difference
 
yeah multidimensional arrays
 
But the items in the list have varying size.
that's a "ragged array" when converted to numpy, with dtype=object
Aug 6 at 23:39, by Andras Deak
numpy and ragged arrays don't match
I'd be somewhat surprised if numexpr did anything with it...
 
wait I'm a bit lost
 
I know
 
7:12 PM
each time I generate this list which will be used inside optimization, the number of items is fixed
 
I don't really try to understand what your situation is until you give exact information, which you haven't. But it's alright, something will happen in your code.
 
what exact info is missing?
there was a stupid error on the test, running it again
the data structure I'm using right now is a list and looks like this:
 [[[0, 0, 6.0], [1, 1.5, 2.0]], [[[0.0, 4.0, 1.0], [0.0, 5.0, 3.0], [0.0, 2.0, 0.5]], [[0.0, 2.0, 0.5], [0.0, 2.0, 0.1], [0.0, 2.0, 0.5]]], [4.74, 129.5], [2, 2, 2]]
 
that is as clear as mud.
@PedroSpinola now that is exact.
 
sry :P
 
>>> np.array( [[[0, 0, 6.0], [1, 1.5, 2.0]], [[[0.0, 4.0, 1.0], [0.0, 5.0, 3.0], [0.0, 2.0, 0.5]], [[0.0, 2.0, 0.5], [0.0, 2.0, 0.1], [0.0, 2.0, 0.5]]], [4.74, 129.5], [2, 2, 2]]).shape
<ipython-input-25-5b04af7aed35>:1: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
  np.array( [[[0, 0, 6.0], [1, 1.5, 2.0]], [[[0.0, 4.0, 1.0], [0.0, 5.0, 3.0], [0.0, 2.0, 0.5]], [[0.0, 2.0, 0.
and that ^ means you have a "ragged array" because the nested structure doesn't have the same sizes on every level
 
7:16 PM
it says "nested" though :P
 
nested means multidimensional...
Whatever. I'll be surprised if your code runs (faster).
 
ok so each dimension should have the same size for this to be effective?
dimension size and element size, if I understand correctly
(and subdimensions, if present)
 
Only if you want to make good use of numpy. Since you are presumably porting working numpy code to numexpr, your original code should also have no ragged arrays...
 
test feels slower indeed, but not finished yet
by porting do you mean something like this?:
a = np.log(z)
n = numexpr.evaluate('a * 5 - 1')
 
if your original was n = np.log(z) * 5 - 1 then yes
but numexpr will probably support log(a) in the string
>>> arr = np.random.rand(100, 100)
... lst_ragged = arr.tolist()
... lst_ragged[-1].append(0)
... arr_ragged = np.array(lst_ragged, dtype=object)
... assert np.isclose(arr.sum(), sum(arr_ragged.sum()))
... %timeit arr.sum()
... %timeit sum(arr_ragged.sum())
5.12 µs ± 405 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
1.07 ms ± 11.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
difference between a proper (rectangular) numpy array and a ragged one ^
arr_ragged is the same as arr, except the last row of the array has an additional 0 that doesn't affect the sum (but makes the array ragged)
 
8:20 PM
yo
anyone here that knows both c++ and python?
 
9:19 PM
@Hi-IloveSO I've used both, tho my C++ is a bit rusty (and judging from your recent C++ question, the language has changed a lot). Go ahead and ask your question, we'll answer if we can, or we won't if we can't. If you don't post the question, we definitely won't answer.
 
@Hi-IloveSO If it's about to your recent question, please keep in mind the room rules and wait 48 hours before asking
 
I didn't see any python mentioned in that question so I didn't prod them on it.
Plus it looks like I was too slow to respond - looks like they left.
 
they'll see a notification on main
 
Oh, true
Man, I barely recognized the code in their question. Probably should call it C++++ by now.
 
@PaulMcG no worries. I just get a bit bored of repeating the mantra and moving messages :P
 
10:14 PM
hey is this somewhere i can ask someone for some help on coding a file sorter in python?
 
@Tg1tim hello, please see our rules to see how to ask and how not to.
 
@AndrasDeak thanks so post the code and a quick description?
 
We also have a formatting guide. Chat formatting is not exactly intuitive
 
i tried to use dpaste idk what happened sorry
pretty much i just need help understanding how to read the sort folder and sort based on file type into the other two folders
 
Assuming the indentation of your code is correct, it looks like you are going to create 3 directories under that path directory. The formatting guide roganjosh mentioned helps you do the python formating
 
What, exactly, are you trying to do anyway?
 
@Tg1tim naive approach: 1. loop over all filenames, 2. determine file type, 3. choose what to do with the file based on file type
 
thanks any tips on how to implement that into code im pretty new to coding @AndrasDeak Thank You
 
@Tg1tim you would start by reading a tutorial :)
It's a crucial investment when you're new, so that you're not reliant on other people writing your code.
 
10:37 PM
ive done some python back in highschool just dont know anything about the file stuff i usually just break down the code into bite size pieces and learn by understanding how everything is working together thank you so much for the help breaking it down into those three steps really help
 
All through this, my spidey senses were tingling that you're going to be looking for this. Andras' advice is the starting point, but maybe that link will be useful in the future
 
@roganjosh thanks that will come in handy
 
10:53 PM
@JonClements I still use Ecplise :P
I mean there are only 4 IDEs for professional Java (3 if you consider that one is purely for Android).
 
@roganjosh I had a friend I worked with in the 80's and 90's used the "tingling spidey senses" expression in much this way (and usually talking about software too), Steve Metsker. He passed away of a rapid and aggressive cancer in 2008. Ironically, he wrote the book "Building Parsers with Java" almost the exact same time I wrote the first few versions of pyparsing. His book includes a parser for a multipendulum simulation - very pretty.
 
Saddly I have also done some Python work in Eclipse (if you count it being in the project as "work" cause usually I just open them in Gvim for actual editing)
 
@PaulMcG that's not a very happy anecdote. At least he lives on in his advice
 
Similar happened to John Hunter, original author of matplotlib, in 2012...
 
11:09 PM
114
Q: Thank you, Geoff

Shog9It seems that after 11 years, Geoff Dalgas - "Valued Associate #00003" - has decided to hang up his hat as a developer at Stack Exchange. That deserves... Some recognition and gratitude! Let's talk about Geoff, baby Eleven years. Eleven (11) years! Twelve, if you count all the work he was doing w...

Wow
 
oof...
 

« first day (3591 days earlier)      last day (1349 days later) »