« first day (1529 days earlier)      last day (3420 days later) » 

11:00 AM
@Ffisegydd awsome
 
I'm glad someone appreciates my comedic genius.
 
@Ffisegydd Well, I know for motor vibration analysis, you can look at the types of vibration and infer what's going wrong with the engine (ie, non-periodic impacts = brown trouser time)
I just can't think what would cause beat frequencies ..
unless the bloody thing is rotating!
 
What are you actually measuring? Is it on one of your devices?
 
Aye. Effectively it's a metal rod
Might be encapsulated, might not. Could be tensioned, might not. Could be fixed at one end, both ends, or somewhere in between...
 
O_o hmm ok
I did think about encapsulation. If you had something vibrating, and it was made from two different materials, whether the frequency might change.
 
11:13 AM
Well, we'd likely pick up both frequencies (we're measuring longitudinal vibration, rather than transverse)
 
Due to the different bulk properties.
 
Just one will be much smaller in magnitude than the other
I'm presuming we don't have a nice clean "accoustic connection" between the materials
But I guess if they've actually done a good job in grouting (read: never [doesn't happen in the field]), and there's a low accoustic impedance between materials - it's possible
 
I dunno dude. This is well outside my knowledge. I learned about beat frequencies once in one module 5 years ago :P
So while I know how it works, I can't think of anything practical
 
That's fine - I was just looking to bounce ideas. On this project, I deal mostly with electronic engineers so they're not always the best sounding board. Despite best intentions
 
@IntrepidBrit feel free to continue bouncing :P I just can't promise to provide any solid ideas.
But I can definitely apply my "physics sense"
 
11:31 AM
Oh hello
Didn't realise sound travelled through rock at similar speeds as steel
(Haven't found many articles where they actually specify v for different kinds of rock)
 
If you do find any papers I can VPN in and get academic access if you need.
 
Bloody hell, I'd better not spread that about. One of the guys in the office eats academic papers
 
I don't do much velocity measurements of materials, I mainly deal with the bulk modulus. Which can be related of course.
 
But I appreciate it mate. I might have to do that if I spy any that look promising
I usually deal in velocities because it stops people's eyes from glazing over when I mention bulk and shear modulii
 
Hah yeah. Well because I work with high pressure the bulk modulus is the param of choice. And it's derivative. And it's second derivative -_-
 
11:41 AM
I need to gatecrash your office/lab at some point - just to have a nosey at what you're doing :)
I swear that I might need to go back to University to do my Masters, if I'm going to continue working on this stuff
 
I should take some photos of my lab before I leave.
 
You definitely should
Ye gads, I think we smothered all the Python chat
 
11:59 AM
Eh it'll survive.
Any other ideas on your problem?
 
Not for the time being. Other than I don't believe it's rotation (the engineers would notice that when testing) or the encapsulating material because it wouldn't/shouldn't have the same magnitude
 
What is it anyway?
 
The encapsulation material?
 
No the thing itself
 
It varies, but we group them together as "Ground Anchors"
 
12:03 PM
Right ok
 
Most of them are just giant sodding metal bars shoved in holes and filled with cementitious materials
 
Ah ok
 
So this includes mines, rockfaces, docks etc
 
I used to work in civil engineering, so I know the type.
 
So a ground anchor is a bit of a misnomer. I'm pushing for just "anchor"
Yeah, basically there's a lot of interest in our work (on the low down) because there's been many mine, bride and tunnel collapses because the anchors are failing
And there wasn't enough warning (if any)
 
12:05 PM
Is there any machinery working nearby? That could be vibrating?
 
Almost guaranteed to be
Because there's a lot of random pish going on, I only consider beat harmonic ranges
 
You've presumably got some electronics in there, could the electronics be generating some electrical signal as well?
So the actual sensor itself or whatever.
 
Aye - the earlier models picked up noise from the lighting, but have since been shielded (I think)
 
@IntrepidBrit A victim of the government's campaign against the poor, no doubt. Couldn't you all club together and get him a decent meal?
 
I think he does it through choice rather than necessity ;)
Fizzy - part of me is wondering if we're detecting some severe corrosion. Technically there would be a variance in the bulk modulus and there would be little (if any) accoustic impedance internally between different segments of the bar
Meaning it has the capability of having a similar magnitude. Or should I lay off the jaffa cakes for a while?
 
12:15 PM
Yeah could be. I'm right in thinking that a different acoustic velocity leads to a different frequency as well? i.e. it's complex and not like EM waves.
Never lay off the jaffa cakes, brah.
 
@Ffisegydd Aye - it's longitudinal rather than transverse.
 
Acoustic waves were always weird. Bloody group velocity and that if I remember.
 
Yep - but they're nice because harmonics are simple. They're integer multiples of one another, instead of integer multiples, plus a linear deviation because of shear
 
Any good dupe targets for stackoverflow.com/questions/27620231/…?
Java dev hoping to find static type checking in Python.
 
12:31 PM
What to do with this answer, if anything? stackoverflow.com/a/27364182/3005188
It's a Linkedin developer replying to a supply request, but is pretty crap.
 
Gah, LinkedIn has not thought this through; Microsoft just realised their forums were no longer really being used and saw that Stack Overflow was being far more effective, and they have a former Stack Overflow moderator on staff to help ensure the IE support on SO is not getting out of hand.
LinkedIn clearly has no such experienced users.
 
If you look at the tag it's pretty hilarious. The majority of the recent questions have been closed (mostly by us).
That user (who answered) is the guy who posted the announcement on the linkedin website developer.linkedin.com/blog/stacking-api-support-linkedin
 
Ugh, so their lead user has 200-odd points, not even enough to vote to close or edit.
 
so that's where they are coming from...
 
12:39 PM
Can't we shove them into a specialised LinkedIn instance?
 
Do we need to ask the community manager to reach out to LinkedIn now?
 
Someone asked on meta but it was dupe closed.
 
> "Attention, developers! We have transitioned to StackOverflow for forum-based support."
uhh no, SO is not a forum...
 
But I did think about going to The Tavern and asking around, or using the Contact Us link.
 
12:41 PM
11
Q: LinkedIn directing people to SO?

MonkeyZeushttps://developer.linkedin.com/blog/stacking-api-support-linkedin Is this really happening? Can we no longer provide comments to the effect of "Take this up with the support team for XYZ Product." How is this going to be handled within the SO community? How long before other companies claim to...

I can draft a "reach out" question to ask on sopython wiki.
 
@davidism well, I can't show you my own (because that one is at work, and I'm at home, with a Mac now) but here is what I used as a starting point
I also use this little app, for the GUI config: github.com/lxde/compton-conf
(obviously I wanted shadow on FF so I removed that from the list, etc.)
 
@MartijnPieters can you take a look at sopython.com/wiki/Linkedin_reach_out to see what you think? Once people have given feedback I'll post it on meta. Anyone else is free to give feedback of course.
 
1:00 PM
Typo detected: "Unforunately"
 
Fixeded.
 
maybe the second link should link to the question instead of the user's profile?
 
Oh god yeah, cheers.
 
awesome, aside from that, looks good to me
 
Linked it to the comment specifically.
 
1:07 PM
Okay folks, going to rhubarb outta here
Special shout outs to Fizzy and Holden for their help today
 
No problem dude.
 
If I don't catch you before, [Merry Crimbo/Merry Observing us observing a bastardised pagan festive period (delete as appropriate)]
 
0
Q: Reach out to LinkedIn about outsourcing their support to Stack Overflow

FfisegyddLinkedIn recently closed their support and began directing their users to use Stack Overflow. This has seen an upsurge in questions within linkedin. This has been previously brought up on Meta here where it was closed as a duplicate. Unfortunately, the majority of these questions are off topic o...

4
 
@Ffisegydd sorry, was afk for a bit; looks good now.
 
Cheers, I copied the title and tags from a previous "reach out" question
 
1:21 PM
what is the python wheel?? pypi.python.org/pypi/regex#downloads
 
Woo another bronze badge :D
 
Go @Ffise Go!
 
Ok, I un-gave-up my idea to add a markdown link to the "share" button on SO posts. Here is my first functional prototype.
 
Fair play. That's pretty awesome.
 
1:36 PM
I'm dissatisfied with the workaround necessary to manipulate the share box - it doesn't exist by the time the userscript's onclick callback executes, so it has to sleep for a hundredth of a second.
I wish I could just tell it "wait for the original callback to execute, then you can execute"
 
I have a doubt! Say I have a python program with 20 lines of code, And the 19 lines do not have any syntax error, But 20 th line does . Will I get result of 19 lines with error msg saying syntax error in last line
or will I get Just the error message itself
 
It should crash before executing anything.
 
But it is not in my case :/
 
wait I will post the code
 
1:39 PM
(barring weirdness where you do, like, eval(some_poorly_formatted_string))
 
@VamsiPavanMahesh A syntax error means Python cannot execute it.
Because it cannot know for certain that the syntax error wasn't caused by something in those first 20 lines.
For example:
 
Off with ye, typo post. I banish you into the land of wind and ghosts.
 
result = function(argument,
    keyword1='value',
    keyword2='anothervalue',
another_thing = 'foobar'
 
are you reffering me? @Kevin
 
There is a syntax error, and Python will blame that last line. But the real error is that the function line wasn't closed of.
 
1:41 PM
@VamsiPavanMahesh No, I don't wish to banish you :-)
I was referring to Martijn's request.
 
In any case, rather than guess, the whole file is rejected.
Note that Python first has to compile your source, and it is that compilation step that fails here.
 
Nope not in my case
I'll get you the link
please wait
 
What do you mean with Nope not in my case?
Are you saying you altered the Python executable to try and execute the result of the compilation so far?
Because there is no intermediate result if the tokenizer threw the error;there is no bytecode produced. Compilation is a multi-pass process.
 
BTW , Naming error is different from syntax error
?
 
1:45 PM
Maybe he has a syntactically correct source file, which imports a module that has a syntax error.
 
Yes.
 
Yeah, a NameError is not a SyntaxError.
 
So 19 lines gets executed ?
 
Sure.
 
SyntaxError is a special one (Is it unique?) where it won't even run the Python code. But for a NameError it'll run 19 lines and then fail on the 20th.
 
1:46 PM
@VamsiPavanMahesh A NameError is a runtime exception.
It has nothing to do with syntax, so all the code up to that point has been executed.
 
My bad ! I should have said NameError
I thought everything is same
 
You don't have an end20. Should that be end7?
 
@VamsiPavanMahesh You will learn to be more precise in asking your questions. Learning is a difficult process, so people here mostly seem quite forgiving.
 
And any idea, Why compiler is not checking name error ?
 
In other languages, particularly compiled ones, using a name that doesn't exist might indeed be considered a syntax error. Not so in Python.
 
1:48 PM
@VamsiPavanMahesh Because you can introduce new names dynamically.
Such is the joy of a dynamic programming language.
 
You mean loosely typed language !
 
The parser can't predict what craziness you may get into at runtime, ex. calling update on globals().
 
@VamsiPavanMahesh No, Python is not a loosely typed language.
Python objects have a fixed type.
You cannot treat strings like integers, like you can in Perl or JavaScript.
 
@holdenweb: Yes people here are , But not so positive people in the main site
-2
Q: Why does %s accepts Integer type variable and %d gives an error for a String variable

Vamsi Pavan Maheshenter code here my_name="vamsi" my_age=20 my_height=74 my_weight=180 my_eyes="Blue" my_teeth="White" my_hair="Brown" print "Let's talk about %s" % my_name print "He's %s inches tall" % my_height # This works fine print "He's %d pounds heavy"%my_weight print "He's got %d eyes and %s hair"%(my_eye...

It's like you have read my mind @MartijnPieters
 
@VamsiPavanMahesh Because %s includes an implicit str() call.
 
1:50 PM
LOL
 
The main site is a den of thieves, and also a shark tank. A tank-den of shark-thieves.
4
 
The newer str.format() sort-of fixed that issue.
But since the whole point of string formatting is to... produce strings..
 
@MartijnPieters: Did you check my profile and answered it or ?
 
And, to be fair, the issue could be demonstrated with a much shorted program
 
1:51 PM
yes I could have @hold
 
@VamsiPavanMahesh No, I did not.
 
The simple reason is that "%s" will format anything, pretty much, while "%d" always requires an integer value.
 
With str.format(), formatting to a string is delegated to object.__format__().
 
Then how come you talked about what I just asked in main site ?
 
and you can first convert values to strings before their __format__ is called with the !s converter.
@VamsiPavanMahesh Because you were talking about loosely typed languages.
and Python is no such language.
 
1:53 PM
The newer format as in 3.0 ?
 
Don't confuse string formatting (where the goal is to produce strings) with loose typing.
 
so python is dynamically typed ?
 
The newer method is available in Python 2 as well.
 
Then zed shaw screwed me !
 
New in Python 2.6 and up.
 
1:54 PM
Still people say, that's the best resource lo learn
 
Who is Zed Shaw?
 
On the subject of Python, Wikipedia says: "Typing discipline: duck, dynamic, strong"
 
learn python the hardway
duck means?
 
In computer programming with object-oriented programming languages, duck typing is a style of typing in which an object's methods and properties determine the valid semantics, rather than its inheritance from a particular class or implementation of an explicit interface. The name of the concept refers to the duck test, attributed to James Whitcomb Riley (see history below), which may be phrased as follows: When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck. In duck typing, a programmer is only concerned with ensuring that objects behave...
 
Duck Typing: the assumption that if something quacks like a duck, walks like a duck, then it must be a duck.
 
1:56 PM
Thanks! I'll be back with a new doubt !
haha @mar
 
You test for functionality, not for specific classes.
 
Do you people want to recommend me other than Learn python the hard way ?
 
@VamsiPavanMahesh LPTHW is still fine, I think, but new things have been added to the language since.
 
@VamsiPavanMahesh I don't have any alternatives to recommend, but I do know that we seem to get a lot of people struggling with LPTHW.
Also other members of the room actively dislike it.
 
I'm gonna fly off the handle if we get another "why isn't my text adventure working?" question from LPTHW
 
sorry @kev
 
@Kevin 1. what are you doing sitting on a handle? and 2. Dude, you can fly!?
 
Hey, the book does deliver on the title then.
 
@VamsiPavanMahesh No need to apologize, as you have not asked a text adventure question yet :-)
 
2:00 PM
@Ffisegydd It is the way of my people.
 
Sir, That wiki has a set of books!
I wish I could, But I don't have that much time to read all those
@mar
 
@VamsiPavanMahesh I suggested you pick one to start with.
I have no recommendations, because I haven't touched any Python book in years.
 
@VamsiPavanMahesh diveintopython3.net
 
It takes a couple years to get good at a language, so that should be plenty of time to finish a stack of books.
Dupe times a million
 
2:22 PM
1G0ON1G0G1G0
 
Grr ... what kind of coke-addled idiot TV executive decides to region-lock a trailer? It's an advert ferchrissakes, you're supposed to want people to watch it.
Also cbg
 
(but only because I cheated and dupe-hammered it before non-room people could vote).
@ZeroPiraeus cbg :-)
 
"grid returns None" is the lowest of hanging fruit, I really need to stop answering them.
 
3 more votes for a silver.
 
2:29 PM
@Ffisegydd The very first vote on that post was mine, I cannot help there.
@Kevin Yeah, trivial enough not to be helpful.
 
Is it theoretically possible to make it so that variables cannot be modified from within functions? I.e., even if I did var = 'something else', when I try to print var from within the same function, I would still get the original variable.
 
There's no straightforward way that I am aware of, no.
 
No, Python cannot prevent code from assigning to locals.
 
@Soviero you can't stop another part of the code from rebinding a name to something else, no.
 
Why would you want this, specifically?
 
2:33 PM
Hello everyone. I am wondering what is the best design to read objects (from a text file) of different types of initially unknown size (i.e. objects can occupy several lines) in Python. Could anyone help?
 
I think this falls under the "we're all adults here" principle. You should ask the users of your API to pretty please not modify this value, and if they do, well don't expect anything to work properly.
 
@Riga That's way too vague a description to say anything about.
 
@MartijnPieters When I set a hostname for Fabric to connect to, I don't want the script itself to be able to change what env.host_string is.
 
@Soviero You can make attributes read-only, up to a point.
 
If it's specifically an object's attribute that you're trying to keep from changing, you can override the object's class' setattr method to check for the attribute name and bail out early.
 
2:35 PM
But it is better to just write your code to not do that.
 
Or, uh, I think there's a nice way to prevent it with the property decorator, but I don't have much experience with that
 
@MartijnPieters That'd be nice... If I were the one writing the scripts.
 
I like what holdenweb wrote in this context.
> There are two fundamentally different programming language philosophies: one group seeks to make it harder to write bad programs (Java), the other strives to make it easier to write good programs (Python). Neither is completely successful, because it is possible to write bad programs in any language.
@Soviero So why is it your responsibility to prevent them from hitting their fingers with the hammer?
It is still a don't do that, you dummy kind of mistake to make.
 
@MartijnPieters Because I don't want them logging into other peoples servers. ;)
 
@MartijnPieters I have the following format, I need to read two types of objects from a text file.
text file example:
PATTERN A # everything below belongs to pattern A until a new keyword appears (like SHAPE, PATTERN)
BOX 0 0 0 1 1 1
BOX 1 1 1 2 2 2
SHAPE B # everything below belongs to shape B until a new keyword appears (like SHAPE, PATTERN)
PATTERN A STEP_X 20
SHAPE C # everything below belongs to shape C until a new keyword appears (like SHAPE, PATTERN)
PATTERN A STEP_X 40

and I have two classes which may read themselves from a set of lines: PATTERN, SHAPE
@MartijnPieters should I use xml-like format instead and identify ending of each object before passing lines to them for read themselves?
 
2:40 PM
Where are all the class built-ins (e.g., init, etc.) documented?
 
@Soviero and there is nothing else, like credentials, preventing them from doing that?
 
@MartijnPieters Nope.
 
If env is a Fabric object, you'd have to subclass it or proxy it.
I'd still go with whipping the devs that try and alter it..
 
@MartijnPieters That's a fine solution.
 
@Riga I'd probably do something like:
keywords = ["PATTERN", "SHAPE"]
objects = []
current = []
for line in file:
    if any(line.startswith(keyword) for keyword in keywords):
        if current:
            objects.append(current)
            current = []
    current.append(line)

if current: objects.append(current)

print objects
 
2:43 PM
@Soviero, this helped me to understand why Python don't have "const": http://stackoverflow.com/questions/17291791/why-no-const-in-python
And this has some workaround for actually having "const" behavior: http://stackoverflow.com/questions/2682745/creating-constant-in-python
 
Result:
 
@Riga So there is no specific number of lines?
 
[
    ['PATTERN A', 'BOX 0 0 0 1 1 1', 'BOX 1 1 1 2 2 2'],
    ['SHAPE B'],
    ['PATTERN A STEP_X 20'],
    ['SHAPE C'],
    ['PATTERN A STEP_X 40 ']
]
 
@ZeroPiraeus Thanks!
 
2:44 PM
@Kevin Have you been reading up on my past answers on the subject, have ya? :-)
 
Nah, is there a resemblance? Great minds think alike ;-D
 
Well, usually I make it a generator and yield..
 
@MartijnPieters yes, the object may contain arbitrary number of lines. I was wandering what is best approach in Python for that. YOur solution looks straightforward and simple. Is it a pythonic way?
 
but other than that.
@Riga it is a Pythonic approach, yes.
 
yield, good idea.
 
2:47 PM
@Kevin, your approach is to deserialize this data? how can I properly read this format?
 
Define "read". objects is an ordinary list, so you can iterate through it and inspect its elements as usual.
 
@Soviero I always have trouble finding them in the official docs, but this page collects a bunch of them in one place.
 
@tristan where do you find all these? Are you making the chat room double up as a triage queue now?
 
user559633
Hahah, no, the office was loud yesterday, so i just idly scanned.
 
user559633
I was just doing one final pass on the questions that were bad from yeterday, but weren't closed yet -- I don't plan on regularly spamming the room with links to low quality posts
 
Boom meta silver.
 

« first day (1529 days earlier)      last day (3420 days later) »