w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android Emulator not loading when Google API (API Level 17 or in any other API level) is selected on windows
Google Api's doesn't support Intel HAXM. Try Genymotion and download a VM with gapps e.g. Nexus 7 Jelly Bean with Google Apps

Categories : Performance

Suppress warning on solution level. Treat warning as error on solution level
A solution is just a (pretty dumb) container for projects. If you open it in a text editor you'll quickly see you can't extend it, only add projects/items. What you want is one or more common msbuild files specifying all needed options for compiler/linker/whatever tools you use, and Import it in every single project. We've been using this for years and it's very convenient (though part of the convenience is probably we also wrote a small tool to generate project files to automatically import the global properties so we don't have to mess with them manually) Alternatively you could add a machine wide file, look in $(MSBuildToolsPath)Microsoft.CSharp.targets to see where to place those files. I'm not going to copy/paste the content here, but the very first lines basically check if there ar

Categories : C#

How to suppress stylecop on a namespace level?
According to http://blogs.msdn.com/b/sourceanalysis/archive/2009/08/10/rule-suppressions.aspx you cannot use global suppressions. You have to attach each suppression to a code element. StyleCop only checks source code not IL code. If StyleCop checks the code of the third party plugin, then maybe you have attached the project of the third party plugin to your solution rather than a reference to its compiled assembly. You have three options: Add a reference to the compiled assembly of the third party library in your project. This way the StyleCop rules won't be checked against the third party library. Suppress the rules at each code element if the third party plugin is added as a project to your solution. That means you will change the source code of the third party library. Disable all

Categories : C#

This browser is not supported by Shopify While Authenticating Using Web Browser Control In Windows
Your question does not describe at all what you are trying to do and what problem you are trying to solve in doing so, so my only suggestion is: Don't use a Web Browser control, but use an HTTP client like HttpClient or HttpWebRequest and access their API. There's even have a .NET library for that.

Categories : C#

PHP - sorting a 3 level multidimensional array - sort base on 3rd level value but sort it in first level
This should work for sorting from low count to high count. Switch the last negative on the last statement if you want it the other way around. usort($array, function ($x, $y) { // Set highest count to 0 for both arrays $highestCountForX = 0; $highestCountForY = 0; // Loop through first array to check foreach ($x as $secondLevelX) { if ($secondLevelX['count'] > $highestCountForX) { $highestCountForX = $secondLevelX['count']; } } // Loop through second array to check foreach ($y as $secondLevelY) { if ($secondLevelY['count'] > $highestCountForY) { $highestCountForY = $secondLevelY['count']; } } if ($highestCountForX === $highestCountForY) { return 0; } return ($highestC

Categories : PHP

Differentiating between browser tabs and browser windows in C#
Your goal, if I understand correctly, is to identify if a page you've loaded/launched is tabbed or if it launched in a new browser window. It's agreed that a tabbed browser window is indistinguishable from a standalone browser window. I’ve got a solution for you – admittedly it’s not terribly elegant but it should do the trick. Imporant: You can switch between tabbed windows using Ctrl+Tab and Ctrl+Shift+Tab. Launch the page in question Start your coded-ui recording If your page is tabbed, press Ctrl+Shift+Tab and this will take you to the parent page, or whichever other page you’re tabbed with. Create an assertion to verify that you’re on that page. Press Ctrl+Tab, and now you should be back on the new page you're testing. Create an assertion to verify that you’re on that n

Categories : C#

ASP.NET Menu Control: 1st level static, second level dynamic, third level static
Kettic Menu Controls for Windows Forms can fully customize item appearance, text, orientation, image, checkbox, and any other controls at design time.

Categories : C#

Browser Javascript security warnings and errors
This doesn't effect the functionality of page. You are seeing this error because your main page is from https:// and iframe you are loading in that page is from http://, That is the only reason. Try using relative protocol e.g.; <iframe src="//example.com"/> and try to correct this warning. It is ok to have this error but this error should be solved because this may impact user experience in few circumstances depending your page code approach.

Categories : HTML

How to suppress browser backdoor for form validation by changing element attribute
I dont think that there is. However, it is already expected that you'll have your more robust "protection" or validation in your server side codes, and that's what you'll need the most against advanced users; those who do hacks/tricks with developer tools as what youre doing..

Categories : HTML

.gitignore NuGet packages folder at any level but include .targets file at any level
There is no 'good' way to do it (see manpage as a proof), however there is a hack around it. Main issue with ignoring packages/ of the bat is that git does not even check it's subdirectories due to directory being ignored. Solution here - you will have to have 2 gitignore files. One regular, and one inside the packages directory that looks like this: # ignore all files * # do not ignore directories !*/ # do not ignore targets !*.targets # do not ignore gitignore !*.gitignore New example: $ mkdir foo $ cd foo/ $ mkdir foo $ mkdir foo/bar $ mkdir foo/bar/baz $ touch foo/.foo $ touch foo/bar/.foo $ touch foo/bar/baz/.foo $ touch regular.txt $ touch foo/ignored.txt $ touch foo/bar/baz/ignored-2.txt $ cat foo/.gitignore * !*/ !*.foo !regular.txt !.gitignore $ git add . && git stat

Categories : Windows

Python logging: propagate messages of level below current logger level
There is a method in the logger class called "propagate" that seems to do what you ask: http://docs.python.org/2/library/logging.html#logger-objects

Categories : Python

Should exceptions be checked at lower level if higher level takes care of them
I'm not sure that I'd be happy with this approach, what if checkAccessControl is called from many places? You have to rely on each caller doing the null check - it's not a safe way to proceed. I'd be putting the null check in to the checkAccessControl method, probably throwing IllegalArgumentException if a null was detected. So, my broad approach would be, if your method relies on specific values being presented to it ( eg a parameter can't be null ), I would make it the responsibility of the method to validate it. You can of course still ask the caller to validate the argument for you ( via javadocs for example ), but you can't enforce it.

Categories : Java

How can i resolve the css warnings for browser specific selectors in Bootstrap 3?
The most important thing to note is that Chrome is telling you that it thinks those CSS selectors are invalid. That does not, however, mean they're inherently and/or universally invalid or that you've erred in some way. Two foundational coding points: Browsers (usually) ignore most things they don't understand and that generally goes for CSS as well. While browsers try to adhere to the core specifications, when it comes to CSS they're notorious for having their own CSS attributes for certain things, especially when supporting legacy browsers. So, with those two things in mind, CSS writers who have a large, varied browser base to support (e.g., Twitter Bootstrap) will throw in all the CSS selectors and such for all browsers they intend to support, knowing that IE will ignore sel

Categories : CSS

How to get the top level parent term related to the current archive page?
I think I figured it out. I ended up with the following: $term_id = get_queried_object()->term_id; //Get ID of current term $ancestors = get_ancestors( $term_id, 'product_category' ); // Get a list of ancestors $ancestors = array_reverse($ancestors); //Reverse the array to put the top level ancestor first $ancestors[0] ? $top_term_id = $ancestors[0] : $top_term_id = $term_id; //Check if there is an ancestor, else use id of current term $term = get_term( $top_term_id, 'product_category' ); //Get the term echo $term->name; // Echo name of top level ancestor Perhaps there is a better way to do this, but this seems to work fine.

Categories : Wordpress

Naudio - Count the times audio level rises above a level
Firstly, you should be dealing with audio in decibels. This post here includes a c# sharp example on how to calculate your audio buffer as an RMS value in decibels: Calculate decibels in c# Secondly, split your methods so that their names are meaningful thus easier to read and manage. You have named your method ProcessData and it returns a bool but the comment on the method is: calculate the sound level based on the AudioThresh. I suggest you split it up for example: private float calculateDBinRMS(buffer){ // This method calculates and returns the RMS value of the buffer in DB } private bool hasReachedThreshold(buffer, AudioThres) { if(calculateDBinRMS(buffer) >= AudioThres) return true; return false; } I'm not sure where your AudioThres is coming from in the first place but

Categories : C#

HTTPS iframe in HTTP page, browser false warnings
Same Origin Policy as specified in RFC 6454 Subsection 3.2 covers the protocol, host, and domain. Iow: Sorry, it's as designed.

Categories : Facebook

Very strange 'stack level too deep' problems on 'bootstrap' related gems
Well, here is a crazy idea. Probably, you have non-deterministic load order of files in your project. Here is an example: # file2.rb def f; puts "In #{__FILE__}"; end # file1.rb def f; puts "In #{__FILE__}"; end # test.rb Dir.glob('file*.rb').each { |x| require x } f Possible output: machine1> ruby test.rb In file1.rb # copy *.rb to a different machine machine2> ruby test.rb In file2.rb See also this (not directly related) answer: Does Dir.glob guarantee the order?

Categories : Ruby On Rails

@Path configuration at class level and method level
A request to /v2/ie/box is mapped to Class2 because is has @Path("/v2/ie") as a class annotation. The longest Path wins in this case. Class1 is never looked at since it has the shorter class annotation @Path("/v2"). Since Class2 has no method that maps to the remaining /box, you will get a 404 Not Found. Recommendation Use @Path annotations only on the methods: @Path("/v2/ie/bag") and @Path("/v2/ie/box") OR use one resource class with a class annotation of @Path("/v2/ie") and method annotations of @Path("/bag") and @Path("/box"). Edit See also section "3.7 Matching Requests to Resource Methods" of the JAX-RS 2.0 spec.

Categories : Web Services

CSS two level menu - second level doesn't appear in proper position
Demo: http://jsbin.com/ewolik/1/edit Simple dropdown Menu: http://jsbin.com/ewolik/2/edit Position the first level of Li elements relative: #navbar li { list-style: none; float: left; position:relative; } Position the second level ul with absolutely with an top offset equal to the first level lis height: #navbar li:hover ul, #navbar li.hover ul { display: block; position: absolute; margin: 0; padding: 0; top:1.8em; }

Categories : CSS

Get top level entity based on lower level criteria being met
It sounds like you want something like this, to look up the business areas for a single user: var results = WFE.BusinessAreas .Where(ba => ba.Processes .Any(p => p.WorkerProcesses .Any(wp => wp.UserId == "pmarshall"))); Or in query syntax: var results = from ba in WFE.BusinessAreas where ba.Processes.Any(p => p.WorkerProcesses.Any(wp => wp.UserId == "pmarshall")) select ba; Or alternatively: var results = from ba in WFE.BusinessAreas from p in ba.Processes from wp in p.WorkerProcesses where wp.UserId == "pmarshall" select ba; If you'd like to find all areas for all users, you'd want to do something like this: var results = (from ba in WFE.BusinessAreas from p in ba.Processes from wp in p.WorkerPr

Categories : C#

keeping 2nd level navigation on first level li:hover visible
You can't do that with only CSS. The :hover pseudo classes is triggered when you hover the element. So when leaving the element stops the hover effect. You could use JQuery to show the submenu. [EDIT] A Jquery solution would be this: HTML <ul class="ebene1"> <li><a href="">NAV1</a> <ul class="ebene2"> <li><a href="">Nav1.1</a></li> <li><a href="">Nav1.2</a></li> </ul> </li> <li><a href="">NAV2</a></li> <li><a href="">NAV3</a> <ul class="ebene2"> <li><a href="">Nav3.1</a></li> <li><a href="">Nav3.2</a></li> <

Categories : CSS

Android: How to receive the intent when download a file completely by browser?
The solutions you are trying , I don't think so its possible. The Possible solutions you should try is use File Observer , Which basically does : Monitors files (using inotify) to fire an event after files are accessed or changed by by any process on the device (including this one). FileObserver is an abstract class; subclasses must implement the event handler onEvent(int, String). Each FileObserver instance monitors a single file or directory. If a directory is monitored, events will be triggered for all files and subdirectories inside the monitored directory. An event mask is used to specify which changes or actions to report. Event type constants are used to describe the possible changes in the event mask as well as what actually happened in event callbacks. You should download the

Categories : Android

Pass window.open object from 1 browser to another when these 2 are completely independent
Yes you can. Let's say your page A opens windows B and C like this: var b = window.open("childB.html", "_blank"); var c = window.open("childC.html", "_blank"); Then your window b which is page childB.html opens windowd d var d = window.open("childD.html", "_blank") In the javascript code of childD.html you can place code: var propC = opener.opener.c.propertyOfC; opener.opener will reference original window A, which can reference .c and all its objects You will have to add checks for window/property existence (most likely try/catch will be in order)

Categories : Javascript

Android: If an element is deprecated at a certain API level, is it only for that API level and above?
From the Docs Annotation type used to mark program elements that should no longer be used by programmers. Compilers produce a warning if a deprecated program element is used. I would suggest trying not to use them at all when possible. When you do I would take into consideration that this object, method, etc...may not work at some point in the future. When you build an app you typically want to build it so it can be easily maintained and flexible in the future. For this reason, I wouldn't use them if not necessary and there is almost always another way to do something

Categories : Android

How to decide the level of multiple level paging
There's not enough information to decide that. You could theoretically have one single level table with 2^36 entries. You could also have a 36-level setup with each table only containing 2 entries. Current designs typically use between 2-4 levels...

Categories : Misc

Sort array top level by next level value - Ruby
Obviously We should use Enumerable#sort_by here. a = [ { "id"=>1, "popularity"=>7.77030797174916, "title"=>"Another film", }, { "id"=>2, "popularity"=>2.7703074916, "title"=>"A film", }, { "id"=>3, "popularity"=>9.77030797174916, "title"=>"A third film", } ] a.sort_by{|h| h["popularity"]} # => [{"id"=>2, "popularity"=>2.7703074916, "title"=>"A film"}, # {"id"=>1, "popularity"=>7.77030797174916, "title"=>"Another film"}, # {"id"=>3, "popularity"=>9.77030797174916, "title"=>"A third film"}] Or I could also use Enumerable#sort : a = [ { "id"=>1, "popularity"=>7.77030797174916, "title"=>"Another film", }, { "id"=>2, "pop

Categories : Ruby

3 level CSS3-only menu not opening 3rd level
Your markups are messed up. Start with a valid html coding : <a href="#weeknights">Weeknight Programming</a> <ul class="wn-menu"> <li><a href="#monday">Monday</a></li> /* this next block is not well nested */ <ul class="three-line"> <li><a href="#">The Anthony Duva Show</a></li> <li><a href="#">The Adult Entertainment Show</a></li> <li><a href="#">GeekBeat Radio</a></li> </ul> <li><a href="#tuesday">Tuesday</ etc.etc etc. Revise your code to correctly nest ul > li ( ul > li > div, ul > li > ul > li ) and make sure your tags are closed properly. Then, may

Categories : HTML

Queries related to browser cache
There are two main storage method in modern browsers, localStorage and sessionStorage, in your case I assume you are using localStorage. For localStorage: the data stored will be persistent as long as the user not clearing the data or you remove them using localStorage.removeItem() the maximum size of localStorage varies from browsers, basically there is at least 2.5MB. details in this post localStorage works just like cookies, so you don't want to store any sensitive stuff, SSL between clicent and server is recommended IE 8 and above, Chrome 4, Firefox 3.5, Opera 10.5 and Safari 4 have already implemented this API Details about localStorage in this link

Categories : Javascript

Query (2, 2) By default, a year level was expected. No such level was found in the cube.ytd Function In MDX Query Not Work
From the documentation : The Ytd function is a shortcut function for the PeriodsToDate [...] .Note that this function will not work when the Type property is set to FiscalYears. How about using the following instead : Select PeriodsToDate( [Date].[Fiscal].[Fiscal Year], [Date].[Fiscal].[Fiscal Quarter].[Q3 FY 2003] ) on columns From [Adventure Works]

Categories : Sql Server

two level menu - second level doesn't appear
The selector you are using is looking for ul.side_sub_nav as a direct sibling to .side_nav li:hover. However, your markup has your .side_sub_nav as a sibling, so the styling you specified will not be applied. What I believe you're looking for is the direct sibling selector. Instead of using >, use + instead.

Categories : HTML

styling two level menu (second level)
Add left:0; width:100%; to your .sub-menu rules. .sub-menu { display: none; margin: 0; padding: 0; position: absolute; z-index: 1; background-color: #061361; height: 26px; line-height: 26px; left:0; width:100%; } jsFiddle example

Categories : HTML

Browser issues related to cookie reading from javascript
I don't think this part looks correct: // Store the cookie Cookie.prototype.store = function () { var cookieval = ""; for(var prop in this) { // ... cookieval += prop + ':' + escape(this[prop]); }; // ... }; Basically, this loops through every global Javascript variable (which has nothing to do with cookies) and adds them to the cookie value. Is that really what you want? Look at the output when I run the following in Chrome: That's going to be a gigantic cookie. All of that aside, the error that your seeing looks like a problem with the Same Origin policy. You can't reference Javascript from a domain outside of your page's domain unless the external domain has a special setup. Google has a few servers with that special setup, so if you don't want

Categories : Javascript

jquery menu ui. Auto expand 3rd level submenu when 2nd level submenu is expanded
Yes, focus and expand is what you need. You don't need .show(). I am not sure whether your mouseover will not conflict with the normal menu events handling. For the beginning, to get at least something simple working, a code like below could automatically expand the submenus after menu creation (to simplify the selectors maybe you could add ids to your menu items, I have doubts whether your selectors select what intended): $("#main-nav").menu() .menu("focus",null,$("#main-nav > li.first")) .menu("expand") .menu("focus",null,$("#main-nav > li.first > ul > li.first")) .menu("expand"); In the current jquery-ui-1.10.3 + jquery-2.0.3 this code actually fails with some null element access... It is a bug in jquery. I can't find the bug ticket now but I saw that it was already res

Categories : Javascript

Windows Phone - get zoom level from distance
If I understated you correctly, you can achieve the goal by using the following code var start = ...; var finish = ...; // Calculate center var center = new GeoCoordinate((start.Latitude + finish.Latitude) / 2, (start.Longitude + finish.Longitude) / 2); var width = Math.Abs(start.Longitude - finish.Longitude); var height = Math.Abs(start.Latitude - finish.Latitude); Map.SetView(new LocationRectangle(center, width, height));

Categories : C#

Change emulator battery level in Windows
Windows supports telnet from the command prompt, at least on XP and Vista. If you do not find this program on other Windows versions, you can perhaps install PuTTY. Then, you telnet into the emulator the same way that you would on any other development OS: telnet localhost 5554 where 5554 is the port number given in the title bar of your emulator window. From there, it's how the rest of the instructions that you have read describe it. For example, to set the power to 70%, execute the power capacity 70 command in the telnet session. There are other power subcommands outlined in the documentation.

Categories : Android

Change SYSTEM volume level in windows
Here is the easiest and well known method using P/Invoke calls: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace VolumeControl { public partial class Form1 : Form { [DllImport("winmm.dll")] public static extern int waveOutGetVolume(IntPtr hwo, out uint dwVolume); [DllImport("winmm.dll")] public static extern int waveOutSetVolume(IntPtr hwo, uint dwVolume); public Form1() { InitializeComponent(); // By the default set the volume to 0 uint CurrVol = 0; // At this point, CurrVol gets assigned the

Categories : C#

Is it impossible to have both transport level security and message level security in rampart? Why?
I too agree to the point that the specification doesn't say if we can use more than one binding or not (but may be we both have missed it). But you can still use Asymmetric binding for an HTTPS endpoint.

Categories : Java

Can I disable or suppress Vim W11 Warnings?
When editing this file, set the autoread setting, so Vim will automatically reread it: :setl autoread This can possibly be set via a modeline. Another alternative is to set the buftype option for this file. But I am not sure, what other consequences this have, so I suspect this might have some side effects. See :h 'buftype' For the possible values and their implications of the buftype option.

Categories : Vim

Does each Windows Store application have its own network level/layer that can be accessed?
WebView in 8.1 has mechanism to intercept resource requests and replace them with your own. See http://channel9.msdn.com/Events/Build/2013/3-179 around 42 minutes. Basically you will have to create your own implementation of IUriToStreamResolver.UriToStreamAsync that uses HttpClient to get all of your data through proxy.

Categories : Dotnet

How to suppress warnings in third-party source files?
You may want to use -isystem instead of -Idir third party headers. See GCC manual. If you're ok to edit third party source files, you can use #pragma GCC diagnostic ignored "-Wwarning-to-disable" see GCC manual.

Categories : C++



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