w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
ssis smtp mail task /connection ,how to mention the port number if the port number is not 25
You need to configure your SmtpClient to use ssl like: mySmtpClient.EnableSsl = true this should do the trick. EDIT: To use the correct credentials use: mySmtpClient.Credentials = new System.Net.NetworkCredential("yourusername", "yourpassword")

Categories : Sql Server

Format a number based on a required number of decimal places *and* sig figs
Look at accepted answer for this question. I've ported code from the accepted answer to C# and made some tests. Code: using System; using System.Diagnostics; using System.Linq; namespace ConsoleApplication1 { public static class NumericExtensions { public static double RoundToSignificantFigures(this double num, int n) { if (num == 0) { return 0; } double magnitude = Math.Pow(10, n - (int)Math.Ceiling(Math.Log10(Math.Abs(num)))); double shifted = Math.Round(num * magnitude); return shifted / magnitude; } public static double RoundToSignificantFiguresWithConvert(this double num, int n) { var sigFigFormatted = num.ToString("G" + n.ToString())

Categories : C#

In a PDF417 barcode where number of columns are fixed, how would I calculate the number of rows required for some text?
You could look at the source-code of some PDF417 implementation, such as ZXing. The text encoding isn't just two characters per code-word. If you use any other character than uppercase letters and space, the encoder will add extra characters to switch character-sets etc. You really have to encode the text to see how many code-words it will become. public class Test { public static void main(String[] args) { String msg = "Hello, world!"; int columns = 7; int sourceCodeWords = calculateSourceCodeWords(msg); int errorCorrectionCodeWords = getErrorCorrectionCodewordCount(0); int rows = calculateNumberOfRows(sourceCodeWords, errorCorrectionCodeWords, columns); System.out.printf(""%s" requires %d code-words, and %d error correction code-w

Categories : Algorithm

Get connected port number and hub number of the device
You need to list the USB device IDs using WMI, then lookup each in the registry to get the location information, if any exists... $devices = gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)}|select DeviceID $devices.DeviceID | %{Get-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetEnum$_"}| select Mfg,DeviceDesc,HardwareID,LocationInformation,Class Produces info like this on my machine: Mfg : @msmouse.inf,%msmfg%;Microsoft DeviceDesc : @msmouse.inf,%hid.mousedevice%;HID-compliant mouse HardwareID : {HIDVID_15CA&PID_00C3&REV_0512, HIDVID_15CA&PID_00C3, HID_DEVICE_SYSTEM_MOUSE, HID_DEVICE_UP:0001_U:0002...} LocationInformation : Class : Mouse Mfg : @usb.inf,%generic.mfg%;(Standard

Categories : Windows

changing port number for solr-4.3.1
The port value in solr.xml is for Solr Cloud and is not actually where the listen port is defined for the server. That port is defined (for default Jetty configuration) in jetty.xml file in the example/etc directory. Try changing it there or overriding it from the command line: java -Djetty.port=9999 -jar start.jar

Categories : Solr

HTTPS url with port number not working on iOS
Are you including any additional parent CA certs beyond your own? Also, does it work if you use a port other than 8080 or 443? And does it work if you listen on 443 and explicitly attempt to request https://example.com:443/v1/base? var fs = require('fs'); var httpsOpt = { key : fs.readFileSync('ssl.plain.key').toString(), cert : fs.readFileSync('ssl.crt').toString(), ca:[fs.readFileSync('ca.pem').toString(), fs.readFileSync('sub.class1.server.ca.pem').toString()], }; https.createServer(httpsOpt, app) .listen('8080', function(){ console.log('Listening on 8080') });

Categories : IOS

Specifying port number on client side
The client program can set sockaddr...sin_port and then call bind() before connecting and it will get, subject to availability, the requested outgoing port. The server can verify this port is set manually by calling getpeername() and checking it. As others have said though, you dont really need to set the outgoing port usually, unless you have something weird going on, or specific requirements.

Categories : C

nsis get port number on which service is running
I assume you do not know where tomcat is installed (if it is installed at all). A few pointers - not sure if all this is possible in NSIS: Use Processes plugin to find if tomcat is running. You will be able filter by java.exe, but if there are more than one java processes, not sure what we can do. Assuming you find one java processes which indicates tomcat running, use nsExec plugin to run netstat command, again filter by java.exe and parse the line to get the port number.

Categories : Tomcat

How can I change default port number of Activemq
I believe your problem is there is already something running on port 61616. (It could be another instance of ActiveMQ you started on accident). You can change the port for ActiveMQ in the activemq.xml file. Just do a find on 61616 and replace it with the port you would like to use (it should be in the <transportConnector> tag with the name openwire). You do not have to install ActiveMQ, simply launch activemq.bat in the bin folder to start the standalone service.

Categories : Java

How to run the localhost in MAMP without giving any port number?
I believe all you need to do is open up MAMP (not the webstart) and change it to use Ports 80, 443 & 3306 instead of MAMPS ports which one of them is 8888. It should be in the Server section and under the General tab. I'm using MAMP Pro so not 100% sure if the interface is same for MAMP. -UPDATE for MAMP If you open preferences you should see an option for Ports. Then click "set to default Apache and MySql ports". That should allow you to use localhost instead of localhost:8888. Hope that helps.

Categories : PHP

Binding Port Number 80 for Subdomain in IIS7.5
You can run all the sites you want under the same port, as long as the hostname (in your case testdomain.com and franchise.testdomain.com) varies. So the answer is yes, you can do that without any problems.

Categories : Iis

Jenkins Slave port number for firewall
We had a similar situation, but in our case Infosec agreed to allow any to 1, so we didnt had to fix the slave port, rather fixing the master to high level JNLP port 49187 worked ("Configure Global Security" -> "TCP port for JNLP slave agents"). TCP 49187 - Fixed jnlp port 8080 - jenkins http port Other ports needed to launch slave as a windows service TCP 135 139 445 UDP 137 138

Categories : Jenkins

AngularJS $http POST with port number
Yes, it is possible to use the port number in AngularJS request. So the problem is not here. Could you be a little bit more precise on "not working" ? Check your browser console (F12 in Chrome, also F12 if you have firebug installed on Firefox). An error message is probably displayed in this console. I suspect that the Cross-Origin policy prevent you from fetching httpPost.json. It will happens if the call is not made from where you are trying to extract the data (for example if you opened the browser from file system or from another server than the one running on 8081)

Categories : Angularjs

How to remove port number from appear in the url for node js application?
Yes, using port 80 should work. You have to make sure the node app is configured to list on port 80 as well... If you've tried this, you should update your question with more detail because you don't specify what happened when it didn't work for you.

Categories : Node Js

forward the domain and remove the port number from the URL
Try Nginx server its quit easy! bellow is its demo config. server { listen       80;  server_name  blog.ramki.com;  rewrite_log  on; error_log    logs/error_ramki.log   notice; rewrite   ^/(.*)$   /department1/$1;   location / { proxy_pass;  } } for further reference please visit This

Categories : PHP

tomcat server's port number not changing
There are three ports in default tomcat installations: 8005, 8009 and 8080. You'll need to change all of them. Just search for port= in server.xml and change all the values.

Categories : Java

urllib2 fails when URL has a port number appended
Connection refused means that your operating system tried to contact the remote host, but got a "closed port" message. Most likely, this is because of a firewall between GoDaddy and foo.bar.com. Most likely, foo.bar.com is only reachable from your computer or your local network, but it also could be GoDaddy preventing access to strange ports.

Categories : Python

How to know the Number of Core and RAM Required?
I'll try and list a few constraints that I can think of, but there might be more: webserver with apache running Take a look at the number of file handles that are used (in case apache serves static content like css, javascript or images). Additionally, the number of http connections might be a constraint (normally one per concurrent user). Another constraint might be the number ajp worker threads that pass requests to tomcat. Memory constraints requirements might not be that huge but that depends on what your apache does. app server with Tomcat running Here the size of the sessions would be a constraint. Note that depending on the session timeout, the number of concurrent sessions might be much higher that the number of concurrent users (not all need to do concurrent requests, but

Categories : Java

OAuth callback URI changes port number in Azure emulator
The Oauth2 app has been configured to redirect on specific site + port, so either you need to reconfigure the Oauth2 configuration in the OAuthProvider or else see why the emulator locally is binding to a different port. Maybe the other port is being used by some other site running in the emulator. Sometimes just restarting the emulator does the trick. See this to understand how the local emulator works.

Categories : Azure

How to debug ASP site without port number on VS 2012 Express
Its really simple. You need to attach the IIS process to the visual studio and browse the website. Below article guides to achieve this. http://www.codeproject.com/Articles/37182/Debug-your-ASP-NET-Application-while-Hosted-on-IIS Its always a good practice to do a unit test of web apps to local iis while developing.

Categories : Visual Studio 2010

Extract port number from URL and reverse proxy with Nginx
This may be helpful: server { listen 80; server_name test1.test.com; location ~ ^/app/(.*)$ { proxy_pass$1; } } Notice: If you visit test1.test.com/app/8081, nginx will pass the request to More information about proxy_pass

Categories : Nginx

how to change the port number of the memcached server other than 11211
Changing the memcached.conf file worked for me when I was having similar problems. It seems that memcached is ignoring the options you give it and just using the options which are in the file.

Categories : Java

How does TCP/Application layer identifies the destination port number?
The application has to be told. Either the port is a standard port listed in etc/services, in which case the getaddrinfo() API tells you, or else it is provided via the application's configuration, or it's hard-wired into the source code.

Categories : Networking

Cisco ASA access-list service vs port number
According to the following document: http://www.cisco.com/en/US/docs/security/asa/asa81/config/guide/ports.html either SHOULD work... with the exception that it has both port 47 and 1723 as the ports for this. I don't know enough about PPTP to tell you which does what for how many Oreos. However, if I'm reverse-engineering your request right, and you put in "access-list FROM extended permit tcp object-group MyFriends object-group MyHome eq 1723" (specifying the port number) and then, when you do a show run, you see "access-list FROM extended permit tcp object-group MyFriends object-group MyHome eq pptp", then you're good. The IOS just automagically displays the string instead of the number when it has one of those reserved strings cross-referenced in it. eg, when I make a firewall rule

Categories : Misc

How to change the HTTP port number of JBoss 7 dynamically
You can do this using CLI. This example changes the port from 8081 to 8080: Start CLI (in .../bin/): $ ./jboss-cli.sh You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands. Connect [disconnected /] connect Change into the target area [standalone@localhost:9999 /] cd /socket-binding-group=standard-sockets/socket-binding=http Show the current state: [standalone@localhost:9999 socket-binding=http] ls -l ATTRIBUTE VALUE TYPE bound true BOOLEAN bound-address STRING bound-port 8081 INT client-mappings undefined LIST fixed-port false BOOLEAN interface undefined STRING multicast-address undefined STRING multi

Categories : Batch File

How to make the Android Device listen to a particular port number
Nobody has expressed an opinion yet. May be the question is not clear, at least I found it very difficult to understand what you are trying to do. You say you have a server (laptop) listening on port 9070 and you want a device to connect to this server thru this port? Is that right? Have you try, from your device, launch the navigator and connect to that address? http://abc:9070 Anyway, the java code to make a socket connection is something similar to this: try { Socket clientSocket = new Socket("YOUR_LAPTOP_IP", 9070); // 1024 is an arbitrary number, could be 512, 65535, etc byte[] buffer = new byte[1024]; int ret=0; while ((ret=clientSocket.getInputStream().read(buffer)) > 0) { // from now on it's up to you what to do with the data you read

Categories : Android

Does different port number of different ip and transport protocol on the same machine differ
You have: TCP UDP TCP UDP They are all different. No packet intended for one of them can possibly be delivered to another. Reasons: TCP and UDP ports occupy different namespaces. Each IP address has its own set of ports. So there is no overlap, ambiguity, sharing, ...

Categories : Sockets

php mysql database connection in an array with port number
For more professional, start by worrying about switching to PDO. There are tons of tutorials on it. Same SQL, just different way of working with it. Beyond that it doesn't really matter if it's an array or separate variable if you're using globals like this but procedural programming is fine when needed. My main advice is whenever you need to use the db, use a single configuration file you include to gather these variables, b/c too many times when i clean up sites like this later i have to go hunting through 50 different files to update connection strings. $dbconfig = array( 'user' => 'dbusername', 'pass' => 'dbpassword', 'host' => 'dbhostaddr', 'name' => 'dbhostname', ); $link = mysql_connect($dbconfig['host'], $dbconfig['user'], $dbconfig['pass']); // lat

Categories : PHP

how to cache images from hadoop and also how to hide port number given in the url
I'm not familiar with webhdfs but if it does not support caching, you have to put a caching layer between client and webhdfs server. Well, the thing you need is called reverse proxy with enabled caching capability. There is several options how to do it, but you should go with Apache mod_cache or Nginx reverse proxy caching and you will be just fine. So, if you want to hide port from url you have to start webserver/proxy on port 80. Then just make proxy alias on /proxy context and set request redirect to http://testing:50070/webhdfs. Enable caching. And finally you can request your webhdfs via caching proxy on url http://testing/proxy/v1/Test/asaw4zds_ssdf4_ht35-9a1a-4a7b-9n.jpg?op=OPEN The communication will look like: Client 1:00PM <> Proxy (no cache) <> Webhdfs (asaw4zds_

Categories : Caching

Symfony inserts number (?port) into URL when redirects for authorization
I solved the problem by adding this to my config.yml: framework: router: http_port: 80 https_port: 443 If you have other ports for http and https on your local dev environment you can use parameters for them.

Categories : Symfony2

How can I set a WCF service base address port number dynamically in app.config?
You could add this in your app.config. <appSettings> <add key="Port" value="8000" /> </appSettings> And read it out in the code string port = ConfigurationManager.AppSettings["Port"]; After you read the port in you have to create the url.

Categories : C#

linux command to connect to another server using hostname and port number
Try this : ssh <YOUR_HOST_NAME> 'ps auxwww' Like Dark Falcon said in the comments, you need a protocol to communicate with the server, a port alone is useless in this case. By default on unix (and unix like) servers, ssh is the way to go.

Categories : Linux

SQL Server Allowing Login on providing wrong PORT Number
The instance name in the connection string is not authoritative. It is used to determine the port number, or the named pipe name, using the SQL Browser service (which normally takes UDP 1434, but that is a different story). If you provide the port number explicitly in the connection string then the instance name is not used for anything, the client attempts to connect to the provided hostname (localhost) and port. Authorization succeed, so the connection succeeds. You could write anything in the instance name, localhostfoobar,1433 will also connect successfully.

Categories : Sql Server

Hiding port number in WordPress URL when using node-http-proxy
I've now got this working in a much simpler way. It turns out my custom routing with my hosts and ports arrays was overkill. I'm not entirely sure why this makes a difference, and whether it is because the following code is reverse-proxy as opposed to a forward proxy, but I went ahead and implemented one of the examples on node-http-proxy's GitHub page which wields the desired results: var options = { hostnameOnly: true, router: { 'www.some-apache-website.co.uk': '', 'www.some-node-website.co.uk': '' } }; var proxyServer = httpProxy.createServer(options); proxyServer.listen(80); This effectively (and with much less code) reverse-proxies the sites based on the host name. The result is that my WordPress site (sitting behind the Apache server) no

Categories : Wordpress

How to list the Connected USB Port Number using Vendor id and product id using java
You can list all serial ports by using simple javax.comm API import javax.comm.*; import java.util.Enumeration; public class ListPorts { public static void main(String args[]) { Enumeration ports = CommPortIdentifier.getPortIdentifiers(); while (ports.hasMoreElements()) { CommPortIdentifier port = (CommPortIdentifier)ports.nextElement(); String type; switch (port.getPortType()) { case CommPortIdentifier.PORT_SERIAL: type = "Serial"; break; default: /// Shouldn't happen type = "Unknown"; break; } System.out.println(port.getName() + ": " + type); } } } The output would be like COM1: Serial COM2: Serial COM7: Serial EDIT: Also see a good blog on Creating and using a real-time port monitoring application powered by IBM Lotus. Also by using jusb for windows , for linux you can do read

Categories : Java

Prime number required by user in Java
Anyways the better solution would be public void calcPrime(int inp) { ArrayList<Integer> arr = new ArrayList<Integer>(); arr.add(2); arr.add(3); int counter = 4; while(arr.size() < inp) { if(counter % 2 != 0 && counter%3 != 0) { int temp = 4; while(temp*temp <= counter) { if(counter % temp == 0) break; temp ++; } if(temp*temp > counter) { arr.add(counter); } } counter++; } System.out.println("finish" +arr.get(inp-1)); } }

Categories : Java

HTML5 input number min max not working with required
Your code works fine. Check this fiddle (I'm using latest chrome) My only concern you is your pattern="[1-8][0-9]" can simple use this pattern="[0-9]{2}"

Categories : HTML

%d format: a number is required, not NoneType for is_valid()
According to the Django documentation max_length is a required argument for CharField. Hence, adding the max_length to the CharField should fix it. I just had the same issue while adding a new Model and ModelForm, based on a preexisting Form, to an application in a Django 1.4 project. I had not used max_length in the Form (which worked without any issues) and since CharField is common to Form and Model, I tried using the field as it is. Kaboom! Fortunately, I noticed the word 'required' in the documentation. The error message and traceback were not very helpful.

Categories : Python

Show only the number of sha digits that are required to make it unique it git log?
From man git-log: --abbrev-commit Instead of showing the full 40-byte hexadecimal commit object name, show only a partial prefix. Non default number of digits can be specified with "--abbrev=<n>" (which also modifies diff output, if it is displayed). This should make "--pretty=oneline" a whole lot more readable for people using 80-column terminals. So: git log --abbrev-commit

Categories : GIT

Number of Sides Required to draw a circle in OpenGL
I would say that you need to set the number of sides depending on two variables the radius and the zoom (if you allow zoom) A circle or radius 20 pixels can look ok with 32 to 56 sides, but if you use the same number of sided for a radios of 200 pixels that number of sides will not be enough numberOfSides = radius * 3 If you allow zoom in and out you will need to do something like this numberOfSides = radiusOfPaintedCircle * 3 When you zoom in radiusOfPaintedCircle will be bigger that the "property" of the circle being drawn

Categories : Opengl

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