w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Unmount my external hard drive in bash
Searching for "Unmount Hard Drive Terminal" yields http://ubuntuforums.org/showthread.php?t=842698 as the first result. >.> russlar provides a solution: open terminal, and run df -h. this will tell you all the hard drives mounted. then, run sudo umount /dev/something, where somethign is the name of the hard drive that you want to unmount. Nothing wrong with asking, but when a solution is on the first Google result, it's a little... odd.

Categories : Misc

How to remove file permissions on linux from an external hard drive?
To make the partition accessible under Linux run: sudo chmod -R 777 /media/<drive-name>/ this should make the mac drive accessible for you. Changing ownership would do about the same, but you need not worry about it.

Categories : Linux

Change my current working directory in Python to my external hard drive.
You are correct. >>> 'E:CollegeProject3dlife-gc-2013-dataset-hhi3dlife-gc-2013-dataset-hhi' 'E:\College\Projectx03dlife-gc-2013-dataset-hhix03dlife-gc-2013-dataset-hhi' Double the backslashes, use forward slashes, or use a raw string.

Categories : Python

Is there a way to read directly from the hard drive to the GPU
The GPU is not directly connected to the system RAM. There's a bus inbetween, in current generation computers a PCI-Express bus. ATA storage has a controller inbetween. There is no direct connection between memories. BUT there is DMA, which allows certain periphials to directly access the system memory through DMA channels. DMA on PCI-Express also works between periphials. Theoretically a GPU could do DMA to the ATA controller. Practically this is of little use! Why? Because of filesystems. Even if there was some kind of driver support to let the GPU access a storage periphial directly, it'd still have to do all the filesystem business, which doesn't parallelize to the degree as GPUs are designed for. Alas regarding your question: In my OpenGL program I read from the header file t

Categories : Opengl

how to shrink KVM hard drive image
Images can be sparsed, and your cp might not respect that for various reasons. I would: check the real file usage (du -sh vm.img or qemu-img info vm.img) use qemu-img convert -S to recreate a sparse image convert to qcow2 to have growing and versatile image instead

Categories : Misc

Adding a new hard drive to xampp
If you want to sort of "span" the drive, Windows has this handy feature (similar to linux's symlinking) called mklink which you can create a folder in the current directory that is just a symbolic link to the drive. Quick and easy way to span it. I am not sure of any downsides to do doing this, other than if the drive letter changes (if external drive). That way you should not have to add or change any of your paths in the config etc. Not sure if that is what you were looking for, but hopefully it helps. Also, did you try your 3rd config you pasted? Did it not work? From what I can see, as long as permissions are fine it should work that way.

Categories : PHP

Methods for tracking changes to hard drive
For realtime tracking when file or directory changes you can use inotify on Linux or FileSystemWatcher on Windows. Combine with rsync to get delta.

Categories : Svn

Accessing a file on the server's hard drive
You cannot reach the file that is "above" the wwwroot folder by design. The way to do this is to a) copy the file there, b) setup a symbolic link (if on linux) or c) preferably, move / setup another web root folder. Alternatively, write a server script to dump the file contents.

Categories : Javascript

How to identify system hard drive using Win32_DiskDrive
The documentation you linked has the answer: string SerialNumber; uint32 Signature; Your management object will have those properties in it. If you're getting null for those values then the problem is that you're using a version of Windows that doesn't support them. SerialNumber ... Windows Server 2003 and Windows XP: This property is not available. In which case you have to use the Signature property, but this requires XP SP3 I believe.

Categories : C#

Remove files from a NetBeans project but not the hard drive
Solution working with Netbeans 7.3.1: right click on your project in the "Projects" window, click on "Properties", click on "Ignored folders" in the left panel called "Categories", click on "Add folder" and select the folders you want to ignore.

Categories : Misc

Save Work Done In MS Word To A Database Not On A Hard Drive
The method you are using is extremely inefficient and I wouldn't recommend the process, but the reason that you code is failing is your length.... when you are saving your MemoryStream you are setting the length int len = Application.ActiveDocument.Content.StoryLength; but when you try to retrieve it, you are setting it int len = int.MaxValue; which would be far past the end of the data stream.

Categories : C#

Is three a way for a Chrome App to reach user's file on hard drive with permission?
Streaming can be done using HTML5 Video tag. Please check : http://html5doctor.com/the-video-element/ Also, you can use plugins like : http://www.videojs.com/

Categories : HTML

Single git repo setup tracking multiple locations on hard drive
No, there is no mechanism in git for this. Git assumes that all files that it manages (the "working copy") live in a single directory (and subdirectories); there is no support for managing two separate directories in in repo. So you'll have to somehow keep everything in one directory, probably as subdirectories HTMLTemplates and theme or similar. You could use two git repos, but I'd strongly advise against this. A single repo should contain a whole "project", i.e. everything needed to build one piece of software (excluding things like external libraries). If you split your project across two repositories, you cannot usefully branch and merge (because you'd have to do it in both repos simultaneously), you cannot easily check out old versions etc.. To solve your problem, I see a few poss

Categories : Wordpress

My Apple MacBook hard drive crashed - provisioning profiles lost, is there a way I can still update my app?
Create a new certificate if needed then create a new set of provisioning profiles. Install the updated profiles and update your apps to use the new profiles. That's it. Not that big of deal other than spending 30 minutes redoing this stuff.

Categories : IOS

How do I bind a WPF Image element to a PNG on the local hard drive using a relative filepath derived from a DB?
You need to use custom value converter to convert strings to images if you want to load files from the file system. Image.Source, when a string is passed, expects a file name from resources. You can find implementation of a such converter here: Display an image in WPF without holding the file open.

Categories : C#

Python upload an Image form my hard drive and show it on a canvas wideget.
There's a handy module for that: tkFileDialog! import tkFileDialog tkFileDialog.askopenfilename() The function will return the path to the file for you and theres a variety of options you can set here

Categories : Python

Need Apps Script to Copy a File(s) from my Local Hard Drive to a Google Sites Folder
You have to write an UI to that allows the visitor to the site to upload the file. See https://developers.google.com/apps-script/reference/ui/file-upload for an example.

Categories : Google Apps Script

Serial Communication gets back wrong answer when something is running in the background (like browsing the hard drive)
Note: serialPort.Write(string) is a non-blocking store into the output buffer. That means the following won't guarantee you've even finished writing your request before you stop listening for a response: serialPort.Write(request); Thread.Sleep(50); _shouldStop = true; You could add: while( serialPort.BytesToWrite > 0 ) Thread.Sleep(1); // force blocking but it's ill advised. One thing I'm wondering. There is only a single serial port here. Why do you want many different threads to work with it when you could manage the entire serial port interaction with a single thread? (Or at worse, 1 thread for input 1 thread for output) To me it makes a lot more sense to store up requests into a queue of some kind and then peel them off one at a time for processing in a single threa

Categories : C#

Google Drive API behavior
When you are accessing Drive using the SDK, you pass an access token (hidden in a Credential object). That access token is what associates the API call with a particular Drive account. It is the responsibility of your app to use the correct access token (Credential). Without seeing your app, it's nigh on impossible to tell you what you are doing wrong. One thing to be aware of. You say "GAE running on my gmail id". That could mean "my appengine application is owned by my gmail id". It could also mean "I use GAE's authentication mechanism to login to the app". Neither of these are related to the Google Account access token that you are using to access Drive. It might be that you've confused the Appengine Login Id with your Google Accounts ID. They are different. In general, if you are usi

Categories : Google App Engine

Weird Behavior Using MOQ
The mocked property of the first item is set up to always return 1. It doesn't matter you add 2 to it then, it will always return 1. Edit: your += is ignored because your cart stores mocked objects. The one that gets to the cart first is mocked to ALWAYs returns 1.

Categories : Unit Testing

Weird Set.contains() behavior
This is due to that fact that the comparison is done on the provided object not the elements in the set. From HashSet#contains(Object): Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that (o==null ? e==null : o.equals(e)). So in your example, you would be doing comparison like integer.equals(person). So if your set contains Person objects, the if(obj instanceof Integer) condition will never be checked, but if your set contained Integer objects, that condition would be satisfied and as such would be checked.

Categories : Java

With PowerShell, is there a way to make an external hard disk attached to host available to VM?
I don't use Win8, so this is entirely untested. Judging from the description of Add-VMHardDiskDrive something like this might work, though: $usbdisk = gwmi Win32_DiskDrive | ? { $_.PNPDeviceID -like 'USBSTOR*' } Add-VMHardDiskDrive -VMName MyWin7PC -ControllerType IDE -ControllerNumber 0 ` -ControllerLocation 1 -DiskNumber $usbdisk.Index

Categories : Powershell

Weird behavior with JsonConverter
I think you get an exception while deserialization. You can use this site and convert your json to a concrete class. var obj = JsonConvert.DeserializeObject<RootObject>(json); public class Data { public string id { get; set; } public object title { get; set; } public object description { get; set; } public int datetime { get; set; } public string type { get; set; } public bool animated { get; set; } public int width { get; set; } public int height { get; set; } public int size { get; set; } public int views { get; set; } public int bandwidth { get; set; } public bool favorite { get; set; } public object nsfw { get; set; } public object section { get; set; } public string deletehash { get; set; } public string link { ge

Categories : C#

git push having weird behavior?
git push only pushes the changes into the .git directory in the remote repo, but it does not update the files in the working directory of the remote repo. You can say git reset --hard in the remote repo to update the files, but if there were uncommitted edits to some files, you will lose those changes. (You can even make a git hook that runs git reset --hard if you want the files automatically updated every time a pull is received.)

Categories : GIT

weird behavior with jquery
Because .find() looks for descendants, use in your case filter() instead: var el = $('<ul><li/></ul><a id="clickMe">click me!</a><p>').filter('#clickMe'); DEMO NOTe: in your html string, you are not closing <p> tag.

Categories : Jquery

Weird $ behavior: ${string}
The bareword "string" is being understood as a string you simply didn't quote. use strict would prohibit this, and use warnings would have complained about it. You are then taking a reference to the string (effectively, my $ref = "string";), and dereferencing it (effectively, ${$ref}). It is "normal" in the sense that life without strict is sometimes both slippery and sharp-edged.

Categories : Perl

CLLocationManager weird behavior
OK! Fixed that by running the code on main thread using this code: -(void) locateMe { NSLog(@"locateMe"); dispatch_async(dispatch_get_main_queue(), ^{ _locationManager = [[CLLocationManager alloc] init]; [_locationManager setDelegate:self]; [_locationManager setDesiredAccuracy:kCLLocationAccuracyBest]; // 100 m [_locationManager startUpdatingLocation]; [_locationManager startUpdatingHeading]; }); }

Categories : IOS

EF weird behavior when debugging
In EntityFramework we have two type of query execution: Immediate Deferred in the immediate execution the query will be executed immediately on the database sample > db.Foo.Where(f => f.bar == bar).ToList(); and for deferred execution, when you call them nothing actually happens on database and only the query will be there and when you try to get data the query will be execute ob the database sample > var baz = db.Foo.Where(f => f.bar == bar); // no query execution on the database baz.count(); // deferred execution on database and all of these happens for optimization and better experience, only run query on database when it is necessary.

Categories : C#

Weird behavior of & function in Set
The expression Set("hi") can be either a scala.collection.immutable.Set[String] or a scala.collection.immutable.Set[Object], depending on what the context requires. (A String is a valid Object, of course.) When you write this: Set(new Object) & Set("hi") the context requires Set[Object], so that's the type that's inferred; but when you write this: val b = Set("hi") the context doesn't specify, so the more-specific type Set[String] is chosen, which (as you expected) then makes a & b be ill-typed.

Categories : Scala

Weird behavior with === operator
That would be the expected behavior according to ActionScript documentation on === operator: Numbers and Boolean values are compared by value and are considered equal if they have the same value.

Categories : Actionscript

NSQueueOperation weird behavior
When you just use: int pageCounter; You are creating a global variable. Presuming you set this at each iteration, then refer to it in your PDFGenerator methods, it will always use the last value it was set to. Example: // Bar.h @interface Bar : NSObject FOUNDATION_EXPORT int someThing; @end // Bar.m @implementation Bar int someThing; @end // Foo.m #import "Foo.h" #import "Bar.h" @implementation Foo - (void)doSomething { ++someThing; } @end That's totally valid code, and calls to [Foo doSomething] increment someThing. If you wanted an instance variable, it would look like this: @interface Bar() { int someThing; } @end @implementation Bar - (void)doSomething { ++someThing; } @end In this case someThing is defined as an instance variable (not a global variable). I

Categories : IOS

Weird NSPredicate Behavior?
I have left inline comments (signed off with my initials) in your viewWillAppear: method that point out what I believe to be errors. Essentially, you fetch an arbitrary athlete instead of the one that's been selected (which I'm assuming is the source of _athletesFullName. As far as your saveEval method, your naming conventions are tough to follow so it's not clear to me what further issues you could have here. -(void)viewWillAppear:(BOOL)animated{ self.title = [NSString stringWithFormat:@"%@'s Evaluations",_athletesFullName]; AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; _managedObjectContext = [appDelegate managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSFetchRequest *athleteRequest = [[NSFetchRequest allo

Categories : IOS

Weird MongoDB Behavior
The behaviour is perfectly normal since all the data for a given student are stored in the same document. What is happening is that: each document of your collection has a min score for the evaluation of type homework. So each document matches the criteria and is delete. In the second option, you take the precaution of pulling one score. But still, you can not be sure to always succeed. Let say that a quiz or an exam has a score equal to the min of the homework scores. You can also pull that one. In addition to check that you pull the evaluation with min score, you should also check that the evaluation you are pulling is of type homework. The part of your query ("scores.type": "homework") is only making sure that you update only student that have a least one score in homework. If there i

Categories : Python

Weird behavior in C printf
Your code seems to work. At least as this : #include <stdio.h> #include <string.h> #define MAXS 1024 int main() { char str[MAXS]; int N; int i; gets(str); N = strlen(str); for (i = N / 2 - 1; i >= 0; i--) { printf("%c", str[i]); } for (i = N - 1; i > N / 2 - 1; i--) { printf("%c", str[i]); } printf(" "); } Check your MAXS define. No other clue, sorry ! Edit: Oh! you're doing C++, actually...

Categories : C

Php sessions weird behavior
You always need to call session_start() at the start of your page. It doesn't actually start a new session, but rather initializes the session, including the loading of session variables. It's usually the first thing you do, and usually not only under conditions like in your current panel.php.

Categories : PHP

How can the behavior of my .msi on Windows Vista and Seven be so weird?
The behavior of the ALLUSERS property, as occasionally used before the UAC era to provide a "for all users or just me" option, was not well conceived and does not work well, especially in the post-UAC era. On Windows Vista, you can only choose one value for the setting on your .msi package that has it elevate or not; ALLUSERS does not change this. Since it always (or never) elevates, you can really only handle one of the two scenarios. Windows 7 and Windows Installer 5 introduced the MSIINSTALLPERUSER property which can override the setting that causes the package to elevate. Thus the same package can either elevate and install for everyone, or can remain non-elevated and install for "just me". While versions of InstallShield since Windows 7 came out provide this configuration option, it

Categories : Windows

C++ Pointers -- Weird Loop Behavior
The code has undefined behaviour as a local variable, named addPrime, is being used beyond its lifetime: lastPrime->pprime=&addPrime; lastPrime=&addPrime; cout << "n:" << lastPrime->pnum <<" "; return true; } // 'lastPrime' is now a dangling pointer because it holds the address // of 'addPrime' whose lifetime has ended. To correct, you need to dynamically allocate a prime using new instead. But, it appears (without the definition of prime I am uncertain) the code is building a list of primes encountered. Suggest using a std::vector<prime> to build the list and let it manage memory for you. If a std::vector<prime> is not an option, for whatever reason, then ensure all instances of prime are dynamically allocated and not a mix

Categories : C++

Python datetime weird behavior
datetime.replace returns a new datetime instance. In your first example you are ignoring the return value of datetime.replace and are then doing datetime.strftime on your old datetime instance. This causes the inequality you are experiencing. To make both examples equal you would have to edit the verbose one to look like: >>> a = datetime.fromtimestamp(1373576406) >>> a = a.replace(tzinfo=tzutc()) >>> a.strftime('%s') '1373576406

Categories : Python

Weird nullable comparison behavior
<= and > are lifted operators which return false if either value is null. For the relational operators < > <= >= a lifted form of an operator exists if the operand types are both non-nullable value types and if the result type is bool. The lifted form is constructed by adding a single ? modifier to each operand type. The lifted operator produces the value false if one or both operands are null. Otherwise, the lifted operator unwraps the operands and applies the underlying operator to produce the bool result. Since comparers are used for sorting they need a total ordering where null by definition compares as less than every other value. This need takes precedence over consistency with comparison operators. Returning 0 when comparing null with any other v

Categories : C#

python dictionary weird behavior
dict2 = dict1 This doesn't erase the contents of dict2 and fill it with the contents of dict1. This makes the names dict1 and dict2 refer to the same object. Anything you do to dict2 affects dict1, because they're the same thing. If you want a new dict, make a new dict: dict2 = collections.OrderedDict() If you want to clear the old dict, clear it, but that's probably not what you want: dict2.clear()

Categories : Python

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