w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Long Path in .net
Please checkout this library, it was more then perfect for me to work with long path Link Here

Categories : Dotnet

How to make an "alias" for a long path?
First, you need the $ to access "myFold"'s value to make the code in the question work: cd "$myFold" To simplify this you create an alias in ~/.bashrc: alias cdmain='cd ~/Files/Scripts/Main' Don't forget to source the .bashrc once to make the alias become available in the current bash session: source ~/.bashrc Now you can change to the folder using: cdmain

Categories : Linux

Long path xquery in SQL Server
Maybe this solution helps? DECLARE @p1 VARCHAR(MAX) = 'variable1' , @p2 VARCHAR(MAX) = 'variable2'; SELECT @SSRXML.query('//root/*[local-name()=sql:variable("@p1")]/*[local-name()=sql:variable("@p2")]'); It is not clear what you mean by 'variable1/variable2' and what result you want to get. If you know maximum number of nodes in @p variable you can use this solution: DECLARE @p0 VARCHAR(MAX) = 'variable1/variable2/variable3' , @p1 VARCHAR(MAX) , @p2 VARCHAR(MAX) , @p3 VARCHAR(MAX) , @p4 VARCHAR(MAX) ; SET @p0 = REPLACE (@p0, '/', '.'); SELECT @p1 = ISNULL (PARSENAME(@p0, 1), '') , @p2 = ISNULL (PARSENAME(@p0, 2), '') , @p3 = ISNULL (PARSENAME(@p0, 3), '') , @p4 = ISNULL (PARSENAME(@p0, 4), '') ; SELECT @SSRXML.query(' if (sql:variable("@p4") != "") t

Categories : Sql Server

The cspack throw one exception that: the file path 'out:c:pweb.cspkg' contains invalid characters or is too long
I think your issue is that you are leaving off the / on the command parameters. the role, sites and out parameters should all be proceeded with a /. check the command line help by typing the following: cspack.exe /? Also, if you are attempting to create a package that the local emulator will use you need to ensure to include the /copyOnly parameter. Looking at the MSDN documentation on CSPack it states as follows: "If /copyOnly is not specified, this option specifies the file name for the application package. If no file name is specified, the application package is created as .cspkg." In the MSDN Documentation for CSRun is states as follows: "Before you can use CSRun to deploy an application to the compute emulator, you must run the CSPack Command-Line Tool with the /copyOnly opti

Categories : Azure

Get full path and long file name from short file name
@echo off setlocal rem this need to be a short name to avoid collisions with dir command bellow cd C:BALBAL~1BLBALB~1 set "curr_dir=%cd%" set "full_path=" :repeat for /f "delims=" %%f in ('for %%d in ^(.^) do @dir /a:d /n /b "..*%%~snd"') do ( set "full_path=%%f\%full_path%" ) cd .. if ":" NEQ "%cd:~-2%" ( goto :repeat ) else ( set "full_path=%cd%%full_path%" ) echo --%full_path%-- cd %curr_dir% endlocal The path is hardcoded at the beginning but you can change it or parameterizied it.As you can easy get the full name of a file here is only a solution for directories. EDIT now works for file and directory and a parameter can be passed: @echo off rem --------------------------------------------- rem ---------------------- TESTS ---------------- rem --------------

Categories : Batch File

Why can I run this file packaged by Maven by specifying the path as argument but not by setting the path permanently in my path variable?
You'll need to add the storm dependencies to your classpath - it's currently not included because it is marked as 'provided' in the m2-pom.xml, change it to 'compile': <dependency> <groupId>storm</groupId> <artifactId>storm</artifactId> <version>0.8.2</version> <scope>compile</scope> </dependency>

Categories : Java

Hadoop get relative path from absolute path and base path
How about building a String while recursing with getParent() until the current path is equal to the base path? Here is a helper function that might do what you want. (I haven't tested it yet, but the idea might help) private static String absolutePathToRelativeString(final Path path, final Path base) { final StringBuilder builder = new StringBuilder(path.toString().length()); Path curPath = new Path(path); while (curPath != null && curPath.depth() != 0 && !curPath.equals(base)) { if (!curPath.equals(path)) { builder.append('/'); } builder.insert(0, curPath.getName()); curPath = curPath.getParent(); } return builder.toString(); }

Categories : Java

Sqlite database fails on target due to 'long long int' (64 bits) data type
I found the root cause and wanted to bring this thread to a close. Well this is really embarrassing! There were 2 copies of the 'Sqlite.h' header files within the project and each of them had different configuration for SQLITE_INT64_TYPE. Hence the difference in the output. Many thanks to all people who have spent time on this.

Categories : C

Issue related to IQueryable method (Cannot implicitly cast type 'long?' to 'long'
if you are sure of the types you want to use, you could try this: public IQueryable<vmTest> TestMethod(long ID) { return from m in db.table1 join n in db.table2 on m.table1_ID equals n.table1_ID into tabC from c in tabC join o in db.table3 on m.table3_ID equals o.table3_ID where m.table1_ID.Equals(ID) select new vmTest { field1 = m.xxx.HasValue ? m.xxx.Value : default(long) /*or something else, or an exception maybe... according to your expectation in this case*/ }; }

Categories : C#

Finding the length of a dynamically allocated array of unsigned long long
One way is to keep a counter every time an element is inserted into the array. Maybe you can encapsulate the array in a struct e.g: typedef struct int_arr { int* arr_ptr; size_t max_size; int curr_elem; } int_arr; Then you can specify init, add and get_max_size and get_curr_size functions. Init: int_arr* arr_init(int_arr* ptr, size_t size) { ptr = calloc(size, sizeof(int); ptr->max_size = size; ptr->curr_elem = 0; return ptr; } Add: void add(int_arr* ptr, int value) { if (ptr->curr_elem < ptr->max_size) ptr->arr_ptr[ptr->curr_elem++] = value; else printf("Max size reached! "); } Get total size: size_t get_total_size(int_arr* ptr) { return ptr->max_size; } Get current size: int get_curr_size(int_ar

Categories : C

Oracle 11g + Hibernate -> ORA-01461: can bind a LONG value only for insert into a LONG column
So, it was a problem with bigger String then 4000 byte. We changed the column to CLOB, this should solve it. And if the character literal is smaller then 4000 byte, it still gets stored in Oracle as if it would be varchar2(4000).

Categories : Java

powerpc-gcc compiles long long datatype variables into floating registers
You would pass -msoft-float to the compile command line. This will force it to not use any floating point registers, and instead treat the target as having only 32 32-bit GPRs.

Categories : Gcc

Is the name of an Eclipse plugin irrelevant as long as residing in the plugins/ directory and as long as its contents are valid?
Regarding the BundleActivator.start() and IStartup.earlyStartup(), I already answered this in your previous question, and you accepted the answer. Did you need further clarification? It would be better to ask for clarification on the original question rather than just repeat it. Regarding bundle JAR file naming, OSGi does NOT care what the name of the JAR file is, which is why you could not find anything about it in the spec. In fact the bundle doesn't even have to be in a file, you could read it over the network or from anywhere you can get a java.io.InputStream. However, Eclipse is built on top of OSGi and various parts of Eclipse do expect the name of the bundle JAR file to match the Bundle-SymbolicName of the bundle. Since you say you are developing an OSGi application rather than a

Categories : Java

Can I achieve type equivalency between uint_fast64_t and unsigned long long?
static_cast should do the trick since they are all numeric types (providing that your fast64 ints are not using more than 64-bits). unsigned long long convert_to_ull(uint_fast64_t i) { return static_cast<unsigned long long>(i); } std::vector<uint_fast64_t> origData; // fill in origData std::vector<unsigned long long> data; data.reserve(origData.size()); std::transform(origData.begin(), origData.end(), data.begin(), convert_to_ull);

Categories : C++

using qsort to sort an array of long long int not working for large nos
The result of compare function must be int. The subtraction of two long long can easily overflow the int type (and it does in your case). Try comparing the two values explicitly and returning -1, 0 or 1.

Categories : C

Transform coordinates from Long Island Zone to Lat. Long format with R
You can do this with rgdal and sp. library(rgdal) library(sp) # I made a guess at the PROJ4 string that your data was in. This is using SRID: 2831 long.island.proj4<-CRS("+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs") # Remove the missing values in your data, and convert to SpatialPoints sp.points<-SpatialPoints(example[complete.cases(example),],proj4string=long.island.proj4) # Project to lat/long spTransform(sp.points,CRS('+proj=longlat'))

Categories : R

Dividing variables of type long long to get a percentage?
You're performing an integer division, then the result is getting casted to a double but it's too late: you already lost precision.If you just cast one of the two operands to a double, the other one will be also promoted to a double and you'll get a floating point value as result: NSLog(@"%f,"(double)totalBytesWritten/totalBytesExpected);

Categories : Objective C

simple unsigned long long conversion from array
Huh? If you're certain that the unsigned long long is big enough, then why are you bothering with the manual implementation? Why not just use an unsigned long long variable? There's some brokenness in your loop; the expression (counter->data[m] << m * 8) does not have type unsigned long long so will likely drop a lot of bits. Use something like this: for(m = 0; m < COUNTER_LENGTH; ++m) { a <<= 8; a |= counter->data[m]; } The above should also be endian-safe; it always OR:s in the most significant byte first (as determined by the counter representation).

Categories : C

Find all lat/long pairs within a given distance from a lat/long pair
Many databases support storage of spatial types directly, and include spatial queries. This will handle the distance computation correctly for you, as well as provide a far more efficient means of pulling the information. For examples, see: Spatial Data in SQL Server Geometric types in PostgreSQL MySQL Spatial Extensions SpatiaLite

Categories : Database

How to stop displaying long long file list of `ls`?
You can control the ls output by using less or more command, like below: ls | more ls | less They'll work on interactive way. Or you can truncate output with head or tail command, like: ls | head ls | tail head will show default 10 lines from head and tail will show default 10 lines from tail.

Categories : Linux

std::abs for "unsigned long long int" data type
Because back before C++ with C you used to have use abs, fabs, labs for each different type, c++ allows overloading of abs, in this case it doesn't understand or isn't happy with your overload. Use labs(a-b) seeing as you're using longs, this should solve your problem.

Categories : C++

c: unsigned long long being assigned wrong value on HP-UX Only
My guess is that f_bsize and f_blocks are of type int. The value is probably overflowing into a negative value. Try casting each of these values to unsigned long long before multiplying them.

Categories : C

How to declare an unsigned long long in Protobuf?
The documentation clearly lists the available scalar types. Not sure exactly what you're after, but perhaps uint64?

Categories : C++

Long long data type python
Yes, there is a long long data type for humongous integers. It's called Long. Integers that are too long to be stored in a 32-bit integer is automatically made into Longs, so you generally don't have to think about it. However, you can explicitly create on by adding an L after the number: foo = 27L In Python 3 the types have been merged, so you can't explicitly create it anymore. In effect all integers are also longs.

Categories : Python

Allocating 2D dynamic arrays (with long long int)
try this #include<iostream> #include<stdio.h> using namespace std; int main(int argc, char *argv[]) { int N=10; int i; long long int **A=new long long int*[N]; for(i=0;i<N;i++) { A[i]=new long long int [N]; } A[2][5]=5; cout<<A[2][5]<<endl; for(i=0;i<N;i++) delete []A[i]; delete [] A; return 0; } works for me no warning even with -Wall

Categories : C++

How can I cin an unsigned long long without error?
You say you entered a "huge value". If that value exceeds the upper bound of unsigned long long, then cin >> p; will fail. A quick experiment indicates that once that happens, cin >> q; doesn't do anything, and no value is stored in q. The value of p will probably be 18446744073709551615, or 264-1. You need to check whether each input operation succeeded or failed, and decide how to handle any errors. You also need to update your question to indicate exactly what input you provided to your program.

Categories : C++

combine a byte into long long
You can use bitwise operators to achieve this. Let's say you want to sacrifice the 8 most significant bits in your long long. (Be careful if your long long is negative ! The sign is stored as the most significant bit, so you'll lose the sign !) Now, to do this, you can do : byte get_hp_id(int64 global_row_id) { return ((char)global_row_id); } int64 get_row_id(int64 global_row_id) { return (global_row_id >> 8); } int64 make_global_rowid(int64 rowid, byte hp_id) { return (rowid << 8 + hp_id) } For the little explanation, << is a bitshifting operator. What it does is that it shifts all your bits either right or left. Bits that goes out of boundaries are lost, and bits coming from nowhere are set to 0 : 1001001 << 2 == 0100100 // the first 1 is lost, and 2

Categories : C++

Get a Map from Ebean sql query
The findMap() method of SqlQuery does not return a Map<Long,Long>, it returns a Map<?, SqlRow>. See the ebean API here. Try returning a List<SqlRow> instead, using findList(), and then use the methods contained in SqlRow to access the two Long values. Here's the API doc for SqlRow.

Categories : Java

Binary representation of a long long
According to http://www.cplusplus.com/reference/bitset/bitset/bitset/, the std::bitset constructor you're trying to use only uses an unsigned long, which, on your system, is probably just 32 bits. Other systems will have unsigned long be 64-bits, so others may not see this issue (try printing out sizeof(unsigned long)). Only real fixes for this are to construct the bitset from the low 32 bits of truncator, and manually set the rest of the bits.

Categories : C++

Why use Long.valueOf(...) rather than a long literal?
valueOf takes a primitive long. For literals, I'd agree that 42L is better, but if you have an int or long variable, Long.valueOf is a good way to get a Long. valueOf also uses a cache of values from -128 to 127, which gives it a slight performance edge over new Long(long) for common values.

Categories : Java

How to convert string to long long in c
Use strtoll , strtoumax is for converting to a uintmax_t, which is usually not a long long. Note that your printf format specifier is wrong too, there's no such thing as "%ull". "%ull" will get interpreted as the format specfier "%u" and an ordinary string of "ll". Passing an long long to be formatted as an unsigned int("%u") will likely give you unpredictable results. You need to use printf("%lld ", val1); If you had an unsigned long long, you'd use "%llu"

Categories : C

divdi3 division used for long long by gcc on x86
There is not word as word. On x86 machines, word usually means 16-bits. It's customary. Normally, a word is 16-bit or 32-bit number which´s width depends on activated mode (real or protected). I think that this terminology has been stated because linux/unix is generally running on many platforms. You can feel conflicts of term meanings on more tools. Live example is gdb, which uses w for 32-bit word and hw for 16-bit "half-word". EDIT: There is another naming used for size of floats, but sometimes it's also used for integers. It is: s - single (precision, word?) for four byte integers (int) / floats (float) d - double (precision) for eight byte integers (long or long long) / floats (double) t - ten bytes for integers (long long) / floats (long double) This naming is used for all a

Categories : C

Scala: How to pattern match scala.Long and java.lang.Long
It should work straight away: object LongTest { def test(value: Any): Boolean = value match { case l: Long => true case _ => false } def run() { println(test(1L)) println(test(new java.lang.Long(1L))) } } LongTest.run() // true and true It wasn't obvious to me that you want to match classes instead of instance. I'm not sure I understand what you actually want. Like this? object LongTest { def test(clazz: Class[_]): Boolean = clazz == classOf[Long] || clazz == classOf[java.lang.Long] def run() { println(test(1L.getClass)) println(test(new java.lang.Long(1L).getClass)) } } LongTest.run() // true and true Or as a pattern match: def test(clazz: Class[_]): Boolean = clazz match { case q if q == classOf[Long] || q == classOf[j

Categories : Scala

path smooth algorithm for astar path planning based on quad tree
haha,I find the method for the difference size path smooth. Just use the funnel algorithm too, but there is a difference: when add left and right point for two quads, find one intersection side, and sort the four points(a0, a1, b0, b1) like ([x, y0], [x, y1], [x, y2], [x, y3], and y0 <= y1 <= y2 <= y3) , and use the two points [x, y1], [x, y2].

Categories : Misc

PHP: fopen path for `include`d script using Apache Document Root when full path is specified?
If the Path starts with / It will point to the root Filesystem which is fine with CLI but CGI would understand it this way: /home/jweinberger/com.example/logs/script1.log//home/jweinberger/logs/script1.log You should use the index 'DOCUMENT_ROOT' from the $_SERVER array. fopen($_SERVER['DOCUMENT_ROOT'].'/home/jweinberger/logs/script1.log')

Categories : PHP

Need help creating reg-ex expression to rewrite path and filename using information in original path and file name
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^(ImageFolio4_files)/1/([^/]+)/((?!AM|tn_)[^.]+.jpg)$ /$1/cache/images/~$2~$3 [L,R=302,NC] Once you verify it is working fine, replace R=302 to R=301. Avoid using R=301 (Permanent Redirect) while testing your mod_rewrite rules.

Categories : Regex

var di = new DirectoryInfo(path) throws exception until I use Windows Explorer to open the path for a first time
Since you said it's happening on network folders, my first inclination is that the windows process that this app is running under doesn't have security access to read the directory info. When the user browses to this folder, the security is authenticated, and so your app can now read it. Does the app work if Root is a local folder?

Categories : C#

The Widest Path Challenge - the most efficient way for finding path in Maximal Spanning Tree
Use the set to construct a Subgraph object. Subclass DepthFirstIterator so that encounterVertex puts an entry with key v and value (whatever the other endpoint of e is) into a map p. Search depth-first from the sink. Recover the path by initializing v to be the source and looking up v, p[v], p[p[v]], etc., until there is no entry. This is a pain, but the library authors baked FibonacciHeap into ClosestFirstIterator, which otherwise would be the class you want. (Heck, if you don't care about another n log n time operation, you could just run Dijkstra on the subgraph.) Kruskal's algorithm functions fine with disconnected graphs. It returns a minimum-weight spanning forest, i.e., for each connected component, a minimum-weight spanning tree. I can't vouch for this particular implementation.

Categories : Algorithm

included dbconfig.php file failes when using a direct path instead of relative path
You are trying to include file over HTTP. That is not right, you should include files with passing your local filesystem path to include or require. Your root should probably look like so: $root = '/var/www/mywebsite/testing-folder/';

Categories : PHP

How to resolve a relative directory path to canonical path in MATLAB/Octave
The simplest way I know to convert a path to its canonical form is using cd command: oPath = cd(cd(iPath)); Note that this would fail if the path does not exist on your file system.

Categories : Matlab



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