w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Not seeing OSX desktop notifications with test app closed (Lion)
PushyMac app code was written during OSX 10.7 and the only notification type available was Badge. If you are running OSX 10.8, then add the alert notification type as well, as shown below. [NSApp registerForRemoteNotificationTypes:(NSRemoteNotificationTypeBadge | NSRemoteNotificationTypeAlert)] However, after doing this, I am not able to launch the app by clicking on the alert in notification area. If you find an answer for that, please do reply.

Categories : Objective C

Xcode Developer Preview: Cannot Run on Device
The solution was very simple in my case, in Terminal just execute sudo xcode-select -switch /Applications/Xcode5-DP6.app/Contents/Developer/ with the path for the currently used Xcode Developer Preview. Do not forget to switch back when developing on the previous stable Xcode version again - especially when archiving for AppStore submit.

Categories : IOS

Can the Network Panel in Chrome Developer Tools Log When Closed?
No, this is not possible directly. You have to have DevTools open for it to log requests. There is a work-around though: This is similar to https://code.google.com/p/chromium/issues/detail?id=178918 - use remote debugging locally (https://developers.google.com/chrome-developer-tools/docs/debugger-protocol#remote).

Categories : Google Chrome

How to release DataSnap memory once connections are closed?
Let me quote a "must read" article about DataSnap. This is about XE3 but i hope the code here would work for XE2 as well. Memory consumption One of the issues that I observed was related to memory consumption. Why Datasnap server consumes so much memory if the method called does absolutely nothing? Maybe I don’t know how to explain exactly but i will try. Basically the DataSnap creates a session for each HTTP connection that it receives. This session will be destroyed after 20 minutes, in other words, on the first 20 minutes of the test the memory consumption will only go up, after that it has the tendency of stabilize itself. I really have no idea why Datasnap does this. In a REST application I don’t see much sense in these sessions with a default configuration. Of course, session

Categories : Delphi

How to get Squeryl to release closed connections back to C3P0?
I found out why this was happening. I needed to use JDBC features not supported by Squeryl. So I got the connection from Squeryl and used it directly. But I had a bug where a prepared statement was not being closed. This resulted in the dead connection being reused over and over. I'm not sure how or why this happened. But as soon as I put the closing of the statement in a finally block everything started working. Now when Squeryl gets to the transaction block a second time it receives a fresh connection from c3p0. For anyone else seeing the same errors, I also found out that you can get the c3p0 errors (top two errors in the question text above) even when nothing is wrong. If your thread holding the database connection is busy (a Thread.sleep() in my case, for testing) and c3p0 notices b

Categories : Scala

Use a Public Method of a Closed Form in MS Access
You may be able to do what you want by using the name of the form's code module to qualify the procedure call. For example, my Form7 includes a public sub, SayHello, which simply does ... MsgBox "Hello " & CurrentUser As you're aware, I can call that procedure when the form is open like this ... Forms!Form7.SayHello When the form is closed, I can still call the procedure like this ... Form_Form7.SayHello Although the form is not displayed, that approach does add it to the Forms collection and leave it there afterward. So I would have to explicitly remove it. DoCmd.Close acForm, "Form7" However, if that approach is acceptable for your purpose, it may not work, depending on the specific details of your procedure. Mine is trivial, so no problem. In actual practice, I pre

Categories : Forms

Doesn't the JVM release all the resources that are not explicitly closed by the programmer on program exit
These resources are indeed closed upon a normal JVM exit. However, you may not always know how your method is being called, and it could perhaps be called 2000 times externally by another programmer, and those resources will start to stack up. In addition, certain non-mainstream OSs may run into the issue that if the JVM were to halt abnormally(via System.halt or a crash) then resources could remain open(due to cleanup code not being run), potentially unusable until rebooted or manually released. Even on mainstream systems sockets could remain open for multiple minutes.

Categories : Java

meteor release 0.6.5 public/images looks like it's packaging up in the wrong directory
This is the correct behaviour. The public directory isn't there in the final bundled version or the deployed version of your app (so it also applies when developing your application). When deployed its stored alongside everything static with meteor. This means that your files in /public/images would still be accessible at yourhost/images. (Without the name of the public folder anywhere)

Categories : Image

Retrieving a static pointer from a closed-source library, not exposed by the public interface
From my understanding, classes operate similarly to structs in C in terms of how they're set up. So, perhaps by doing ptrToClassObject+offset it might just work. There's a way to get the offset of the class members, I just don't know anything about how that's set up.

Categories : C++

Can you install the Xcode 5 Developer Preview in parallel with Xcode 4.6.2?
Short answer: Dont replace XCode 4! If you plan to deploy some app to appstore, you can't do it using Xcode 5 at this moment. The best way is download the Xcode 5 version, unpack it and run the app on different folder (not application folder). You will stay with Xcode 4, and can run Xcode 5 separated (You don't need to 'install' xcode 5).

Categories : Xcode

Capistrano deploy:migrate and db:migrate run all migrations every time
How did you "add a few rows to a table in the db"? I suspect your data loss results from mixing migrations and your own db changes. Rails expects you to do all the database changes via migrations. There's some debate on migrations in general in the Rails community, but right now (especially if you're a beginner) always use migrations to change your database. That way you have a complete blueprint for your db allowing you to deploy on several machines from scratch without fiddling with your db and to make sure other contributors have the same db to work with. I don't know a lot about these kinds of internals, but from what I understand your data loss resulted something like that: After your manual changes Rails couldn't match the db-layout to the result of any migration (via the timestamp

Categories : Ruby On Rails

Commonsware camera preview demo: no preview after device on/off
It is not a solution, but a workaround: invoke setContentView() in onResume(). It can be either protected void onResume() { super.onResume(); setContentView(R.layout.xxx); // ... } or private View cachedContentView; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); cachedContentView = doCreateContentView(getLayoutInflater()); // ... } protected void onResume() { super.onResume(); setContentView(cachedContentView); // ... } Both of them work. I still have no idea what causes the problem and what is the difference between the original example and the library.

Categories : Android

Camera Preview Issue - Preview becomes pixellated and distorted
if anyone like me (learning the ropes) comes across this same issue, what my problem was I had added camera.setDisplayOrientation(90); in order to rotate the preview to portrait. My problem was, I had called this in the wrong place, I now call it in the onResume() method. A simple fix in the end...thanks everyone

Categories : Android

Configuring a single Jenkins release job to release from trunk or branches with Perforce as SCM
If I were trying to implement this as described I would created a parameterized build where I could hand in a Perforce label name. The Perforce Jenkins plugin can sync to a label; I would create labels for each release specifying the paths that should be synced and with a revision specifier of #head. Jenkins should then sync just the files you want for that build. The workspace would of course map everything; the labels will specify the files to fetch.

Categories : Jenkins

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

Maven release plugin: How to deploy only a distribution jar on release:perform
Seems like the Release plugin behavior was fixed and it now properly invokes deploy:deploy. So I used my standard trick to suppress default plugin execution. Root pom.xml: <!-- Don't deploy all artifacts. Overridden in submodules. --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <executions> <execution> <id>default-deploy</id> <phase>none</phase> </execution></executions> </plugin> And the dist module pom.xml: <!-- Enable deploy for this submodule. --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dep

Categories : Maven

How to release an iOS app as worldwide which was release with Italian as the language in the first version?
The third Question answers my query. https://vpp.itunes.apple.com/faq 3. Can I distribute redemption codes to employees who are not located in my country? No. Apps can only be distributed to employees with Apple IDs located in the same country where the apps were purchased. To distribute redemption codes in other countries, you must enroll your business in the Volume Purchase Program for every eligible country in which you wish to purchase and distribute apps.

Categories : IOS

Restarting firefox using the developer console (shift+F2) makes every restarted window have the developer console open
The Developer Toolbar is a global thing, just like any other toolbar (e.g. Nav Bar or Bookmarks Bar). Firefox will remember the visiblity state and will restore it when opening new windows, either the usual way, or after a restart.

Categories : Firefox

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

Difference between debugging the release and running the release
If you have Application Property Settings, the 'debug' settings and 'release' settings are distinct. For instance, if I set up a 'server name' and 'default database name' in settings fields, when I compile to 'release' it won't pull in the names that I set while I was in debug. Therefore, you will need to populate the release settings separately. You haven't included that detail in your post, but it could easily affect the program session.

Categories : Visual Studio 2010

Github release from maven-release-plugin
The problem seemed to be the "circular" reference where the aggregator inherits from one of the poms that it is aggregating. As soon as I removed that, everything worked. So there are basically two simple choices, either merge the parent and the aggregator, or have the SCM info duplicated (or just moved) in the aggregator so that the aggregator doesn't inherit from anyone

Categories : GIT

How to load html contents from stream and then how to create style sheet to display the html file in preview pane (like HTML preview handler)
You mean you want to make HTML Browser inside a window? please take a look at this link. http://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla if this isnt what you want, please explain what you mean by "preview handler for HTML"

Categories : C++

Is there any pattern that provide similarities of public static, private and public methods and vars in JS?
"Static" methods in JavaScript are usually achieved by simply assigning a function to a property of the constructor function object: function MyClass() {} // Constructor MyClass.staticMethod = function () {};

Categories : Javascript

Singleton object w/ Private/Public: Public function dependency problems
You can simply define the functions inside (or alongside) the constructor and just "attach" them to the new instance. This way the functions are free to refer to one another as required: function PKMNType_Engine(){ "use strict"; function getEffectiveness(defenseType, offenseType){ return 1; } return { PKMNTypes_getEffectivness: getEffectiveness, PKMNTypes_getMatchup: function(type1, type2, offensiveType){ var output = getEffectiveness(type1, offensiveType) * getEffectiveness(type2, offensiveType); return output; } }; }

Categories : Javascript

Are "public" and "public final" redundant for interface methods?
You cannot have a final method declared in an interface. Fields are always final but methods are always abstract (and never final). You cannot define an interface method that is to be implemented only by classes in the same package.* From section 9.3 of the Java Language Specification: Every field declaration in the body of an interface is implicitly public, static, and final. It is permitted to redundantly specify any or all of these modifiers for such fields. and from section 9.4: Every method declaration in the body of an interface is implicitly public (§6.6). Every method declaration in the body of an interface is implicitly abstract, so its body is always represented by a semicolon, not a block. It is permitted, but discouraged as a matter of style, to redundantly

Categories : Java

What the difference between Release|AnyCPU and Release|ARM
If you're only using managed code, there's no reason not to use Release|AnyCPU. This way the same package will be used for all three platforms (ARM, x86 and x64). On the other hand, if your project references natively compiled library, you'll need to set a specific platform, like Release|ARM, that your native library is compiled for. If the native library is installed as an extension (e.g. SQLite for Windows Runtime), you'll be able to compile your app for all 3 target platforms, each one referencing the appropriate native library, though they will need to be individual packages instead of a single universal one. You'll still be able to submit your app to the store as a single app even if it has 3 separate packages, one for each platform.

Categories : Visual Studio 2012

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#

Conflicts with Spring 3.2.1.RELEASE and spring security 3.1.3.RELEASE. java.lang.NoSuchFieldError: NULL
It is visible from your dependency:list that you have incorrect version of spring-expression dependency: org.springframework:spring-expression:jar:3.0.7.RELEASE:compile Just add the following to your POM: <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>3.2.1.RELEASE</version> </dependency> </depdendencies> </dependencyManagement> You can alter the definition of transitive dependencies via dependencyManagement like this.

Categories : Spring

Installing JDK on OSX Lion for Scala
Scala is a popular enough of a language for there to be plenty of information on how to get started from scratch. For example, googling for "scala installation" gave me (amongst other stuff) http://www.tutorialspoint.com/scala/scala_environment_setup.htm —they talk about JVM versions, how to install Scala, etc; i.e. all you need. If that page won't do, I'm sure you'll find many more.

Categories : Scala

SublimeClang OSX Mountain Lion C++11
It may be too late, but I found how to do it. This matter is because clang uses headers for gcc-4.2, which is quite old and doesn't support C++11. To complete C++11 code, you have to get newer gcc and copy the include path it uses. If you have homebrew, open terminal and type brew tap homebrew/versions brew install gcc48 You can install gcc-4.8 and new libstdc++ with these two lines. Now, create some c++ file and try to use g++-4.8 with -v option. g++-4.8 -v example.cpp -v option tell gcc to show detailed log. In the output, there should be some lines like this. #include <...> search starts here: /usr/local/Cellar/gcc48/4.8.1/gcc/lib/gcc/x86_64-apple-darwin12.4.1/4.8.1/../../../../include/c++/4.8.1 /usr/local/Cellar/gcc48/4.8.1/gcc/lib/gcc/x86_64-apple-darwin12.4.1/4.8.1/

Categories : C++

Will it be possible to upload to App Store from Lion?
Your Lion will be just fine as stated here: https://developer.apple.com/support/ios/ios-dev-center.html "To develop with the iOS SDK and Xcode, you must have an Intel-based Mac running Mac OS X Snow Leopard or later and you must be registered as an Apple Developer." Update July 2015 https://developer.apple.com/support/enrollment/ You must have an Intel-based Mac running OS X Yosemite (v10.10) or later.

Categories : IOS

Two versions of PHP - Mountain Lion
Your Apache is including libphp5.so of the wrong/the other installation. Option 1: See if you can find a libphp5.so file for your other PHP installation and point the Apache config to it (just put the whole path in the LoadModule line and restart Apache). If you cannot find such a file, the Apache module wasn't compiled for that PHP version. Compiling that may be a bit complicated, so in that case: Option 2: Figure out which PHP you're executing on the command line using which php and then just use the other one using the full path, e.g. instead of $ php ... use $ /usr/bin/php .... Note that you may still have different PHP configuration files for Apache and the CLI.

Categories : PHP

TideSDK Notifications in OSX Lion 10.7.5
Harry, I'm not too familiar with CoffeeScript, but the following code works for me in 10.7.5 and 10.8.4 - it seems similar to what you have: function showNotify(title, message) { var notification = Ti.Notification.createNotification({ 'title': title || 'No Title', 'message': message || 'No Message', 'timeout': 10 }); notification.show(); } showNotify("The Title", "The Message"); Hope it helps.

Categories : Misc

MAC OSX LION: gcc on mac not compiling wget
Honestly, even though it appears that gcc exists; but does it point to a valid install? It still sounds like it is not installed properly and with an upgrade to Mountain Lion, all your open source tools have been scrubbed away and pushed to Xcode and must be manually installed if necessary.

Categories : C++

R - OSX Mountain Lion and CPU Limit
Tried ulimit... Appears I do not have access, even via sudo. I get the same output from ulimit -a -H before and after giving ulimit -t 12000 # sets cputime limit to 12000 seconds from 600 seconds SOLVED via Debian Virtual Machine. If someone has a Mountain Lionic solution, please let us know.

Categories : R

Mac OSX Lion/X11/CImg Library
The header file Xlib.h is in /opt/X11/include, so add that path to the Header Search Paths in Xcode: You'll probably need to add libraries from /opt/X11/lib as well...

Categories : Xcode

Why isn't maven replacing the environment variable for the maven-release-plugin release version?
you will have to use the arguments attribute: http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#arguments So in your context your cmd line will look like this (Note the double quotes as well): mvn release:clean --batch-mode release:prepare "-Darguments=-Dtag=${env.tag} -Dproject.rel.com.mycompany.project:project-root=${env.project.rel.com.mycompany.project:project-root} -Dproject.dev.com.mycompany.project:project-root=${env.project.dev.com.mycompany.project:project-root}" Furthermore, if i remember right the uses of the tokens ${env.X} requires the usage of the property name in upper case (to be verified)

Categories : Java

Cannot access public field on public inner class
The A character in int А = new Main2().А; is not a UTF-8 character, and is not the same as the one used in the variable name in the Main2 class. Copy-paste the A from the inner class and use that. It will compile.

Categories : Java

PHP OpenSSL Public Key Encryption With String Public Key
The key that you should pass to this function is a PHP resource object, and not the string representation of the key itself. $pubkey = openssl_get_publickey(base64_decode($row['public_key'])); $success = openssl_public_encrypt($data, $encrypted, $pubkey);

Categories : PHP

RabbitMQ not working on OS X Mountain Lion
I've managed to fix this issue by completely removing brew from my system and reinstalling it again. I've used the following instructions (adapted from the official brew documentation) to completely remove brew from my system: cd `brew --prefix` rm -rf Cellar brew prune rm -r Library/Homebrew rm -rf .git rm -rf ~/Library/Caches/Homebrew I simply reinstalled RabbitMQ afterwards: brew install rabbitmq .. and everything worked like a charm!

Categories : Osx

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