w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Javascript .find() not working under all the IE browser
Inspect the dropdown ul element and check if the lis are there, it seems to be a CSS problem, which is very common on IE. Try giving the ul ant its elements a float: left; and a width.

Categories : Javascript

Javascript: Find point on perpendicular line always the same distance away
Generally you can get the coordinates of a normal of a line like this: P1 = {r * cos(a) + Cx, -r * sin(a) + Cy}, P2 = {-r * cos(a) + Cx, r * sin(a) + Cy}. A demo applying this to your case at jsFiddle.

Categories : Javascript

Find the number of lines a string runs into inside a div of a set width (there is no new line separator) in javascript
Take the height of the span and divide by the line height. Note that this version doesn't account for padding, margin, etc that could potentially affect the outcome. This works for your example though. // webkit line-height normal consideration thanks to mVChr var $sent = $('.sentences'), lh = $sent.css('line-height'), ws = $sent.css('white-space'); if (lh === 'normal') { $sent.css('white-space', 'nowrap'); lh = $sent.height(); $sent.css('white-space', ws); } $('.lines').text(Math.ceil($('.sentences').height() / parseInt(lh, 10))); Updated fiddle Fiddle without explicit line-height Update: this does work regardless of margin and padding as .height() does not include margin, padding, nor border. This fiddle has large padding/border/margin and still correctly compute

Categories : Javascript

Why can one line of code work, but then the same line throws a null pointer exception later?
On the third line of your onStart method you are setting the context to the activity. Try setting it to the context instead. this.context = getActivity().getApplicationContext();

Categories : Java

System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10
@HighCore is right, using application solves your issue in the given scenario <ImageBrush ImageSource="pack://application:,,,/Resources/ClientBackground.png"/> You still can use siteoforigin. For that you have to set the image property Copy to Output Directory to "Copy always" MSDN Link

Categories : C#

Restrict browser refresh, f5, browser back like banking sites through javascript/jquery
(1) No. There no possible cross-browser way to control browser functionality with javascript/jquery. (2) Banking sites do not restrict or control the browser functionality. They only ask users to desist. At most they attempt to detect some actions and then show errors. But, they don't try to control the browser. (3) This is a bad idea.

Categories : Javascript

Bash: loop through file line by line, find specific string and append to each subsequent line until same string is found
If I have your requirements right, this little awk program will work: awk '/^AB1/{ab1=$0;next}/^AB2/{print $0, ab1}' That will do nothing with any line which doesn't start with AB1 or AB2 and it fails to check for equality of the 12-character string following the AB1/AB2. I couldn't tell if you require that check.

Categories : Regex

How do I find the exception type of an exception that gets thrown in C#?
This: System.Exception: Timeout shows that they're just throwing a bare System.Exception, e.g. if (weHaveNoApiDesignSkills) { throw new Exception("Timeout"); } It's possible that there are some exceptions which are better designed, but the one you've shown isn't promising :( Unfortunately unless you start using the message in the exception to differentiate between them (which is almost always a bad idea) you're stuck. It may be worth asking the authors of the library to see if they can improve matters for a future release.

Categories : C#

regex pattern to find a line and then look for a number within the line
Easy: grep -E "BuildStops.BuildStop.AddConsignee: ([5-9][0-9]{3}|[0-9]{5})" System_2013626.log This matches the line only if (at least) five digits are present in that position, or a four-digit number that starts with at least 5. Also, don't forget to escape the literal dots.

Categories : Regex

I want to see only my URL in the URL line on a browser
If you're really trying to have JUST your base url in the navigation bar then you'll have to do some trickery. The url shows for a reason, so you know where you're at. The only way I can think of to trick your browser into only showing the base url is to use iframes. You'd do this like: <iframe src="www.panos-oliveoil.gr"></iframe>

Categories : Asp Net

javascript how to read line by line from a local text fie and display in a listbox
You can't access to the local file system, because that would mean you can read all the files on one's computer. Howewer, you can get a particular file when the user drag and drops that file into an element. Here's an example that shows you the content of the file if it is a txt document: http://html5demos.com/drag-anything

Categories : Javascript

Removing the new line character from javascript and making the data come in single line
Don't use new RegExp. Just use the string replace method. justiread..replace(/( | | )/gm,"") The "g" switch is global replace, "m" means it should happen more than once. See http://www.textfixer.com/tutorials/javascript-line-breaks.php

Categories : Javascript

How to load jsp page some data content dynamically without using javascript or ajax? Because my IE8 browser doesn't support most javascript tags?
jQuery 1.9 (early 2013): We’ll remove many of the interfaces already deprecated in version 1.8; some of them will be available as plugins or alternative APIs supported by the jQuery project. IE 6/7/8 will be supported as today. says http://blog.jquery.com/2012/06/28/jquery-core-version-1-9-and-beyond/ So just try using jquery to send the ajax-request. Below is a small snippet I used from one of my projects. $.ajax({ type: "POST", url: "tradecopy.action", data: $("#tradecopyform").serialize(), complete: function(xhr, textStatus) { $("#innerModalPopupDiv").html(xhr.responseText); } });

Categories : Jsp

Applet: visually bugs out only in browser, and throws exception from Swing
java.lang.ClassCastException: javax.swing.JLabel cannot be cast to javax.swing.text.JTextComponent see components tree for JTextComponents, there isn't JLabel, JLabel isn't member of JTextComponents safest could be to test if (Xxx instanceof JTextComponent) before any casting

Categories : Java

Set default web browser via command line?
I know this doesn't specifically answer your question, but if you only need to do this for Chrome, it has a flag that let's you set itself as the default browser: $ open -a "Google Chrome" --args --make-default-browser

Categories : Osx

Web browser command line program
You haven't completely finished the request. You need two newlines, as otherwise it just looks like you're still writing out the request headers. Add an extra println and you may be okay, although as HTTP specifies CRLF for the line ending, I would actually use print rather than println, and put at the end of each line explicitly. (I'd also avoid using PrintWriter, personally - swallowing exceptions is bad...)

Categories : Java

How to use R's `browser()` function from command line when using `Rscript`
R functions such as browser(), debugger(), or recover() only work interactively. If your script does not take command-line arguments a simple workaround is to start R and source("myscript.R").

Categories : R

How to set cakephp to disable a line of code if a certain browser is not being used
See these pages http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx http://www.quirksmode.org/css/condcom.html and use conditional comments. Example from the second page: <!--[if IE 6]> Special instructions for IE 6 here <![endif]-->

Categories : Cakephp

read a file line by line using javaScript
Yes, using HTML5 FileReader API. The best source for that is , http://www.html5rocks.com/en/tutorials/file/dndfiles/. Scroll down to reading files. FileReader.readAsText(Blob|File, opt_encoding) Split the content with EOL character for UTF-8. Note: By default the string is decoded as 'UTF-8'.

Categories : Javascript

Console calls (like cache clears or behat) throw an exception but all is fine in browser
I figured out where the problem came from, but without understanding it. It appeared that somewhere in my application I called $this->container->get('twig')->render("Bundle:View:action.html.twig") I changed to $this->container->get('templating')->render("Bundle:View:action.html.twig") twig service is a Twig_Environment instance, and template is a DelegatingEngine instance, both allowing to render a template. And all works great again. If someone could explain me what happened, I'll appreciate :)

Categories : PHP

Continue from the next line after getting exception
Yes, it is possible without the finally block. try{ statement A; } catch(NullPointerException NPE){.....} try{ statement B; } catch(NullPointerException NPE){.....} try{ statement C; } catch(NullPointerException NPE){.....} On the side note, I don't really think this is nice. If you managed to come to the point where you need this kind of flow control, you need to take a step back and rethink your code design.

Categories : Java

how to find particular site is already open or not in the browser?
There is no way to run any client side code in an HTML formatted email. So this is impossible. The closest you could come would be to: use some kind of token to identify a user (e.g. stored in a cookie) run some heart beat code to see if they are still on the page (e.g. use XMLHttpRequest to request a 1 byte file every 15 seconds using a page id generated when the page was loaded and the user id in the cookie) check on the server to see if a heart beat from a different page was received recently when a new copy of the page is loaded serve different content if it is

Categories : Javascript

How can i get xml line number from ptree exception
If you want to detect malformed XML (as opposed to XML documents which simply don't contain the values you expect, in which case line numbers aren't feasible to obtain): #include <iostream> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xml_parser.hpp> int main(int argc, char* argv[]) { boost::property_tree::ptree pt; try { read_xml(argv[1], pt); } catch (const boost::property_tree::xml_parser::xml_parser_error& ex) { std::cerr << "error in file " << ex.filename() << " line " << ex.line() << std::endl; } } Now given that t.xml is not a valid XML document: $ a.out t.xml error in file t.xml at line 10

Categories : C++

Browser can't find www.dnndev.me to install DotNetNuke
Did you add the binding to IIS for DNNDEV.ME as well as WWW.DNNDEV.ME? The video instructs you to use DNNDEV.ME which is different than WWW.DNNDEV.ME, so you will need to add the binding for WWW if you want to access that. Right click on the website in IIS, choose Edit Bindings and add the new one there.

Categories : Asp Net

How can I find a string with the Web Browser in Visual Basic
Do you mean WebBrowser object in VBA form? Then you can get text of the body (yes, current text, with ajax or javascript changes): Dim doc As MSHTML.HTMLDocument Set doc = Wb1.Document Dim s As String s = doc.body.innerText ...and find what you want. Note: Using WebBrowser object needs reference to Microsoft HTML Object Library (mshtml.tlb).

Categories : Visual Studio 2010

How do I find what parts of an npm package work in the browser, and which don't?
Actually, I believe that when using something like Browserify, you can require nearly every package without much problems... according to Browserify docs: Many npm modules that don't do IO will just work after being browserified. Others take more work. Many node built-in modules have been wrapped to work in the browser, but only when you explicitly require() or use their functionality. However, I'm not experienced with Browserify so I can't ensure it to you; but I can surely say that it would be an extra layer in any app. "Does it need it?" should be asked in such moment. As I'm a guy who prefer to manage only Node.js packages with npm, I'm against trying to use them in a browser this way. Most browser compatible packages will notify the user when they are tested for such p

Categories : Node Js

automatic resize pictures when scale down the browser page without break to new line
@media (min-width:450px;){ img{ width:50%;/*or whatever floats your boat*/ } } You can modify the min-width: value to customize your needs. This won't handle resizing. Just different media sizes. You can use jQuery.resize to handle actually resizing a browser window like so: $(window).resize(function(){ var div = $('#images');//images container div.find('img').each(function(k,v){ $(v).width((div.width()/4));//resize each image however you want }); });

Categories : Javascript

sending a command line using Runtime don't do anything, and no exception even?
You need to pass each command line argument as a separate method argument like this: Runtime.getRuntime().exec(new String[] {"netsh", "wlan", "start", "hostednetwork", "runas", "/noprofile", "/user:mymachine\administrator"}) Otherwise, it seems like the command name is netsh wlan start hostednetwork runas /noprofile /user:mymachine\administrator.

Categories : Windows

I am catching exception in a DispatcherUnhandledExceptionEventHandler In App.cs so I don't now what line is throwing it
When you call a line of code like e.Exception.GetBaseException().Message You have to first make sure that GetBaseException() actually returns an object. var baseException = e.Exception.GetBaseException(); if (baseException != null) { // Do something with baseException.Message } This is the problem, according to your stack trace. I'm skeptical, because the MSDN documentation states that GetBaseException() should always return an object (if you are, in fact, handling an actual exception that hasn't been unwound yet).

Categories : Dotnet

Find PID of browser process launched by Selenium WebDriver
To get process id and attempt to kill it you would use Process class. The methods of interests are: GetProcessesByName Kill Once you resolve a process by name you can query it's property: process.Id for an id. Keep in mind, some browsers, like Google Chrome have several running processes (Chrome has at least one running process per tab). So if you want to kill it, you need to kill all the processes.

Categories : C#

How to find an element post button click - Web browser vb.net
Have you tried using a different attribute to get the button? I was experiencing a similar before and it was due to the fact that their was more then one button with the field I was checking. So try looking at a different attribute or use an AND statement to check more than attribute at a time.

Categories : Vb.Net

Floated items in "gallery" layout break to next line at random browser widths
Hmmm, I can't say this is the only solution, but here's how I feel you could fix this problem: Looking at the site, I believe the issue lies with the dimensions of the images being used for those <div class="promoItem"> elements. The variation between heights of your assets (264px-265px) seems to be causing the line breaks. You can fix this in a couple of ways: Standardize the heights of the assets you use in those instances. Since you don't have many images there, this shouldn't be a very lengthy task - but if they change, you'll have to remember the correct height to make the new assets with. Or, you can... ...Change your CSS to be a bit more flexible. These changes seem to work for me: div.promoItem { position: relative; display: inline-block; width: 29%; margi

Categories : HTML

Why am I getting a Null Pointer Exception on my Android Program line 73?
It looks to me, that line (ViewPager) findViewById(R.id.pager); returns null and therefore the statement mViewPager.setAdapter(mSectionsPagerAdapter); crashes. Make sure, there is a ViewPager in your xml layout.

Categories : Java

what is the line number of an ienumerable exception when it is lazily evaluated?
The problem is that the structure may or may not be evaluated lazily, but your method is executed as soon as it is called. Since your Exception is hit before anything is returned, that execution throws. You could try this instead. It takes advantage of the yield keyword to lazily build the result on the fly: private IEnumerable<int> GetIntsButReallyThrowError() { yield return 1; throw new Exception("Threw this on purpose."); }

Categories : C#

jQuery Find and Replace is Hanging up the browser! Data size too big?
It is really hard untangle the mess you have but if what you want is ajax requests every 10 seconds it make sense to separate this logic from business logic over data from server. Your code would also really benefit from using promises. Consider this example $(document).ready(function() { var myData = { } , ajaxPromise = null setInterval(callServer, 1000) function callServer() { ajaxPromise = updateCall() .then(controlCall) .done(handler) .error(errorHandler) } function updateCall() { return $.get('updateTable.php', function(data) { myData.update = data }) } function controlCall( ) { return $.get('ajaxControl.php', function(data)

Categories : Javascript

Can't find the source of exception
Basically your problem is twofold One log stream does not accept 8-bit strings with extended characters, and throws UnicodeError There is a silly bug in logging module which make it lose the original traceback The exact cause of the exception is this: >>> 'ä'.encode('UTF-8') Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) But this exception is not the real problem. This is the part of the 2.6 logging code; the 799 is the last line of the block. The last line is the one causing the problems. Basically something logs a message in a 8-bit byte string, UTF-8 encoded, containing Latin-1 extended letters; but the stream does not like that, and

Categories : Python

Find Exception type
You can call e.getClass().getName() to get class name. getName() returns the name including package, e.g. java.lang.OutOfMemoryError. getSimpleName() returns just a class name, e.g. OutOfMemoryError. See javadoc for Class object to see all info you can get.

Categories : Java

Find all the on a page in a browser that doesn't support them
If you're using jQuery, you can get them using .filter(): var $unsupported = $('input').filter(function() { return this.type !== $(this).attr('type'); }); This'll select all unsupported inputs, so you may want to filter that further using .filter('[type="number"]') or do that from within the filtering function. A pure JS solution isn't much different: var inputs = document.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) { if (inputs[i].type === inputs[i].getAttribute('type')) { continue; } // inputs[i] isn't supported by the browser } And a demo: http://fiddle.jshell.net/PENRD I tested it in IETester and it worked down to IE6.

Categories : Javascript

Get Line Highlighting (or at Least a Stack Trace) for noSuchMethod Exception Dart
In Tools > Preferences > Run and Debug you can change the policy for Breaking on exceptions. By selecting all the editor will break on every exceptions and you will be able to see stacktraces in the debugger panel.

Categories : Dart

SqlBulkCopy exception, find the colid
I hope this helps solve someone else's issues as well. The error was because one of the string/varchar fields in the datatable had a semicolon ";" in it's value. Apparently you need to manually escape these before doing the insert! I did a loop through all rows/columns and did: string.Replace(";", "CHAR(59)"); After that, everything inserted smoothly.

Categories : SQL



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