w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Vagrant synced folder permission issue with apache
Figure out the user/group which runs httpd, make sure the user has execute permission on /var/www and its subfolders. Also, in you apache site configuration files, make sure you have correct directives for /var/www, something like below DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> Disable SELinux in the guest, it's useless to a development env Edit /etc/selinux/config Change SELINUX to disabled SELINUX=disabled Reboot the vagrant box => vagrant reload See if #1 with #2 helps.

Categories : Apache

vagrant package creates a copy of the original box with no changes I have made
The reason could be that you used the same box name. As you described, you've done something like this: Created a Vagrantfile: Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = 'base' config.vm.box_url = 'http://the-url-of-box-you-used-as-base.com/precise.box' end vagrant up vagrant ssh => there you've made some changes vagrant package --box [name] --output [new.box] Edit the original Vagrant file (or create a new one) to load your new box: Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = 'base' config.vm.box_url = 'my-new.box' end And here I'm assuming you kept the config.vm.box the same, which means Vagrant didn't use your box, but the original previous box as there's already downloaded box with that name in your ~/.vagrant.d/bo

Categories : Windows

Vagrant shared folder with rails server
I go this issue on Vagrant box synchronising my folder with NFS. I made a change in my application development configuration file (config/environments/development.rb), just adding this line config.reload_classes_only_on_change = false and it works. Ensure that you have this config.cache_classes = false as well, I had it by default when I setup rails application (using version 4.1.5), because where I found that workaround (http://edgeguides.rubyonrails.org/configuring.html) says that config.reload_classes_only_on_chage = false is ignored if config.cache_classes is true Another solution is use vagrant Rsync synchronise mechanism, which is available from version 1.5 and have some benefits, but for me it doesn't work because I run out of space if I have to make a copy of my workspace on eac

Categories : Ruby On Rails

Vagrant chicken-and-egg: Shared folder with uid = apache user
How I solved this was that I first configure the share to Vagrantfile with no user or group information. Then in the provisioning phase I unmount the share and remount it with proper user and group information. e.g.: exec { 'umount /share/location': command => 'umount /share/location'; } -> exec { 'mount /share/location': command => 'mount -t vboxsf -o uid=`id -u apache`,gid=`id -g apache` /share/name /share/location' You can check the share name from virtualbox or by running the provisioning with debug flag and non working settings (it prints out the actual mount command). I know this is kinda workaround and might not work in every situation, but it worked for me.

Categories : Linux

Eclipse, Java project - How do I add a source folder where the folder name is part of the package name?
My recommendation, especially if your source files are all in one - or just a few - director(ies): 1) Check out your CVS project into a temp folder 2) Create a new Eclipse project from scratch. It will create a "src" folder by default. 3) Create your package with Eclipse. It will automatically create subfolders representing your package name (e.g. com.foo.mypackage). 4) Drag/drop your source into the Eclipse package 5) Make sure everything builds 6) Save the new Eclipse folder tree to CVS (ideally, use the CVS plugin for Eclipse to do this). IMHO...

Categories : Java

Java create a folder in current package folder
Well assuming your current path is within the application folder (where your package folders are), and your class files are not within a jar, you can do this. String OUTPUT_DIR = this.getClass().getCanonicalName().replace(".","/"); OUTPUT_DIR = OUTPUT_DIR.substring(0,OUTPUT_DIR.lastindexOf('/'));

Categories : Java

Keep vagrant database data after vagrant destroy
It depends on the RDBMS you use. For MySQL on Ubuntu, you can simply backup (tar or rsync to a remote host) the /var/lib/mysql folder (when mysql is NOT running) and its configuration files /etc/mysql. For PostgreSQL it is similar, the database files are normally under cd /usr/local/pgsql/data. Refer to File System level backup NOTE: avoid using the default vboxsf to share large number of files between guest and host because it has known performance issues.

Categories : Ubuntu

Automatically chdir to vagrant directory upon "vagrant ssh"
You can add cd /vagrant to your .bashrc and it will run the command when you ssh. The /bashrc you want is in /home/vagrant (the user you login as when you vagrant ssh.) You can just stick the new line at the bottom of the file.

Categories : Bash

How to update npm package from a local folder
Instead of npm install from a local directory, try npm link, which creates a globally-installed symlink to the directory. As stated in the docs, this is a two-step process: In package directory: $ npm link This creates a symlink to the current folder in npm's global installation directory. Somewhere else, where you want to use the module: $ npm link <pkgname> This will create a symlink in your project's node_modules/ folder to the global installation.

Categories : Node Js

wp8 Package.Current.InstalledLocation.GetFolderAsync can't get the new folder under Assets
You should use await StorageFolder.GetFolderFromPathAsync(...) var folder = await StorageFolder.GetFolderFromPathAsync(Windows.ApplicationModel.Package.Current.InstalledLocation.Path + @"AssetsAnimalImages");

Categories : C#

Bind images to listbox with datatemplate from app package folder
Windows.Storage.ApplicationData.Current.LocalFolder is retriving file from the application storage not the package. For the package folder you need to use Windows.ApplicationModel.Package.Current.InstalledLocation. Also the GetFileAsync take just the name of a file not a full path. Here is the code to acomplish what you want: var layoutGraphiceFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("layoutGraphics") var file=await layoutGraphiceFolder.GetFileAsync("offline.png"); Another way to do it with the full path is: var file=await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///layoutGraphics/offline.png"));

Categories : C#

intellij how to find / search for a folder / directory / package name
If you try CTRL + SHIFT + F You can do a global file search (like eclipse CTRL + H). In the file search, you can select which folder to search for, what file type to search for, case sensitive etc, all the normal stuff. Global Replace is CTRL + SHIFT + R (Mac replace CTRL for CMD)

Categories : Intellij Idea

How do I put a folder with java files into eclipse's package explorer
Create a new project in Eclipse: File > New > Java Project This will create a project with a src folder. Then copy and paste the Java files into this directory via the file system. If the .java files are packaged you may need to create packages within the src folder. Click the src Folder > File > New > Package

Categories : Java

Created package in Laravel workbench, but how to transfer to vendor folder?
Got it working. I added: "psr-0": { "Test\Test": "vendor/test/test/src/" } to the autoload section in composer.json in the laravel root directory so it looks like this: "autoload": { "classmap": [ "app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds", "app/tests/TestCase.php" ], "psr-0": { "Test\Test": "vendor/test/test/src/" } }, If I decide to put the package on Packagist later then I might remove this from the autoload and just keep the package referenced in the "require" part of my composer.json. We'll see what happens when I get that far!

Categories : Laravel

How to access package folder(/data/pakcage_name) in android device
if your device isn't root follow these steps to access that: 1- open adb 2- perform $ sudo ./adb shell 3- to access to data folder use ran-as command: shell@android:/ $ run-as app.package.name now, you can access to files of your project. but maybe you don't have permission use chmod 4- shell@android:/data/data/app.package.name $ chmod 777 databases/database_ame and also you can put/get files in/from that such as $ sudo ./adb pull /data/data/app.package.name/databases/database_ame /home or $ sudo ./adb push /home/database_ame /data/data/app.package.name/databases/database_ame Edit: By the way, if you work in linux I think you should install ia32-libs

Categories : Android

Eclipse+Maven src/main/java not visible in src folder in Package Explorer
Eclipse filters out folders that are marked as source from the "raw" folder path. That is, they are visible only as source folders: If you can't see them in either place, then they are either filtered out in the settings: check your settings for Package Explorer (the Package Explorer bar, downwards menu arrow -> Filters...) or they were created externally and Eclipse haven't noticed them: Refresh your project in this case. or they don't exist: right-click on the project, select New->Folder and input the path, e.g. src/test/java (not "Source Folder"). After you use Maven->Update Project... on the project, they will be automatically added as source folders, provided you have the default configuration. Now, as I said, those folder will only be used as source if you preserved the defaul

Categories : Eclipse

Compiling scala files inside their package folder from Command Line
You are not passing the source file of VitalSigns.scala as a parameter, so it will try to search for a classfile. The classfile of a class in the package x.y is under the directory x/y, which means it is trying to find gasguru/patient/VitalSigns.class, which does not exist in the current directory you are at. If you add -classpath ../.., it should find the file.

Categories : Scala

How do I create a class with constant properties accessible to other classes within a package folder structure?
Are you sure you have "RootFolder" added on the path? Here is a quick test I did, which works just fine (I'm running R2013a): root/+pkg/MyClass.m classdef MyClass properties (Constant) Version = '1.0'; Info = struct('Name','MyClass', 'Version',pkg.MyClass.Version); end end Now >> addpath('/path/to/root') >> pkg.MyClass.Version ans = 1.0 >> pkg.MyClass.Info.Version ans = 1.0 So I was able to even directly index into the returned structure. Note that if you want to reference any of the constant properties inside other properties, you have to use the fully qualified name including the package name (just like we did for the "Version" property inside the structure)

Categories : Matlab

vagrant on windows need a second vagrant up
This can be a few things... the easiest way to tell the exact problem is to see what the VM itself is stalling on by running it in gui mode. config.vm.provider "virtualbox" do |v| v.gui = true end It could be stuck at the grub prompt or something... it could also just be a bad image... perhaps try a different Vagrant base box.

Categories : Windows

How can I simply modify the path for the entire requests package within a libraries folder in my appengine project
I have all my third party libs in a lib dir The I just include sys.path.insert(0,'./lib') in appengine_config.py which is loaded before any of your code. If find it needs to be inserted at the beginning of sys.path rather than at then end if you use specific versions of libs like webob that are not part of the appengine available versions. Then you don't have to modify any of the libraries etc.... This is pretty standard python behaviour. In a normal desktop install situation you are installing vie easy_install which sticks stuff in places like site-packages and setups paths etc.... but if you aren't using any of that, and you can't with appengine you have to do the path manipulation yourself.

Categories : Python

My chrome extension isn't synced
Chrome will only sync apps that are published to the web store. For more information on how to integrate your extension's data with sync, see this page: https://developer.chrome.com/extensions/storage.html

Categories : Google Chrome

How can I keep my code synced to both a Git and SVN repository?
Your best option is probably to use git-svn. This allows you to use git as a frontend for a Subversion repository. The simplest way to do this would be: create a SVN repository for the software (or use an existing repo) commit the software to SVN once (as a bunch of folders, using svn commit) use git svn clone to fetch the software as a git repository The disadvantage is that you lose the git history you have created so far. If you want to keep the git history, things will get a bit more complex (because SVN cannot represent some aspects of git's history, particularly branches). Basically you'd: create an empty SVN repo check it out using git svn clone import your existing git commits into this git repo push them to the SVN repo (git svn dcommit) The "import your existing git com

Categories : GIT

Listbox selection "synced"
I would implement the event of "SelectedItem_Changed" for both the Listbox. Then using a global bool variable for discriminating if an item of one listbox has been already selected. If an item of listbox1 is already selected, I would clear the selection from listBox1 and then select the item from listBox2. EDIT private bool itemSelected = false; private void listBox1_SelectedItemChanged(object sender, EventArg e) { if(itemSelected == false) { // select the item of listBox1 itemSelected = true; } else { // Clear items of listBox2 itemSelected = false; } } private void listBox2_SelectedItemChanged(object sender, EventArg e) { if(itemSelected == false) { // select the item of listBox2 itemSelected = true;

Categories : C#

How to keep two read only collection synced with mongoose
My suggestion would be to insert into a new empty collection with a temporary name and then rename it to overwrite the existing collection atomically. You could also consider doing an upsert on each document that has been created or updated in the spreadsheet and then delete any deleted documents.

Categories : Database

Code First ASP.Net membership not synced with WSAT
In case this helps someone else: If you're going Code-First, ensure your connection string is named after your custom DbContext class. public class MyCoolContext : DbContext{} Change your connection string name from DefaultConnection to: <connectionStrings> <add name="MyCoolContext" .... /> Ensure that InitializeSimpleMembershipAttribute under ~/Filters has this line: WebSecurity.InitializeDatabaseConnection("MyCoolContext", "UserProfile", "UserId", "UserName", autoCreateTables: true); That will ensure your membership and EF schemas are rolled into a single db.

Categories : Asp Net

canvas offset- mouse pointer not synced
Change your getMouse to this and it should work: function getMouse(e) { mx = e.clientX - canvas.offsetLeft; my = e.clientY - canvas.offsetTop; } The mouse positions are relative to the whole page so you need to subtract the offset of the canvas element to get them relative to the canvas.

Categories : Javascript

How are models in Django unittests synced to database?
Django creates a new blank database on the fly to run your tests, so if you have models just for testing, they don't need to be added to your main database by syncdb. This is discussed in the docs here: https://docs.djangoproject.com/en/dev/topics/testing/overview/#the-test-database

Categories : Django

How do I keep two article tables synced, but keep stock separate
Unless of course if you have two databases located on two different DB servers, why don't you simply create a table articles and a table stock referencing it. You could add the shop (ideally the shop_id) as an extra column of that latter. Something like that: CREATE TABLE articles(id int primary key not null, name char(20) not null); CREATE TABLE stock(article_id int not null, shop ENUM('M', 'S') not null, qty int not null, FOREIGN KEY(article_id) REFERENCES articles(id), UNIQUE(article_id, shop)); Please see http://sqlfiddle.com/#!2/e6eca/5 for a live example. If you really need to restrict creation of items on table articles to shop M that could be achieved by creating different users for

Categories : Mysql

Two synced events creating an infinite loop
A quick method of preventing an infinite propagation loop: // Infinite loop prevention var bounceProtection = { remoteUpdate: false, // remote toggle local: function(cb) { if (this.remoteUpdate) return; cb(); }, remote: function(cb) { this.remoteUpdate = true; cb(); this.remoteUpdate = false; } }; var myRoom = platform.room('myRoom'); var myKey = myRoom.key('myKey'); myKey.on('set', function(textAreaContent) { bounceProtection.local(function() { $('textarea').val(textAreaContent); }); }); $('textarea').on('change', function(){ var textAreaContent = $(this).val(); bounceProtection.remote(function() { myKey.set(textAreaContent, function(err) { if (err) throw err; }); }); });

Categories : Javascript

PHP SESSION is NOT SAME (Not-in-Synced) in load-balanced Servers?
If you are using the default file-based session storage engine, then naturally, you can't load balance them (at least, not without using some kind of stickiness). What you need is centralized storage for sessions, e.g. using a database or memcache. See also PHP sessions in a load balancing cluster - how?

Categories : PHP

SVN: how to make sure I synced the trunk to a branch correctly
mergeinfo just tells you what revisions have been merged into your branch, that's all. You can get the same info just by looking at the output of your merge command, it won't really tell you any more than that. I'm not sure what else you want, the merge commend will tell you what revisions and files were merged in. Addendum: SVN 1.8 was released, I've just checked the release notes and there is this bit of info: In Subversion 1.8, the -r option restricts the output of svn mergeinfo to the specified revision range, which is useful when determining whether or not a given revision, or range of revisions, is eligible for merging, or whether it has already been merged. In the following example, r682012 has not been merged from trunk yet, while r26112011 has already been merged:

Categories : Svn

Displaying additional profile fields that are synced with AD using JavaScript
$().SPServices.SPGetCurrentUser calls this page : http://you.site.com/_layouts/userdisp.aspx?Force=True&1376982818371. For me the function is not able to parse the page correctly, but you could simply use jQuery (or pure JS or whatever) to get by yourself the same page, and then parse it to find the data you want. Otherwise you can use $SP().people() to query the User Profile Service and gets the info for the user. See the example from the provided link. In theory that should return you the same information or even more info.

Categories : Sharepoint

How can I properly send a Synced External Application Image to a RESTful WCF
from the chooser dialog , you can always get a bitmap chooser-->$Result->getData() = imageUri from the imageUri, get a Bitmap by running the following code: Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), imageUri); Once you get the bitmap.., you can put it to a fileSink you can use a Hashmap to cache it in Memory mBitMap = BitmapFactory.decodeStream( mCR.openInputStream(imageUri), null, options); OutputStream os = new FileOutputStream(f); mBitMap.compress(Bitmap.CompressFormat.JPG, minVal, os); mload.memoryCache.putbig(file.toURI().toURL().toString(), mBitMap); and you can http POST the Bitmap directly by loading its ByteArray to the Entity... case POST: HttpPost httpPost = new HttpPost(url); ByteArrayOutputStream stream

Categories : Android

What's the difference between "source folder" and "pydev package" in pydev eclipse?
A "source folder" is a directory that contains source files. Putting .py files into this directory will make them discoverable by PyDev, so that you can for instance import them from other Python files. A "PyDev Package" is a Python package. This means that it contains a file called __init__.py. For example, if you create a new PyDev Package with name foo, then you will get file foo/__init__.py. You can place other .py files into foo/, which you can then import. So, if you place bar.py into foo/, then you can do import foo.bar This is not possible with source folders. You normally place packages into source folders. I don't know if it is possible to place a source folder into a package, but even if it were you would hardly ever do it.

Categories : Python

Event alarms not created correctly in EventKit with iOS4.3 / calendars synced to Google Calendar
Wow, I just solved it... Apparently this had nothing to do with iOS versions, Google Calendars sync, etc. I just haven't realized that I need to pass a negative value to alarmWithRelativeOffset. This was completely non-intuitive. With a negative offset, it works perfectly. This also explains why zero offset was working before. (I guess perhaps it might have a little bit to do with Google Calendars... I'm guessing that other calendars might support alarms after the event, and so that would have allowed me to debug the issue more easily, but it's not supported in Google Calendars so the invalid "alarm in the future" is just ignored). There's still the minor issue where there's essentially no way to create an event without an alarm in CalendarA, but my guess is that nothing can be done here

Categories : IOS

Moving files from one folder to a hot folder BUT only move one at a time when the hot folder is empty
Pretty sure this should do what you want in vbscript: Set objFS = CreateObject("Scripting.FileSystemObject") set objFolderA = objFS.GetFolder("c:Folder A") set objFolderB = objFS.GetFolder("c:Folder B") For each objFile in objFolderA.Files Do While True If objFolderB.Files.Count = 0 Then objFS.MoveFile objFile.Path, ojbFolderB.Path & "" Exit Do End If Loop Next

Categories : Batch File

separating Model folder, view folder and controller folder in codeigniter
I am not sure that you can move views and models to different locations but you can change the location of application folder to the location of your choice. You can move your application directory to different location and then open your index.php file and set the $system_folder and $application_folder variables with the new path values, preferably with a full path, e.g. '/www/MyUser/system'. Reference: http://ellislab.com/codeigniter/user-guide/installation/index.html Hope this is helpful.

Categories : Codeigniter

Using the Git folder as my main folder, or as a copy of the actual work folder?
Don't copy ! There's no point in doing it and it's prone to accident as you noticed. Simply do your git operations in your work repository, and use push/fetch operations to propagate to other repositories.

Categories : GIT

Error: Package doesn't exists when importing a user defined package
To compile, go to the root and use paths: D:>javac companyBudget.java The compiler has a slightly peculiar way of looking for source code files, documented here. Alternatively you could add the root to the class path explicitly: javac -classpath D: Budget.java

Categories : Java

Where to find the Package Installation Wizard in VS2008 for Deploying SSIS Package?
DTSInstall.exe is the executable that is the SSIS Package Installation Wizard/Deployment Utility. It should be found at C:Program FilesMicrosoft SQL Server100DTSBinnDTSInstall.exe You can also automate deploys by using PowerShell and the SSIS APIs as I demonstrate on PowerShell SSIS deployment and maintenance

Categories : Visual Studio



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