w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

Facebook like button https issue: protocol mismatch from http and https
Reviewing the js code on Facebook there are multiple urls containing hard coded strings for http://static .../rsrc.php it's possible those are the files triggering the error. This may be something Facebook needs to update. On a side note, it may be possible to download that js file from Facebook and store it on your server and remove the hard coded http string. I would test this further but I am on my phone at the moment.

Categories : Facebook

How do you enable https and http->https redirects in ring / compojure
It's possible to serve HTTPS with clojure, but it's much more popular to put nginx or something like that in front of your ring server. If you can figure out how to configure jetty, though, run-jetty clearly supports SSL.

Categories : Http

Once https page is visited, all subsequent pages are served from https
ok I think I found the reason. The links I am visiting are relative, so "/forum" for example. Once https is in the browser it seems like visiting a relative address is leaving the root as https:// and appending the relative path. I believe the fix here will be to use the full path for the link instead of relative.

Categories : Htaccess

when using https, https can't find codeigniter controllers. Running Centos
Change this line : RewriteRule ^(.*)$ index.php?/$1 [L] to : RewriteRule ^(.*)$ /index.php?/$1 [L] The .htaccess would otherwise be redirected relatively to a index.php in the join folder, which off course is not there.

Categories : PHP

How can i convert links to https when server providing https?
If you remove the http:// portion and use instead: <script type="text/javascript" src="//static.monstermmorpg.com/js_files/jquery-1.9.1.min.js"></script> It should request based on the current scheme being used.

Categories : C#

Redirect all http AND https non-www URLS to https://www.xyz.com via htaccess
In case anyone from the future (HELLO PEOPLE OF THE FUTURE) stumble across this, I asked the same question and had it answered over at Server Fault. Short version: impossible. Long version: http://serverfault.com/questions/523199/redirect-all-http-and-https-non-www-urls-to-https-www-example-com-via-htaccess

Categories : Htaccess

Can https fallback to http and security level of https
No, HTTPS never falls back to HTTP automatically. It would take deliberate action by the user. If you're just going to a web page by putting its URL into the address bar, this is easy; for form submission it's harder. Yes, sending plain text over SSL is fine. In fact, sending a hashed password doesn't really increase security much at all -- if someone manages to sniff the connection and gets the hashed password, that's all they need to be able to login to the site. It has one small advantage: if the user uses the same password at multiple sites, learning the hashed password for one site doesn't help them get into another site that uses a different (or no) hash. And it's not likely to be feasible to send salted hashes, since the client doesn't know the salt. A cnonce adds an extra level

Categories : Asp Net

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?
It sounds like you're looking for the Concave Hull of the data set. Unfortunately, I don't know of any pre-canned algorithms, but the link references a paper that another developer was starting from, as well as some sample code, so maybe that'll help you in the right direction.

Categories : C#

HTTPS GET request to https://www.googleapis.com/plus/v1/people/me
Create a Google_Oauth2Service object (put it under the $plus initialization), like: $client = new Google_Client(); $plus = new Google_PlusService($client); $oauth2 = new Google_Oauth2Service($client); and after succesfully authenticating the client use: $userInfo = $oauth2->userinfo->get(); $email = $userInfo['email'];

Categories : PHP

IHttpHandler to redirect "https://example.com" to "https://www.example.com"?
If you use IIS7, you might want to try URL Rewrite Module. http://www.4guysfromrolla.com/articles/072810-1.aspx http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/

Categories : Asp Net

The underlying connection was closed: The connection was closed unexpectedly wcf service
The first thing i will do is, instead of returning the full list of candidates i will return an empty list. If that works fine, then it is very clear that the size of the data is a problem. To modify the size play with your binding parameters.

Categories : Wcf

"The underlying connection was closed: The connection was closed unexpectedly"
The first request does not utilize a header that indicates the length of the result. It closes the connection when it finishes. The second request utilizes the length header, reads the designated number of bytes, then closes the connection gracefully. (under the client side control instead of server driven disconnection) -or- The url you sent caused an error on the server. Is there an error in the server log or event viewer?

Categories : C#

How to redirect from url: https://myfavourite.test.com/Account/LogOn?ReturnUrl=/ to url: https://myfavourite.test.com/ using IIS7.5
I followed the steps mentioned in the below mentioned article and it helped me. http://www.trainsignal.com/blog/iis7-url-rewrite-extension-on-windows-server-2008 I used the Redirect option and then added a Blank rule with the following regular expression: account$|account/(?!LogOff) and that helped me to resolve the redirection issue.

Categories : Asp Net Mvc

apache redrict 301 from https://www.domain.com to https://domain.com
If you request https://www.meinedomain.de/ and your cert isn't authorized for www.meinedomain.de, then you'll get a security warning regardless of how you redirect. The redirect can only happen after they accept the security exception. Make sure you've put those rules in the SSL vhost's config, not the non-SSL one. Apache usually has them separate. If that still doesn't work, you can try just putting this in an htaccess file in your document root: RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www.meinedomain.de$ [NC] RewriteRule (.*) https://meinedomain.de%{REQUEST_URI} [R=301,L]

Categories : Apache

Tag 'h1' not closed
Try adding space: <h1> @employee.Name </h1> Take a look at this question

Categories : Asp Net Mvc

When is FileDescriptor closed?
I belive you are right. A small test shows that the FileDescriptor becomes invalid after its FileInputStream is closed. Note that, in case of more than one FileInputStream for the same FileDescriptor, the FileDescriptor becomes invalid as soon as its first FileInputStream is closed, i.e. it does not matter if you close first fis1 and then fis2 or the other way around: FileInputStream fis1 = new FileInputStream("/tmp/adb.log"); FileDescriptor fd = fis1.getFD(); FileInputStream fis2 = new FileInputStream(fd); System.out.println(fd.valid()); fis1.close(); System.out.println(fd.valid()); fis2.close(); System.out.println(fd.valid()); Output is: true false false Do not forget to close the stream in a finally block, to make sure you close it also in case of an I/O (read/write) error.

Categories : Java

Detecting whether .exe was closed
Use the Exited event (note: you need to set EnableRaisingEvents to true) e.g. : private void button1_Click(object sender, EventArgs e) { string openexe= @"C:UsersmarekDocumentsVisual Studio 2012Projects ours oursinDebug etpokl.exe"; var proc = new Process(); proc.StartInfo = new ProcessStartInfo(openexe); proc.EnableRaisingEvents = true; proc.Exited += new EventHandler(proc_Exited); proc.Start(); } private void proc_Exited(object sender, EventArgs e) { // the process has exited... } This is the asynchronous way, for a synchronous approach you can use the WaitForExit method : private void button1_Click(object sender, EventArgs e) { string openexe= @"C:UsersmarekDocumentsVisual Studio 2012Projects ours oursinDebug etpokl.exe"; var proc = new Proces

Categories : C#

Is this inputstream being closed?
You re doing some wierd stuff it seems? For each archieve entry while your reading your archieve you re recursively calling your read archieve method which results in opening the next archieve while your parent code is still handling your previous archieve. You should loop entirely through your archieve entry before handling any new archieve entry in your compressed file. Something like ArArchiveEntry entry = (ArArchiveEntry) arInput.getNextEntry(); byte[] content = new byte[entry.getSize()]; LOOP UNTIL entry.getSize() HAS BEEN READ { arInput.read(content, offset, content.length - offset); } as stated in the examples on the apache site

Categories : Java

Is socket closed from my end or the other end
It looks like your application is shutting down the HttpClient connection pool too soon. It is not happening in the code you showed in your Question. That code looks like "an innocent victim". Is this an issue with the HttpClient version I am using? Probably not. Or is something in my environment changing the behaviour? Erm ... could be. Especially if "my environment" is an obscure way of saying some other part of your program.

Categories : Java

How do I tell if an HttpResponse is already closed?
Stab in the dark here, but would connectionInfo being null mean that the HttpResponse has finished? Otherwise, I guess you could set a "closed" bool variable from the Future returned by done, and test whether it's set before processing the response? HttpResponse response = ...; bool closed = false; response.done.then((_) => closed = true); if (!closed) { ... } But I'm not sure whether you could ever do this early enough, would depend on the scenario.

Categories : Dart

get the information on the last closed iOS App
It is not possible to get the last closed iOS app, but if you have two apps and you want to be able to move between the apps you may be able to use URL schemes. URL Schemes Documentation Here: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW18

Categories : IOS

PSQLException: this ResultSet is closed
when you close the connection object in your getProduttori method, your result set will be automatically closed. when you try to re use it , it will be null. ResultSet rs = ProduttoreDCS.getProduttori(); = null, as you have closed the connection in getProduttori method, which will automatically close the resultset thus, it returns null. From Connection#close Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released. applies same when closing the Statement as well.For your code to work don't close Statement and Connection untill you get the rows. @Baadshah has already shown you the standard way. If you are using java 7+ you can make use of try-with-resource block,

Categories : Java

Does IndexedDB need to be closed other than on upgrade?
Take a look to the documentation from W3: When a connection is initially created it is in opened state. The connection can be closed through several means. If the connection is GCed or execution context where the connection is created is destroyed (for example due to the user navigating away from that page), the connection is closed. The connection can also be closed explicitly using the steps for closing a database connection. When the connection is closed the closePending flag is always set to true if it hasn't already been. There is no need to close explicitly the connection, the browser should handle that.

Categories : Javascript

Nodejs: This socket is closed
Try this code Option1 function broadcast(message, sender) { try { clients.forEach(function (client) { if(client._handle){ // ensure there is still underlying handle client.write(message); // ERROR IS HERE } }); } catch (ee) { } } Option2 Attach error event listener on socket. Socket.on('error',function(){ console.log("%j", arguments); });

Categories : Node Js

File being used by another process even if closed it before
When you are using using you don't need to close Stream because it automatically close the Stream after using; so try this code: using (FileStream fs = new FileStream(assemblyFile, FileMode.Open, FileAccess.Read, FileShare.Read)) { //read a file and write to memorystream. }

Categories : C#

HTML5 App on Windows 8 which cannot be closed
This isn't possible on Windows 8; the soon to be released Windows 8.1 has a "Kiosk Mode", which seems to be what you are looking for. From Windows 8.1 kiosk mode locks systems to a single app: Generally speaking, kiosk mode is something that’s intended for use in corporate and shared computing settings — like public information terminals. It would, for example, make an excellent way to lock a point-of-sale terminal in to the “cash register” app and prevent would-be procrastinators from tabbing out and surfing the web.

Categories : HTML

.Net SoapClient Connection Was Not Closed
The error occurs in the database connection. Make sure that the SqlConnection object is properly disposed in your server code (a good practice is to wrap your code with using statements).

Categories : Asp Net

IE 10 not using AppCache after browser closed
Did you find the answer to this? I have the same problem. I did get a bit further though. I found that if you go to the IE10 File menu option and tick Work Offline then try and access your cached app it loads the page but I still have an issue as it does not appear to be using the javascript file that should also be cached. All works ok on Google Chrome but our clients are restricted to IE so Chrome is not an option.

Categories : Internet Explorer

Haskell IO - handle closed
getContents == hGetContents stdin. In fact hGetContents marks its handle (semi-)closed and this means anything attempting to read from stdin ever again will fail. Take a look at After using getContents in the Haskell User Guide

Categories : Haskell

Closed type classes
I believe the answer is a qualified yes, depending on what you're trying to achieve. You can refrain from exporting the type class name itself from your interface module1, while still exporting the names of the type class functions. Then no one can make an instance of the class because no one can name it! Example: module Foo ( foo, bar ) where class SecretClass a where foo :: a bar :: a -> a -> a instance SecretClass Int where foo = 3 bar = (+) The downside is no one can write a type with your class as a constraint either. This doesn't entirely prevent people from writing functions that would have such a type, because the compiler will still be able to infer the type. But it would be very annoying. You can mitigate the downside by providing another emp

Categories : Haskell

Reopening closed file: Lua
So, now the problem is that the "LoadScript" function isn't doing what you expect: Because I'm psychic, i have divined that you're writing a Crysis plugin, and are attempting to use it's LoadScript API call. (Please don't assume everyone here would guess this, or be bothered to look for it. It's vital information that must form part of your questions) The script you're writing attempts to set Backup - but your script, as written - does not separate lines with newline characters. As the first line is a comment, the entire script will be ignored. Basicallty the script you've written looks like this, which is all treated as a comment. --[[ comment ]]--Backup="Hello!" You need to write a " " after the comment (and, I'd recommend in other places too) to make it like this. In fact, you d

Categories : Windows

App gets closed wen emualtor is rotated
Without any log it is hard to give an asnwer. You can give a look here Recreating an Activity where it says Caution: Your activity will be destroyed and recreated each time the user rotates the screen. When the screen changes orientation, the system destroys and recreates the foreground activity because the screen configuration has changed and your activity might need to load alternative resources (such as the layout). It could be you don't initialize correctly some variables.

Categories : Android

OpenCV 'Almost' Closed contours
You can utilize color information and kmeans clustering as explained in the link. As long as target object color differs from the background, the pixels of the square object can be detected accurately.

Categories : C++

What determines if a variable is closed over?
This code closes over sample twice. from x in new int[]{0} from i in sample from j in sample select Math.Pow(i,j); The actual method calls this evaluates to are: new int[] {0} .SelectMany(x => sample, (x, i) => new {x, i}) .SelectMany(@t => sample, (@t, j) => Math.Pow(@t.i, j)); This code closes over sample once. from i in sample from j in sample select Math.Pow(i,j); The actual method calls this evaluates to are: sample.SelectMany(i => sample, (i, j) => Math.Pow(i, j)); So if you change sample, only the i => sample lambda will "see" the "new" value for sample; sample.SelectMany has already run with the "old" value. Both examples cause R# to issue an Access to modified closure warning, which is usually a big red flag. Consider keeping a private cop

Categories : C#

Closed Captions in YouTube API v3
We are hoping to have Captions support on Data API v3 soon. You won't need to scrape the website. Update: This has been implemented now. The docs can be found here.

Categories : Java

Detect closed contours
If your example image is a bitmap, even a single pixel has an area already, so it also has a contour. The closed circle even has two contours, one on the inside, one on the outside. The half circle has just one, spanning inside and outside and making a U-turn at the ends. I guess you want to treat these two circles as curves that indeed have no area and just one "contour". The circle would then be a closed curve, the half circle would be open. If that is the case, your new problem is turning a bitmap into curves. This isn't trivial, even though we humans easily perceive the curve there, because it requires defining an algorithm and parameters that turn an area into a curve. One approach I know is deriving a skeleton from the bitmap, which basically peels off layers of pixels on the outsi

Categories : Python

I want the notification to get closed after I opened the app
NotificationManager.cancelAll(); http://developer.android.com/reference/android/app/NotificationManager.html#cancelAll()

Categories : Android

End Program After MessageBox is Closed
Add a boolean to the top to determine if the operation completed. bool readerCompleted = false; try { reader = new Reader("COM6"); readerCompleted = true; } catch { MessageBox.Show("No Device Detected", MessageBoxButtons.OK, MessageBoxIcon.Error) } if(readerCompleted) { Application.EnableVisualStyles(); Application.SetCompatibleRenderingDefault(false); Application.Run(new Form1()); } Because there is no code after the if statement, the program will just close when the boolean is false. You can apply this sort of logic to any other section of your code, not just the Main() function.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.