w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
installation of twisted fails using python3 on centos 6.x?
You can't install Twisted on Python 3 this way. Check the source out from subversion: svn checkout svn://svn.twistedmatrix.com/svn/Twisted/tags/releases/twisted-13.1.0 Then run setup3.py: python3.3 setup3.py install

Categories : Python

python installation, failing to find bz2 module
It would appear that a sort of non-answer answer was arrived at accidentally via a long string of twitter conversation(s). I've filed another SO question here to ask WHY what we found was the solution to this problem: python installation: --prefix not being persisted in config For posterity sake, right now the solution is that I have to set the PYTHONHOME environment variable to /usr, and everything starts working. The puzzling part is that the documentation says PYTHONHOME should default to {prefix}, which I was clearly setting as default during configure to /usr. So why should I have to manually set it? Running python-config --prefix reveals that the {prefix} default is in fact /usr/bin, NOT /usr like I specified, which leads to me needing to override the default back to the default,

Categories : Python

Maven unable to find Java installation
I suppose that JAVA_HOME="/usr/lib/jvm/java-6-openjdk/jre" is the problem. Maven log clearly says that your path should point to JDK not just JRE. So try export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

Categories : Maven

How to find out the Python library installation path?
I don't know of a good way to do this in Python (other than crawling the directories from a given root to look for a file using os.walk). If you do not get any better answers for how to do this in Python you could execute a command on your OS from python to execute a standard Linux/Unix find command on the library you are looking for. You could use the subprocess module to do this.

Categories : Python

Getting Android SDK installation to find JDK dropped javaw.exe out of Eclipse
The FAQ section Find the JVM could be of interest: Eclipse DOES NOT consult the JAVA_HOME environment variable. To explicitly specify a JVM of your choice, you can use the -vm command line argument: eclipse -vm c:jreinjavaw.exe ''start Java by executing the specified java executable eclipse -vm c:jreinclientjvm.dll ''start Java by loading the jvm in the eclipse process See the launcher page for more details on specifying a JVM. eclipse.ini The most recommended way to specify a JVM for Eclipse to run in is to put startup configuration into the eclipse.ini file in the same folder as the Eclipse executable (eclipse.exe on Windows). The Eclipse program launcher will read arguments from either the command-line or the configuration file named eclipse.ini

Categories : Java

find an error in installation of phonegap plugin in eclipse
You may be running into https://code.google.com/a/eclipselabs.org/p/mobile-web-development-with-phonegap/issues/detail?id=97 See the workaround in comment #2.

Categories : Java

when using https, https can't find codeigniter controllers. Running Centos
Change this line : RewriteRule ^(.*)$ index.php?/$1 [L] to : RewriteRule ^(.*)$ /index.php?/$1 [L] The .htaccess would otherwise be redirected relatively to a index.php in the join folder, which off course is not there.

Categories : PHP

Exception Value:failed to find libmagic. Check your installation in windows 7
Your multiuploader form uses python-magic library possibly for filetype identification. However you probably do not have all the missing dependencies installed. Please install the missing dependencies. https://github.com/ahupp/python-magic#dependencies

Categories : Python

Python-magic installation error - ImportError: failed to find libmagic
The below original answer is now outdated. Please simply follow the instructions denoted under the "dependencies" section. ORIGINAL ANSWER: I was able to solve this problem by moving the 3 files from GNUWin32 project to a separate directory (not the system32 directory the docs suggest) and adding them to the PATH environment variable

Categories : Python

Cut string when find a space
You would be better off by using explode this way: $text_arr = explode(" ", $datum[0]); echo $text_arr[0]; Forget about the foreach loop, just use the first element as it's already cut on the first space. Hope this helps.

Categories : PHP

iOS Find the box given a point in space
The CGRectContainsPoint method does all the work for you. Say for example you used a tap gesture. -(void)handleTap:(UITapGestureRecognizer *)gesture { CGPoint point = [gesture locationInView:self.view]; if (CGRectContainsPoint(box.frame, point)) { NSLog@("Point is in Box"); } }

Categories : IOS

space complexity to find a subtree
The function calls itself recursively, so although you are not explicitly using memory, the stack will cost O(h1) + O(h2) in the call stack. If the tree is sufficiently balanced, this is the same as O(logn) + O(logm).

Categories : C++

Regex:find extra space
string pattern = @"ss[INF]ss"; Regex Test

Categories : C#

FInd an unused/empty space in an array
This should work, please note, it's untested. LINQ: var nullOrEmptyIndexes = ListObject.Select((item, index) => new { item, index }).Where(x => x.item == null).Select(x => x.index); Loops: public static IEnumerable<int> GetEmptyIndexes(List<object> list) { for (int i = 0; i < list.Count; i++) { if (list[i] == null) { yield return i; } } } Change ListObject to the list you wish to check. Although, you really shouldn't have blanks in your list, seems messy to me.

Categories : C#

How to find convex hull in a 3 dimensional space
I would suggest first try an easier approach like quick hull. (Btw, the order for gift wrapping is O(nh) not O(n2), where h is points on hull and order of quick hull is O(n log n)). Under average circumstances quick hull works quite well, but processing usually becomes slow in cases of high symmetry or points lying on the circumference of a circle. Quick hull can be broken down to the following steps: Find the points with minimum and maximum x coordinates, those are bound to be part of the convex. Use the line formed by the two points to divide the set in two subsets of points, which will be processed recursively. Determine the point, on one side of the line, with the maximum distance from the line. The two points found before along with this one form a triangle. The points lying insid

Categories : Algorithm

PDF: how do I find how much space will the text occupy when rendered?
The mechanisms and math of PDF text rendering are exhaustively explained in the PDF specification ISO 32000-1. Most important are chapters 8 Graphics and 9 Text. Essentially you need to know the current graphic state (which should be easy because you after all are the one who creates the PDF) and the metrics of the font you use and then calculate. Most of these details are governed by the operators and calculations described in chapter 9 but one should not forget the current transformation matrix described in chapter 8.

Categories : C

How can find out how much space my snapshots are taking in Amazon EC2
Snapshots are persisted to S3, but are not stored in buckets owned by the user - so you won't be able to see them there. To see how much space is being used by snapshots, you should be able to log in to the AWS Console through your web browser and see it under "Elastic Block Store", or if you've installed the command-line tools by running the ec2-describe-snapshots command you will see the following parameter returned: volume-size The size of the volume As for downloading your snapshots, it's possible with the non-Windows instance snapshots, but it's also quite involved. But here's the instructions.

Categories : Amazon

WiX Toolset - check for all installation prerequisites at once (conditional installation)
The WiX Condition element when used under a Fragment or Product element represents an entry in the LaunchCondition Table and is processed by the LaunchConditions Action. The behavior you see is a limitation of that underlying feature. Here's a blog article I wrote about this 7 years ago: Short Comings of LaunchConditions Sadly, Microsoft has never taken my recommendations for improvement. So instead of using the Condition element you'll have to write your own custom table and custom action to do the processing. I have sample code for this in InstallScript and C# but I've never written it in C/C++. Here is a stripped down example in InstallScript. Read it as pseudocode for refactoring in C/C++. You'll need to also create the custom table used by the SQL query, define and schedule

Categories : Wix

How to find if url containing special characters or space exists in java
URLs with spaces in them are invalid. The correct way to create a properly encoded URL from a filename that may contain spaces is URI.toASCIIString(), and then passing that to new URL(), making sure to use a URI constructor that takes multiple arguments so the filename part gets encoded: see the Javadoc. However I question the requirement. The best way to test whether any resource is available is to try to use it. In this case presumably you are going to read from the URL if it exists, so just do that and catch the FileNotFoundException.

Categories : Java

How to find loop in a Link List using O(N) space complexity
For detailed implementation, read this post(How to determine if a linked list has a cycle using only two memory locations). Basically you maintain two pointers, both of which point at the head of the linked list initially. On each enumeration, advance the first pointer by one node and the other by two. If at some point these two pointers reach an identical node again, a cycle is detected. I gather from your description that you do know this algorithm. If the space taken by the linked list itself is not considered, this one works in O(1) space. And even with that much space considered, it's still O(n). (If space complexity is the only concern, obviously worse algorithm exists.)

Categories : C

Regular expression to find position of the last alpha character that is followed by a space?
I'm not sure about REFindNoCase, but I think you can try with REReplaceNoCase. I hope that CF can take back references like most regex engines do: REReplaceNoCase(MyString, "(.*[a-zA-Z]+)s.*", "$1", ALL); EDIT: for the backreference, it appears that you use the backslash instead of the dollar sign: REReplaceNoCase(MyString, "(.*[a-zA-Z]+)s.*", "1", ALL); And if it goes well, you should have something like this. .* matches anything besides a newline character,  matches word boundaries, [a-zA-Z]+ are for alphabet characters and s is for the space just after it. The greediness of the first .*'s is being exploited here to capture as much as possible until you get the last word followed by a space. And I guess you can add the ellpses after the $1 like so: REReplaceNoCase(MySt

Categories : Regex

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

Gem installation error during MYSQL gem installation in ruby
You need to install mysql before installing mysql gem. Follow this link on how to install mysql on windows

Categories : Mysql

calculate total used disk space by files older than 180 days using find
du wouldn't summarize if you pass a list of files to it. Instead, pipe the output to cut and let awk sum it up. So you can say: find . -mtime +180 -exec du -ks {} ; | cut -f1 | awk '{total=total+$1}END{print total/1024}' Note that the option -h to display the result in human-readable format has been replaced by -k which is equivalent to block size of 1K. The result is presented in MB (see total/1024 above).

Categories : Linux

Cannot find hadoop installation: $HADOOP_HOME must be set or hadoop must be in the path
Go to /etc/profile.d directory and create a hadoop.sh file in there with export HADOOP_HOME=/opt/hadoop/hadoop export HIVE_HOME=/opt/hadoop/hive export PATH=$PATH:$HADOOP_HOME/bin:$HIVE_HOME/bin After you save the file, make sure to chmod +x /etc/profile.d/hadoop.sh source /etc/profile.d/hadoop.sh This should take care of it.

Categories : Hadoop

qmake: could not find a Qt installation of '' - Setting up qmake?
This message shown by qtchooser app. To setup it properly, you should make conf files in /etc/xdg/qtchooser/ for example: $ ls -1 /etc/xdg/qtchooser/ default.conf qt-4.8.5.conf qt-5.1.0.conf each file has two lines: path to bin, path to lib: $ cat /etc/xdg/qtchooser/default.conf /opt/Qt/4.8.5/bin /opt/Qt/4.8.5/lib additional info: man qtchooser

Categories : Qt

find the number of string including white-space that can be inserted inside a div of fixed width with a fixed font-size
Yes you can do it programmatically. Check this var wid = $("div").width(); var allowedChars = parseInt(wid/getCharWidth('Courier New', '10px')); var div = $("div"); for(var i = allowedChars; i > 0; i--) { $(div).append("a"); } function getCharWidth(fontFamily, fontSize) { var div = document.createElement("div"); div.style.position = "absolute"; div.style.visibility = "hidden"; div.style.fontFamily = fontFamily; div.style.fontSize = fontSize; div.innerHTML = "S"; document.body.appendChild(div); var width = div.offsetWidth; document.body.removeChild(div); return(width); } Also check this link for more information. Cheers!!!

Categories : Javascript

UNIX:Create array from space delimited string while ignoring space in quotes
This is bash specific, may work with ksh/zsh inp='ROLE_NAME="Business Manager" ROLE_ID=67686' set -- $inp arr=() while (( $# > 0 )); do word=$1 shift # count the number of quotes tmp=${word//[^"]/} if (( ${#tmp}%2 == 1 )); then # if the word has an odd number of quotes, join it with the next # word, re-set the positional parameters and keep looping word+=" $1" shift set -- "$word" "$@" else # this word has zero or an even number of quotes. # add it to the array and continue with the next word arr+=("$word") fi done for i in ${!arr[@]}; do printf "%d %s " $i "${arr[i]}"; done 0 ROLE_NAME="Business Manager" 1 ROLE_ID=67686 This specifically breaks words on arbitrary whitespace but joins

Categories : Shell

javascript regex replace all doublequotes in string unless the doublequote is followed by space or comma space
A way: rebuild the json string: var str = '{"description":"This is my 12" pizza I ordered.","value":"1"}'; var regex = /"(.*?)"(?=s*([,:])s*"|(}))/g; var result = '{'; var arr = regex.exec(str); while (arr != null) { result += '"' + arr[1].replace(/\?"/g, '\"') + '"'; if (arr[2]) result += arr[2]; if (arr[3]) result += arr[3]; arr = regex.exec(str); } console.log(result);

Categories : Javascript

We would like to register a user if space is available or put on waiting list if space is full. Any ideas how to approach this?
Maybe I'm missing something, but it doesn't seem that complicated to me. This answer only uses the SQL pieces that matter to preserve legibility, since I'm mainly referring to queries and not the VB. First, you do what you were already doing--check to see if they're already signed up/on the waiting list. SELECT Count(*) FROM ( SELECT * FROM tblTrainings UNION SELECT * FROM waitingList ) AS t WHERE Username = XXX AND CourseID = XXX AND LocationID = XXX AND dateID = XXX /* Tells you whether the person is signed up already, whether for the course itself or the waiting list. */ SELECT Count(*) FROM tblTrainings WHERE CourseID = XXX AND LocationID = XXX AND dateID = XXX -- This will give you the number of people in the course. Then, once you have that, you can decide whether to add th

Categories : Asp Net

What is the linux command line to check kernel space and User space Memory used
Try: sudo slabtop or sudo cat /proc/slabinfo These should give you enough information to estimate the total kernel memory consumption. You can read more info about kernel and userspace memory here.

Categories : Linux

How to capitalize each word after a space leaving the rest of it as is and preserve the space in the end if it exists
Use re.sub: >>> import re >>> re.sub(r'[a-z]', lambda m: m.group().upper(), 'home swe eeeet home') 'Home Swe Eeeet Home' >>> re.sub(r'[a-z]', lambda m: m.group().upper(), 'heLLo OoO ooo ') 'HeLLo OoO Ooo ' re.sub(pattern, repl, string, count=0, flags=0) Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl. If the pattern isn’t found, string is returned unchanged. repl can be a string or a function. If repl is a function, it is called for every non-overlapping occurrence of pattern. The function takes a single match object argument, and returns the replacement string. [a-z] match any lowercase character([a-z]) after the word boundary (). The lambda function

Categories : Python

Windows batch file to get C: drive total space and free space available
cut 9 digits of the size by bytes to get the size in GB: @echo off & setlocal ENABLEDELAYEDEXPANSION SET "volume=C:" FOR /f "tokens=1*delims=:" %%i IN ('fsutil volume diskfree %volume%') DO ( SET "diskfree=!disktotal!" SET "disktotal=!diskavail!" SET "diskavail=%%j" ) FOR /f "tokens=1,2" %%i IN ("%disktotal% %diskavail%") DO SET "disktotal=%%i"& SET "diskavail=%%j" (ECHO(Information for volume %volume% ECHO(total %disktotal:~0,-9% GB ECHO(avail. %diskavail:~0,-9% GB)>size.txt TYPE size.txt cmd can calculate only with numbers up to 2^31-1   (2,147,483,647 ~ 2.000001 Gigabytes)

Categories : Windows

Adding empty rows or space in fo:table inly if there's enough space for next data
As a workaround, you can add 'padding-bottom' to each row except the last row in the table. You may end up with row 5 of your example being moved to the second page, but you can at least be sure that there's no extra space at the top of the page.

Categories : Xml

Are Java threads created in user space or kernel space?
Java threads are "user" threads, but under the hood, the Java Virtual Machine is using kernel threads and delegating the user threads CPU time on each kernel thread in its kernel thread pool. See this question for a better explanation. It seems that threading is JVM-vendor specific, and my understanding might not hold for all JVM implementations.

Categories : Java

delete img tag and remove double space into single space using preg_replace
I think, you can use strip_tags instead $str = '<img src="xxxxxx"/> Title'; echo strip_tags($str); // Title Also using preg_replace $str = '<img src="xxxxxx"/> Title'; echo preg_replace('#<img.*?(/>|$)#s', '', $str, 1); // Title DEMO.

Categories : PHP

SQL Server Express 2012 Installation fails with Could not find the Database Engine startup handle in SQL Server Express 2012
I have found the solution. It was, in fact, a r/w rights error. I have added following users to my profile folder: IUSR Local Service Network IIS_IUSRS Service I know I went overkill here but I wanted to be sure without giving everyone access rights. I will disable them one by one and find the right one(s) needed to properly run SQL Server Express 2012.

Categories : Misc

Splitting a string containing space-delimited "key=value" pairs when the value can also contain space
You can search for the unwanted spaces by using a lookahead that ensures that they don't preced a key: $input =~ s/[ ](?!S+=)/_/g; The lookahead makes sure that there is no = before the next space character. Then you can split on spaces. Alternatively, to match right away, you can use a similar technique: while ($input =~ m/(S+)=((?:S|[ ](?!S+=))+)/g) { # $1 is the key # $2 is the value } For the value we repeat either non-space characters or spaces that do not preced a key. Working demo. If your keys are always upper case, you can replace all S+ in my code with [A-Z]+.

Categories : Regex

How do I fix the right column space and bottom container space in html
Take a look at what are called Reset Sheets here: http://meyerweb.com/eric/tools/css/reset/ The specific CSS you are looking for is: html, body { margin: 0; padding: 0; }

Categories : Javascript

Installation Error - D/InstallAppProgress(): Installation error code: -25
Check the version number in your Manifest. If the version is less than the one on the device, you will not be able to over-install. You can install it using adb by using the -r flag. See here http://developer.android.com/tools/help/adb.html

Categories : Android

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