w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Duplicate a pop window display on dual monitors
My guess is the only way to do it is to use JavaScript to generate two popups and then use CSS to push the popups to the correct locations. The problem I would think you are going to run into is knowing whether or not you have two displays to manage or not.

Categories : Javascript

Eclipse Juno- Suddenly “cannot run program 'make' : unknow reason”
Apparently this error is due to low memory conditions. It mostly occurs after searching in files within Eclipse (a search that returns a large result set). If the error occurs again: Re-start Eclipse and try again If it does not fix the problem, you need to completely reboot the OS

Categories : Eclipse

Broken user, broken Data.Binary or broken installation?
The Problem Let's review what you think you're doing and what you are doing. You think you are using binary to encode a list of Ints and write that bytestring into a file. Then, you read from the file and decode a list of Ints only to have it fail. What you are actually doing is encoding a list of Ints as a bytestring then encoding that bytestring as a bytestring (so, an extra length field is prepended to the bytes) and writing that bytestring to disk. Your decode then fails because you have on disk encode(encode(list)) instead of encode(list). The solution Just change the line reading: encodeFile worldfile $ encode world to encodeFile worldfile world Reading Hexdump 00000000 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 03 |....... ........| 00000010 00 00 00 00 00 00 00

Categories : Haskell

Draw DirectX/OpenGL Graphics on an existing graphics application
Your approach in injecting an DLL is indeed the right way to go. Programs like FRAPS use the same approach. I can't tell you about the method for Direct3D, but for OpenGL you'd do about the following things: First you must Hook into the functions wglMakeCurrent, glFinish and wglSwapBuffers of opengl32.dll so that your DLL notices when a OpenGL context is selected for drawing. Pass their calls through to the OS. When wglMakeCurrent is called use the function GetPixelFormat to find out if the window is double buffered or not. Also use the glGet… OpenGL calls to find out which version of OpenGL context you're dealing with. In case you have a legacy OpenGL context you must use different methods for drawing your overlay, than for a modern OpenGL-3 or later core context. In case of a double

Categories : C++

CMD skips a line in batch file for no apparent reason, so what's the reason?
You can read a lot about delayed expansion on this site. An entire IF/FOR construct (or multiple lines within parens) are loaded and expanded as 1 line. So you have to consider LOAD-TIME behavior and RUN-TIME behavior. Try this: @echo off setlocal enabledelayedexpansion set custom=1 if %custom% equ 1 ( set /p customsettings="Some input prompt: " if /i "!customsettings:~0,1!"=="Y" echo Some output )

Categories : Windows

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 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 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.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#

Enumerating monitors on a computer
In case it is relevant in your case, when using Qt 5.x, you can use the QGuiApplication::screens() method (http://qt-project.org/doc/qt-5.1/qtgui/qguiapplication.html#screens) to enumerate all displays. Or if it is not relevant, you can always have a look into their source code, how they enumerate the displays and get all relevant properties (also regarding mirroring, extended desktops, and so on).

Categories : C++

java print screen two monitors
You could try: int width = 0; int height = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); for (GraphicsDevice curGs : gs) { DisplayMode mode = curGs.getDisplayMode(); width += mode.getWidth(); height = mode.getHeight(); } This should calculate the total width of multiple screens. Obviously it only supports horizontally aligned screens in the form above - you'd have to analyse the bounds of the graphics configurations to handle other monitor alignments (depends how bulletproof you want to make it). If your Main Monitor is on the right side and you want to get an image even with the left side, use this: Rectangle screenRect = new Rectangle(-(width / 2), 0, width, height); BufferedImage capture = new Rob

Categories : Java

Draggable attribute and multiple monitors
The .draggable() function in JQuery UI has an option for containment Here's an example of its usage JSFiddle HTML <div id="container"> <div class="child-container"> <div class="draggable" id="d1">I'm stuck inside my parent</div> <div class="draggable" id="d2">I'm stuck inside the outer container</div> </div> <div class="draggable" id="d3">I'm stuck inside the document</div> <div class="draggable" id="d4">I can go anywhere!</div> </div> CSS div { border-width: 2px; border-style: solid; margin: 2px; padding: 2px; background-color: #fff; } #container { margin: 20px; border-color: lime; height: 300px; } .child-container { border-color: red; widt

Categories : Javascript

Make image not wrap on small monitors
Add a div around the image: <div class="pic"> <img src="http://www.new-line.com/catalog/images/nlbanner1.png" /><img src="http://www.new-line.com/catalog/images/nlbanner2.png" /> </div> Then with CSS: .pic { white-space: nowrap; } Like Charles380 mentioned, if you want the scroll functionality, use: .pic { white-space: nowrap; overflow: scroll; } Note that this will also cause the scrollbars to appear, which may not fit with the look you want. jsfiddle

Categories : CSS

How to make X11 window span multiple monitors
In general, an application should not try to rigidly control its window size and position, as WM is supposed to be smart and place the windows in the best possible fashion. If you want control anyway, try using XSizeHints like this: XSizeHints sh; sh.width = sh.min_width = 1700; sh.height = sh.min_height = 930; sh.h = 220; sh.y = 0; sh.flags = PSize | PMinSize | PPosition; XSetWMNormalHints(dpy, win, &sh); XMapWindow(dpy, win); WMs will respect min_width and will not shrink the window smaller than this. If you need a fullscreen window spanning multiple monitors, this is done differently, see here.

Categories : C

Shell Script that monitors a folder for new files
Try this: watcher.sh: #!/bin/bash if [ -z $1 ]; then echo "You need to specify a dir as argument." echo "Usage:" echo "$0 <dir>" exit 1 fi while true; do for a in $(ls -1 $1/* 2>/dev/null); do otherscript $a && rm $a #calls otherscript with the file a as argument and removes it if otherscript returned something non-zero done sleep 2s done Don't forget to make it executable chmod +x ./watcher.sh call it with: ./watcher.sh <dirname>

Categories : Shell

Image background repeats on big display monitors
The obvious answer is to use: #featured-area { /* other CSS unchanged */ background-repeat: no-repeat; } Currently Chrome's Web Inspector tool shows the background-property rules defined as: background: url(/themes/sunrise/img/nav/slider-background-baby.jpg) repeat-x top center; If you replace 'repeat-x with the above no-repeat this would be the shorthand version of the above.

Categories : CSS

CLLocationManager only monitors regions the first time the app is run after install
So lets clean this up a little bit You dont need to call startUpdatingLocation and stopUpdatingLocation when using region monitoring. Those activate the standard location tracking sending messages to the delegate callback locationManager:didUpdateLocations:. Region tracking apps implement these delegate callbacks: – locationManager:didEnterRegion: – locationManager:didExitRegion: Also its very unlikely that location services will become disabled in the course of this method and you should make sure its not possible to get rid of the 'locationManager' from a background thread. Therefore we dont need to check them twice. As you are region monitoring its best to make sure you have region monitoring available with + (BOOL)regionMonitoringAvailable. Also best to check the location perm

Categories : Iphone

When running as a windows service, how do i get the number of active monitors? C++
Services are not allowed to interact with the user desktop for security reason. Therefore they are running in their virtual desktop which has nothing to do with the physical one. You can try the following. In the service list of the service manager. Rightclick your service, go to properties and there to "Log On". There you can change the account the service is using. With the "Local System account" you can check the "Allow service to interact with desktop". I didn't try that my self. But for interacting the service has to get the access to the "real" desktop and therefore the monitor count should be right.

Categories : C++

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#

Table header is unexpextedly shifted in firefox on monitors with big resolution
@Eliran Malka has right, but maybe you can do some workaround, too. In this example the table.border has no border, but you can add a 'bordered' div after it. If you modify the #all element to hide the unnecessary .footer_border parts you get something like this: http://jsfiddle.net/Stocki/mBQS2/2/ Edit: For modern browsers it is possible to use the ::after selector instead of div, so the HTML code stays clean: http://jsfiddle.net/Stocki/mBQS2/4/

Categories : HTML

Dual authentication mode
It is possible technically. The classic Mode doesn't requires much effort and can be implemented more or less easily. However when in integrated mode , some careful work is required to achieve the same. Check one post here which may be of help to you for getting started.

Categories : Asp Net

three.js dual viewports only one displays
Needed the following statement (in the javascript init function) to prevent renderer clearing its buffer after rendering the first viewport:- renderer.autoClear = false

Categories : Javascript

column pk dual varchars or int?
If you add a surrogate autoincrement integer column, you still need a unique index on the JobID, SubJobID columns. This is the natural primary key. It may not add much value except using more disk and memory to store the extra column. Saying that, if the composite (JobID, SubJobID) index is used in child tables as a foreign key, it can make more sense to use one. 10000 rows here could have 10 million child rows: then the varchar overhead matters. However, there is no truth in anything you read that says Thou shalt always have an identity/autoincrement primary key It is an implementation decision for performance depending on the design.

Categories : SQL

Dual divs on the same place
When I click on About me the "slide down div" will slide down and show the about me section. And when I click on contact the contact section will be showed...) How can I make this, and I'm a beginner when it comes to coding and hopefully this can be solved with a simple line of code... Actually, this can be done with a simple line of code! Change your "About me" link to this: <a href="#AboutMe">About Me</a> And, create a div like this: <div id="AboutMe">This is about me!</div> When you click the link, your browser will scroll to the AboutMe div. JsFiddle: http://jsfiddle.net/NmrbP/11/

Categories : Javascript

Function dual to std::move?
If you can manipulate T you could template the constructor. #include <iostream> using namespace std; class B { int x; public: B (int i) : x(i) { } B (B && b) : x(b.x) { cout << "B moved (" << x << ")" << endl; } B (B const & b) : x(b.x) { cout << "B copied (" << x << ")" << endl; } }; class A { B b; public: template<typename TB> A (TB && init_b) : b(std::forward<TB &&>(init_b)) { } }; B foo (void) { B x(3); return x; } int main (void) { A a1(foo()); B b1(4); A a2(b1); return 0; } Prints B moved (3) B copied (4) As far as I understand reference collapsing you should come out with a constructor A(B&) forwarding to the copy constructor of B and a A(B&&a

Categories : C++

Formatting column name in dual table
Try this SELECT 'HELLO WORLD' as HELLOWORLD FROM dual; or SELECT 'HELLO WORLD' as "HELLO WORLD" FROM dual; See SQL Fiddle

Categories : SQL

Highcharts - Dual yAxis not displaying
You've got two problems I can see right off the top: 1.) You haven't assigned any series to plot against the 2nd y axis. yAxis: 1 2.) You have a right margin of -4, which is suppressing the drawing of the right y axis. marginRight: -4, // where's the axis going to draw if it doesn't have space? Updated fiddle.

Categories : Javascript

Best Practice for Dual Layouts in Rails 3
It seems to me an admin might be doing different things with a user than an end user would be doing so different controllers may not be completely unDRY. However, if they are completely the same and you just want to have a different layout, then you can just set your layout based on the current user. Something like this would work: layout :determine_layout def determine_layout return 'admin' if current_user && current_user.admin? 'application' end

Categories : Ruby On Rails

Has anyone had success with ADT on a (dual-booted) Chromebook?
Are you sure you installed the driver correctly? If so, try switching Nexus 7's usb mode from storage mode to pics transfer??/view?? mode(forgot the exact name here). Hopefully it does help.

Categories : Android

Dual play frameworks on the same system
There is answer for similar problem dedicated for mac/unix. In Win you can create symlinks pointing to the proper version of Play directly in the instance folder

Categories : Java

Dual use of composite foreign keys
Here's what you started with. CREATE TABLE medication ( "id" INTEGER NOT NULL, -- You don't need this. "therapy_id" INTEGER NOT NULL, "day" INTEGER NOT NULL, "revision" INTEGER NOT NULL, "substance" VARCHAR(100), "dosage" VARCHAR(50), PRIMARY KEY (id), -- Drop this. FOREIGN KEY(therapy_id, day, revision) REFERENCES day (therapy_id, day, revision), -- Ok, but should be PK. FOREIGN KEY(therapy_id) REFERENCES therapy (id) -- You don't need this. ); The column "id" serves no useful purpose, and has instead convinced you that you don't need a unique constraint on the real key: {therapy_id, day, revision}. Replace the useless primary key constraint on "id" with a primary key constraint on {therapy_id, day, revision

Categories : SQL

Get selected values in a dual listbox PHP
This is the weird code: function listbox_selectall(listID,isSelect) { var listbox=document.getElementById(listID); for(var count=0;count<listbox.options.length;count++) { istbox.options[count].selected=isSelect;//<-- ? } } Maybe, you wanted to say: listbox.options[count].selected=isSelect; You said, that only 1 value from "destination" is submitted to PHP. To allow multiple values to be submitted, add [] to the names of the <select>-s: <SELECT id="s" size="10" name="source[]" multiple> <SELECT id="d" size="10" name="destination[]" multiple> Also, there is no need to use name attribute for options. You don't use it anywhere.

Categories : PHP

Dual-parent nested resources or is polymorphism right for me?
I would use polymorphic: routes.rb resources :students do resources :evaluations end resources :goals do resources :evaluations end models/evaluation.rb class Evaluation < ActiveRecord::Base attr_accessible :some_attribute belongs_to :evaluable, polymorphic: true end models/student.rb class Student < ActiveRecord::Base attr_accessible :some_attribute has_many :evaluations, as: :evaluable end models/goal.rb class Goal < ActiveRecord::Base attr_accessible :some_attribute has_many :evaluations, as: :evaluable end your relation between goal and student will look like: id evaluable_id evaluable_type other_field 1 4 'Goal' 'other goal content 1' 2 1 'Student' 'other student content 1' 3

Categories : Ruby On Rails

How to find out which SIM is making the outgoing call (Dual SIM)
You can create BroadcastReceiver, which will accept all outgoing calls. Then: String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); int slot=intent.getIntExtra("com.android.phone.extra.slot",-1); //0 or 1 are valid in my case number is dialed number slot is through which slot you make that call You will need to register that receiver, and give proper permissions. This works for dialed USSD codes also. It is tested on Privileg GSM S7589 2 SIM cards, Android 4.2.1

Categories : Android

How to properly represent inheritance in dual hierarchy?
This is a classic generic case: EDITED One more time - still the same concept, but the inheritance chain is fully there. You have to have hiding properties (new) in order to do what you need, but since you're implementing the ICar interface, you still get the base property for when you have a mixed collection. I think this is the best you're going to be able to do. public interface ICar { IEngine Engine { get; set; } } public abstract class BaseCar<T> : ICar where T : IEngine { public T Engine { get; set; } IEngine ICar.Engine { get { return Engine; } set { Engine = (T)value; } } } public class Car : BaseCar<Engine>, ICar { } public class SportsCar : Car, ICar { IEngine ICar.Engine { get { return Engine; } set { Engine = (TurboEn

Categories : C#

qt dual-stack ipv4 & ipv6 application
Definitely create a local IPv6 network environment. A lot of things work the same in IPv6 as in IPv4, but a lot of other things are different. When developing applications that use IPv6 you should have some hands-on experience. You wouldn't expect someone who has never used IP to develop an application that uses IPv4, would you? Some key differences: IPv6 addresses are written in hexadecimal IPv6 hosts will probably have multiple addresses An IPv6 address that starts with fe80:This is the link-local address. Every IPv6 hosts has one for every interface it has. Link-local addresses exist on every link (ethernet segment, LAN) and they use the same address range on each LAN. It is therefore impossible to route them, but they are very useful when communicating only within the LAN. One or m

Categories : Qt

Dual GridView simultaneous and syncronised scrolling
So I ended up biting the bullet and going back to one grid view and battling through the complicated code since no matter what I tried with the scrolling there was always a lag before the other grid caught up and I just couldn't find a way to smoothly scroll both grid views at the same time.

Categories : Android

Using dual polymorphism through a join table in Rails 4
if you still want to do so without STI, you can checkout( even though it is not recommended) joins on polymorphic table

Categories : Ruby On Rails



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