Search Results

Search found 373 results on 15 pages for 'subdirectories'.

Page 13/15 | < Previous Page | 9 10 11 12 13 14 15  | Next Page >

  • Big Data – Data Mining with Hive – What is Hive? – What is HiveQL (HQL)? – Day 15 of 21

    - by Pinal Dave
    In yesterday’s blog post we learned the importance of the operational database in Big Data Story. In this article we will understand what is Hive and HQL in Big Data Story. Yahoo started working on PIG (we will understand that in the next blog post) for their application deployment on Hadoop. The goal of Yahoo to manage their unstructured data. Similarly Facebook started deploying their warehouse solutions on Hadoop which has resulted in HIVE. The reason for going with HIVE is because the traditional warehousing solutions are getting very expensive. What is HIVE? Hive is a datawarehouseing infrastructure for Hadoop. The primary responsibility is to provide data summarization, query and analysis. It  supports analysis of large datasets stored in Hadoop’s HDFS as well as on the Amazon S3 filesystem. The best part of HIVE is that it supports SQL-Like access to structured data which is known as HiveQL (or HQL) as well as big data analysis with the help of MapReduce. Hive is not built to get a quick response to queries but it it is built for data mining applications. Data mining applications can take from several minutes to several hours to analysis the data and HIVE is primarily used there. HIVE Organization The data are organized in three different formats in HIVE. Tables: They are very similar to RDBMS tables and contains rows and tables. Hive is just layered over the Hadoop File System (HDFS), hence tables are directly mapped to directories of the filesystems. It also supports tables stored in other native file systems. Partitions: Hive tables can have more than one partition. They are mapped to subdirectories and file systems as well. Buckets: In Hive data may be divided into buckets. Buckets are stored as files in partition in the underlying file system. Hive also has metastore which stores all the metadata. It is a relational database containing various information related to Hive Schema (column types, owners, key-value data, statistics etc.). We can use MySQL database over here. What is HiveSQL (HQL)? Hive query language provides the basic SQL like operations. Here are few of the tasks which HQL can do easily. Create and manage tables and partitions Support various Relational, Arithmetic and Logical Operators Evaluate functions Download the contents of a table to a local directory or result of queries to HDFS directory Here is the example of the HQL Query: SELECT upper(name), salesprice FROM sales; SELECT category, count(1) FROM products GROUP BY category; When you look at the above query, you can see they are very similar to SQL like queries. Tomorrow In tomorrow’s blog post we will discuss about very important components of the Big Data Ecosystem – Pig. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Big Data, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    Read the article

  • Bash completion doesn't work, or is ignoring what I've typed; but works for commands

    - by Neil Traft
    Bash completion seems to be ignoring what I've typed (it tries to complete, but acts as if there's nothing under the cursor). I know I saw it work on this machine earlier today, but I'm not sure what has changed. Some examples: cd shows all directories under my current folder: $ cd co<tab><tab> cmake/ config/ doc/ examples/ include/ programs/ sandbox/ src/ .svn/ tests/ Commands like ls and less show all files and directories under my current folder: $ ls co<tab><tab> cmake/ config/ .cproject Doxyfile.in include/ programs/ README.txt src/ tests/ CMakeLists.txt COPYING.txt doc/ examples/ mainpage.dox .project sandbox/ .svn/ Even when I try to complete things from a different folder, it gives me only the results for my current folder (telling me that it is completely ignoring what I've typed): $ cd ~/D<tab><tab> cmake/ config/ doc/ examples/ include/ programs/ sandbox/ src/ .svn/ tests/ But it seems to be working fine for commands and variables: $ if<tab><tab> if ifconfig ifdown ifnames ifquery ifup $ echo $P<tab><tab> $PATH $PIPESTATUS $PPID $PS1 $PS2 $PS4 $PWD $PYTHONPATH I do have this bit in my .bashrc, and I have confirmed that my .bashrc is indeed getting sourced: if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi I've even tried manually executing that file, but it doesn't fix the problem: $ . /etc/bash_completion There was even one point in time where it was working for ls, but was not working for cd ... but I can't replicate that result now. Update: I also just discovered that I have terminals open from earlier that still work. I ran source .bashrc in one of them and afterwards completion was broken. Here is my .bashrc: # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # # Modified by Neil Traft #source ~/.profile # Allow globs to expand hidden files shopt -s dotglob nullglob # If not running interactively, don't do anything [ -z "$PS1" ] && return # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # If set, the pattern "**" used in a pathname expansion context will # match all files and zero or more directories and subdirectories. #shopt -s globstar # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # set variable identifying the chroot you work in (used in the prompt below) if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # Color the prompt export PS1="\[$(tput setaf 2)\]\u@\h:\[$(tput setaf 5)\]\W\[$(tput setaf 2)\] $\[$(tput sgr0)\] " # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi

    Read the article

  • Some PowerShell goodness

    - by KyleBurns
    Ever work somewhere where processes dump files into folders to maintain an archive?  Me too and Windows Explorer hates it.  Very often I find myself needing to organize these files into subfolders so that I can go after files without locking up Windows Explorer and my answer used to be to write a program in something like C# to do the job.  These programs will typically enumerate the files in a folder and move each file to a subdirectory named based on a datestamp.  The last such program I wrote had to use lower-level Win32 API calls to perform the enumeration because it appears the standard .Net calls make use of the same method of enumerating the directories that Windows Explorer chokes on when dealing with a large number of entries in a particular directory, so a simple task was accomplished with a lot of code. Of course, this little utility was just something I used to make my life easier and "not a production app", so it was in my local source folder and not source control when my hard drive died.  So... I was getting ready to re-create it and thought it might be a good idea to play with PowerShell a bit - something I had been wanting to do but had not yet met a requirement to make me do it.  The resulting script was amazingly succinct and even building the flexibility for parameterization and adding line breaks for readability was only about 25 lines long.  Here's the code with discussion following: param(     [Parameter(         Mandatory = $false,         Position = 0,         HelpMessage = "Root of the folders or share to archive.  Be sure to end with appropriate path separator"     )]     [String] $folderRoot="\\fileServer\pathToFolderWithLotsOfFiles\",       [Parameter(         Mandatory = $false,         Position = 1     )]     [int] $days = 1 ) dir $folderRoot|?{(!($_.PsIsContainer)) -and ((get-date) - $_.lastwritetime).totaldays -gt $days }|%{     [string]$year=$([string]$_.lastwritetime.year)     [string]$month=$_.lastwritetime.month     [string]$day=$_.lastwritetime.day     $dir=$folderRoot+$year+"\"+$month+"\"+$day     if(!(test-path $dir)){         new-item -type container $dir     }     Write-output $_     move-item $_.fullname $dir } The script starts by declaring two parameters.  The first parameter holds the path to the folder that I am going to be sorting into subdirectories.  The path separator is intended to be included in this argument because I didn't want to mess with determining whether this was local or UNC and picking the right separator in code, but this could be easily improved upon using Path.Combine since PowerShell has access to the full framework libraries.  The second parameter holds a minimum age in days for files to be removed from the root folder.  The script then pipes the dir command through a query to include only files (by excluding containers) and of those, only entries that meet the age requirement based on the last modified datestamp.  For each of those, the datestamp is used to construct a folder name in the format YYYY\MM\DD (if you're in an environment where even a day's worth of files need further divided, you could make this more granular) and the folder is created if it does not yet exist.  Finally, the file is moved into the directory. One of the things that was really cool about using PowerShell for this task is that the new-item command is smart enough to create the entire subdirectory structure with a single call.  In previous code that I have written to do this kind of thing, I would have to test the entire tree leading down to the subfolder I want, leading to a lot of branching code that detracted from being able to quickly look at the code and understand the job it performs. Overall, I have to say I'm really pleased with what has been done making PowerShell powerful and useful.

    Read the article

  • ClickOnce permissions

    - by stephenfalken
    We recently updated our main website. This included creating a new directory to hold the new site; then, some of the existing subdirectories needed to be copied over. Some of the virtual directories below the main site are clickonce publishing locations. These have been 100% successful publishing locations for 3 years now. We would update the application in Visual Studio and then publish... painless. Very long story short, since we've copied the directories to the new main site location on disk, all of our clickonce sites except one will no longer publish. They all fail with an error saying "you are not authorized to perform the current operation". This is immeidately after we set permissions to Full Control for my domain user group. I've checked everything I know how to check as far as permissions go and made the non-working ones' permissions match the one that does work, but no joy. We had problems on Friday and I fixed the one site that does work, but I can't remember how I fixed it; all I remember is that it took a long time screwing with it to make it work. Could there be some arcane setting in IIS that has been omitted? Is there a simple list of things to check anywhere on the Net? ClickOnce information is scattered among 50,000 URLs and I haven't been able to figure it out again. Thanks

    Read the article

  • Izpack: Creating custom panels

    - by bguiz
    Hi, I am trying to create a custom panel for an IzPack installer. This means that I have to extend IzPanel. However, it appears that if I do this, the extended panel needs to be in the com.izforge.izpack.panels package. Then I found this post, which stipulates that: As such, you must include installer.jar from the lib folder of IzPack in the build path of your custom panel project. Your custom panel /must/ extend com.izforge.izpack.installer.IzPanel. Furthermore, it /must/ reside in the com.izforge.izpack.panels package. On top of it all, your build jar's name /must/ be the same as the unqualified name of your custom panel class. I take issue with the 1st and 4th points. They imply that I have to create an additional JAR file for each custom IzPanel that I create. Also, I would have to modify the IzPack installation by adding these JARs to one of its subdirectories. Is this article outdated (2008) and can it be safely ignored, or is this still true? If not how can I avoid this and simply have the extended IzPanel on the classpath instead? Thank you!

    Read the article

  • How to correctly set the ORACLE_HOME variable on Ubuntu 9.x?

    - by nowarninglabel
    I have the same problem as listed here: http://stackoverflow.com/questions/52239/oracle-lost-sysdba-password although I did not lose the password, I entered it twice in the configure script originally, and then when I went to login (localhost:8080/apex, password not accepted. I don't have anything in the database, I just want to install and use Oracle-XE. I have tried apt-get removing it twice and reinstalling, but if I try to run /etc/init.d/oracle-xe configure again and I get "Oracle Database 10g Express Edition is already configured" despite the second time removing any folders I could find for Oracle XE. I tried running sqlplus "/ as sysdba" but all I get is: "Error 6 initializing SQL*Plus Message file sp1.msb not found SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory" I tried setting the variable via export. (also tried set). Tried: "export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlplus" and all the subdirectories of that. Same error every time. What is the ORACLE_HOME supposed to be set to? The only reference I have seen either just say general or say the above up to the version number then "/db_1". I do no thave a db_1. Let me know if need any clarification. Don't understand what I did wrong in this process.

    Read the article

  • Configuring ASP.NET MVC ActionLink format with GoDaddy shared hosting

    - by Maxim Z.
    Background I have a GoDaddy shared Windows hosting plan and I'm running into a small issue with multiple domains. Many people have previously reported such an issue, but I am not interested in trying to resolve that problem altogether; all I want to accomplish is to change the format of my ActionLinks. Issue Let's say the domain that is mapped to my root hosting directory is example.com. GoDaddy forces mapping of other domains to subdirectories of the root. For example, my second domain, example1.com, is mapped to example.com/example1. I uploaded my ASP.NET MVC site to such a subdirectory, only to find that ActionLinks that are for navigation have the following format: http://example1.com/example1/Controller/Action In other words, even when I use the domain that is mapped to the subdirectory, the subdirectory is still used in the URL. However, I noticed that I can also access the same path by going to: http://example1.com/Controller/Action (leaving out the subdirectory) What I want to achieve I want to have my ActionLinks automatically drop the subdirectory, as it is not required. Is this possible without changing the ActionLinks into plain-old URLs?

    Read the article

  • Firefox: Can I use a relative path in the BASE tag?

    - by Aaron Digulla
    I have a little web project where I have many pages and an index/ToC file. The toc file is at the root of my project in toc.html. The pages are spread over a couple of subdirectories and include the toc with an iframe. The project doesn't need a web server, so I can create the HTML in a directory and browse it in my browser. The problem is that I'm running into XSS issues when JavaScript from the toc.html wants to call a function in a page (violation of the same origin policy). So I added base tags in the header with a relative URL to the directory in which toc.html. This works for Konqueror but in Firefox, I have to use absolute paths or the toc won't even display :( Here is an example: <?xml version='1.0' encoding='utf-8' ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <base href="../" target="_top" /> <title>Project 1</title> </head> <body> <iframe class="toc" frameborder="0" src="toc.html"> </iframe> </body> </html> This is file is in a subdirectory page. Firefox won't even load it, saying that it can't find page/toc.html. Is there a workaround? I would really like to avoid absolute paths in my export to keep it the same everywhere (locally and when I upload it on the web server later).

    Read the article

  • Recursive Perl detail need help

    - by Catarrunas
    Hi everybody, i think this is a simple problem, but i'm stuck with it for some time now! I need a fresh pair of eyes on this. The thing is i have this code in perl: #!c:/Perl/bin/perl use CGI qw/param/; use URI::Escape; print "Content-type: text/html\n\n"; my $directory = param ('directory'); $directory = uri_unescape ($directory); my @contents; readDir($directory); foreach (@contents) { print "$_\n"; } #------------------------------------------------------------------------ sub readDir(){ my $dir = shift; opendir(DIR, $dir) or die $!; while (my $file = readdir(DIR)) { next if ($file =~ m/^\./); if(-d $dir.$file) { #print $dir.$file. " ----- DIR\n"; readDir($dir.$file); } push @contents, ($dir . $file); } closedir(DIR); } I've tried to make it recursive. I need to have all the files of all of the directories and subdirectories, with the full path, so that i can open the files in the future. But my output only returns the files in the current directory and the files in the first directory that it finds. If i have 3 folders inside the directory it only shows the first one. Ex. of cmd call: "perl readDir.pl directory=C:/PerlTest/" Thanks

    Read the article

  • Yet another Python Windows CMD mklink problem ... can't get it to work!

    - by Felix Dombek
    OK I have just posted another question which outlined my program but the specific problem was different. Now, my program just stops working without any message whatsoever. I'd be grateful if someone could help me here. I want to create symlinks for each file in a directory structure, all in one large flat folder, and have the following code by now: # loop over directory structure: # for all items in current directory, # if item is directory, recurse into it; # else it's a file, then create a symlink for it def makelinks(folder, targetfolder, cmdprocess = None): if not cmdprocess: cmdprocess = subprocess.Popen("cmd", stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE) print(folder) for name in os.listdir(folder): fullname = os.path.join(folder, name) if os.path.isdir(fullname): makelinks(fullname, targetfolder, cmdprocess) else: makelink(fullname, targetfolder, cmdprocess) #for a given file, create one symlink in the target folder def makelink(fullname, targetfolder, cmdprocess): linkname = os.path.join(targetfolder, re.sub(r"[\/\\\:\*\?\"\<\>\|]", "-", fullname)) if not os.path.exists(linkname): try: os.remove(linkname) print("Invalid symlink removed:", linkname) except: pass if not os.path.exists(linkname): cmdprocess.stdin.write("mklink " + linkname + " " + fullname + "\r\n") So this is a top-down recursion where first the folder name is printed, then the subdirectories are processed. If I run this now over some folder, the whole thing just stops after 10 or so symbolic links. Here is the output: D:\Musik\neu D:\Musik\neu\# Electronic D:\Musik\neu\# Electronic\# tag & reencode D:\Musik\neu\# Electronic\# tag & reencode\ChillOutMix D:\Musik\neu\# Electronic\# tag & reencode\Unknown D&B D:\Musik\neu\# Electronic\# tag & reencode\Unknown D&B 2 The program still seems to run but no new output is generated. It created 9 symlinks for some files in the # tag & reencode and the first three files in the ChillOutMix folder. The cmd.exe Window is still open and empty, and shows in its title bar that it is currently processing the mklink command for the third file in ChillOutMix. I tried to insert a time.sleep(2) after each cmdprocess.stdin.write in case Python is just too fast for the cmd process, but it doesn't help. Does anyone know what the problem might be?

    Read the article

  • How to write a custom solution using a python package, modules etc

    - by morpheous
    I am writing a packacge foobar which consists of the modules alice, bob, charles and david. From my understanding of Python packages and modules, this means I will create a folder foobar, with the following subdirectories and files (please correct if I am wrong) foobar/ __init__.py alice/alice.py bob/bob.py charles/charles.py david/david.py The package should be executable, so that in addition to making the modules alice, bob etc available as 'libraries', I should also be able to use foobar in a script like this: python foobar --args=someargs Question1: Can a package be made executable and used in a script like I described above? Question 2 The various modules will use code that I want to refactor into a common library. Does that mean creating a new sub directory 'foobar/common' and placing common.py in that folder? Question 3 How will the modules foo import the common module ? Is it 'from foobar import common' or can I not use this since these modules are part of the package? Question 4 I want to add logic for when the foobar package is being used in a script (assuming this can be done - I have only seen it done for modules) The code used is something like: if __name__ == "__main__": dosomething() where (in which file) would I put this logic ?

    Read the article

  • iPhone dev: Recurse all project resoureces and collect paths

    - by thomax
    I have a bunch of HTML resources in my app organized in a hierarchy like so: dirA |---> index.html |---> a1.html |---> a2.html |---> dirB |---> b1.html |---> b2.html |---> dirC |---> c5.html |---> c19.html I'm trying to collect the absolute paths of all HTML resources however deep down, but can't seem to figure out how. So far I've tried: NSArray myPaths = [[NSBundle mainBundle] pathsForResourcesOfType:@"html" inDirectory:nil]; This returns an empty array, because I have no HTML files at the root of my project. Then there is: NSArray myPaths = [[NSBundle mainBundle] pathsForResourcesOfType:@"html" inDirectory:@"dirA"]; This returns an array containing only the paths for the three HTML resources directly below dirA. If I read the doc correctly, I guess this is to be expected; pathsForResourcesOfType does not traverse subdirectories. But is there a (preferably nice) way to do it?

    Read the article

  • ASP.NET: disabling authentication for a single aspx page (custom error page)?

    - by Richard Collette
    I am using a custom error page: <customErrors redirectMode="ResponseRedirect" mode="On" defaultRedirect="Error2.aspx"/> I want to disable authentication for the custom error page because the error being raised is related to an authentication module and I don't want to get into an infinite loop and I want to display a clean error page to the user. I have been trying the following configuration to do that. <location path="Error2.aspx"> <system.web> <authentication mode="None"/> <authorization> <allow users="?"/> <allow users="*"/> </authorization> </system.web> </location> I am getting a System.Configuration.ConfigurationErrorsException for the line that sets the authentication mode. It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. I have verified that there are no other web.config files in subdirectories under the application's folder. The applications folder is configured as an application in IIS and the error page is at the application's root. File permissions set for the error page in IIS include anonymous and windows authentication (I have tried just anonymous as well).

    Read the article

  • PHP count total files in directory AND subdirectory function

    - by Neoweiter
    I need to get a total count of JPG files within a specified directory, including ALL it's subdirectories. No sub-sub directories. Structure looks like this : dir1/ 2 files subdir 1/ 8 files total dir1 = 10 files dir2/ 5 files subdir 1/ 2 files subdir 2/ 8 files total dir2 = 15 files I have this function, which doesn't work fine as it only counts files in the last subdirectory, and total is 2x more than the actual amount of files. (will output 80 if I have 40 files in the last subdir) public function count_files($path) { global $file_count; $file_count = 0; $dir = opendir($path); if (!$dir) return -1; while ($file = readdir($dir)) : if ($file == '.' || $file == '..') continue; if (is_dir($path . $file)) : $file_count += $this->count_files($path . "/" . $file); else : $file_count++; endif; endwhile; closedir($dir); return $file_count; }

    Read the article

  • Host Primary Domain from a subfolder

    - by TandemAdam
    I am having a problem making a sub directory act as the public_html for my main domain, and getting a solution that works with that domains sub directories too. My hosting allows me to host multiple sites, which are all working great. I have set up a subfolder under my ~/public_html/ directory called /domains/, where I create a folder for each separate website. e.g. public_html domains websiteone websitetwo websitethree ... This keeps my sites nice and tidy. The only issue was getting my "main domain" to fit into this system. It seems my main domain, is somehow tied to my account (or to Apache, or something), so I can't change the "document root" of this domain. I can define the document roots for any other domains ("Addon Domains") that I add in cPanel no problem. But the main domain is different. I was told to edit the .htaccess file, to redirect the main domain to a subdirectory. This seemed to work great, and my site works fine on it's home/index page. The problem I'm having is that if I try to navigate my browser to say the images folder (just for example) of my main site, like this: www.yourmaindomain.com/images/ then it seems to ignore the redirect and shows the entire server directory in the url, like this: www.yourmaindomain.com/domains/yourmaindomain/images/ It still actually shows the correct "Index of /images" page, and show the list of all my images. Here is an example of my .htaccess file that I am using: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$ RewriteCond %{REQUEST_URI} !^/domains/yourmaindomain/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /domains/yourmaindomain/$1 RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$ RewriteRule ^(/)?$ domains/yourmaindomain/index.html [L] Does this htaccess file look correct? I just need to make it so my main domain behaves like an addon domain, and it's subdirectories adhere to the redirect rules.

    Read the article

  • Qt MOC Filename Collisions using multiple .pri files

    - by Skinniest Man
    In order to keep my Qt project somewhat organized (using Qt Creator), I've got one .pro file and multiple .pri files. Just recently I added a class to one of my .pri files that has the same filename as a class that already existed in a separate .pri file. The file structure and makefiles generated by qmake appear to be oblivious to the filename collision that ensues. The generated moc_* files all get thrown into the same subdirectory (either release or debug, depending) and one ends up overwriting the other. When I try to make the project, I get several warnings that look like this: Makefile.Release:318: warning: overriding commands for target `release/moc_file.cpp` And the project fails to link. Here is a simple example of what I'm talking about. Directory structure: + project_dir | + subdir1 | | - file.h | | - file.cpp | + subdir2 | | - file.h | | - file.cpp | - main.cpp | - project.pro | - subdir1.pri | - subdir2.pri Contents of project.pro: TARGET = project TEMPLATE = app include(subdir1.pri) include(subdir2.pri) SOURCES += main.cpp Contents of subdir1.pri: HEADERS += subdir1/file.h SOURCES += subdir1/file.cpp Contents of subdir2.pri: HEADERS += subdir2/file.h SOURCES += subdir2/file.cpp Is there a way to tell qmake to generate a system that puts the moc_* files from separate .pri files into separate subdirectories?

    Read the article

  • What would it take to get auto-revert-mode to actually work in my dired buffer?

    - by Cheeso
    Apparently auto-revert-mode is supposed to work in dired buffers. I had never heard of this, but the doc says it works. Then I read a little more and found some fine print: Auto-reverting Dired buffers currently works on GNU or Unix style operating systems. It may not work satisfactorily on some other systems. ...and... [dired buffers] do not auto-revert when information about a particular file changes (e.g. when the size changes) or when inserted subdirectories change. To be sure that all listed information is up to date, you have to manually revert using g, even if auto-reverting is enabled in the Dired buffer. source Well, uh, gee.... That doesn't sound like autorevert to me. What would it take to get auto-revert for dired to actually work? Even on (gasp) non-Unix operating systems. Could I just modify auto-revert-handler to call revert-buffer on dired buffers?

    Read the article

  • Read file:// URLs in IE XMLHttpRequest

    - by Dan Fabulich
    I'm developing a JavaScript application that's meant to be run either from a web server (over http) or from the file system (on a file:// URL). As part of this code, I need to use XMLHttpRequest to load files in the same directory as the page and in subdirectories of the page. This code works fine ("PASS") when executed on a web server, but doesn't work ("FAIL") in Internet Explorer 8 when run off the file system: <html><head> <script> window.onload = function() { var xhr = new XMLHttpRequest(); xhr.open("GET", window.location.href, false); xhr.send(null); if (/TestString/.test(xhr.responseText)) { document.body.innerHTML="<p>PASS</p>"; } } </script> <body><p>FAIL</p></body> Of course, at first it fails because no scripts can run at all on the file system; the user is prompted a yellow bar, warning that "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer." But even once I click on the bar and "Allow Blocked Content" the page still fails; I get an "Access is Denied" error on the xhr.open call. This puzzles me, because MSDN says that "For development purposes, the file:// protocol is allowed from the Local Machine zone." This local file should be part of the Local Machine Zone, right? How can I get code like this to work? I'm fine with prompting the user with security warnings; I'm not OK with forcing them to turn off security in the control panel. EDIT: I am not, in fact, loading an XML document in my case; I'm loading a plain text file (.txt).

    Read the article

  • Looking for a very simple file-based CMS

    - by nfm
    I'm building a site for a friend for free, and am trying to work out a good way for her to be able to easily make updates. I haven't used any CMSs before. I was browsing the web today looking at some, and they all seem way too complicated for what I'm after. Basically, all I want is a really simple CMS that pulls together HTML snippets in particular subdirectories, and wraps them in header/footer HTML and inserts them into a template page in the appropriate section. I'm imagining a site layout something like this: / /index.php /blog_template.php /news_template.php /blog/ /blog/header.php /blog/footer.php /blog/my-first-blog.html /blog/blogs-rule.html /blog/... Say index.php contains div#blog. PHP would wrap each /blog/*.html file in /blog/header.php and blog/footer.php, and insert them into the div#blog as div#blog([0-9]*). I haven't been able to find anything this basic, and am one step away from throwing something together myself, but I'm a bit short on time at the moment and figured I'd post here first. Has anyone come across something like this? I don't want any DB, extensions, user accounts, installation, config, updates... just a simple file based solution. Thanks :) Forgot to mention - needs to be FOSS and run on Linux!

    Read the article

  • Apache/Rails/Passenger directory URLs that don't end in '/' fail to 404.

    - by Portamento
    I'm using Apache with passenger to run a rails app. In my rails app, I have some static content in subdirectories of the public directory. Each subdirectory has an index.html in it. So, inside the public directory, I have a subdir called 'b' and inside it, is an index.html. So it's like this: /public/b/index.html I have links to these pages, of the form: http://a.com/b If I do this in my regular non-rails web directory, Apache correctly rewrites this URL to be http://a.com/b/ which then, subsequently shows the index.html. It's only when accessing my rails app that it doesn't work. In fact, if I turn off passenger mod... so it just accesses my rails app like a regular document root, it works correctly also. What the heck do I need to do to get this to work properly with passenger? Again, it works fine in apache itself when passenger is not involved. I am running passenger 2.1.3. I have another server running passenger 2.0 that doesn't seem to have this problem, but I don't see anything different in the config other than the different versions of passenger itself. HELP! Been working on this for two days solid with no improvement!

    Read the article

  • Using mod-rewrite to conditionally select existing file in a subdirectory based on Host header?

    - by Kevin Hakanson
    I'm working through a problem where I want to select a different static content file based on the incoming Host header. The simple example is a mapping from URLs to files like this: www.example.com/images/logo.gif - \images\logo.gif skin2.example.com/images/logo.gif - \images\skin2\logo.gif skin3.example.com/images/logo.gif - \images\skin3logo.gif I have this working with the following RewriteRules, but I don't like how I have to repeat myself so much. Each host has the same set of rules, and each RewriteCond and RewriteRule has the same path. I'd like to use the RewriteMap, but I don't know how to use it to map the %{HTTP_HOST} to the path. <VirtualHost *:80> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" ServerName www.example.com ServerAlias skin2.example.com ServerAlias skin3.example.com RewriteEngine On RewriteCond %{HTTP_HOST} skin2.example.com RewriteCond %{DOCUMENT_ROOT}$1/skin2/$2 -f RewriteRule ^(.*)/(.*) $1/skin2/$2 [L] RewriteCond %{HTTP_HOST} skin3.example.com RewriteCond %{DOCUMENT_ROOT}$1/skin3/$2 -f RewriteRule ^(.*)/(.*) $1/skin3/$2 [L] </VirtualHost> The concept behind the rules is if the same filename exists in a subdirectory for that host, use it instead of the direct targeted file. This uses host based subdirectories at the lowest level, and not a top level subdirectory to separate content.

    Read the article

  • Recursion through a directory tree in PHP

    - by phphelpplz
    I have a set of folders that has a depth of at least 4 or 5 levels. I'm looking to recurse through the directory tree as deep as it goes, and iterate over every file. I've gotten the code to go down into the first sets of subdirectories, but no deeper, and I'm not sure why. Any ideas? $count = 0; $dir = "/Applications/MAMP/htdocs/idahohotsprings.com"; function recurseDirs($main, $count){ $dir = "/Applications/MAMP/htdocs/idahohotsprings.com"; $dirHandle = opendir($main); echo "here"; while($file = readdir($dirHandle)){ if(is_dir($file) && $file != '.' && $file != '..'){ echo "isdir"; recurseDirs($file); } else{ $count++; echo "$count: filename: $file in $dir/$main \n<br />"; } } } recurseDirs($dir, $count); ?

    Read the article

  • Django sub-applications & module structure

    - by Rob Golding
    I am developing a Django application, which is a large system that requires multiple sub-applications to keep things neat. Therefore, I have a top level directory that is a Django app (as it has an empty models.py file), and multiple subdirectories, which are also applications in themselves. The reason I have laid my application out in this way is because the sub-applications are separated, but they would never be used on their own, outside the parent application. It therefore makes no sense to distribute them separately. When installing my application, the settings file has to include something like this: INSTALLED_APPS = ( ... 'myapp', 'myapp.subapp1', 'myapp.subapp2', ... ) ...which is obviously suboptimal. This also has the slightly nasty result of requiring that all the sub-applications are referred to by their "inner" name (i.e. subapp1, subapp2 etc.). For example, if I want to reset the database tables for subapp1, I have to type: python manage.py reset subapp1 This is annoying, especially because I have a sub-app called core - which is likely to conflict with another application's name when my application is installed in a user's project. Am I doing this completely wrongly, or is there away to force these "inner" apps to be referred to by their full name?

    Read the article

  • How to use a rewrite rule to force calls for "domain.tld/subdir/file.html" to show as "subdir.domain.tld/file.html"?

    - by Wion
    Hi! First time poster. Very new to mod_rewrite. I'm on a shared server and the context of this problem is with a virtual directory under my root account. The domain (domain.tld) will have subdirectories representing annual mini-sites of static .html files. Subdirectory names (yyyy) will be the 4-digit year (e.g., "2010"). I want any call to domain.tld/yyyy/file.html to appear as yyyy.domain.tld/file.html in the browser address bar, and (of course) for the page to load properly. I already force dropping “www” by using… RewriteCond %{HTTP_HOST} ^www\.domain\.tld [NC] RewriteRule (.*) http://domain.tld/$1 [R=301,L] So far so good. But no matter what I try after that, I can’t get the subdomain to force to the front of the domain. Here’s one of the more complicated examples I’ve tried (no doubt wrong)… RewriteCond %{HTTP_HOST} ^domain\.tld/([0-9]+)/([a-z-]+)\.html [NC] RewriteRule (.*) %1.domain.tld/%2.html [NC] This doesn’t break anything (that I can tell), but it doesn’t do what I want either. I.e., if I type yyyy.domain.tld, I’ll see yyyy.domain.tld in the address bar, and navigating around will give me yyyy.domain.tld/file.html, etc. Fine. But if also type domain.tld/yyyy I’ll see domain.tld/yyyy, etc, which is not how I want people to see it. It doesn’t redirect or mask or alias or whatever you call it. Is it even possible to force one look over the other like that? Should I be handling this with DNS instead? Thanks in advance!

    Read the article

  • Exclude subdirectory from rewrite rule in web.config

    - by Clog
    This question comes up often, but I can only find solutions for PHP, Apache, htaccess etc but not for web.config I would like my pages to return in HTTP not HTTPS, except for forms within certain subdirectories. I have created the following web.config file, but how do I exclude a subdirectory called forms. <configuration> <system.webServer> <rewrite> <rules> <rule name="Force all to HTTP" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="on" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Found" url="http://www.mysite.com/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> Many thanks all you clever clogs.

    Read the article

< Previous Page | 9 10 11 12 13 14 15  | Next Page >