w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Inserting into mysql table with archive engine "duplicate key" error
It looks like you have discovered a bug in the ARCHIVE engine. The insertion seems to be failing as soon as you try to insert a record with a value for an AUTO_INCREMENT column smaller than the AUTO_INCREMENT property of the table. This works fine: CREATE TABLE test_table1 ( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=ARCHIVE AUTO_INCREMENT=123; -- notice the AUTO_INCREMENT value INSERT INTO test_table1 (id) value (123); -- ok But this fails with "Duplicate key": CREATE TABLE test_table2 ( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=ARCHIVE AUTO_INCREMENT=124; -- notice the AUTO_INCREMENT value INSERT INTO test_table2 (id) value (123); -- duplicate key MyISAM and InnoDB do not exhibit this behaviour, and I can find no reference to this in the do

Categories : Mysql

Django 1.5.1 support from Google App Engine
Provided you are using Cloud SQL as your backend and not the datastore, you should be able to use your own Django. You might need to do some work in tweaking the database settings. App Engine provides up to django 1.4, so you can use that if you don't want to install your own. If you want to use the datastore, you'll have to use django-nonrel. I believe there is an experimental branch that's up to 1.5 if not 1.5.1

Categories : Django

jQuery validation engine - [IE8] "object doesn't support this property or method"
.indexOf isn't supported in <= IE8. As a workaround you could create a custom indexOf() implementation, placed in perhaps a centralised JS script file targeted for IE8. For example, // create self-invoking anonymous indexOf() function (function () { if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (obj, start) { for (var i = (start || 0), j = this.length; i < j; i++) { if (this[i] === obj) { return i; } } return -1; }; } })();

Categories : Jquery

Create batch to archive files using main folder name for archive name
I don't have WinRAR, so I can't check the syntax for the rar command, but you could create a batchfile (backup.bat) like: cd %1 "C:Program FilesWinRARWinRAR.exe" a -esh -m5 -mt2 -r -s -t "..\%1.rar" cd .. And invoke it with backup A from the temp folder. That might be a start...

Categories : Batch File

Archive old files only AND re-construct folder tree in archive
I would take this route instead of rsync: Change directories so we can deal with relative path names instead of absolute ones: cd /home/user/documents Run your find command and feed the output to cpio, requesting it to make hard-links (-l) to the files, creating the leading directories (-d) and preserve attributes (-m). The -print0 and -0 options use nulls as record terminators to correctly handle file names with whitespace in them. The -l option to cpio uses links instead of actually copying the files, so very little additional space is used (just what is needed for the new directories). find . -type f -mtime +1000 -print0 | cpio -dumpl0 /home/user/archives Re-run your find command and feed the output to xargs rm to remove the originals: find . -type f -mtime +1000 -print0 | xargs

Categories : Linux

Alternative IDE supporting debugging for Google App Engine in Python (Eclipse + PyDev no debug support on SDK 1.7.6+)
I posted this in google groups a while back. I can run debugging in Boa Constructor using remote debugging. https://groups.google.com/forum/#!topicsearchin/google-appengine/Boa/google-appengine/-m00Qz4Vc7U I am pretty sure it would be trivial to make winpdb work with remote debugging as well, though I haven't tried it (I don't use winpdb ;-) If any other debug environments support similiar remote debugging facilities it shouldn't be too hard to get them going. There a screen shot of Boa debugging in action here https://groups.google.com/forum/#!searchin/google-appengine/debugging$20Boa/google-appengine/ZHHkwr3ok8c/btDno8oPYyAJ T

Categories : Python

InnoDB working, still showing "Database server does not support InnoDB storage engine message"
If I rememebr correctly WAMP Server comes with innodb disabled, but it is a simple job to activate it. Edit the my.ini ( use the wampmanager menus to edit it ) Look for this line, its roughly around line 90 - 100, you will see a set of paramteters all commented out. Remove the # so it is no longer a comment. You may have to do a little reasearch on what the params mean and then you may have to do some tweeking to get innodb working well, but just uncommenting them should activate innodb. # Uncomment the following if you are using InnoDB tables innodb_data_home_dir = D:/wamp/bin/mysql/mysql5.5.28/data/ innodb_data_file_path = ibdata1:64M:autoextend innodb_log_group_home_dir = D:/wamp/bin/mysql/mysql5.5.28/data/ # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of sett

Categories : Magento

A Maven plugin 1.8.3 to support App Engine requires Maven version 3.1.0
I think your intention is to use the appengine-maven-plugin? If so, you need to use version 3.1 of maven. Download it, install it. It is all clearly explained here : http://maven.apache.org/

Categories : Google App Engine

resolve symlinks in Go
Use os.Lstat: func Lstat(name string) (fi FileInfo, err error) Lstat returns a FileInfo describing the named file. If the file is a symbolic link, the returned FileInfo describes the symbolic link. Lstat makes no attempt to follow the link. If there is an error, it will be of type *PathError. EDIT: Then returned os.FileInfo will only allow you to check if 'name' is a link or not (fi.Mode() & os.ModeSymlink != O). If it is, then use os.Readlink to get the pointee: func Readlink(name string) (string, error) Readlink returns the destination of the named symbolic link. If there is an error, it will be of type *PathError.

Categories : Go

Symlinks on windows
The os.path.islink() docstring states: Test for symbolic link. On WindowsNT/95 and OS/2 always returns false In Windows the links are ending with .lnk, for files and folders, so you could create a function adding this extension and checking with os.path.isfile() and os.path.isfolder(), like: mylink = lambda path: os.path.isfile(path + '.lnk') or os.path.isdir(path + '.lnk')

Categories : Python

Capistrano Symlinks Being Cached?
I can't verify this, but it seems that there is some unpredictable behaviour with Apache following / caching the old location of symlinks: Is there a way to mimic symlink behavior with an apache configuration? Case Against Using Symlinks For Code Promotion The only thing that would absolutely clear up this issue was to cycle Apache, which we would prefer not to do on every deployment. -- Mike Brittain He suggests moving the whole directory, instead of updating the symlink.

Categories : PHP

platform independent symlinks in build script
Gradle doesn't offer a public API for creating symlinks. If your builds run under JDK 7 or higher, you could try the JDK's symlink API. Otherwise, it should be possible to solve this with exec as well, as long as you can figure out the correct command.

Categories : Windows

Use "find" to list all c/h/cc files but exclude symlinks
This definitely works for me. Are you sure your shell isn't expanding the * in your commandline? Or you didn't apply -type f to all your items: find . -type f -and ( -name "*.c" -o -name "*.h" -o -name "*.cc" )

Categories : Linux

How to preserve symlinks when unpacking tar using maven assembly plugin
Preserving symlinks is not supported in any of the maven plugins at the momenet. I got around this problem by using the maven executor plugin that would execulte a shell script and tar and untar artifacts for me.

Categories : Maven

Persuading git to handle symlinks correctly on vboxsf filesystem
Based on the mount output are using default synced folder, which is VirtualBox's vboxsf. Not sure if you are aware that vboxsf lacks support for symbolic / hard links, which will potentially cause problems using git. see the ticket #818 here, it is still not fixed. So I would avoid using vboxsf, use sshfs or NFS instead to share files and directories between host and guest. NOTE: sshfs is pretty handy, we will be able to mount remote path via SSH and use them as if they were local. I haven't heard of git issues like vboxsf (but could still be). Quick example: mount remote ssh directory as sshfs => sudo sshfs user@host:~user /mnt/sshfs unmount sshfs => sudo fusermount -u /mnt/sshfs

Categories : GIT

Subshells, permissions and following symlinks on OS X/Darwin: why do I get permission errors?
$(en_US/LC_COLLATE) will execute string en_US/LC_COLLATE as command (script). Since it does not have execute permission shell will output that error. Probably you wanted to do it that way: $(cd /usr/share/locale/; stat en_US/LC_COLLATE)

Categories : Bash

Can't archive iOS Application (iOS App Archive)
I solved the question by myself. The decision is: in Build Settings - INSTALL_PATH set "$(LOCAL_APPS_DIR)" - this code will generate /Applications. INSTALL_PATH install place where XCode will store archive for you. As I right understand to solve the task about archiving you need to do: in your PROJECT-SKIP_INSTALL - set to NO, and in your LIBRARIES-SKIP_INSTALL - set to YES; in your Project set Build Settings - INSTALL_PATH set "$(LOCAL_APPS_DIR)" in Build Phases-Copy headers transfer headers from Public/Private to Project section. I did these three steps and they are helped me, and I hope they will help you too.

Categories : IOS

Automatically create symlinks with lowercase names from uppercase directories
A step-by-step way: First, in a scratch directory, I'm creating a sample of directories like yours: $ mkdir Holmes Kingship Lost Monkey 'Space Ship' Test a_lower_case_one $ touch just_a_file One_with_UpperCase $ ln -s Holmes holmes $ ls -og total 28 drwxr-xr-x 2 4096 Jun 18 11:54 a_lower_case_one lrwxrwxrwx 1 6 Jun 18 11:54 holmes -> Holmes drwxr-xr-x 2 4096 Jun 18 11:54 Holmes -rw-r--r-- 1 0 Jun 18 11:54 just_a_file drwxr-xr-x 2 4096 Jun 18 11:54 Kingship drwxr-xr-x 2 4096 Jun 18 11:54 Lost drwxr-xr-x 2 4096 Jun 18 11:54 Monkey -rw-r--r-- 1 0 Jun 18 11:54 One_with_UpperCase drwxr-xr-x 2 4096 Jun 18 11:54 Space Ship drwxr-xr-x 2 4096 Jun 18 11:54 Test Now, how are you going to loop through your directories? Like so: $ for i in */; do echo "$i"; done a_lower_case_one/ holme

Categories : Bash

Devise after sign in/out inside of Mountable Engine redirecting to parent app rather than Engine
The problem was not having namespaced the sessions controller. Specifying the controller explicitly in the engine, and having it namespaced correctly fixed the issue. Routes: MyEngine::Engine.routes.draw do devise_for :users, { :class_name => "MyEngine::User", :module => :devise, :controllers => { :sessions => "my_engine/sessions" } } end SessionsController in 'controllers/my_engine/sessions_controller': module MyEngine class SessionsController < ::Devise::SessionsController end end

Categories : Ruby On Rails

mountable engine and modules. how to create lib files in an engine?
Isn't this something that would go in the engine's gemspec using "add_dependency"? Gem::Specification.new do |s| [....] stuff [....] s.add_dependency "github_api" [....] stuff [....] end That's how you signal that your engine uses other gems.

Categories : Ruby On Rails

App Engine, query results displayed locally, but not on App Engine
Make sure that you have indexed (and created composite indexes where necessary) for the fields in use in your query. The deployed appengine requires these to exist, but locally it will prompt you to add a composite index on first usage and work fine thereafter.

Categories : Google App Engine

support lib android.support.v7.widget.GridLayout causes InflateException / ClassNotFoundException with app widgets
When making widgets, you are constrained to the Views that implement the RemoteViews mechanism. The way that mechanism works is that the remote, "host" process is the one doing the actual inflating. Therefore, if that remote process (the launcher that hosts the widget) does not have the GridLayout class in its classpath, there is absolutely no way you can do this short of drawing the View in your own process and setting it as a Bitmap on an ImageView. I wouldn't do that, though. In general, when making widgets, constrain yourself to the Views that come with the framework.

Categories : Android

jQuery.support.ajax returns true even if XMLHTTP support is disabled
According to this Microsoft page, the IE8 setting only disables the W3C standard XMLHttpRequest object. It leaves the ActiveX Microsoft.XMLHTTP control enabled. There is a separate setting to disable (all) ActiveX controls. The jQuery support.ajax test works for both methods, so disabling the former but leaving the latter enabled will return true.

Categories : Javascript

Using Devise in a Mountable Engine Rails from outside of the engine
I just had the same problem which I solved by adding Devise.setup do |config| config.router_name = :<your engine name here> end to my config/initializers/devise.rb as stated in the how to.

Categories : Ruby On Rails

Compute Engine Firewall for App Engine Url Fetch
URL Fetch uses IP addresses specified here: _cloud-netblocks.googleusercontent.com Of course those IP addresses are shared by multiple Applicationss, and are also used by other services than URL Fetch. Thus, you should not reply on firewalling as your primary means of authentication.

Categories : Google App Engine

Starting app engine modules in Google App Engine
With modules, they changed the terminology around a little bit. What used to be "backends" are now "basic scaling" or "manual scaling" instances. "Automatic scaling" and "basic scaling" instances start when they process a request, while "manual scaling" instances run constantly. Generally to start an instance you would send an HTTP request to your module's URL. start_module() seems to have limited use for modules with "manual scaling" instances, or restarting modules that have been stopped with stop_module().

Categories : Python

Proble with support library android.support.v7.app.ActionBarActivity
Create a custom and modify it with this: <item name="android:actionMenuTextColor">#aabbcc</item> I didn't confirm this though (I'm just pretty confident it will work).

Categories : Android

OpenCV: No GPU support (The library is compiled without CUDA support)
You seem to have a mix of two different versions of OpenCV on your system (2.4.6.1 and 2.4.2). The older version (2.4.2) appears to be built without GPU support. You might try removing any older versions of OpenCV completely and start your build process for 2.4.6.1 over again.

Categories : C++

What's the best way to create an engine for an engine in Rails?
What about creating an other Engine that you would mount in your main application in addition to the first one ? CoreEngine ExtendedCoreEngine Are your additional models and controllers specific to the Engine and have nothing to do the any Rails application your engine is mounted in ?

Categories : Ruby On Rails

Rails: Reference an engine from an engine
There are 2 things to understand here: If your Engines are supposed to be public (like Devise engine for example), then you'll want to reference your Core dependency in the gemspec. You'll not be able to reference it using path though. But for public engines, this is not a matter since public engines will be on Rubygems at some point in time. If your Engines are private and used only to cleanup your code base, then adding gem 'core', path: '../core' to your Engine's Gemfile is fine. The thing to remember here: gemspec is for dependencies declaration (the gems your engine needs in order to work) Gemfile is for local or test dependencies declaration

Categories : Ruby On Rails

How do you ensure resources (e.g. styles) of a support library project (e.g. android-support-v7-appcompat), are added to your project?
Look at the "Adding libraries with resources" section of this document http://developer.android.com/tools/support-library/setup.html Basically, you import the resources in a library project called "android-support-v7-appcompat" that you reference in your app project.

Categories : Android

Using Search Engine APIs to replace my own crawling (for non search engine purposes)?
You will not want to use a search engine to do this. Search engines will not index all content on a site. If a site has lots of similar pages, for example, they will be thrown out. Sites with large number of pages will not be completely indexed. You could potentially miss lots of pages this way. Keep it crawling! P.S. Crawling individual websites often violates their TOS. If you care about that, also take care to adhere to robots.txt.

Categories : Search

Unzip The Zip Archive With PHP
You should check which error code gives open (http://www.php.net/manual/en/ziparchive.open.php), that will give you some help. Error codes are this: ZIPARCHIVE::ER_EXISTS -10 ZIPARCHIVE::ER_INCONS - 21 ZIPARCHIVE::ER_INVAL - 18 ZIPARCHIVE::ER_MEMORY - 14 ZIPARCHIVE::ER_NOENT - 9 ZIPARCHIVE::ER_NOZIP - 19 ZIPARCHIVE::ER_OPEN - 11 ZIPARCHIVE::ER_READ - 5 ZIPARCHIVE::ER_SEEK - 4

Categories : PHP

best way to archive records
There are many ways to do this.. You can use appropriate "Replication" functionality of SQL Server. In your case Snapshot Replication type seems appropriate for more details Click You can create windows service to move data from RawNews to UsedNews. You can create an exe to move data and using windows task scheduler you can call that exe at specific time when there is less load on server.

Categories : Sql Server

Getting images from CBZ archive
You can use a ZipFile. It gives you an InputStream for each entry, which you can decode using BitmapFactory.decodeStream. ZipFile zipFile = new ZipFile(<filename>); for (Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements(); ) { ZipEntry ze = e.nextElement(); Bitmap bm = BitmapFactory.decodeStream(zipFile.getInputStream(ze)); }

Categories : Android

Create a zip archive in c++
It looks like this will work. If you are on a Unix environment you may have to run the Java version: http://www.7-zip.org/sdk.html

Categories : C++

git-archive a subdirectory --
You can do that like this: git archive -o ../subarchive.zip HEAD:subdir By the way, an easy way to play with the command and see what it will generate is if you use it in this form: git archive --format=tar HEAD:subdir | tar t git archive --format=tar HEAD subdir | tar t # ... and so on ... Once you see what you're looking for, you can change the format and use the -o flag to actually create the archive.

Categories : GIT

Creating zip archive in php
first problem solution foreach($files_to_zip as &$value){ $value = 'path/to/app/'.$value } or use array_walk second problem: try to create tmp folder, copy every file to it and zip em. This is simpliest solution. Don't forget to remove tmp files.

Categories : PHP

7z will not find archive using subprocess
I encountered a similar problem when using 7zip compressed file with subprocess, I solved my problem by another way. This is my code, def zip_files_in_special_path(rom_path, rom_name): pre_cwd = os.getcwd() os.chdir(rom_path) cmd_str = r'C:7-Zip7z a -tzip -r '+rom_name+' *' try: status = os.system(cmd_str) if status<=1: return True else: raise RunCmdError('run 7z to zip files failed!') finally: os.chdir(pre_cwd) hope to help you.

Categories : Python

Extracting and creating .jar archive containing aux / aux.*
A JAR is just a ZIP file with a manifest and a specific ordering of the content files. You can extract any file from a Jar using an unzip tool. To extract the AUX file, use the "rename" capability that's in most zip tools, or "extract to..."

Categories : Windows



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