Getting the name of a pc
I'm trying to resolve the name of a computer. This is the code I'm using now and it works:
try{
InetAddress hostname[] = InetAddress.getAllByName(InetAddress.getLocalHost().getHostAddress() ) ;
System.out.println(hostname[0].getHostName());
} catch (UnknownHostException e) {
}Sometimes it just works so slowly, so is there a better way ?
thnx
You could try...
InetAddress addr = InetAddress.getLocalHost();
localHostName = addr.getHostName();I don't think it will be any faster though as it does almost exactly the same thing. Its just a bit more concise.
Similar Messages
-
Cisco Unity 7: Voice mail cann't get the name or Number phone of the caller
Hi,
I have installed Cisco Unity Messaging Unified version 7 and integrated with Exchange 2010.
I have two scenario, and I want to know if are normal or not:
1. If the 2 IP phones are subscribed with Cisco Unity: the first IP phone call the other IP phone and let a voice mail. When the second IP phone check his message vocal it can get the name of the caller or his number phone (the message is: You have One message from XXXX) and he get e-mail as objet: Voice Mail from XXXX.
2. If one IP phone is not subscriber with cisco unity call other Ip phone subscribed with cisco unity and let him a voice mail. The second IP phone when check his message vocal it can’t get the name of the caller or his number phone: The message is: You have one voice mail xxxx; without indicate from!! and he get a e-mail as object: Voice mail from Unknown.
Please, I want to know if the second scenario is normal ? if not, who to resolve this problem? I want that he indicate the number of caller same he isn't subscriber with cisco unity?
Thanks a lot,
Best regards,
Omar YUNSISo for the 2nd scenerio you would want to check what your Message Subjects were set to. For Unity 7 open Web SA, click Configuration and then Message Subjects. Make sure that the Outside Caller Message has %CALLERID% in it somewhere. The value %CALLERNAME% will return unknown if we do not receive a name from the PSTN.
Try setting the Outside Caller Message to:
%U% %P% Voice Message from %CALLERID%
and that should get you your desired results.
The default Message subject is:
%U% %P% Voice Message from %CALLERNAME% (%CALLERID%). So with that it would say Voice Message fom Unknown (xxxx) if it was not able to determine the name of the user which is usually normal from a PSTN call.
Just to note, the From address is always going to say from Unity Messaging System, it will only be the subject that has the extension in it.
Bryan -
How to get the name and value of an attribute on a node/element that is not a child
Hello,
Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
another doc with the same layout, but different content.
I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'. I can only seem to get the node names, but not the attributes on the node. I need the name, because it can be different from doc to doc, so
I can't hardcode this.
Can someone please help with how to retrieve an attribute name/value on a node that is not a child. Here's an example of what
my xml looks like:
DECLARE
@myDoc1 xml
,@mydoc2 xml
DECLARE
@ProdID int
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>2 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "wheel">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first. If they are, then i want to show the difference in the child elements.
This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
...etc...
but that only gives me the node names, and the child elements. It does not give me back the attribute names and values from the node itself.
Thanks in advance for your help.
ceeAre you looking for something like this:
DECLARE @myDoc1 xml
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<Features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>'
SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
T.c.value('.', 'nvarchar(50)') AS value
FROM @myDoc1.nodes('ProductDescription/@*') AS T(c)
Erland Sommarskog, SQL Server MVP, [email protected] -
after I burn the files to dvd and load to view the name does not appear. How do I get the name listed to appear on the burn disk instead of the file number?
Naming the Photo - or giving it a title - is not the same as naming file.
How are you burning to dvd? With iPhoto? If so then the Title will be available in any app that understands basic metadata.
If you want the title available in the Finder - which does not understand photo metadata - then you'll need to export the file
File -> Export
In the resulting dialogue you'll see a heading for 'File Name'. Choose 'Use Title' from the drop down.
Regards
TD -
Need of a Webservice to get the name of the file in a Folder
Hi All,
I am in need of a Web service which should get the name of the file in a folder.
Note : Folder is created in the MOSS server.
Thanks.Just to add, Mac in intergrated into AD and all I need is help in creating the script
Thanks -
How do I get the names of tracks I type in Adobe Audition 3 to copy to the Sony CD-RW CRX217E in myD
How do I get the names of tracks I type in Adobe Audition 3 to copy to the Sony CD-RW CRX217E in my Dell Precision Workstation 670?
I have recorded 10 tracks of voice with music using Adobe Audition 3 and Sony CD-RW CRX217E with no problem.
The problem is, however, that the names I type in Audition 3 for each of the tracks and artist do not copy to the CD I have recorded. This means that when I play the tracks on any playback equipment that shows the names of the tracks and artists, etc. all that appears on the screen is the track number, such as Track 1, Track 2, etc.
I am using a Dell Precision Workstation 670
Inter®Xeon
CPU3.2GHz
3.19GHz,2.00GB RAM
SYSTEM
Professional x64 Edition
V2003
SP 2, v.4354
Thank you
NoProWell, there is one possibility, but I can't absolutely confirm this. I had a look at the specification for the drive on the Dell website:
http://support.dell.com/support/edocs/storage/P89087/en/index.htm
and nowhere does it say that the drive supports CD-Text, I'm afraid. Even though all drives can in theory write this, a lot have the header hard-coded, and simply can't. Yours may be one of them, but I think you'll have to ask Dell to confirm this. -
How to get the name of the current tab.
Hi Experts,
I have two tabs in my tab strip and a button common to both the tabs.Can you please let me know how to get the name of the current tab in the event method of the push button.
Thanks in advance.
Regards,
Arun1.Declare an Action for OnSelect event of Tabstrip. This event is triggered whenever any change in tab occurs.
2. Declare an Import Parameter in this method
Tab type String.
3. This parameter has value of the selected TAB.
4. You can set this value in some Attribute in Attribute Tab in this event only (OnSelect):
wd_this->Att = Tab.
Att is the attribute created by you in Attributes Tab of View. ( of type String)
5. Now the selected Tab ID is stored in this Attribute Att.
6. In the Onaction of Button , retrieve the selected tab value from this attribute using :
Data : lv type string.
lv = wd_this->Att
Now lv has your selected TAB ID.
I hope it would help you.
Edited by: Saurav Mago on Oct 13, 2009 2:22 PM -
How to get the name of current monitor?
I have a script which is used to get some application data. The script take parameters such as "LOB" so it can query data for different department. When it found something, it raise an event in event log.
Therefore this script is used by several different monitors. Each monitor calls the script by passing different parameters. To better understand the event was created by which monitor, I want the script can get the name of monitor which calling it and they
list it in the event log too.
Currently, I am passing $MPElement$ as one script parameter so I can get the monitor's GUID. Then get the name by running powershell command. Is there an easier way to get the monitor name? Thanks!The best way to do this is to put the monitor name as a property bag in the script and pass that to your event details. Otherwise, we're looking at querying the database each time the monitor generates an event, and this is overhead that is really not
necessary. The other option, which is just even worse in terms of performance, is to use powershell to query the SDK for the monitor name. Both of these options are not going to be a good solution, because now you need to implement action accounts that can
either query the database or the sdk.
Jonathan Almquist | SCOMskills, LLC (http://scomskills.com) -
How to get the name of the attachment in Sender Mail Adaper?
hi mates,
I've scenario a where in I need to pick up a mail with an attachment and change its extension and send it to target system using file adapter.
I'm able to pick up the mail with attachment using sender mail adapter but not able to get the name of the attachment so that I can use it in mapping or on the adapter configuration. How do I read the name of the attachment and manupulate it?
I looked at the thread sender mail adapter - attachment name But the solution is not described. I think Stefan is talking about the SP!2 for PI 7.0. I'm on XI 3.0 what is the equivalent SP for that, SP20? Stefan, can you please throw me more light on it?
I appreciate your valuable inputs
thx in adv
praveenThanks Aamir.
Earlier I replied to that thread asking for more details...but did not see the response...
anyways, thanks for your quick help..
but I wonder abt the PI SP12/ XI SP20 pre-requisite. We can have adapter modules on SPs lower than PI SP12/XI SP20 as well, can we not?
thanks
praveen -
Which Table i will Get the Name of Receipt Recipient in FBCJ
Hi Experts
Which Table i will Get the Name of Receipt Recipient in FBCJ
Transaction Code : FBCJ
Technical name : Name of Receipt Recipient
Field Name : BP_NAME
But it is not stored in TCJ_POSITIONS table
Regards
JagadishHi,
Please check in TCJ_DOCUMENTS table, field name BP_NAME.
Regards
Radhika -
9I: How can get the names of all objects in a package header? [RESOLVED]
Is there a way to get the names fo all objects (function, procedures) from package header
select * from user_objects only gives the the header name, I need the object in the header.
John
Message was edited by:
johnminkjanHere is an example with dbms_output package!
SQL> select owner, object_name,procedure_name from all_procedures
2 where object_name='DBMS_OUTPUT';
OWNER OBJECT_NAME PROCEDURE_NAME
SYS DBMS_OUTPUT GET_LINES
SYS DBMS_OUTPUT GET_LINE
SYS DBMS_OUTPUT NEW_LINE
SYS DBMS_OUTPUT PUT_LINE
SYS DBMS_OUTPUT PUT_LINE
SYS DBMS_OUTPUT PUT
SYS DBMS_OUTPUT PUT
SYS DBMS_OUTPUT DISABLE
SYS DBMS_OUTPUT ENABLE
9 rows selected.
"or"
SQL> desc dbms_output -
Can we get the name of fmx file at runtime
Hi all,
can we get the name of fmx file which is doing some DML operation on a specific table Can we back track which fmx module has done DML on a specific table. The reason I need this because I've 7 different fmx files which are doing some DML operation on a specific table and these fmx files were used by different users. Not necessarily 1:1 For eg. one user can do DML through 3 different fmx files. So in such case if I want to want to know from which fmx file this DML has take place .How can I achieve that. I know I can get the oracle username through v$session but it will not suffice my needs. I need the name of fmx file also.
I'm using:
Forms [32 Bit] Version 10.1.2.0.2 (Production)
Oracle Database 10g Release 10.2.0.1.0 - Production
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Any help?
Warm Regards
PercyPercy,
For that you can set the Module Field in the V$session in each form by,
DBMS_APPLICATION_INFO.SET_MODULE(MODULE_NAME => :SYSTEM.CURRENT_FORM, ACTION_NAME => USER);Write this in each form, and then you will get the form name in the V$SESSION's module field with form name.
Hope this helps.
Regards,
Manu. -
Dashcode: How do I get the name of an image in a website?
I'm making a widget that gets the filename of an image on a website and it changes the value of some parts of the widget if the filename has a certain name. The only problem is that I don't know how to get the name of this image in the widget. Could somebody please help me?
If I understand well, I think that the XMLHttpRequest object may help you. Please check the following link:
http://developer.apple.com/internet/webcontent/xmlhttpreq.html
Also, if you can program in Perl (or some other scripting language), you can use an external script to read the filename and send it to your Widget.
Mihalis. -
How to get the name of tag or variable
Hi everyone,
I am a newbie, I have problem on getting the name or tag of the variable from OLE for Processing Control(OPC) server, could anyone tell me how I can get the name of tag or variable from writting vb codes or please direct me to any helpful information. Here are
my codes,
Dim ItemsDef(NBR_ITEMS) As String
Dim DeviceAddress As String
Dim IndItem As Long
DeviceAddress = "MBT:152.160.178.60"
'Preparing the Handles for "AddItems"
For IndItem = 1 To NBR_ITEMS
ItemsDef(IndItem) = DeviceAddress & "!40000" & Format(IndItem) '40000 is the memory location of variable in the OPC, how can I get the variable name, what is the code or syntax?
Next
blah...
Thank you,
CalvinHi Calvin,
If you are looking for general information and examples about OPC, then we have lots of places for you to browse!
Here is a small list, and you can probably find other links within these documents:
**If you have Measurement Studio from National Instruments, then you can look at the "Measurement Studio Reference" help file. Search for OPC and in the overview you will find the methods for accessing the items on an OPC server.
**Elsewhere in the help file, you can find a link to this Application Note on our developer zone
http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&F4921B34CA8F4A9786256874005BE3F7&cat=7CDA3E51FEFC4AA2862568B80071A1E2
**One more resource is http://www.ni.com/opc
**Probably the most useful will be the examples yo
u can find on our web site. You can go to http://www.ni.com/support and in Option 3 search the Example Code database for "opc".
In the first example program (Controlling OPC Servers with the OPC Automation API in Visual Basic) that you should get when searching for "opc" in the example programs database, look for the line with this code: "browser.GetItemID(leaf)". There you can see the way the program creates an OPCBrowser from the server instance, and then gets the servers available items for use by the client. This sounds like the specific information you are looking for with the variable name.
If you aren't able to find out your answer here or in the various help resources, then please feel free to contact us at National Instruments at http://www.ni.com/ask
Regards,
John N
Applications Engineer
National Instruments -
How can I get the name of an Array Item in LabVIEW
Hi,
I would need to display the name of the items in the Step.Result.Measurement array in a VI. I can access these properties using the index, but I don't know how to get the name of them like Step.Result.Measurement[0] .
Is there any suggestions to do it in an elegant way?
AndrasHi Andras,
look here.
Regards, Guenter -
How to get the name before @ in an email id
Hi All,
How can i get the name before '@' in an email id, for example if i have [email protected], how do i get 'abc' in my query result.
Thanksthinkingeye wrote:
Hi All,
How can i get the name before '@' in an email id, for example if i have [email protected], how do i get 'abc' in my query result.
Thankscombine INSTR() & SUBSTR() functions
Maybe you are looking for
-
IPhone 4 not connecting to any computer, Mac OS or Windows, or iTunes after ios 7 update
Hello Apple community, I desparately need help connecting my iphone 4 to iTunes so I can restore my previous iPhone4 backup that is on my windows laptop computer. It used to connect perfectly to my windows 7 laptop with iTunes, but after ios 7 (an
-
Creation of Purchase Requisations through MDBT
Dear All I am facing a problem to schdule MDBT Tcode every day 2 times , EX : I want to run at every day 6.00am and 10.00am only can any body help me to to make this kind of sttings in tcode MDBT Advance Thanks Srinivas
-
Hi OO gurus, I'm calling Set_data method to set line item data of PO in POST method in ZME_PROCESS_PO_CUST. But data is not updating. Can any body give logic how to call set data method in POST method? Thanks in advance. Edited by: v bheem on Jan 27,
-
Item level Condition types appearnance by default in PO
Dear all, I have created the pricing procedure. But, While creating a PO, I want the condition types to appear by default so that I can just enter the discount and freight %. in the input field. I do not want to enter the condition types for item ma
-
How can I change a var in class C from class B if C and B are created in A?
Hi! I have a little problem. It´s not really a Swing problem as you may believe by reading below, it´s about object creation. I have a JFrame class called TransactionDialog. The TransactionDialog contains a JPanel with a CardLayout. The CardLayout co