w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Powershell ParseExact() Military time Convert-DateTime
Make the format string yyyyMMddHHmmss. hh is for 12-hour format, HH for 24-hour format. See here.

Categories : Dotnet

Networks vs Subnetworks
You'd need to change the subnet mask to 255.255.254.0, or use a router or layer-3 switch to communicate. Network generally means the whole network you're referring to, while subnet refers to a specific separate portion of it. However, the terminology is pretty loose.

Categories : Networking

What is the iOS API for scanning available wi-fi networks
There is no public API in iOS currently that can do this (used to be available pre iOS 5). You can check out a third party library like Stumbler which should help you achieve the viewing of networks: http://code.google.com/p/iphone-wireless/wiki/Stumbler

Categories : IOS

FTP over different networks in python
You're probably running into firewall issues; using passive mode FTP should help. There's a good explanation at that link, but the short version is that FTP, by default, uses "active" mode where the client creates a connection to the server to make a request, then the server creates a new connection to the client to respond. Most firewalls are configured to block "spontaneous" inbound connections, and unless the firewall is specifically configured to look at the content of the outbound connection from the client and see "ah ha, an FTP request, I should expect an incoming connection from that server very soon", it will block the connection. Passive mode, on the other hand, has the client create two outbound connections, one for the request and a second one (on a different, randomly-chosen

Categories : Python

Make GCM work on all networks
As I understand it, when you set a firewall in your network, it blocks all ports except default ports (used for general purposes such as HTTP, HTTPS, SMTP, etc...). If you to use other ports, you have to open them manually. Google needed some ports for their service, and they chose 5228-5230. In a similar way, Apple chose 5223 for their push notifications. Both will be blocked in a normal firewall configuration, and have to be manually opened. Since this issue is not unique to your applications (i.e. all the applications that use Google Cloud Messaging will be affected the same way by the GCM ports being blocked), there is no point worrying about it.

Categories : Android

ip address networks in Python 3.3
Based on bsdlp's comment, this code got a lot simpler and faster! def find_range(x,y,c_code="",c_name=""): print() print("%29s %23s" % (x,y)) print("%16s %16s %16s %4s %s" % ("mask","start","end","code","name")) print("%16s %16s %16s %4s %s" % ("----","-----","---","----","----")) result = ipaddress.summarize_address_range( ipaddress.IPv4Address(x), ipaddress.IPv4Address(y) ) for entry in result: net = str( entry.network_address ) bcast = str( entry.broadcast_address ) print( "%16s %16s %16s %4s %s" % (entry, net, bcast,c_code,c_name))

Categories : Python

Using Wireshark in Computer Networks
Go to Statistics -> Endpoints -> tab: IPv4 Click on Address to sort the column. Click on Copy to copy the list values to the clipboard. You can find more information in the Wireshark User's Guide.

Categories : Networking

Developing networks in R using graph
You're closer, but your data looks a little funny. There are many different ways to provide data to igraph in a form that it can interpret. You should determine for yourself which for you like. I prefer the edgelist format, so I present that here. This format requires you define a source and destination of every edge. You can see in the example below that I use the third column in the CSV to provide attribute data to igraph which allows me to label the edges using the plot function. Here's an example of something you could write: library(RCurl) library(igraph) el <- read.csv(text = "Source,Target,name GENE1,GENE2,hsa-miR-24-1-5p GENE2,GENE3,hsa-miR-124-5p GENE2,GENE4,hsa-miR-223-5p") nodes <- read.csv(text = "Node

Categories : R

Sending broadcast to all networks
Try nmap. There is python-nmap here https://pypi.python.org/pypi/python-nmap for your needs NOTE: the 0.2.7 version number is for python-nmap, not python itself, so it works in python3).

Categories : Python

Scan for available WiFi networks in F#
It is not clear from your message if your college assignment prescribes pure F# solution, or you can base it on existing open source .NET libraries. Depending on this factor your mileage may vary... Nevertheless, if you are allowed to use existing .NET libraries, then as Jack P already noted you may base your approach on Managed Wifi API. It consists of 2 C# classes: Wlan, which is pInvoke interop wrapper over Native WiFi API, and WlanClient, which represents per se managed .Net API for manipulating WiFi. If you would be able building the Managed Wifi API DLL named, say, interop.dll from CodePlex C# sources, then using it from F# to list available WiFi networks and their signal strength is almost trivial: #if INTERACTIVE System.Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ #r @

Categories : Networking

UDP Broadcast to All IPs not working in some networks
255.255.255.255 is not the best option for sending UDP broadcasts, and some routers/firewalls do block it unless configured otherwise. The better option is to use the NIC's actual subnet broadcast IP instead. For example, if a UDP socket is bound to local IP 192.168.0.1 with a subnet mask of 255.255.255.0, then the broadcast IP for that subnet is 192.168.0.255. Most platforms have OS-specific APIs for retrieving a NIC's actual broadcast IP, such as getifaddrs() on POSIX systems, or at least for retrieving the NIC's subnet mask, such as GetAdaptersInfo() and GetAdaptersAddresses() on Windows, so you can calculate the broadcast IP manually. Retrieving the local broadcast IP(s) may be added to Indy in a future version.

Categories : Delphi

Determine if a given IP address is in an array of networks
The IPAddr class has its own include? method that is very different from Array#include? http://www.ruby-doc.org/stdlib-2.0/libdoc/ipaddr/rdoc/IPAddr.html#method-i-include-3F When you say internal.include? you are actually calling Array#include? which tests object equality. Obviously these are not the same objects, so the comparison fails. What you actually want is to see if any of the IPAddr objects include? your my_ipaddr object if internal.any? {|subnet| subnet.include?(my_ipaddr) } puts "I'm in the internal network" end

Categories : Ruby

Apple MFI Bluetooth using RN-42 from Roving Networks
I tested communication between RN-42-APL with 5.36 firmware and worked fine. However communication between iPhone and RN-42 requires additional chip called authentication coprocessor which must be wired to Bluetooth module (I2C serial bus). This chip is required if you want to establish communication between iPhone and bluetooth module. Firmware 5.43 has fixed bugs related to authentication, but it doesn't have influence on making connection between iPhone and module. In addition you have to properly set your module. Without that settings, iPhone will not see your module. You have to send to module the following commands: S˜,5 SN, SC,0024 SD,0704 ST,253 SO,% T,1 SM,0 SA,0 The most important commands are: SC and SD. Other settings for that commands will cause that your iPhone

Categories : Iphone

iOS sharing picture on Social Networks
iOS has an inbuilt social sharing kit. You can share images via Email, Facebook and Twitter. But for using Google+ and other social services you will need their respective SDKs. 1) For Facebook SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; [controller setInitialText:message]; [controller addImage:image]; [self presentViewController:controller animated:YES completion:Nil]; 2) For twitter replace SLServiceTypeFacebook with SLServiceTypeTwitter. 3) For Email MFMailComposeViewController *emailShareController = [[MFMailComposeViewController alloc] init]; emailShareController.mailComposeDelegate = self; [emailShareController setSubject:@"Share Image"]; [emailShareController setMessageBody:m

Categories : IOS

Capture All Wi-fi Networks and save into list
You can use the CoreWLAN Framework. Here is some sample code tested on Mavericks (10.9.1) CWInterface* interface = [[CWInterface alloc] initWithInterfaceName:@"en1"]; NSError* error; NSSet* wifi = [interface scanForNetworksWithName:nil error:&error]; if (error) { NSLog(@"%@", [error description]); } else { [wifi enumerateObjectsUsingBlock:^(id obj, BOOL *stop) { CWNetwork* net = (CWNetwork*)obj; NSLog(@"%@", net.ssid); The CWNetwork class has a method to check security : - (BOOL)supportsSecurity:(CWSecurity)security; with CWSecurity : enum { kCWSecurityNone = 0, kCWSecurityWEP = 1, kCWSecurityWPAPersonal = 2, kCWSecurityWPAPersonalMixed = 3, kCWSecurityWPA2Personal = 4, kCWSecurityPersonal = 5, kCWSec

Categories : Objective C

Internet connection not working on some networks
most probably,open Internet is not available on your University /Office network or might be the url you are trying to access is blocked on these networks. Try to browse the same url through Browser App in your phone. This will give you a better picture of the problem.

Categories : Android

iPhone app sharing data over both Wifi networks
You cannot programmatically modify the selected WiFi on iOS without using private API. I think this post describes what you want. I think it is very unlikely for Apple to change this, therefor I suggest using a web service to upload the data to and a push notification to the computer to tell it to download the data once it has finished uploading.

Categories : Iphone

How do I play video using MPMoviePlayerController over WWAN networks?
To serve a video file over a slow network, you should be using HTTP Live Streaming (HLS). Your code need not change, however the URL you call it with should point to the stream's index file. The index file amounts to a playlist of individual (often 10 second) MPEG Transport Stream files. Explore the details on Apple's HTTP Live Streaming page, or get an overview and list of server software at Wikipedia. As an aside, you don't show the declaration of videoPlayerController, but you need to make sure that it's a property of your view-controller, or in some way make sure that its lifetime is going to be as long as the video is being played for.

Categories : IOS

Soft hand off in CDMA cellular networks
For the benefit of everyone, i have touched upon few points before coming to the main point. Soft Handoff is also termed as "make-before-break" handoff. This technique falls under the category of MAHO (Mobile Assisted Handover). The key theme behind this is having the MS to maintain a simultaneous communication link with two or more BS for ensuring a un-interrupted call. In DL direction, it is achieved using different transmission codes(transmit same bit stream) on different physical channels in the same frequency by two or more BTS wherein the CDMA phone simultaneously receives the signals from these two or more BTS. In the active set, there can be more than one pilot as there could be three carriers involved in soft hand off. Also, there shall also be a rake receiver that shall do max

Categories : Misc

Generating isochrone maps from road networks
Interesting problem, to get better answers you might want to define exactly what will this area that shows the range (isochrone map) be used for? For example is it illustrative? If you define what kind of approximation you want it could help you solve the problem. Now here are some ideas. 1) Find all the cycles in the graph (see link), then eliminate edges that are shared between two cycles. Finally take the convex hull of the remaining cycles, this together with all the roads, so that the outliers that do not form cycles are included, will give a good approximation for an isochrome map. 2) A simpler solution is to define a thickness around each point of every road, this thickness should be inversely proportional to how long it takes to arrive at that point from the starting point. I.

Categories : C#

how to get available wifi networks and display them in a list in android
You need to create a BroadcastReceiver to listen for Wifi scan results: private final BroadcastReceiver mWifiScanReceiver = new BroadcastReceiver() { @Override public void onReceive(Context c, Intent intent) { if (intent.getAction().equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) { List<ScanResult> mScanResults = mWifiManager.getScanResults(); // add your logic here } } } In onCreate() you would assign mWifiManager and initiate a scan: mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); registerReceiver(mWifiScanReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); mWifiManager.startScan(); Note that the code which handles your scan results would run every time a new scan result is

Categories : Android

Error while uploading large files in RoR from different networks
Are you using unicorn? The default timeout is 30 seconds. Are you using heroku? They limit connections to 55 seconds. Otherwise you may need to provide more information about your application server/implementation/etc. For more about dealing with file uploads in rails: RoR - Large file uploads in rails, Best Ruby on Rails Architecture for Image Heavy App

Categories : Ruby On Rails

Android:FourSquare Setting->Sharing with other networks
You unfortunately can't let a Foursquare user connect to Facebook through your application. Connecting Foursquare to Facebook requires Foursquare itself to save some information from Facebook and we don't let other apps do this. For a user that has already connected Facebook, you can, however, change what gets posted to Facebook and add a check-in to Facebook through the broadcast parameter.

Categories : Android

defining the UDP socket for the nodes located in different networks
Here is a code from my college days, hope this will help /* Sample UDP server */ #include <sys/socket.h> #include <netinet/in.h> #include <stdio.h> int main(int argc, char**argv) { int sockfd,n; struct sockaddr_in servaddr,cliaddr; socklen_t len; char mesg[1000]; sockfd=socket(AF_INET,SOCK_DGRAM,0); bzero(&servaddr,sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr=htonl(INADDR_ANY); servaddr.sin_port=htons(32000); bind(sockfd,(struct sockaddr *)&servaddr,sizeof(servaddr)); for (;;) { len = sizeof(cliaddr); n = recvfrom(sockfd,mesg,1000,0,(struct sockaddr *)&cliaddr,&len); sendto(sockfd,mesg,n,0,(struct sockaddr *)&cliaddr,sizeof(cliaddr)); printf("---------------

Categories : C

Open Wi-Fi networks - Check connection in android
It seems to me like you just need to check if you have Wi-Fi, since if you have Wi-Fi, you can send data through it. You check it like this: ConnectivityManager connManager = (ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE); NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (wifi.isConnected()) { // send your data }

Categories : Java

How to scan wifi networks and list them in a listview?
But I can't find NOWHERE what in the god's name is R.layout.wifi_item and R.id.list_value, cause I get errors on them. Can somebody help me figurning this out? Thanks. The files you named are layout files, defined in .xml They can contain the UI-Components such as the ListView you want to use to display your WiFi Networks. In your example you have 2 Layout files. One is the R.layout.wifi_list that contains a button (button1) and a ListView (listView1). The other one is R.layout.wifi_item, a custom layout file that represents the layout of one entry in the ListView. Do display a simple String containing the name of the WiFi Network, you could use the Android-predefined layout "android.R.layout.simple_list_item_1" for your List-Adapter.

Categories : Java

Get All Access Points Connected to my Wifi Networks
You could read the /proc/net/arp file to read all the ARP entries. See the example in the blog post Android: Howto find the hardware MAC address of a remote host . In the ARP table, search for all the hosts that belong to your Wi-Fi network based on the IP address.

Categories : Android

Command Line to transfer file between 2 different servers in different networks
This uses the current date - I have a feeling you want the file date, but that's not clear. If it's run every hour then neither date stamp will be unique. @echo off for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a" set "YY=%dt:~2,2%" set "YYYY=%dt:~0,4%" set "MM=%dt:~4,2%" set "DD=%dt:~6,2%" set "HH=%dt:~8,2%" set "Min=%dt:~10,2%" set "Sec=%dt:~12,2%" set datestamp=%YYYY%%MM%%DD% copy "\serverashareapple" "\serverbshareapple.bk" ren "\serverbshareapple" "apple_%datestamp%_bak" ren "\serverbshareapple.bk" "apple"

Categories : Networking

Meteor mobile application STOPS working over 2G and 3G networks
This could occur if you have a bad connection. The Meteor in the device's browser can't really tell what network it's on. It just uses whatever it gets. As soon as it can get a connection back it should reconnect. Keep in mind with 2G (EDGE/GPRS) connections you might have to wait a bit longer for the HTML/JavaScript to connect to the DDP server as all the client HTML/JavaScript data needs to be downloaded first. This can take quite a while. The other thing is to ensure your (3G) connection isn't over some kind of proxy, especially if you're hosting the application yourself on an unusual port number (websockets usually fall back to long polling, though).

Categories : Meteor

GCM alternative for local networks or sending messages to device IP
You should take a look at MQTT. There is also a Java library that is compatible with Android; the Eclipse Paho Client. In very simplistic terms, MQTT an asynchronous publish/subscribe mechanism that is well suited for what you want. It runs on top of TCP/IP.. You will need to use a MQTT broker on the server side (i.e. mosquitto (mosquitto.org) or RSMB (Really Small Message Broaker), etc) If you are interested, I created a simple project that allows you to connect to a Raspberry Pi and turn the lights of your house on and off using and Android device. Here is the git

Categories : Android

Android - Location services, use wirless networks disabled
I wrote a blog post about Android location services and it contains example code on how to check which providers are enabled, alert the user and then take them to the settings screen to enable them. You can find it here: http://www.scotthelme.co.uk/blog/android-location-services/

Categories : Android

Function to find WiFi networks returnes false
Make sure you have <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> in your manifest.xml And of course make sure you are testing on a device on a network, with WiFi enabled.

Categories : Android

How to view List of Available WIFI Networks Programatically in Windows Phone8 App
It is not possible to get a list of available WiFi networks via any of the public APIs. It will not be possible to build the app you describe on Windows Phone. The ability to view available WiFi networks and choose the one to connect to is already included in the phone settings.

Categories : Dotnet

How to read functions from a file? [for factor graph in Bayesian networks]
I think in case of calling eval with multiple line eval function, it fails. You should use eg.exec instead of eval:solution Furthermore i think you have to call the functions, the definition doesn't seems enough: def f(x0,x1,x2): return x0*x1*x2 f(x0,x1,x2)

Categories : Python

How to get the record of Wifi networks connected using C#? I tried to extract from registry but it Gives null exception
I've tested your code and it works fine for me in listing the network interfaces I have on my computer. However, I needed to elevate the privileges to access the information and did that by adding an Application Manifest File and in it changing the requestedExecutionLevel to requireAdministrator. <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo>

Categories : C#

admob mediation custom event Request Error: No ad to show from all configured ad networks
You do need to call [self.delegate customEventBanner:self didReceiveAd:bannerView_]; at some point in your custom event flow. If you don't do so within about 5 seconds of requestBannerAd:parameter:label:request: being invoked, AdMob Mediation will time out on the request to your custom event and move on. That's why you're seeing the message: Error Domain=com.google.ads Code=9 "Request Error: No ad to show from all configured ad networks." UserInfo=0x1e8e31a0 {NSLocalizedDescription=Request Error: No ad to show from all configured ad networks., NSLocalizedFailureReason=Request Error: No ad to show from all configured ad networks.} As far as when to invoke [self.delegate customEventBanner:self didReceiveAd:bannerView_];, it depends on your custom event. If your custom event just return

Categories : IOS

Database Scheme for unified profiles fetched from multiple Social Networks (Facebook and Linkedin...)
var UserSchema = new Schema({ name: { type: String, default: '' }, email: { type: String, default: '' }, provider: { type: String, default: '' }, hashed_password: { type: String, default: '' }, salt: { type: String, default: '' }, authToken: { type: String, default: '' }, facebook: {}, linkedin: {} }) I'm using the Schema mentioned above for my users collection. and when a new user wants to Sign up, using either the local strategy or social strategies I just use the update mongoose function with the "upsert: true" option, to either update or create an entry.

Categories : Mongodb



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