« first day (731 days earlier)      last day (4199 days later) » 

7:00 PM
Thank you! The regexp way looks good.
 
0
Q: How to use an array values inside a Mysql query with 'IN' operator?

user1726659$_POST['domain'] is the result of some form's CHECKBOX with 3 or more values of domain (C,C++,Java,etc.), whose value is now saved in an array '$Domain'. Now, I need to select the tuples from my table which are in the same domain as selected by the user in the CHECKBOX. I tried using FOR loop, b...

Could anyone explain this guy what I'm clearly missing in my explanation?
@Hypn0tizeR P.S. I searched for mysql select strip characters
Google does magic with ambiguous searches.
 
Didn't knew about sql stripping
 
. . . ^ ignoring that
 
This is my first time doing so
 
hey all, does it make sense to pass instances of one data mapper into another? So for example, pass an Address_Mapper into a Person_Mapper because a Person domain object has Address domain objects to save? Am i making sense?
 
7:06 PM
What about the speed of outputting all the results when stripping like that? 'where replace(replace(phone, '+', ''), '-', '') LIKE '%123%'
 
@AndyPerlitch @tereško would probably be able to help you there
@Hypn0tizeR Try it
 
@AndyPerlitch Depends if you want to update the address when you update the person, I suppose.
 
@LeviMorrison i do
@MadaraUchiha yea probably
 
Without knowing anything else I will say yes. @tereško does deal with stuff more often than I do, though.
 
and also, i dont have an exact 1:1 between domain objects and data mappers, but i do have multiple mappers when necessary
 
7:08 PM
emmm ... SQL is not suited for searchable storage of phone numbers
 
@tereško Proof?
As far as I can tell, it is gaining in popularity according to TIOBE: tiobe.com/index.php/content/paperinfo/tpci/index.html
 
@tereško Notice how it is already up for Oct with partial data?
It's called m1 release.
 
@LeviMorrison google.com/trends/…
notice the pattern
 
7:16 PM
Guess what happened at that spike in Oct 2011? It was announced.
@tereško Bad data.
Dart !== Go
 
yes , go was much more popular
 
@tereško . . . It's older, nothing more.
 
did you LOOK at the graphs ?
 
Yes, yes I did.
All I want to say is that you are being a horribly negative troll on a currently very promising project.
 
actually this gives a bit cleaner result : google.com/trends/…
 
7:19 PM
I'd appreciate it if you would stay in your cave on this subject.
 
you asked for proof
 
@tereško There is none, you fool.
I just wanted to bring up this:
2 mins ago, by Levi Morrison
All I want to say is that you are being a horribly negative troll on a currently very promising project.
 
... ehh
 
You know a lot more than I do on a lot of things, but this is one you simply don't know anything about, yet you keep jabbing at the project.
 
damn....i keep forgetting i'm out of close votes for the day :P
 
7:31 PM
please learn the difference between skepticism and trolling
what i was pointing out was the similarity between trends of two google programming projects
 
7:48 PM
@cHao Just [cv-pls] em, we'll take care of it.
 
@PeeHaa What changed since the latest version? Do you have a changelog?
Disregard that. Found it.
 
8:07 PM
Uuergh
 
Hi All
Can anyone help me with the setup of Php + Apache?
The Server is running all good
I get the php version when I run this : localhost/index.php
 
And what seems to be the problem?
 
I get this when I run a basic script
I have that saved inside save.php
It should be passing the contents, instead of what's inside the save.php?
 
@Andrew You get what when you run a script?
 
@DaveRandom I should get the contents the user types, instead i am getting what's inside the save.php
I'll create a jsfiddle
 
8:19 PM
@Andrew You're not giving much away on this are you? You'll have to show us you code, explain what "user types" are to you and what you expect their contents to be
 
@Andrew How are you accessing / requesting that file?
 
thru sublime
 
8:24 PM
so when I run it in Chrome
I only see that what is inside the Save.php
 
What address do you use to access the file?
 
file:///C:/Users/andrewb/Desktop/jQuery/Lesson-24/Index.html
is in the url
 
That's the local file
That isn't parsed by the server
 
oh.. how do i pass it automatically so when I get the save button it will parse ?
 
You should always access it through localhost if you want it to be parsed
 
8:26 PM
@PeeHaa Read: HTTP
 
that
Is it just me who think 25/8 == integer math is strange?
 
@PeeHaa OK. So I need to put all my files in the root directory of php?
 
@PeeHaa It isn't when you're expecting it. In fact, it's quite useful
when you're not expecting it (as that), it's really strange...
 
@Andrew yes. If you want to access it through your webserver yes. And not the root of php, but the document root
@ircmaxell I see how it can be useful, but I'm sure I would have had the same WTF as OP
 
yup. I did at first too
 
8:33 PM
@Andrew You basically need to run all files through apache (which uses php to parse the files). When accessing a file like: file:/// you are just loading a "local" file from your machine. And don't forget to use only relative paths or you will have to change all your urls at some point
 
I see
 
Because it's text. — Diodeus 2 mins ago
lol
Ah nevermind. User is repwhoring on and stackoverflow.com/users/12579/diodeus :)
nuff said
 
8:49 PM
@PeeHaa I have followed instructions here on how to set this up
How do I actually set it up so that I pass all files via apache
 
Just access it through http://whatever-you-have-set-up or http://localhost and make sure you don't have any references to file:/// anywhere in your code
@hakre but he's learning C!!!!
 
@PeeHaa yes, a detail very important in context of the question ;)
 
I see, I got it now.
I thought there would have been an easier way to do it i.e it would automatically pick it up but guess that isn't an option
 
@hakre I think that might be a signature, as in I'm learning, C
 
8:53 PM
@DaveRandom well, this is a great signature for a programmers website ;)
 
@Andrew You should just always use relative URLs. I.e. /path/to/file.php. This way it should always just work. Even when switching hosts
 
Please help me assembler a solution, thanks for your help, I'm learning C
 
@Andrew Andrew that Apache setup guide is like a bazillion years old. What versiona of PHP/Apache are you using?
 
I am using Apache 2.2 with php 5.4.7
 
@Andrew with which PHP SAPI do you want to use your PHP?
If you have the apache webserver installed before you install PHP, the PHP setup normally can install it into apache, too.
 
8:56 PM
@Andrew Crucially, where did you get your Apache build from?
 
user1125394
it's "I'm learning. C:" looks more like a typo
 
(Surely no-ones still building Apache 2.2 with VC9/10?)
 
i suspect that it wasn't a typo , @cyril
 
I have got everything dumped into this directory
C:\Apache2.2
 
8:57 PM
C:\Apache2.2\php
 
@Andrew Yes but where did you download Apache from?
 
I watched the video from here youtube.com/watch?v=qoAao43QFsI
hold on
let me get the link
@DaveRandom httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
 
@DaveRandom yes. but in your case you told there is a close() function to be called. it could clear the global reference and so this should clean up. but sure. that's a very specific solution to your problem, I fear there is no general feature you can make use of in PHP.
 
9:01 PM
@DaveRandom so I have installed the wrong one??
 
did you try reading a tutorial on how to set up php-stack webserver on windows ?
 
@Andrew Not the wrong one as such, but certainly an outdated one. It's always worth running the latest versions of things, and especially true of Apache 2.4 which has taken some huge strides in the right direction after years of ingrained stupidity
The more important thing is that you are running PHP 5.4.x
But just looking at the page you got your binary from you may find that build unreliable, it looks as if it might have been built with VC6
 
I would always suggest to download from the apache httpd project directly.
 
Or download from the official nginx site ;-)
 
well, nginx yet has not implementation of .htaccess
 
9:06 PM
@hakre Apache build with VC6, PHP build with VC9. That's why I always use ApacheLounge builds (VC10)
 
i tend to prefer HEAnet mirrors ... but that's just me
 
@DaveRandom install PHP as FCGI
 
@hakre why should they ?
 
@tereško Because .htaccess is so nice. You just need to love it.
 
All good, I'll start back on the horse again
 
9:07 PM
@hakre True that. But can be tough for newbies (IMHO)
 
Thanks @hakre @DaveRandom
 
@DaveRandom Last setup I did worked pretty good on windows.
 
@hakre , please don't make such statements .. newbies cannot tell when you are making fun of something
 
@tereško I can paste the config, it's not really complicated. I normally don't do much sysadmin related stuff.
 
@hakre Not saying it doesn't work well, it can just be a PITA to setup fcgid
 
9:09 PM
@DaveRandom noh. it's a pretty straight forward concept.
 
.. internet makes me sad
 
but you need to understand how it works a little.
 
@hakre I know how to do it, just a little difficult for complete n00bs. I tried to talk someone through it once over the phone and ended up having to RDP in, not a situation I've ever had with mod_php. If it's "my first WAMP" I don't see the harm in it. Then when you understand a little about how things work, then start messing about with fcgid. IMHO.
 
@DaveRandom okay, I must admit when I started with Apache 1.3 I was using PHP as CGI. Worked well on windows.
So then finally as I have this newer-ish computer, I decided to install a current apache version on it.
So after years using apache 1.3 with php as CGI, I now installed it as FCGI on apache 2.2 or 2.4.
 
in The Assembly on The Stack Exchange Network Chat, 19 hours ago, by Mark Trapp
> Stack Exchange in 3 Acts. First act: introductions. Second act: Summer of Love. Act Three: Redemption.
 
9:16 PM
LoadModule fcgid_module modules/mod_fcgid.so

<IfModule mod_fcgid.c>
  FcgidInitialEnv PHPRC "c:/programme/php"
  AddHandler fcgid-script .php
  FcgidWrapper "c:/programme/php/php-cgi.exe" .php
</IfModule>
 
emmm ... i think the person, you both are talking to, is gone
 
@tereško that makes me sad :/
But I always talk with @DaveRandom regardless ;)
 
@hakre Well you're missing FcgidWin32PreventOrphans On for a kickoff :-P
 
user895378
My iTunes process apparently thinks it's totally fine to use 1.7Gb of memory. Thanks, Apple.
 
@rdlowrey It's your own stupid fault for iNstalling
 
9:25 PM
which is why i stopped using iTunes for anything (i used it for some time for managing my audiobooks)
 
@DaveRandom yeah hang my devbox here. ;)
 
@rdlowrey , if you want a fancy player for your windows , you can try Zune .. it's quite horrible , but i like the interface
s/player/organizer for all your illegal mp3s
 
user895378
Does anyone have mp3s that aren't stolen?
 
i have .. few .. they were free (from "Nine Inch Nails" and "Silk Demise")
 
user895378
Apparently there are hundreds millions of people around the world lining up to pay Apple for mp3s. I've never met any of them, though. I think they're a myth propagated by the RIAA to make themselves feel better about their outdated business model.
 
9:33 PM
I ripped some CDs I paid for at some point - does that count?
 
@DaveRandom no , because if you rip CDs to something that is not FLAC , then you did it wrong
 
Oh and I transcribed some vinyl that you can't buy in any format any more, I think that's legal. I don't know maybe it isn't. I'm sure Apple have a patent on it even if it is.
@tereško We're probably talking 14 12 years ago that I did this, did FLAC even exist then? (forgot how old I was)
 
oh ..
 
@tereško Doesn't sound particularly "crazy" to me ^^
 
@NikiC , which is why i tagged it with sad =/
hmm ... 12 years ago .. i think i was buying illegal (~3$ per) CDs then
 
9:46 PM
Can anyone help with a regex? I need to escape " with \ except where its already escaped. I have this but it seems wrong - '#(?!\)"#'
 
@rdlowrey I have 100% legal music at this point. Not always the case in my past.
 
legal, illegal, shitegal.
and take note, that when you play music you copy it into the air. I'm not so sure if RIAA actually allows that, because you are fundamentally sharing the music on an atomic level.
 
shitegal ^^
 
Illegal downloading is caring
 
PHP/ SimpleXML question
 
9:53 PM
@NoahGoodrich $regex = '#(?!\))\"#'; should do it...
 
Got some answers, but not working.
Can't get elements out of simpleXML.
And yes, I am using PHP.
 
@DonBriggs I would use plain DOM functions...
 
OK, how do I do that.
 
Nicely summed up in the last comment:
> The problem there is not that the frameworks make you write bad code, the problem is that those frameworks are the bad code, they have 3 or 4 tasks per super class and then the user extends from those classes in an “static spree” attempt, the same as including the damn “util.php” that I hate so much.
 
I get as far as getting a simpleXML object created from the XML feed.
 
9:57 PM
@DonBriggs So you want to get the root element, then get the data from the nodes inside?
 
Yes.
I did try the code that people suggested. It is not running properly. I thought it might be a problem with WAMP, so I uploaded it to a server.
I know that the server is running PHP 5.3.
 
bah. was gonna say some "oh, i see your problem...you're using simplexml". but apparently we've filled our quota of that joke today.
and wasted it on ruby, even.
 
@hakre , they actually don't allow it. When you buy a CD/mp3 you are NOT allowed to play it publicly
 
Ahhh. Well, I do feel obligated to give you a polite laugh, scince you are helping me. So... Haaa haaa.
 
same way as you are not allowed to sing aloud if someone else can hear you and you do not own th rights on that song
 
10:01 PM
@DonBriggs, I'm creating an example for you now :-)
 
Thank you.
 
Okay, I've got it to echo the root element name.
 
@tereško whether you're technically allowed to sing or not, the riaa is not stupid enough to sue someone singing in public. :) well, unless they're on stage at a concert people paid $50/ticket to get into.
 
You can see the real data that I am working with here: sandbox.ijeannie.com
 
@cHao it's only true , because it is technically difficult to catch you humming while you are on the buss .. if you sing into camera and post the video on youtube , they will try to do something about it
 
10:04 PM
And if I don't get a good answer, I will sing. I can assure you all that you don't want that to happen.
 
@tereško nah...it's true because if they sued someone for singing along with their mp3 player on the bus, copyright abuse would get a very serious looking at. and that's the last thing people abusing copyright want.
 
i would love to quote this back to you in 5 years ...
 
well, log it or something :)
 
I'm out. Cya all tomorrow
 
Lady is driving me crazy here. Where do I find a good geek chick?
 
10:16 PM
@DonBriggs Your XML is invalid.
 
Which XML is invalid? In the example post, or on the current server?
 
14 mins ago, by Don Briggs
You can see the real data that I am working with here: http://sandbox.ijeannie.com/
 
I am just not echoing is properly.
 
@DonBriggs In the example it is invalid.
 
Do a "view source"
 
10:18 PM
What do you want the end result to be?
 
Should be that <NewDataSet> is the root element.
I should then be able to iterate through the record elements, unfortunately called "<Table>"
And pull out each of the fields.
I will not know the root element name, the record element name, or the field elements names ahead of time.
 
...
 
I can send or post a file that shows the XML tha tyou don't see on the page
For instance, it starts like this:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.ssicat.com/SMART/Updates">&lt;NewDataSet&gt;
Ignore the HTML encoding. It does look right in the file.
 
hey i have a quick php done that i need to get done, anybody interested in quoting me a price for getting it done?
 
so, umm, you just want simplexml to magically know what element to pull?
 
10:21 PM
php jpb
job
 
I want it to pull the first element, and that will be the root element.
From there, the children are record elements.
 
yeah, but you picked the wrong freaking library for that
 
OK, if simpleXML is not the answer, I can use something else.
I just figued that this was very simple.
 
simplexml's whole thing is that xml becomes like an object
check out DOMDocument
 
0
A: Simple XML to parse general recordset

hakreI don't actually understand what you problem is, in your said real-life XML you gave in PHP chat, there are no namespaces involved (and even if!). Just read out the tag-name from the document element: # echoes NewDataSet echo dom_import_simplexml($simplexml)->ownerDocument->documentElemen...

 
10:23 PM
My example is almost finished.
 
You will see the namespace if you do a "view source"
<string xmlns="http://www.ssicat.com/SMART/Updates">
ok
I don't mind using some other library.
It sounds like what you are saying is that the idea of SimpleXML is that you DO know all of the element names ahead of time.
 
simplexml does a bunch of stuff that makes it a pain for any xml you don't already know the structure of
yeah, pretty much
 
@DonBriggs Works equally well, gives you string then as the document element.
 
I have to call a bunch of web services. They will send back XML. I need to be able to parse it, find the field names, and match them up to database column names. I want to do this in a generic way becuase there are about 130 different record set formats that I will have to deal with.
 
yes, bla bla bla ;) however what is your problem?
 
10:27 PM
I've said it before and I'll say it again: SimpleXML is bad news for everybody involved. You're doing it wrong.
4
 
^
 
OK, and I will ask again. How do you suggest I do it.
 
What is your problem?
 
Which xml library is more suted to this?
 
i'll respond again: DOMDocument
 
10:28 PM
OK
 
@DonBriggs libxml is perfectly alright for that.
 
or that
but i like DOMDocument :)
 
Some guy did leave a DOM document reply. But it was not even php code.
 
I'm with @cHao
 
@DonBriggs my answer converts your simplexml into DomDocument on the fly.
 
10:30 PM
I've finished my (rough) example, I'll post a link...
@DonBriggs --^
 
OK, thanks.
I will dump the XML into a DomDocument thingy, and work with that instead.
Thank you for the help. I am on it now.
Now can you help me with the new woman problem?
Just kidding, I will have to source that locally.
Your code is producing the following:Root element name: string
That string element is actually the namespace element.
(Which I really don't need)
 
@DonBriggs So you want it to just print the contents of string?
 
The root element should be: NewDataSet
 
Oh, OK.
 
I don't currently need to do anything with that namespace. However, the vendor is sending it, and I need to be sure that it does not get used as an element, as indeed it is.
I don't even mind if we just ignore the namespace for now.
 
10:42 PM
@DonBriggs But the root (document) element is <string>. And the document has no namespaced elements. <NewDataSet> is the first and only child element of the document element.
 
Let me see if I understand this correctly. The
<string xmlns="http://www.ssicat.com/SMART/Updates"> is a namespace declairation?
I don't really need that.
 
@DonBriggs The element <string> has a namespace declaration.
 
OK, whatever it is, I don't need it. The real data set starts at the "<NewDataSet>" element.
I can't get them to change their format.
I don't need that first string.
 
And the data will not always use <NewDataSet> as the "root node" for the data that we need.
 
10:46 PM
The code that I posted will work around that, because it uses firstChild. The 'root node' can have any tag name.
 
OK, cool.
Now the output looks like what I need.
I guess that thing that I was calling a "namespace" is just the vendor insisting on sending crap.
 
@DonBriggs That's why you use things like firstChild, because it doesn't care about anything about the tag other than its position within the document.
I have never understood why people bother with namespace declarations when there is only one namespace in the document. It really is just superfluous junk and it causes confusion such as this.
 
The only reason that I could give you is if you are receiving multiple, simmilar feeds from multiple vendors. I guess??
Thanks for the help. I will use this to get what I need.
Though, it still shows the root element to be "string"
 
@DonBriggs It shouldn't.... does this do that?
 
10:55 PM
@DonBriggs The root element is <string>. It is simply that the information you are interested in is below that level.
 
Ooops, my fault.
I have been messing around with it so much that I did not copy the code correctly.
It is now working properly.
I see you added an ending </string> tag. I will have to double-check the xml that I am getting. Yes, I understand that it closes the first line. But I was thinking that said line was an attribute, not the beginning of an element. I will check what they are sending.
 
@DonBriggs No, <string> has to be the document element, otherwise it is not valid XML
 
Yeah, I see that. About to check out the XML that they are sending, to insure that they are including it.
 
Please don't reply. Actually, remove your comments they are unhelpful and rude. — Edward 23 secs ago
 
Me?? I said something rude? What was that? It certianly was not my intention.
 
11:01 PM
@DonBriggs Well didn't know you are called Edward ;)
 
@DonBriggs No, that was on another question.
 
Sorry, did not see that it was at edward.
 
This one:
0
Q: How do I parse this XML with xpath to get to an element directly?

EdwardI'm new to xpath, and unable to get this to parse. It produces no output. This contains XML returned from Google Map API V3. I want to have it parse and return the Zip Code from the PostalCode/PostalCodeNumber. I set-up this test because I need to be able to make sure I can get to the PostalCode...

 
@DonBriggs Any sensible XML parser will bork if it they don't.
Actually @hakre's linked question reminded me of another major problem with SimpleXML - its XPath sucks.
 
@DaveRandom Ah I love that simplexml xpath function ;)
The great thing is, it returns an array.
SimpleXML is just the quick and dirty side of DomDocument.
 
11:04 PM
Been a programmer for a long time. New to xml and xpath.
AS to the Edward thing: It is annoying when you are trying to get help, and some guy adds stupid comments about how much smarter he is than you are.
 
@hakre Yeh, sure, if you want to abandon 95% of XML go ahead :-P I've written stuff in SimpleXML before and I don't it has ever once not come back and bitten me on the ass, and I have to rewrite the whole thing in DOM. Now I put in the extra 5 minutes at the start and save myself the 2 hours later.
 
@DaveRandom Especially in the past it was even more limited ;)
I mean freaking limited.
 
Yes, the </string> is at the end of the XML. Well, at least the xml they are sending is valid.
And now I understand why <string> actually IS the root.
 
@hakre I was just looking for a favourite quote of mine and... look at the 3rd result.
 
@DaveRandom The Coding Horror result?
 
11:14 PM
In the future, I will use DOM, rather than SimpleXML.
 
@ShaquinTrifonoff For me it's this
@DonBriggs Good news :-)
 
@DaveRandom Google lists different results, depending what you search for :P
 
@ShaquinTrifonoff Funny. Real funny. Maybe I'll search for "how to ignore trolls in SO chat" :-P
 
@DaveRandom nice finding :)
 
@hakre Why are you using WP by the way?
 
11:22 PM
@DaveRandom Why not?
 
because he is lazy
 
@ShaquinTrifonoff lol, you broke viperpad: viperpad.com/…
@hakre because_of_functions_named_like_this_that_take_no_arguments_and_do_fuck_knows_w‌​hat()
 
@DaveRandom and that, class, is what happens when people try to jerk around with xhtml. just saying.
it's actually more likely because someone's using xhtml and doesn't know what the hell they're doing. but that's the whole point. :)
 
@DaveRandom that site is a hosted service. I don't need to fix WP any longer gg
oh funny, edward already yesterday tried to get the ZIPcode. He is really pushing to get an answer with such a question: stackoverflow.com/questions/12896105/… :)
Oh the fight with Google has even a longer history: stackoverflow.com/questions/12887258/…
 
11:37 PM
@DonBriggs I posted an answer on your question.
 
That's why I hate it if we don't close these begging questions as duplicates like the xpath one.
That user is so far away from understanding even a fraction.
 
i have an impression that most of us here would be unable to teach a complete newbie (someone who has learned about programming from watching CSI or some other tv show)
on a bit related offtopic note :
 
11:53 PM
@tereško Sometimes just a link in comments is the right way to move something:
I have edited the question and want you to post this as an answer since this is the most price way of doing . — user1723889 3 mins ago
 

« first day (731 days earlier)      last day (4199 days later) »