w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
VBA code crashing Excel if closed early
For non english languages, you could use .FormulaLocal or .FormulaR1C1Local. Developer reference says "Returns or sets the formula for the object, using R1C1-style notation in the language of the user. Read/write Variant". However, I strongly recommend not using the above, as it will mean it won't work if the macro is run on a different language version. Instead, better practice is to use English in conjunction with .Formula and .FormulaR1C1. This will still open as French in a French version, as Excel automatically displays formulae text in the relevant language. For example: (I use "FALSE" only as an example - the below is true for formulae too like "=SUM(A1)", and of course, if you really want to set a boolean value then please don't use string "TRUE"!) ActiveCell.Formula = "FALSE"

Categories : Excel

Why is my server crashing when using boost async read? [Stoped the Crashing and getting an error now]
The Crashing was just something weird going on with the project. I recreated the project but changed nothing and the crashing stop and the try-catch picked up an error. The error was me deleting the object on the error. Then I got a error witch was for local system closed the connection, That was cause by me forgetting to use shared_from_this() instead of this.

Categories : C++

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

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

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

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#

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

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

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 can I keep this "onclick" from happening more than once?
That's because your code contains an error: submit.onClick(messageAjax()); The property is onclick, in lowercase. onClick does not exist and throws an error. This prevents the button from having its own onclick cleared, since the error causes the script to stop. I'm not entirely sure what the line above is supposed to be. It appears to be calling messageAjax, and then immediately passing that function's argument to submit.onClick... Did you maybe mean this? submit.onclick = messageAjax;

Categories : Javascript

Too much Full GC happening in CMS
I wonder why the drive-bys are simply dinging this question without at least pausing to comment as to why they would do so... That bugs me. Focusing on this message: GC locker: Trying a full collection because scavenge failed I found this thread: https://blogs.oracle.com/poonam/entry/understanding_cms_gc_logs With this information: CMS can also be run in incremental mode (i-cms), enabled with -XX:+CMSIncrementalMode. Are you running CMS in (i-cms) mode? It appears it could help to me, though I admit this isn't my expertise. Just stopped by to help. Herein would be some further discussion of this issue and possible solutions: https://forums.oracle.com/thread/1543499 Also, focusing on the message "concurrent mode failure", which is a major issue: How to reduce java concur

Categories : Java

What is happening in this query?
The bold part of the expressions does not return a date, it returns a number of days: 31 Convert that to a datetime: SELECT CONVERT(DATETIME, 31); This is 31 days after day 0 (1900-01-01): 1900-02-01 Now, subtract GETDATE() as an integer (41512 days after day 0): SELECT 31 - 41512 = -41481 Now add -41481 days to day 0: SELECT DATEADD(DAY, -41481, 0); -- or SELECT DATEADD(DAY, -41481, '19000101'); Or: SELECT CONVERT(DATETIME, 31 - CONVERT(INT, GETDATE())); Now, I strongly recommend a couple of things: Don't use implicit date math. @date_var_or_col - 1 for example fails with new data types like DATE and DATETIME2. Don't use shorthand like m. If you mean MONTH, just take the massive productivity hit and type out MONTH. To see why, tell me if this provides the results you e

Categories : SQL

Cant understand what's happening
You are using namespaces in your application, therefore you need to make sure that your autoloader can handle this. If it's a ZF1 app then not. Can you try using require to include the class file instead? You can ass well amend the autoloader to work with namespaces Secondly when using namespaces, if you create an alias for a class use ZendCryptBlockCipher; you then instantiate it $blockCipher = BlockCipher::factory('mcrypt',array('algo'=>'aes'));

Categories : PHP

What's happening when I add more