-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Get results of rows that aren't in other results
.josh replied to imperium2335's topic in MySQL Help
No, you are still missing the point. You cannot mix "proper" and "possibility" like that. "Proper" means that possibilities are already thought of, the design has been made, boundaries have been set, a role has been filled. "Possibility" means those things have not been done yet, or could be done more. That does not mean that an established tool cannot be thought to be used for something else. It just means that "I need to put these two pieces of wood together with a nail. The hammer will do that for me. I don't need to know or even think about what else I can use this hammer for, because I'm trying to nail two pieces of board together, not saw something in half, nor do I need to know that I could somehow repurpose this hammer to be a saw, because that is not what I am doing now." -
Get results of rows that aren't in other results
.josh replied to imperium2335's topic in MySQL Help
My point is...when someone says "I am cold, how do I make a fire?". Sure, someone out there had to sit there and think about things like friction and energy transferance and all that jazz, but responding with the whys and hows of the fire warming them etc.. isn't useful; telling them to rub two sticks together is. You can easily spot the difference between someone wanting a solution to a problem vs. Someone looking for better ways to do things, by what they ask. "I need a query that will give me xyz" == "I need a solution to a problem" "I have this query that gives me xyz, but what can I do to improve it?" == gimme theory -
Get results of rows that aren't in other results
.josh replied to imperium2335's topic in MySQL Help
Yes I've already read your "Without theory there would be no..." Argument, and I anybody else is arguing against that; not saying theory doesn't serve a purpose. But most people do not need to know theories and underlying principles behind everything, nor is it particularly useful from a practical point of view. Take OOP for example...the whole point of that way of thinking is to abstract away details and just know that something does what it says on the box. Builders don't ponder the composition of materials or tools, or focus on thy whys of this or that. They focus on learning but rather focus on the materials they have, what they are for, and get to building. Around here you mostly interact with builders, not architects or scientists who develop the base tools. -
Get results of rows that aren't in other results
.josh replied to imperium2335's topic in MySQL Help
ebmique, the problem is that theory is great as a tool to help you get your bearings straight, but it isn't what makes the world turn. What should work (theory) does not always equal what does work (reality). We know you're just trying to help, but most people on forums like these aren't here to learn principles per se, but to figure out how to solve their real working problems. Spend less time in the classroom or with your nose in books and more time in the real, working world, where the real, working problems actually exist, and you will see where fenway is coming from. -
I usually find helping on the forums instead of working more appealing because there's no pressure, deadlines, etc.. in helping out on the forums.
-
I don't think we've ever had anybody officially get demoted for "abuse of power", though there have been a few who were demoted for the other reasons KingPhilip mentioned, that probably would not be readily allowed to step back up (no, I'm not going to play the name game). But anyways, even if someone were to get demoted for "abuse of power," they would more than likely still be put in the Staff Alumni group. That group is simply a record of past staff members, no reasons for demotion considered. If you don't see someone on the list who should be, it's more than likely a clerical error (as in, someone forgot to update the list...or they had a name change and the list wasn't updated...something along those lines).
-
Count the number of links or some other tag from a website.
.josh replied to SecureMind's topic in PHP Coding Help
see this post -
The point was to start by communicating in a more professional manner.
-
I would start by not posting like a 13 year old girl.
-
getting the number in "blah blah REFERENCE ID: [526] blah blah"
.josh replied to ultrus's topic in Regex Help
I don't think I agree with this approach. Firstly, $matches[0] will contain the full pattern match. According to your regex, you should be looking at $matches[1]. Also, there's really no need for a lot of that stuff.. like the anchor tags, the last .*, or those modifiers, based on your regex. Also, if you're just going to assume there's no other numbers in $subject, no need even for the first .* IOW based on your assumptions, You could just do '~\[(\d+)~'. Also \d technically matches more than straight numbers... But on that note..more importantly, that pattern is going to grab the first set of numbers preceded by a [ found in $subject, so it's not going to return the desired number if for instance $subject = "blah [123] more blah REFERENCE ID: [526] blah blah";. But I blame the OP for not being more specific with examples of what he's trying to get the number from. I think at a minimum, a pattern more like this should be used: ~REFERENCE ID: \[\K[0-9]+~ and then look at $matches[0] but..I think it would be "safer" if the OP were to give more details about he $subject he's trying to parse, actually show some real example(s). -
legal to host other business's websites and charge?
.josh replied to dadamssg87's topic in Miscellaneous
yeah...it's not illegal as in against the law, but a most hosts have it against their ToS to do something like that...that's why they have separate "reseller" plans, specifically for that purpose. -
feel better now? btw... marketing is all about lying.
-
file names can have more than 1 dot in it, you shouldn't rely on the extension being the 2nd element of the exploded array...you should instead check for the last element in the array. $extension = array_pop(explode(".",$file_name)); Though that's not guaranteed to be the extension (or not). If you have for instance "file" then it will return "file". Better method: $extension = pathinfo($file_name,PATHINFO_EXTENSION);
-
well if you're just going to lie about the numbers, why bother writing script that records it?
-
<script type='text/javascript'> // original function function someFunction () { document.write('original function<br/>'); } // copy to something else var original_someFunction = someFunction; // new function: make it like this... var someFunction = function() { // call original function original_someFunction(); document.write('new function<br/>'); }; // example... someFunction(); </script>
-
Also, with your "Dr Adam" example, you said the problem is the space. What about capitalization, is that allowed? Your regex currently only matches lowercase letters. You need to add the "i" modifier to your regex if you want it to be case-insensitive.
-
I didn't say it was a waste of time, I said it looks like too much info crammed into 1 space, and no apparent pattern to it all. You can hardly fault me for saying that when out of your own mouth you acknowledged not providing enough info here, and even go on to acknowledge bugs in it. You showed your coworkers an interactive program and legends and explanations, not to mention they work within the context of this data. Now compare that to what you've shown us. What exactly did you expect? But even if you were to provide lots more info...I have a feeling I would probably still say the same thing. The whole point of charts and graphs and visual representations is that they aren't supposed to take more than a few seconds to figure out and require explanation other than some footnotes. If you think it will help you then more power to you, but I don't see that as being a hit for a general audience. IMO you should make it several charts or graphs or whatever, showing different things together...more like a dashboard. You asked for opinions and I gave mine, and I happen to work in the web analytics industry. Don't get all snippy and defensive talking about 30 level IQs just because you didn't get the feedback you wanted to hear, based on the limited presentation you gave.
-
I think it looks kind of pretty but probably isn't going to be terribly useful as a chart. Seems like you are trying to put too much info into one chart...charts are supposed to be an easy, quick way to look at one or two metrics at a time. Beyond that...well if you are spending most of your time trying to look at the legend or other labels...then that's a good sign that you've put too much into it. Also, I see no apparent pattern to the stuff plotted on that chart...I really don't see how it's supposed to actually help you with anything.
-
Well considering that's the name of their business, I would tell them they need to consider themselves lucky it's only that much, bite the bullet and invest in it, because they will potentially lose a lot more money in the long run by not having a domain name that matches their business name.
-
considering your official business name is Red Door Antiques...is there some reason you don't want to use reddoorantiques.com ?
-
I'm not entirely sure what you're really trying to do here, because your preg_match_all as-is produces a syntax error, and you also say you are trying to grab urls from a website but have a specific url named in the regex. Are you trying to regex for urls that match a specific domain? In any case, whether or not it's all links or specific domain, your regex will match for the URL wherever it appears on the page, from a viewsource PoV. So if it is for instance in a javascript variable or displayed on-page as plain-text (not a link), your regex is going to match it. You should include in your pattern to match it only if it appears in anchor tag href attribute. Also, it looks like you're attempting and exact "head" match... is that what you really want? for instance, your regex will match http://www.somesite.com but not https://www.somesite.com or www.somesite.com And overall, you shouldn't really be using regex to parse for links or other html to begin with. You should instead use DOM. Here is a function to grab link urls on a page: function get_links($page,$url=false) { $xml = new DOMDocument(); $xml->loadHTML($page); $links = array(); foreach($xml->getElementsByTagName('a') as $link) { $href = $link->getAttribute('href'); if ( $url ) { if ( strcasecmp($url, parse_url($href,PHP_URL_HOST)) == 0 ) $links[] = $href; } else { $links[] = $href; } } return $links; } // end get_links get all links // get the page content $page = file_get_contents('http://www.somesite.com'); // get all the links $links = get_links($page); echo "<pre>";print_r($links); echo "</pre>"; output: Array ( [0] => http://www.somelink.com [1] => / [2] => /some/path/to/file.html [3] => http://www.someotherlink.com/a/b/c/d.html ) get only links from www.xyz.com // get the page content $page = file_get_contents('http://www.somesite.com'); // get all the links $links = get_links($page,'www.xyz.com'); echo "<pre>";print_r($links); echo "</pre>"; output: Array ( [0] => http://www.xyx.com [1] => http://www.xyz.com/some/file.html )
-
You have to assign the window.open to a variable and so that you can reference it. Example: // open the window, assigning the reference to variable var myWindow = window.open(...arguments here...); // change the URL of the window myWindow.location.href = 'new url here';
-
I think you just found a really good deal in Texas. I used to live in Texas, all over the place there, from SA to Houston to DFW and lots of places in-between. In my experience, wash has been $0.75-$1.50 and $.50-$1 to dry. I imagine the cost of living (and therefore pay rate) to be on average higher in boston though, so that doesn't sound too bad.