Open Side Menu Go to the Top

06-04-2014 , 09:00 PM
Just get WAMP/MAMP..
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
06-04-2014 , 10:01 PM
Quote:
Originally Posted by Shoe Lace
This line is missing a semi-colon. Are they mandatory in PHP?
Yes, missing semi-colons can and will mess PHP right up. I'd still expect an error message, or at least a blank white page rather than no redirect at all.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 10:31 AM
Quote:
Originally Posted by e i pi
Instead of printing out 'hello' get in the habit of printing out the data you care about,

Code:
print_r($_POST);
die;
But since the button isn't responding, I think it's a client side problem otherwise you'd be redirected to some blank white page or php error message. Learn to open the chrome dev console and watch the network requests. You might not even be sending the request.

When you press the submit button does it compress and just not do anything, or does it not even compress? If it doesn't compress you might have a fixed height on your form and some z-index issues preventing you from even pressing the submit button. If it does compress you might have some javascript intercepting the submit and sending it with ajax which you might want to disable while debugging.
Nice tip on the network requests in the dev console. I hadn't used that tab before.

I checked and it is sending the request to "contact-form.php", but the status says "OK" even though the email wasn't sent, and there isn't a page redirect or an error message.

How can I tell if the message was compressed? I was able to resolve the issue by adding a semicolon in the php, but sounds like a good learning opportunity.

Quote:
Originally Posted by Shoe Lace
Urinal,

It's been a long time since I really wrote PHP but...

Code:
$email_was_sent = "Thanks! We'll get back to you shortly."
This line is missing a semi-colon. Are they mandatory in PHP?

Also you should login to the server and check for error logs. There's likely an error.log file somewhere, probably in the root public directory of your site.
Yup, adding the semicolon solved the issue. I couldn't find the error.log file though, and have searched the entire server directory for it. I may have accidentally deleted it if it is in the root public directory; to update the site I've just been deleting all the files in that directory and uploading the new ones.

In a local programming environment I'd be yelled at for that syntax error and could quickly fix it.... *wistful sigh*

Quote:
Originally Posted by _dave_
Yes, missing semi-colons can and will mess PHP right up. I'd still expect an error message, or at least a blank white page rather than no redirect at all.
No error message (that I noticed) or page redirect (browser taking me to another page?) either before or after adding the missing semicolon.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 11:25 AM
unless set up to do something else (using jquery or whatever fancy libraries), submitting a form by default will redirect to whatever page is listed in the form's action - in this case contact-form.php. this is why we are expecting something to happen when you hit the submit button, regardless if actual email sending is functional or not. hitting submit should be equivalent to typing domain.com/contact-form.php in to the address bar of your browser.

I do notice you will get zero output if this fails, it seems to wrap the whole thing:
Code:
if(isset($_POST['message']) and isset($_POST['name']))


regardless, for now I suggest to try something more simple, like this:

contact.html
Code:
<html>
<body>
<form action="contact-form.php">
  <input type="text" name="name">
  <textarea name="message"></textarea>
  <input type="submit">
</form>
</body>
</html>
[n]contact-form.php[/b]
Code:
<html>
<body>
<?php
print "php at least executes" . <br><br>;
print "Request:<br>";
print_r($_REQUEST);
?>
</body>
</html>
If you get nothing from this simple form, try accessing contact-form.php directly and see if it can print it's message.

Last edited by _dave_; 06-05-2014 at 11:32 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 02:23 PM
SQL question - drawing a blank on how to do this:

I want to dense_rank over a field that is non-numeric and change the row number whenever the field changes. Example:

I want this:

C
C
C
A
A
B
B
Z

To look like this:
1
1
1
2
2
3
3
4

The standard dense_rank() over (PARTITION BY ____ ORDER BY ____) orders my field alphabetically which I dont want
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 09:56 PM
I ended up finding an SQL person for the employer. All I can say is that she's a 100% legit friggin' beast. Actually better than I am in a few ways. Tends towards over-engineering, but I can temper that down a bit.

I don't know how I pulled that one off, but I'm glad I'm not the smartest person in the neighborhood anymore.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 10:17 PM
Can someone explain this to me and tell me why it has been at the top of HN all day?

https://news.ycombinator.com/item?id=7855168

I have a very difficult time with these visual puzzle things and never "see" whatever it is I'm supposed to see until it is explained to me. It calls for clicking red squares but I don't see any.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 10:54 PM
Looks like its using javascript to compare sites you've visited to a list of URLs. Each square represents a site within an interest group. The sites you've visited are red. By clicking on them, they're able to "learn" what your interests are.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 10:58 PM
Does my monitor suck, then?



The first few squares are codinghorror, thedailywtf, hanselman, and tutsplus.

I know I've been on 3 out of the 4. If it matters, I turn off tracking and use Disconnect.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 11:01 PM
Your monitor might still suck?

https://www.dropbox.com/s/kemd6mvkxd...2022.59.34.png

If you cant see a difference.. the CSS defines the box color as color: lightgray;

But it might also have to do with privacy settings blocking their ability to access visited sites.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 11:07 PM
Biesterfield,

You can use case statements in the order clause to specify an alternate ranking

Code:
select var, dense_rank() over(order by case var 
          when 'C' then 1
          when 'A' then 2
          when 'B' then 3
          when 'Z' then 4
end) as r
from my_table
order by r

http://sqlfiddle.com/#!6/64a178/4

Last edited by Greeksquared; 06-05-2014 at 11:09 PM. Reason: Thanks to DaveT for not solving this first
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 11:16 PM
Quote:
Originally Posted by txpstwx
Your monitor might still suck?

https://www.dropbox.com/s/kemd6mvkxd...2022.59.34.png

If you cant see a difference.. the CSS defines the box color as color: lightgray;

But it might also have to do with privacy settings blocking their ability to access visited sites.
Okay. I had Blacken turned on and it turned all the cells black. Still doesn't catch all the urls, and I think this is about the dumbest thing I've seen in a quite a long time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-05-2014 , 11:19 PM
Quote:
Originally Posted by daveT
I think this is about the dumbest thing I've seen in a quite a long time.
+1

Last edited by txpstwx; 06-05-2014 at 11:20 PM. Reason: Also surprised daveT didn't insta answer the sql question
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 05:25 AM
The black squares thing isn't dumb, I thought it was really clever! You probably have an extension with stricter security settings that don't render :visited definitions in CSS.

There have been a few clever :visited hacks over the years. One I remember seeing was using JS to determine if the link rendered as :visited. If this was allowed, you could have large lists of urls, find out which ones your visitor has visited and use it to blackmail, phish etc etc.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 06:02 AM
Quote:
Originally Posted by daveT
I ended up finding an SQL person for the employer. All I can say is that she's a 100% legit friggin' beast. Actually better than I am in a few ways. Tends towards over-engineering, but I can temper that down a bit.

I don't know how I pulled that one off, but I'm glad I'm not the smartest person in the neighborhood anymore.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 09:36 AM
Quote:
Originally Posted by Greeksquared
Biesterfield,

You can use case statements in the order clause to specify an alternate ranking

Code:
select var, dense_rank() over(order by case var 
          when 'C' then 1
          when 'A' then 2
          when 'B' then 3
          when 'Z' then 4
end) as r
from my_table
order by r

http://sqlfiddle.com/#!6/64a178/4
This may work but my variable will come in many (thousands) of forms and I will not really be able to predetermine what they all will be
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 10:45 AM
This should work...
Code:
create table ranks
    (rank int auto_increment primary key,
    char_string varchar(255));

insert into ranks (char_string) select
distinct char_string from original_table order by other_column;

select o.char_string,r.rank from original_table as o
join ranks as r using (char_string);
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 11:40 AM
I'm in SQL Server and don't have authority to create tables

sorry to keep bothering you guys

I'm going to see if modifying this code will work

http://stackoverflow.com/questions/6...m-previous-row
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 12:53 PM
SEO question -

I changed the title of a youtube video from (let's say) "golf training with John Doe" to "golf training with Michael Smith". When you google "golf training" the youtube video is the 5th hit, and links to the correct new video but the title that google search is showing is still "golf training with John Doe." How can I get google to show the new appropriate title? Do I ask for a re-crawl or do I use remove outdated snippet/cache tool, or something else?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 09:56 PM
Quote:
Originally Posted by txpstwx
Also surprised daveT didn't insta answer the sql question
Are you surprised now?

Quote:
Originally Posted by Gullanian
The black squares thing isn't dumb, I thought it was really clever! You probably have an extension with stricter security settings that don't render :visited definitions in CSS.
I have a plugin called Blacken that turns all font black or white. This over-rides all the CSS rules. Seriously the most awesome plugin ever if you can't read that gray text on white background that seems so en vogue now days.

After turning off Blacken, I was able to see it. The folly was that I didn't know what was happening so it didn't occur to me to turn it off and see the real thing. I still don't think the site is all that great, tbh.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 10:37 PM
Biesterfield,

I'm not a SQL expert so there may be an easier way, but this seems to work in PostgreSQL:

Code:
WITH t as (SELECT row_number() OVER() as id, field FROM original)

SELECT *
FROM t NATURAL JOIN
	(SELECT  row_number() OVER () as rnk, field
	FROM	(SELECT field, min(id)
		FROM t
		GROUP BY field
		ORDER BY min(id)
		) as sorted
	) as ranked
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-06-2014 , 11:42 PM
I have something absurd, but I think it works. Builds a string dynamically from the ranking variable and then executes the string

Code:
CREATE TABLE order_table
(
ID int IDENTITY(1,1) PRIMARY KEY,
var varchar(255) NOT NULL,
)

insert into order_table  
select var from my_table

select var, row_number() over(order by rank) as rank
into #temp
from (
select var, min(id) as rank
from order_table
group by var
) x

declare @s varchar(8000)
set     @s = 'select var, dense_rank() over(order by case var '

select  @s = @s + 'when ''' + cast(var as varchar(20)) + ''' then ' + cast(rank as varchar) + ' '
from    #temp
group by var, rank
option(maxdop 1) -- this sure there are no funny side-effects because of parallelism

set @s = @s + ' end) as r from my_table order by r'
EXECUTE(@s)
http://sqlfiddle.com/#!6/3db44/1
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2014 , 12:52 AM
Quote:
Originally Posted by Biesterfield
SEO question -

I changed the title of a youtube video from (let's say) "golf training with John Doe" to "golf training with Michael Smith". When you google "golf training" the youtube video is the 5th hit, and links to the correct new video but the title that google search is showing is still "golf training with John Doe." How can I get google to show the new appropriate title? Do I ask for a re-crawl or do I use remove outdated snippet/cache tool, or something else?
You don't *ask* for re-crawls, it just happens. You can influence pages being crawled more often by pointing links to them, but if your YouTube video is as popular as you think, it should be crawled without you doing anything. Just wait a little bit.

Also, how sure are you that you're not receiving personalized results for "golf training" in Google? That's a pretty damn tough keyword, so unless your video is HUGE (which I doubt from the delay in crawling/updating), I suspect personalized results.

And just to be honest, I don't have tons of expertise in YouTube ranking so things could be different on that front, although I do SEO for a living so I figure I'm right.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2014 , 09:27 AM
The "golf training" was just an example - I made it up. But yeah the video is on the front page for a certain google search, although that search and my video are not popular at all.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-07-2014 , 10:26 AM
When I want Google to re-index this is what I do:

https://support.google.com/webmaster.../1352276?hl=en
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m