w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I get the Live wallpaper selection activity to open as soon as my wallpaper services installs
This is not possible with the Android API. Even if you find a way or a hack to achieve this, I am pretty sute this will get fixed ASAP by Google or manufacturers There is the ACTION_PACKAGE_ADDED Broadcast Intent, but the application being installed doesn't receive this.

Categories : Android

Detecting Click on "Set wallpaper" button in Live Wallpaper Picker
You can check if the wallpaper is running as a preview with isPreview() inside WallpaperService.Engine and change the options.

Categories : Android

add google voice search to unity ubuntu 13.04
I managed to figure this out almost imediately, I feel silly! in the bash script I put xdotool keydown ctrl+shift+period sleep 3 xdotool keyup ctrl+shift+period Thats my first useful bit of bash, I feel proud of myself and I managed to figure it out all by myself!! ;-) love it when a plan comes together!

Categories : Bash

Tkinter method deiconify seems not working on ubuntu(12.04, unity)
What you are seeing is apparently the difference between Windows and non-Windows. It looks to me like the Windows behavior is a bug. At the very least, it's not expected behavior. What you are seeing on ubuntu is what I would expect to see. For a GUI to do anything, the event loop must be running. Everything that happens is the response to an event. The drawing of a window on the screen is a response to an event. A button click is a response to an event. The visual effect of a button being pressed is a response to an event. And so on. When you call iconify, that causes an event to be sent to the app saying "remove the window from the screen". The event loop sees the event, and redraws (or "un"draws) the window. The reverse happens when you call deiconify -- the system gets a redraw event

Categories : Python

Enable wildcard subdomain for localhost on Ubuntu 12.04
This can be done without installing the full dnsmasq package. Create/modify the file /etc/NetworkManager/dnsmasq.d/dnsmasq.conf with the line: address=/mydomain.dev/127.0.0.1 (replace mydomain.dev with whatever you need) and then restart network manager. This may or may not work on versions other than 12.04

Categories : Ubuntu

How do I enable the middle mouse button for Pharo on Ubuntu?
Have you tried using a Squeak image with your VM? There, middle/right mouse buttons are mapped to halo/context menu. If it works in Squeak, then the problem is with the Pharo image. If it does not work in Squeak either, the problem is with the VM. You can get a current Squeak release here: http://ftp.squeak.org/4.4/Squeak4.4-12327.zip plus http://ftp.squeak.org/4.4/SqueakV41.sources.zip

Categories : Misc

Live Wallpaper "set wallpaper" not working
Post more of your logcat. Also for a Live Wallpaper, you need to have a service defined in your Android Manifest,which contains an Intent Filter. Ex :- <service android:name="packagename.LiveWallpaper" //LiveWallpaper is the class name android:label="@string/app_name" android:icon="@drawable/icon" android:permission="android.permission.BIND_WALLPAPER"> <intent-filter> <action android:name="android.service.wallpaper.WallpaperService" /> </intent-filter> <meta-data android:name="android.service.wallpaper" android:resource="@xml/livewallpaper" /> </service>

Categories : Android

Auto enable Wi-fi Location in Android 4.2.x
But Can I do it with Pragmatically to directly Enable without prompt any dialog? Fortunately, no, for obvious privacy and security reasons. Below link is work with GPS Satelitte option Fortunately, most Android devices are not affected by this security flaw.

Categories : Android

Re-enable Rails 4 auto-EXPLAIN
Here is the commit that removed auto_explain. Looks like the reasoning is that it was rarely used and slightly problematic w/ the asset pipeline. As the commit notes you can still use ActiveRecord::Relation#explain to generate explain queries, but if you want to have it automatically called you will have to implement that yourself. Looking over the removed code in this commit should help you get on the right path.

Categories : Ruby

Using Ubuntu Squid as a relay with auto-configuration
Ended up doing something much more "simpler". Downloaded the PAC file to local disk than used file:///{drive}:/{folder}/{pacfile} as an automatic configuration script location. Proceeded with adding blocked domain to direct access hosts.

Categories : Ubuntu

Enable Entity Framework Auto Migration for sub project
You should enable migrations for domain project. In Package Manager Console window, you can select project from drop down list. Select your domain project then type "enable-migrations" and hit enter

Categories : C#

Ubuntu 12.04.2 server auto enter root shell in recovery mode
After further study, I thought I had figured it out. Two changes are needed: (1) update the grub.cfg to customize recovery mode - open /boot/grub/grub.cfg - revise the menuentry "linux ...... ro recovery nomodest ...... " to "linux ...... ro single ...... " (2) There is known issue of GRUB in the 12.04 64bits, where the change of timeout is not converged into final grub.cfg (/etc/grub). You have to revise "set timout=-1" to "set timeout=0" in the auto generated grub.cfg or do below, §/etc/grub.d/00_header –In the make_timeout() function: replace the if/else/if block with "set timeout=${2}“ before executing update-grub. Actually, you should do step (2) first and then step (1)

Categories : Linux

SELECT STATEMENT that exclude duplicate row that has different ID (Auto-increment) in SQL Server
If you want to select the lowest pk for every duplicate entry then you can use min() select min(pk), col1, col2 from your_table group by col1, col2

Categories : Dotnet

Auto-change the physics of an object after a change of his size
You have changed scale 0.5 smaller, means you have to change all physics objects smaller by 0.5, use calculator to make your normal numbers / 2 and for numbers less than 0 / 2 them and sum your number with result number, here is an example: 24 = 12 -24 = -36

Categories : Lua

how to change gcc compiler to c++11 on ubuntu
gcc 4.6.3 supports many c++11 features. However, they are disabled by default. To enable them, use the following flag: g++ -std=c++0x ... This flag also disables GNU extensions; to keep them enabled, use -std=gnu++0x flag.

Categories : C++

Enable Textbox on SelectedIndex change
You need to have members in your class that hold references to your DropDownList and other controls that you want to enable/disable. public class YourClass { private DropDownList ddl; private TestBox txa; private void createControls { // ... TextBox txa = new TextBox(); txa.ID = "amtData" + rowcount.ToString(); // ... DropDownList ddl = new DropDownList(); ddl.Items.Add("No Change"); // ... etc. } void ddl_SelectedIndexChanged(object sender, EventArgs e) { if (ddl.SelectedIndex == 1) txa.Enabled = true; } }

Categories : C#

change background color in zsh (ubuntu 12.04)
Changing the background color should dependent on your terminal emulator. This answers some questions using setterm: Change the background color in Gnome terminal through a command? Another link for xterm: xterm: how to change the background color?

Categories : Shell

Change .emacs directory in Ubuntu
This works for OSX, so perhaps for you too . . . just change the paths to whatever suits your needs. The user-emacs-directory is where you would set the equivalent of .emacs.d. I have everything related to Emacs in my user-emacs-directory. If you use package manager, the elpa directory would be automatically crated there also. (setq default-directory "~/.0.data/") (setq user-emacs-directory "~/.0.data/.0.emacs/") (setq diary-file "~/emacs/diary")

Categories : Emacs

Facebook Unity SDK has error when send request with custom friends in Unity Webplayer
One of the Facebook software engineers here. Are you passing in null to the data or title param for FB.AppRequest()? There's a bug where it doesn't handle that correctly currently. Either exclude that or pass in an empty string. We'll get that fix ASAP. Thanks for finding that. Update: The latest SDK version has that fix.

Categories : Facebook

Is it practical to start a Unity game from an Android app and revert back from Unity to the app?
You should be able to have two activities in your app, one using your java code and another with the Unity game. Android is already pretty good at switching between activities. Check out this: http://developer.android.com/training/basics/firstapp/starting-activity.html You'll probably need to add your Java project as a plugin in Unity and override the AndroidManifest.xml in the Unity project to load the Java activity. Check out this documentation on extending android projects in Unity: http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html

Categories : Android

Unity Register For One Interface Multiple Object and Tell Unity Where to Inject them
In the example below you have an interface implemented twice and injected on demand into two different client classes, just as you request. The trick is to use named registrations. class Program { static void Main(string[] args) { IUnityContainer container = new UnityContainer(); container.RegisterType<IFoo, Foo1>("Foo1"); container.RegisterType<IFoo, Foo2>("Foo2"); container.RegisterType<Client1>(new InjectionConstructor(new ResolvedParameter<IFoo>("Foo1"))); container.RegisterType<Client2>(new InjectionConstructor(new ResolvedParameter<IFoo>("Foo2"))); Client1 client1 = container.Resolve<Client1>(); Client2 client2 = container.Resolve<Client2>(); } } public interface IF

Categories : C#

Xcode cannot parse exported project from Unity 4 after being upgraded from unity 3
Some Unity packages install editor scripts that modify the XCode project after it's generated. These scripts can cause the symptom described, if they have a bug, or if they subtly interfere with each other. Search your project for OnPostprocessBuild calls, try disabling them one-by-one, generate a fresh XCode project each time, and see if it starts opening with XCode. If it does start working, diff the working and non-working versions of Unity-iPhone/project.pbxproj, and see if you can figure out why.

Categories : IOS

Unity iOs - screen gets black when changing rotation while Unity is paused
Not sure if you have fixed this, Its been a while... But the reason that your UnityViewController is not functioning properly is because a view controller that is not visible will not receive rotation events. Because you are setting your view controller as the root view controller, the UnityDefaultViewController defined in "iPhone_View.mm" is not receiving rotation events. I have been studying Unity's rotation for a while now as I have my own issue with a similar setup. There are a few things that you might be able to try: In iPhone_View.mm there is a function that is defined called: UpdateOrientationFromController(UIViewController* controller) that might be able to solve your problem. You would want to call this function on the view controller that you designed yourself where you plac

Categories : IOS

Unity.AutoRegistration ?? Convention Based Registration Unity
It appears that what you are looking for is this: container.ConfigureAutoRegistration() .LoadAssemblyFrom(typeof(ITest).Assembly.Location) .LoadAssemblyFrom(typeof(Test).Assembly.Location) .Include(If.ImplementsITypeName, Then.Register()) .ApplyAutoRegistration(); This will tell Unity.AutoRegistration to register all types where there is an interface with the same name, prefixed with I.

Categories : C#

Change bootstrap button class from disabled to enable using knockout.js
The string.length is a property and not a function. So you have an extra set of () in your enablebtn. The correct version should look like this: this.enablebtn = ko.computed(function(){ return this.hotelName().length > 0 ? "enabled":"disabled"; }, this);

Categories : Javascript

Is it possible to enable relationship fixup when change tracking is disabled but proxies are generated
i arent sure how this has anything to do with tracking, however to get the relationship working you need to associate the collection navigation property with the key it is using. See here for an example.

Categories : Dotnet

Enable/Disable in footer of based on change of
Try put your table into form. Also you can make it more convient: <p:commandButton id="submit" ... disabled="#{userPreferencesBean.selectedStudents==null}"/>

Categories : JSF

ON DUPLICATE KEY UPDATE... how to update an AUTO INCREMENT?
It would seem like you're looking for REPLACE instead of INSERT ... ON DUPLICATE KEY; it will remove the old row if one exists with a conflicting primary key or unique key, and insert a new one with a new FEED_ID; REPLACE INTO feeds (p_id,p_name) VALUES (1,'Olle'); An SQLfiddle to test with.

Categories : Mysql

Auto change JSlide
is this jsFiddle answer to your questions? For the auto-slide option, i change your script to play: { active: true, auto: true, interval: 4000, swap: true, pauseOnHover: true, restartDelay: 2500, effect:"fade" } For the pagination the developers allow you to disable it with this option, pagination: { active: false } You can find a lot of informations for this script on SlideJS website i hope this will help you.

Categories : Jquery

Python pandas change duplicate timestamp to unique
Assuming - as you have shown in your example that they are sequential: lasttimestamp = None for ts = readtimestamp(infile): # I will leave this to you if ts == lasttimestamp: ts += inc_by # and this lasttimestamp = ts writetimestamp(outfile, ts) # and this to

Categories : Python

How to avoid duplicate code where only id values change in JavaScript?
To avoid duplication of code, you need to introduce a function for the common behavior, with parameters for the variable parts. Starting from the first part of your example: $(document).ready(function(){ $("#play-bt1").click(function(){ $("#audio-player1")[0].play(); $("#message").text("Music started"); }) $("#pause-bt1").click(function(){ $("#audio-player1")[0].pause(); $("#message").text("Music paused"); }) $("#stop-bt1").click(function(){ $("#audio-player1")[0].pause(); $("#audio-player1")[0].currentTime = 0; $("#message").text("Music Stopped"); }) }) We can wrap this building block in a function. The first step is to find a good name for this function. Since the function initializes a player when the

Categories : Javascript

JAX-RS change the auto generated json
I believe what you want is a MessageBodyWriter<T> - https://jsr311.java.net/nonav/javadoc/javax/ws/rs/ext/MessageBodyWriter.html

Categories : Java

auto change the background image of the div
$('.top-page-content').css("background", "url("+bgArr[i++]+")"); change line like this $('.top-page-content').css("background", "url('"+bgArr[i++]+"')");

Categories : Javascript

ckeditor auto content change
CKEditor modifies your HTML because it is incorrect. You cannot put block elements inside of <a> unless you use HTML5 which isn't supported by CKEditor yet. See my answer for related question. Also take a look at this one regarding blocks in <a>.

Categories : PHP

php set a cookie and change its value with auto actualisation
$timestamp_expiration = time()+30*24*3600 ; if(!isset($_COOKIE['lang_ylx'])) { //If you want your default to be english, use this: setcookie('lang_ylx', 'en', $timestamp_expiration, null, null, false, true); //French: setcookie('lang_ylx', 'fr',$timestamp_expiration, null, null, false, true); } /*if(!isset($_GET['lang'])) { setcookie('lang_ylx', 'fr',$timestamp_expiration, null, null, false, true); }*/ //Comment out above because you're setting french every time llang isn't set. if (isset($_GET['lang']){ else if ($_GET['lang']=='fr') { // si la langue est 'fr' par le bouton de langue, on définit le cookie francais setcookie("lang_ylx", "", time()-3600); setcookie('lang_ylx', 'fr',$timestamp_expiration, null, null, false,

Categories : PHP

Resolving Unity Dependencies without a Unity.MVC
You're doing it in the right way. With DI you can remove dependencies from your application. So that you can get a "Repository agnostic" application. And you have effectively done it. At least on the projects that 'declare' the dependencies. However, when the application has to run, you need to specify the concrete objects which will be used for the "declared" abstract dependencies (interface, abstract class) is required. You do this by registering the types which object will be used for each abstract dependency. In you sample, when a IUnitOfWork or a DbContext, an instance of MyDbContext is provided. So the projects that 'declare' the dependencies are completely independent of a particular implementation. However, when you register the dependent types, you're loosing that independen

Categories : C#

How can I change the font for my auto-email's text?
You appear to be sending the mail as a plain-text email, not as an HTML mail (which you need if you want to use text formatting). See this tutorial. The most important difference is that you need to specify text/html as the mail's MIME type message.setContent("Some text <b>bold part</b> ... continue", "text/html"); Some mail clients also interpret a few plain-text commands such as "Some text *bold part* ... continue", but I wouldn't rely on that.

Categories : Java

Change the auto-complete behaviour of a textbox
I assume you're asking about a winforms textbox, as I dont think the WPF textbox supports autocomplete at all. The base TextBox class will not support doing what you want, so you could in theory attempt to override all of the functionality in the TextBox class to do what you want, but the better idea would be to create a new custom control that inherits from TextBoxBase and implement the autocomplete behavior the way you want it.

Categories : C#

How can I get a WPF TextBox to auto resize after a style change?
I'm only guessing that you're setting TextBox.Width somthing like <TextBox Width="150" .../> if that is the case then, according to Dependency Property Setting Precedence List Style won't override your fixed value. Try setting initial Width like this: <TextBox> <TextBox.Style> <Style TargetType="{x:Type TextBox}"> <Setter Property="Width" Value="150" /> </Style> </TextBox.Style> </TextBox>

Categories : C#

change auto filter operator in xtragrid
Yes, it is possible. Just set the OptionsColumnFilter.AutoFilterCondition property to Containsfor the specific column.

Categories : Vb.Net



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