What can you bring a double library connection analytics.js? - google-analytics

I have double connection analytics.js lib at the my website, what will can happend, maybe smth problems or smth else?

Related

Debug without write access to IIS logs

I don't know ASP, I've just started working for a large corporation and had task with an asp-classic web app dumped in my lap and it doesn't work. No one knows anything about it and apparently I am not allowed to write to IIS log files. So far it would seem that the program is failing because as far as I can tell, the POSTed HTTP parameters, which I can see in IE developer console, being sent in never make it to the server and can not be found in its Request.Form. Does anyone know what to make of that and how I might be able to print out the Response.QueryString where I might have access to it?
Clarifications:
I can see the log files but I can not add my own debugging lines as I am used to with PHP and Apache on Linux. I'm a fish out of water.
Proof the program is failing is that there is a program called ASPXTOASP.ASP which I think turns .Net request parameters into classic parameters is breaking. It gets an index out of bounds exception and I think it's because it is being passed an empty query string. When I tried to write the query string somewhere it never showed up. Where might I be able to write this query string where I can view it?
I am not certain I know enough about all of the components of the web app to organize it into a working version on my desktop for debugging.
I've just used Response.Write and Response.End to write the Request.QueryString to the screen. It's empty. Based on this and the fact that the program immediately preceding the one that breaks is called login.aspx and consists of setting some EVs haing to do with AD authentication I think my issue must be an authentication configuration issue. We are using Active Directory for authentication. Could anyone tell me about any specific settings in IIS that I ask the admins/senior dev to poke at which might fix such an issue?
A couple of ideas to help you debug:
1) If you're debugging this on the live site, you could output all of the Request.Form values into an HTML comment so that your users aren't affected.
<!-- <%
dim key
for each key in Request.Form
Response.Write key & "=" & Request.Form(key) & vbCrLf
next
%> -->
2) If you can debug the web app on your computer using Visual Studio, see this answer for how to debug ASP.
Based on the feedback I've received, the best solution to troubleshoot the application was to try to print the query string to the browser and then stop the program. To do this, I wrote something like this:
Response.Write("Query String: " & Request.QueryString)
Response.End
Ultimately this led me to discover that my parameters had disappeared. The query string is empty. I supposed I'll now need to read Questions about disappearing HTTP parameters.

HHVM not recognizing hh (hack) code

I've been hearing about HHVM for a while now, and when I knew Openshift was offering it as a free option, I decided to check it out.
However, it doesn't seem like my virtual machine is properly recognizing or serving either .hh files or files containing the hh start tag (hack files). I'm assuming this is a configuration problem, but I don't have much system set-up expertise and I'm not sure how to fix it.
If I try to run phpinfo() I just get back the one-word HipHop which I assume is for security. That suggests that the HHVM is actually serving the PHP file, but in that case, I don't know why the hh tag is not working (the code I tried to serve was ultra simple: < ? hh echo "hello"; ?>).
Openshift's VM runs nginx and HHVM, but the configuration seems to be a little different than that suggested for those installing their own.
I discovered the problem --it's very simple, but I'm posting the answer in case it might help others with the same problem.
In php, you typically open each file with < ? php and close it with ?>
In hack, the file opens with < ? hh, but you CANNOT use a close tag at the end.

QWebKit does not show some images on specific platforms

I'm programming a very simple Qt-based application which will be interfacing some website. That website requires user to login with username/password and solved Captcha. Because of that Captcha, I decided to use QWebKit and just display the website for the user (and intercept cookies in my app). It works almost great. Almost, because I'm having a really strange problem.
On Linux my app worked like a charm. On 64bit Windows 7 (32 bit build with VS 2010) - it worked without problems too. But the same binary has a very strange issue under 32bit Windows 7. It works, but does not display Captcha images making logging in impossible. Of course, I used Dependency Walker and ensured that all the DLL's are accessible.
The Captcha is not a popular reCaptcha or something, but Minteye slider Captcha (BTW, in my humble opinion it is quite easy to solve by a computer). As you can see at the bottom of the page I linked to, this captcha downloads a series of images and user has to select the "correct" (ungarbled) one with a slider.
The problem is, that for no apparent reason, my app just doesn't show these images on 32bit Windows 7, while on 64bit version everything works. The code I'm using is very simple, but I'm posting it anyway:
loginView = new QWebView();
QWebPage *page = new QWebPage();
manager = new QNetworkAccessManager();
loginView->setPage(page);
page->setNetworkAccessManager(manager);
jar = new QNetworkCookieJar();
manager->setCookieJar(jar);
page->mainFrame()->load(QUrl("http://site.to.open"));
loginView->show();
I verified with Wireshark that these images are indeed being downloaded from the server. I even changed user agent string to hardcoded one to be sure that the server doesn't mess up something only for for 32bit windows 7. Unless I'm missing something, the dialogue with the server is identical and the problem is on client's side.
The only thing that differs (and I'm pretty sure is connected to my problem) is behaviour of WebKit when trying to navigate to specific URL via developer tools (one can enable them in QWebKit, so did I). When I open the Javascript console for login page and enter:
window.location = "http://www.google.com"
It works on all my platforms. But, when I enter the address of one of the Captcha images:
window.location = "http://img2.minteye.com/slider/image.ashx...
Results vary. On Linux and 64bit Windows 7 it works and I can see an image. On problematic 32bit Windows 7, WebKit shows error Frame load interrupted by policy change and that's all. I have no idea what that error means and what "policy" changed. Google search didn't help me - I found posts by people complaining that they see this error, but nobody explained what causes it (WebKit source isn't super helpful too). If somebody knows, I might be able to get a workaround for my problem.
I'm also very courious, why this problem is present only on 32bit version of Windows 7.
Seems like this is/was a bug in QtWebkit implementation, you can read more about it here:
https://bugs.webkit.org/show_bug.cgi?id=37597
Which version of Qt and QtWebkit are you using ?
It might be a good idea to try a newer version of Qt & QtWekbit.
If it helps in any case here is the code in Webkit which shows this error:
http://src.chromium.org/svn/branches/WebKit/472/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
This is not a bug.
What happens is that this image was generated dynamically, probably Headers were misconfigured.
the Frame load interrupted by policy change occurs because the WebView tries to open something that is not "text/image" (is not supported).
You should use this ( https://stackoverflow.com/a/16782607/1518921 ):
//replace [QWebView] by your WebView
connect([QWebView]->page(), SIGNAL(unsupportedContent(QNetworkReply*)), this, SLOT(downloadContent(QNetworkReply*)));
...
void [main class]::downloadContent(QNetworkReply *reply){
//Replace "[main class]" by "Class" having the signs used in WebView.
[QWebView]->stop();
//solution: stop loading --replace [QWebView] by your WebView,
/*function to donwload*/
}
At this point if you have a download manager, it will ask to save the image instead of opening it, because the content is not supported.
Solutions:
What you can do is try to fix image headers.
if your server is not then there will be, then you will have to parse the header Content-type and see what type it is trying to send, having kind of content you will have to reimplement the QWebPage:
virtual bool extension(Extension extension, const ExtensionOption *option = 0,
ExtensionReturn *output = 0);
virtual bool supportsExtension(Extension extension) const;
Good luck.

How to profile a shared object without profiling the host app?

I have a host application and I have written a plug-in. I compile my plug-in down to a shared object (say foo.so), and the host application will load it via dlopen. In this case, my host application is the opt tool from llvm (though I don't think that's important to the question).
I'd like to compile my plug-in with profiling enabled (i.e. g++ -pg, gprof). However, when I do this, the profile output file gmon.out is never created. Maybe gprof expects someone to call a setup routine, or something like that.
For various reasons, I would like to avoid recompiling the host app with -pg. I am curious if it is possible to profile a shared object foo.so without profiling the host application opt.
I've also looked into other profiling tools; qprof from HP should be able to handle this situation, but it is unable to resolve the names of functions in the shared object (it falls back to addr2line in a very naive way).
Thanks,
Nick
I assume the reason you want to do this is to find ways to optimize the plugin (as opposed to just getting timing information).
Can you run the host app under a debugger or IDE? Does the IDE have a pause button, or can you interrupt it with Ctrl-C or some such key?
Then you can quickly find the costly code by using this technique. Only take samples when your plugin is running, or if you can't do that, just ignore samples that don't end in your plugin.
Even if you get gprof to work, or a similar profiler, you're likely to be disappointed.

What is this 'Multiple-step OLE DB' error?

I'm doing a little bit of work on a horrid piece of software built by Bangalores best.
It's written in mostly classic ASP/VbScript, but "ported" to ASP.NET, though most of the code is classic ASP style in the ASPX pages :(
I'm getting this message when it tries to connect to my local database:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Line 38: MasterConn = New ADODB.Connection()
Line 39: MasterConn.connectiontimeout = 10000
Line 40: MasterConn.Open(strDB)
Anybody have a clue what this error means? Its connecting to my local machine (running SQLEXPRESS) using this connection string:
PROVIDER=MSDASQL;DRIVER={SQL Server};Server=JONATHAN-PC\SQLEXPRESS\;DATABASE=NetTraining;Integrated Security=true
Which is the connection string that it was initially using, I just repointed it at my database.
UPDATE:
The issue was using "Integrated Security" with ADO. I changed to using a user account and it connected just fine.
I ran into this a long time ago with working in ASP. I found this knowledge base article and it helped me out. I hope it solves your problem.
http://support.microsoft.com/kb/269495
If this doesn't work and everything checks out, then it is probably your connection string. I would try these steps next:
Remove:
DRIVER={SQL Server};
Edit the Provider to this:
Provider=SQLOLEDB;
As a side note, connectionstrings.com is a great site so you don't have to remember all that connection string syntax.
I came across this problem when trying to connect to an MySQL database via the wonderful Classic ASP. The solutions above didn't fix it directly, but I resolved it in the end by updating the ODBC Driver (from the long standing 3.51) to the latest version. I was then able to leave the driver line in (and not add the Provider bit), but I did have to update the connection string accordingly to:
Driver={MySQL ODBC 5.1 Driver};
That worked fine. Happy chappy.

Resources