w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Parsing Diskpart output with .NET
Can you get this information from System.IO.DriveInfo? public DriveInfo(string driveName); public long AvailableFreeSpace public string DriveFormat public DriveType DriveType public DirectoryInfo RootDirectory public long TotalFreeSpace public long TotalSize public string VolumeLabel public static DriveInfo[] GetDrives();

Categories : Dotnet

Diskpart commands from WinRT application in C#
Sorry, but there's no current way to access the Diskpart commands from inside the WinRT sandbox. There's also restrictions on local network loopbacks in order to hinder the "app talking to a service outside the sandbox" for security reasons as well.

Categories : C#

how to get access after hide the drive with Diskpart Command-Line Utility
You can use the volume GUID like this: \?Volume{2a0b16cf-f76a-11df-9310-806e6f6e6963}pathfile.ext Note that only the Unicode file functions will accept this sort of path, and the syntax has to be strictly correct. For example, you can't use forward slashes instead of backslashes. I'm not sure how best to enumerate the volume GUIDs. One method is QueryDosDevice but I expect there are better ways.

Categories : C

Cassandra with SSD - two disks or one?
The reason you use separate disk for the commit log when using regular hard drives is so you only do sequential writes on the commit log hard drive. Other cassandra activity, such as reading/compaction etc, will affect cause random access on the other disk, not your commit log meaning that writes to your commit log will be very fast. For SDD random access is as performant as sequential access so there is no need to prevent it to keep your commit log happy.

Categories : Cassandra

Test if device is Always-On/Always-Connected (AOAC) or Connected Standby is supported?
Here's some code that should help: http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/eeb164a3-8ceb-4eb2-8768-4faaa7218c59/ (scroll down to the answer by 'User1024x768')

Categories : C#

SQL Developer: Joining tables from connected SQL Server DB and connected Oracle DB
Oracle has the concept of a DBLink, and SQL Server has the concept of a Linked Server. Both these features let you query data from two separate databases. Here's a link with instructions for setting up an Oracle DBLink to a SQL Server DB... http://www.dba-oracle.com/t_database_link_sql_server_oracle.htm And here's a link with instructions for setting up a SQL Server Linked Server to an Oracle DB... http://support.microsoft.com/kb/280106 See also this SO post... SQL statement joing Oracle and MS SQL Server

Categories : SQL

Cassandra on embedded systems without hard disks
One option is to mount a filesystem backed by RAM. You can use tmpfs or a RAM disk. One difference between them is that tmpfs is a filesystem already but if you use a raw RAM disk, you only get a block device and so you will have to format it separately with a filesystem.

Categories : Cassandra

How to run AWS instances with attached ephemeral disks with the fog library
Looks like the command line equates to <devicename>=<blockdevice>. So we should be able to do that in fog in one of a couple ways. The model version using your values would be something like: compute = Fog::Compute.new(...) compute.servers.create( :block_device_mapping => [ { 'deviceName' => '/dev/sdb', 'virtualName' => 'ephemeral0' }, { 'deviceName' => '/dev/sdc', 'virtualName' => 'ephemeral1' }, { 'deviceName' => '/dev/sdd', 'virtualName' => 'ephemeral2' }, { 'deviceName' => '/dev/sde', 'virtualName' => 'ephemeral3' }, ], :image_id => 'ami-xxxxxxxx' ) Or the lower level, more direct path might look like: compute.run_instances( 'ami-xxxxxxxx', 1, 1, :block_device_mapping => [ { 'deviceName' => '/dev/sdb', 'virtualName' => 'ephemeral0' }

Categories : Ruby

how to retrieve the disk signature of all the disks in Windows using Delphi 7?
Depends what a "disk signature" is. i don't know what that is. i do know the following code returns: - \?ide#disksandisk_sdssdx120gg25___________________r201____#5&20f0fb49&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b} - \?ide#diskst1000dm003-9yn162______________________hp13____#5&33aaabee&0&1.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b} Are those "disk signatures"? It uses the Windows Setup API: procedure GetDisks(slDisks: TStrings); var InterfaceDevInfo: HDEVINFO; index: DWORD; status: BOOL; Name: string; begin { Get the interface device information set that contains all devices of event class. } InterfaceDevInfo := SetupDiGetClassDevs( @GUID_DEVINTERFACE_DISK, nil, // Enumerator

Categories : Windows

Perl vSphere SDK adding multiple disks soap error:
I found the solution. Apparently you need to give each virtual machine config spec its own key, even if it is negative. For posterity set $disk->key = UNIQUE NEGATIVE NUMBER and then set your config spec $devSpec = VirtualDeviceConfigSpec->new( operation => $devSpec->operation, fileOperation => $devSpec->fileOperation, device => $disk, );

Categories : Perl

AWS EBS Volumes and PostgreSQL
Yes. An EC2 instance is a general purpose computer running an x64 or x86 operating system, usually Linux or Windows, so you can run Pg on it. Again, yes. An EC2 is no different to any other server in this regard, you can use any of the supported replication options including streaming replication. Absolutely not, because PostgreSQL does not support shared-storage clustering. You must have independent storage for the read replica, using streaming replication. This is true on EC2 and everywhere else. In any case, AWS doesn't support attaching a single EC2 volume simultaneously to multiple hosts, you'd have to share it via something like drbd even if PostgreSQL did support shared storage - which it doesn't. Where EC2 does start to differ is in performance. EC2's database performance has be

Categories : Postgresql

Keep separate volumes for speaker and headset
I would suggest why dont you try to detect the attachment and detachment of the headset and then set volume accordingly. Click this link for the stackoverflow post which discuss about the attachment and detachment of headset

Categories : Android

Extrude shadow volumes to infinity
This link shows an example of a projection matrix. It has the form: a 0 b 0 A = 0 d e 0 0 0 -(f+n)/(f-n) -2fn/(f-n) 0 0 -1 0 f is the far plane and you want f -> infinity. limit f -> infinity of (f+n)/(f-n) = limit f -> infinity of (1+n/f)/(1-n/f) and limit f -> infinity of 2fn/(f-n) = limit f -> infinity of 2n/(1-n/f) since f -> infinity => n/f -> 0 your matrix with f -> infinity becomes a 0 b 0 B = 0 d e 0 0 0 -1 -2n 0 0 -1 0 if you transform your (x,y,z,w=0) with B you'll get x' = ax + bz y' = dy + ez z' = -z w' = -z and the perspective division gives x' = -ax/z - b y' = -dy/z - e z' = 1 While x' and y' are the same as transforming (x,

Categories : Opengl

How to change volumes of individual programs?
Please see this example in Codeproject. it's a sample documentation of Windows Audio Mixer API Wrapper Library Hope will help it.

Categories : C#

Amazon EC2 change instance type, possible issues with volumes?
If the volumes are EBS volumes then you can safely do this (note that terminating an instance can delete EBS volumes if they have the delete on termination flag set, but stopping an instance is ok). The volumes will stay attached to the instance but depending on the operating system and configuration you may need to remount them If they are ephemeral volumes then stopping the instance will lose all data stored on them.

Categories : Amazon

DirectX - Deferred Shading w/Instanced Stencil Volumes
The problem was that I compiled the vertex shader( for stencil volume mask ) with vs_3_0...I changed it to vs_2_0 and now it works fine...I don't understand because I thought it was necessary to use vertex shader model 3.0 with instancing...

Categories : C++

GAE Datastore - most efficient way to pull stats on large volumes of data
GAE is not a good option to do analytics, because of concurrent write limitations and lack of good query language. If you are serious about analytics you should export data from GAE to BigQuery and do analytics there. Check out Mache and this blogpost.

Categories : Google App Engine

MySQL Database Optimization for Large Volumes of Repeating Data
Use one of indexing engines, such as Sphinx, do not re-invent the wheel. Sphinx organizes data according to searching / querying options and it is really fast, can handle lots of data. If your database doesnt change often you have to run Sphinx Indexer just once. One of cons of this solution is fact, that Sphinx index files are quite large.

Categories : PHP

Suspicion of a java memory leak in the decompression of MHA volumes in Matlab
If the files you read are large (their uncompressed version) this does not need to be a memory leak. You can adjust the java heap space matlab uses in the matlab preferences. Usually it is set to a rather small value of 128 MB - increase it and see if the problem persists. To check whether it is a memory leak, simply try something along: for i=1:1000 % adjust loop-number to your needs m = zlib_decompress(...) end If there is a leak, this should error out once your heap space is full again. If not - your memory footprint should stay within certain limits.

Categories : Java

Python zipfile module erroneously thinks I have a zipfile that spans multiple disks, throws BadZipfile error
I get the same error on a similar file although I am using python 3.4 Was able to fix it by editing line 205 in zipfile.py source code: if diskno != 0 or disks != 1: raise BadZipFile("zipfiles that span multiple disks are not supported") to: if diskno != 0 or disks > 1: Hope this helps

Categories : Python

How to control volumes of file playing using System Sound Services by side volume control buttons in iPhone
use this simple code for control system sound,it not work in simulator,only work in device [[MPMusicPlayerController applicationMusicPlayer] setVolume:0];//set values 0-1

Categories : Iphone

Get Connected entities
First as you know you must create a Plug-in on update for record A so whenever Record A gets updated the plug-in is triggered. Then in the plugin you need to make a join using linq or any other retrieve method to fetch the connection relevant to record A by looking for the GUID in the connection entity it should be "Record1Id". when you get the connection then you can use GUId for Record B it should be "Record2ID". so when you get the record B then update it based on what you want form already fetched connection and update it. The following code gives you all connetions related to recordA if you use LINQ and early binding var connections = (from conn in context.CreateQuery<Connection>() where (conn.Record1Id.Id == recordAid

Categories : C#

Connected branches in Git
That's exactly what you should expect from a merge. If you wanted to rebase and fast-forward, you could have done that instead and had a straight line. Example: Before the merge, you had this situation: That is, the history of master and branch diverged. They share h as a common ancenstor. When merging (via git merge branch while on `master), you end up with a commit with two parents to unify that history: If that's not what you wanted, you can undo that and get what you wanted by doing something like: git reset --hard HEAD@{1} # or whatever commit matches 'j' to undo the merge git checkout branch git rebase master # incorporate 'i' and 'j' commits into 'branch' git checkout master git merge branch # this merge will be a fast-forward now Which will give yo

Categories : GIT

Getting all records but if some of them are connected then getting only last one
If you have API level 16 (Jelly Bean) or later, the following will work: SELECT id, parentId, "desc", MAX(date) AS date FROM MyTable GROUP BY COALESCE(parentId, id) In older Android versions, you must use a correlated subquery to filter out records with an earlier date: SELECT * FROM MyTable WHERE NOT EXISTS (SELECT 1 FROM MyTable AS T2 WHERE COALESCE(T2.parentId, T2.id ) = COALESCE(MyTable.parentId, MyTable.id) AND T2.date > MyTable.date)

Categories : Android

PDO test if connected
I use the following code to connect: <?php class dbConnection extends PDO{ public function __construct() { switch(DB_TYPE){ case "mysql": $dbconn = "mysql:host=".DB_HOST.";dbname=".DB_NAME.";charset=".DB_CHARSET; break; case "sqlite": $dbconn = "sqlite:".DB_PATH.";charset=".DB_CHARSET; break; case "postgresql": $dbconn = "pgsql:host=".DB_HOST." dbname=".DB_NAME.";charset=".DB_CHARSET; break; } parent::__construct($dbconn,DB_USER,DB_PASS,array(PDO::ATTR_EMULATE_PREPARES => false,PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); } } ?> If I give wrong password, I get Connection error, because: SQLSTATE[28000] [1045] Access denied for user 'microaid_logger'@'localhost' (using password: YES) As Yo

Categories : PHP

FileNotFoundException in c# connected with some dll
looks like when of your references is missing ('Microsoft.SqlServer.BatchParser') . In order to validate this do as follows: Open your solution explorer (Ctrl+w, s). Expand your project. Expand the references "folder" locate the 'Microsoft.SqlServer.BatchParser' reference. Is the 'Microsoft.SqlServer.BatchParser' reference highlighted with an exclamation point? thought so... Highlight it and hit F4 for properties. In the properties locate the path. I suspect it is either blank or the file is really not there (as the exception implies...)

Categories : C#

What exactly is a Persistence in JPA? How is it connected to EntityManagerFactory?
See my answer to another of your questions : http://stackoverflow.com/a/16844778/2087640. If different EntityManager instances share the same persistence unit, each one will have its own in-memory representation of the same database schema state.

Categories : Java

AT command with 3g modem while it is connected
3G modems typically (always?) provides two serial interfaces that can be used for AT command communication. Those serial interfaces ends up as /dev/ttyACM0 + /dev/ttyACM1 or /dev/ttyUSB0 + /dev/ttyUSB1 on Linux, /dev/cuaU0 + /dev/cuaU1 on FreeBSD, and on windows machines they should end up as COM<N> + COM<M> for some N and M number (not necessarily next to each other). So open the device manager and try to find the other serial interface which is not used by hyper terminal and use that one.

Categories : Misc

How to know when call is made and connected?
Here you can find all states of call, just make handle this states, like i did: public class PhoneState extends PhoneStateListener { @Override public void onCallStateChanged(int state, String incomingNumber) { switch (state) { case TelephonyManager.CALL_STATE_IDLE: //Some Action break; case TelephonyManager.CALL_STATE_OFFHOOK: break; case TelephonyManager.CALL_STATE_RINGING: //Some Action break; //case TelephonyManager.ANOTHER_STATE: ... } } }

Categories : Android

Check if a socket is connected in mac os x
This - if (connect(s, (struct sockaddr *)&sa, sizeof sa) < 0) is close enough to winsock's isConnected. #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> int main() { register int s; register int bytes; struct sockaddr_in sa; char buffer[BUFSIZ+1]; if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) { perror("socket"); return 1; } bzero(&sa, sizeof sa); sa.sin_family = AF_INET; sa.sin_port = htons(13); sa.sin_addr.s_addr = htonl((((((192 << 8) | 43) << 8) | 244) << 8) | 18); if (connect(s, (struct sockaddr *)&sa, sizeof sa) < 0) { perror("connect"); close(s); return 2; } while ((bytes = read(s, buffer, BUFSIZ)) >

Categories : C++

What is connected in class diagrams
If your Controller looks like the following, then it has a connection to Model and View. class Controller { public Controller(View view, Model model) { this.view = view; this.model = model; } } Or more generally: any class reference saved in a member variable inside a class will be a connection in a class diagram.

Categories : Java

TibrvException Not connected to daemon
Use tibrvlisten and invoked with the correct TIBCO RV SND parameters. This should verify that the rvd is active on the network. Tibrvlisten should be in the RV installation 'bin' dir. It's invoked like this: Tibrvlisten -service 'service port' -network 'network multicast ip' -daemoin 'daemon name and port' "listen subject" There is also a java version in the rv examples directory that you can compile and use

Categories : Java

How to Disconnect all connected in QtScript
You can disconnect individual signals and slots: disconnect(sender0, SIGNAL(overflow()),receiver1, SLOT(handleMathError())); source: http://www.developer.nokia.com/Community/Wiki/Understanding_Signals_and_Slot_in_Qt To get receivers, use QObject::receivers(): http://qt-project.org/doc/qt-4.8/qobject.html#receivers It seems you cannot get slots (you must keep track of connections by yourself): http://qt-project.org/forums/viewthread/6820 However, there are... ...Ways to debug signals and slots: http://samdutton.wordpress.com/2008/10/03/debugging-signals-and-slots-in-qt/

Categories : C++

How do I refresh connected fragments accordingly?
For refreshing the ListView actually what you have to refresh is the underlaying Adapter. This would be the workflow of your scenario: Remove the selected item Call notifyDataSetChanged() Set another item as the current one, for example the previous note or the first one. And that's it.

Categories : Android

Can TFServer be connected to TFService?
You can install a local Team Foundation Server 2012 Build Controller + Agent on your on-premise systems and have it trigger a build and deployment from changes submitted to the Team Foundation Service projects that are using TFVC. See: http://msdn.microsoft.com/en-us/library/ee330987(v=vs.110).aspx#hosted You can install a local Team Foundation Server 2013 Preview Build Controller + Agent on your on-premise systems and have it trigger a build and deployment from changes submitted to Team Foundation Service projects regardless of the source control type used (TFVC and GIT) You cannot connect a Team Foundation Server (Source Control, Work Item Tracking) to the Team Foundation Service.

Categories : Tfs

Can't bind a connected socket
The problem occurs because you connectthe socket. But you would only connect the client (not the server). To get a local endpoint to listen on, just create one yourself : IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName()); IPAddress ipAddress = ipHostInfo.AddressList[0]; IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 6009); s.Bind (localEndPoint); After this it should work.

Categories : C#

Multiple connected objects in QT
You could use QObject::blockSignals as described here. But you must remember that if you use QObject::blockSignals will bloack all signals until you call QObject::blockSignals with false parameter.

Categories : C++

Starting my app when USB device connected
You're going about this the wrong way. Although you can write a program to constantly monitor the USB ports to detect when something is connected, there's no need. The OS is already doing that anyway. Register an Autoplay handler for your device type and class. This is distinct from the old AutoRun feature, which would automatically execute programs found on an inserted file system. You can begin with an overview of the feature from the November 2001 issue of MSDN Magazine. Your handler will be a COM DLL. You can register the DLL as a handler, and register the handler with events you want to handle. You can either perform everything in the DLL, or you can put the bulk of the functionality in your application and just use the DLL as a proxy between the OS and your program.

Categories : Windows

Mysql database not connected to c#?
you need to download mysql drive for mysql connection. Your code is showing that you are trying to connect with sql instead. You can download mysql driver for.net from below link http://dev.mysql.com/downloads/connector/net/

Categories : C#

Connected through VPN: PHP $_SERVER still gives me local IP
If you are using a VPC, then there is a problem in that the local IP will be used for all communication inside the VPC. The Public IP (EIP I assume) does not exist inside the VPC, it is assigned to the network interface and only translated in the IGW going in or out. This means that when you check with www.getip.com you get the EIP just as expected since you pass the IGW, but inside the local net you will only see the local IP. Also, PPTP VPN works as it also passes the IGW. Amazon suggests that you use the FDQN, even if you are on the inside and look up the external FDQN, you will get the local IP. I do not know how this is in the Classic EC2, but I can only guess its similar. If you absolutely need to have the public IP, you find it by using the Amazon service for this: curl http

Categories : PHP



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