Daily Archives

Articles indexed Saturday April 7 2012

Page 4/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to make margin be relative to the center of the UIElement and not its top-left corner in a Grid?

    - by Nockawa
    I'd like the Margin property to reference the center of the UIElement and not the top-left corner. That way when I change the width/height of the UIElement it stays in the same spot. Is there a way to configure this behavior or I'll have to rely on Binding to make the adjustment ? Thanks. For instance if I change the Width/Height of the following rectangle, its center will move. <Grid> <Rectangle Fill="#FF991C1C" Width="10" Height="40" HorizontalAlignment="Left" Margin="90,161,0,0" VerticalAlignment="Top"/> </Grid>

    Read the article

  • Android Google Analytics

    - by ibenot
    I'm trying to use Google Analytics in my Android application with Google Configuration Add .jar in my project Insert this in AndroidManifest Add this in my java file public class MainActivity extends Activity { GoogleAnalyticsTracker tracker; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); tracker = GoogleAnalyticsTracker.getInstance(); tracker.startNewSession("My-UA–XXXXXXXX", this); setContentView(R.layout.main); Button createEventButton = (Button)findViewById(R.id.NewEventButton); createEventButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { tracker.trackEvent( "Clicks", // Category "Button", // Action "clicked", // Label 77); // Value } }); setContentView(R.layout.main); Button createPageButton = (Button)findViewById(R.id.NewPageButton); createPageButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Add a Custom Variable to this pageview, with name of "Medium" and value "MobileApp" and // scope of session-level. tracker.setCustomVar(1, "Navigation Type", "Button click", 2); // Track a page view. This is probably the best way to track which parts of your application // are being used. // E.g. // tracker.trackPageView("/help"); to track someone looking at the help screen. // tracker.trackPageView("/level2"); to track someone reaching level 2 in a game. // tracker.trackPageView("/uploadScreen"); to track someone using an upload screen. tracker.trackPageView("/testApplicationHomeScreen"); } }); Button quitButton = (Button)findViewById(R.id.QuitButton); quitButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { finish(); } }); Button dispatchButton = (Button)findViewById(R.id.DispatchButton); dispatchButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Manually start a dispatch, not needed if the tracker was started with a dispatch // interval. tracker.dispatch(); } }); } @Override protected void onDestroy() { super.onDestroy(); // Stop the tracker when it is no longer needed. tracker.stopSession(); } } == And it's ok, no error, compiling and executing but i have created my ua account yesterday (more 24h) and i have nothing in my google analytics panel. My Question : is there an error in my code or i want to wait again ? Live trafic works for Android application (like tradicional website) ??? I have no information about Live trafic (when i play my app, i would like to show the number of person using my application) and Saved trafic (with viewed pages, time) Thank you for your replies and excuse my poor english :) bye

    Read the article

  • Rails - Format number as currency format in the Getter

    - by daemonsy
    I am making a simple retail commerce solution, where there are prices in a few different models. These prices contribute to a total price. Imagine paying $0.30 more for selecting a topping for your yogurt. When I set the price field to t.decimal :price, precision:8, scale:2 The database stores 6.50 as 6.5. I know in the standard rails way, you call number_to_currency(price) to get the formatted value in the Views. I need to programmatically call the price field as well formatted string, i.e. $6.50 a few places that are not directly part of the View. Also, my needs are simple (no currency conversion etc), I prefer to have the price formatted universally in the model without repeated calling number_to_currency in views. Is there a good way I can modify my getter for price such that it always returns two decimal place with a dollar sign, i.e. $6.50 when it's called? Thanks in advance.

    Read the article

  • Unreasonable errors in merge sort

    - by Alexxx
    i have the following errors - please help me to find the error: 9 IntelliSense: expected a '}' 70 4 it points on the end of the code - but there are no open { anywhere!! so why?? 8 IntelliSense: expected a ';' 57 1 it points on the { after the void main but why to put ; after the { of the void main?? Error 7 error C1075: end of file found before the left brace '{' at 70 1 points to the beginig of the code - why??? #include <stdio.h> #include <stdlib.h> void merge(int *a,int p,int q,int r) { int i=p,j=q+1,k=0; int* temp=(int*)calloc(r-p+1, sizeof(int)); while ((i<=q)&& (j<=r)) if(a[i]<a[j]) temp[k++]=a[i++]; else temp[k++]=a[j++]; while(j<=r) // if( i>q ) temp[k++]=a[j++]; while(i<=q) // j>r temp[k++]=a[i++]; for(i=p,k=0;i<=r;i++,k++) // copy temp[] to a[] a[i]=temp[k]; free(temp); } void merge_sort(int *a,int first, int last) { int middle; if(first < last) { middle=(first+last)/2; merge_sort(a,first,middle); merge_sort(a,middle+1,last); merge(a,first,middle,last); { } void main() { int a[] = {9, 7, 2, 3, 5, 4, 1, 8, 6, 10}; int i; merge_sort(a, 0, 9); for (i = 0; i < 10; i++) printf ("%d ", a[i]);

    Read the article

  • How can I show print statements in debug mode of OPNET Modeler?

    - by Here now
    I'm writing C++ code in OPNET Modeler. I try to simulate my scenario in debugger mode & I need to trace the function that I wrote it. I need to show print statements which I put it in my code. I used in debugger mode: ***ltr function_name()*** then ***c*** But the result looks like: Type 'help' for Command Summary ODB> ltr enqueue_packet() Added trace #0: trace on label (enqueue_packet()) ODB> c |-----------------------------------------------------------------------------| | Progress: Time (1 min. 52 sec.); Events (500,002) | | Speed: Average (82,575 events/sec.); Current (82,575 events/sec.) | | Time : Elapsed (6.1 sec.) | | DES Log: 28 entries | |-----------------------------------------------------------------------------| |-----------------------------------------------------------------------------| | Progress: Time (1 min. 55 sec.); Events (1,000,002) | | Speed: Average (69,027 events/sec.); Current (59,298 events/sec.) | | Time : Elapsed (14 sec.) | | DES Log: 28 entries | |-----------------------------------------------------------------------------| |-----------------------------------------------------------------------------| | Progress: Time (1 min. 59 sec.); Events (1,500,002) | | Speed: Average (51,464 events/sec.); Current (34,108 events/sec.) | | Time : Elapsed (29 sec.) | | DES Log: 28 entries | |-----------------------------------------------------------------------------| |-----------------------------------------------------------------------------| | Simulation Completed - Collating Results. | | Events: Total (1,591,301); Average Speed (48,803 events/sec.) | | Time : Elapsed (33 sec.); Simulated (2 min. 0 sec.) | | DES Log: 29 entries | |-----------------------------------------------------------------------------| |-----------------------------------------------------------------------------| | Reading network model. | |-----------------------------------------------------------------------------| I need to show the print statements in my code. Where it has to be appeared? Is there any step before run the simulation to insure that OPNET debugger using Visual Studio & go through my code??

    Read the article

  • getline won't let me type, c++

    - by Stijn
    I try to get the name of a game the users chooses and store it in a vector. I use getline so the user can use a space. When I try to type a new game to add it won't let me. It automaticly displays me games library. Please tell me what I do wrong. Problem is at if(action == "add") Here's my code: #include <iostream> #include <string> #include <vector> #include <algorithm> #include <ctime> #include <cstdlib> using namespace std; int main() { vector<string>::const_iterator myIterator; vector<string>::const_iterator iter; vector<string> games; games.push_back("Crysis 2"); games.push_back("GodOfWar 3"); games.push_back("FIFA 12"); cout <<"Welcome to your Games Library.\n"; cout <<"\nThese are your games:\n"; for (iter = games.begin(); iter != games.end(); ++iter) { cout <<*iter <<endl; } //the loop! string action; string newGame; cout <<"\n-Type 'exit' if you want to quit.\n-Type 'add' if you want to add a game.\n-Type 'delete' if you want to delete a game.\n-Type 'find' if you want to search a game.\n-Type 'game' if you don't know what game to play.\n-Type 'show' if you want to view your library."; while (action != "exit") { cout <<"\n\nWhat do you want to do: "; cin >> action; //problem is here if (action == "add") { cout <<"\nType the name of the game you want to add: "; getline (cin, newGame); games.push_back(newGame); for (iter = games.begin(); iter != games.end(); ++iter) { cout <<*iter <<endl; } continue; } else if (action == "show") { cout <<"\nThese are your games:\n"; for (iter = games.begin(); iter != games.end(); ++iter) { cout <<*iter <<endl; } } else if (action == "delete") { cout <<"Type the name of the game you want to delete: "; cin >> newGame; getline (cin, newGame); iter = find(games.begin(), games.end(), newGame); if(iter != games.end()) { games.erase(iter); cout <<"\nGame deleted!"; } else { cout<<"\nGame not found."; } continue; } else if (action == "find") { cout <<"Which game you want to look for in your library: "; cin >> newGame; getline (cin, newGame); iter = find(games.begin(), games.end(), newGame); if (iter != games.end()) { cout << "Game found.\n"; } else { cout << "Game not found.\n"; } continue; } else if (action == "game") { srand(static_cast<unsigned int>(time(0))); random_shuffle(games.begin(), games.end()); cout << "\nWhy don't you play " << games[0]; continue; } else if (action == "quit") { cout <<"\nRemember to have fun while gaming!!\n"; break; } else { cout <<"\nCommand not found"; } } return 0; }

    Read the article

  • PHP getting full server name including port number and protocol

    - by vivid-colours
    In PHP, is there a reliable and good way of getting these things: Protocol: i.e. http or https Servername: e.g. localhost Portnumber: e.g. 8080 I can get the server name using $_SERVER['SERVER_NAME']. I can kind of get the protocol but I don't think it's perfect: if(strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))=='https') { return "https"; } else { return "http"; } I don't know how to get the port number though. The port numbers I am using are not 80.. they are 8080 and 8888. Thank you.

    Read the article

  • Cheapest way of binding local variable to closure

    - by mmotorny
    I believe following to be a cheapest way of binding local variable to closure: void ByRValueReference(A&& a) { } std::function<void ()> CreateClosureByRValueReference() { A a; std::function<void ()> f = std::bind(&ByRValueReference, std::move(a)); // !!! return f; } However, it does not compile under Clang 3.1: error: no viable conversion from '__bind<void (*)(A &&), A>' to 'std::function<void ()>' and gcc 4.6.1: /usr/include/c++/4.6/functional:1778:2: error: no match for call to ‘(std::_Bind<void (*(A))(A&&)>) ()’ Am I violating the standard or it's just broken standard libraries?

    Read the article

  • ASP.NET MVC: Is it good to access HttpContext in a controller?

    - by Zach
    I've been working with ASP.NET(WebForm) for a while, but new to ASP.NET MVC. From many articles I've read, in most cases the reason that the controllers are hard to test is because they are accessing the runtime components: HttpContext (including Request, Response ...). Accessing HttpContext in a controller seems bad. However, I must access these components somewhere, reading input from Request, sending results back via Response, and using Session to hold a few state variables. So where is the best place to access these runtime components if we don't access them in a controller? Best regards, Zach@Shine

    Read the article

  • Recording audio from many source/microphones

    - by user657429
    I'm curious if it's possible to record audio from many sources and if not, what's the limitation. Many current devices have two internal microphones (basically for noise reduction). On top of that it's possible to plug additional external one using audiojack. You can as well have another audio stream via bluetooth headset. You are allowed to specify AudioSource in android but is it possible to do recording from many sources at the same time? I'm also interested how the situation look like on the iOS devices.

    Read the article

  • Oracle Enterprise Linux or Red Hat Enterprise Linux?

    - by peturgretars
    I would highly appreciate hearing some opinions regarding the choice of Linux distribution when it comes to setting up an Oracle 11.2.0.3 RAC. We are about to install 2 node Oracle 11.2.0.3 RAC's in data centers A and B. Then we are going to have a standby in B for A and a standby in A for B using Data Guard in ASYNC transmit (long distance). Personally I have more experience with OEL and I know that for example Oracle Smart Flash Cache and zero patching downtime were only supported in OEL 5. I am not sure about OEL 6 vs RHEL 6 though. My question is, which Operating System should we go for and why, Oracle Enterprise Linux 5/6 or Red Hat Enterprise Linux 5/6? The hosting company is unfortunately not supporting OEL at the moment so if OEL is the choice then how would convince the hosting company to start using OEL and supporting it? Thanks so much!

    Read the article

  • Multiple instances of this carousel on a single page - can't get it to work

    - by Andy
    This code comes from a tutorial so it's not originally my own work. What I am trying to do is implement this several times on a single page. I have tried and so far failed - by numbering the id "carousel" and so forth. Any help would be seriously appreciated. I'm tearing my hair out. http://jsfiddle.net/AndyMP/zcKDV/5/ For completeness.. this is the carousel JQuery as it stands. //rotation speed and timer var speed = 5000; var run = setInterval('rotate()', speed); //grab the width and calculate left value var item_width = $('#slides li').outerWidth(); var left_value = item_width * (-1); //move the last item before first item, just in case user click prev button $('#slides li:first').before($('#slides li:last')); //set the default item to the correct position $('#slides ul').css({'left' : left_value}); //if user clicked on prev button $('#prev').click(function() { //get the right position var left_indent = parseInt($('#slides ul').css('left')) + item_width; //slide the item $('#slides ul').animate({'left' : left_indent}, 200,function(){ //move the last item and put it as first item $('#slides li:first').before($('#slides li:last')); //set the default item to correct position $('#slides ul').css({'left' : left_value}); }); //cancel the link behavior return false; }); //if user clicked on next button $('#next').click(function() { //get the right position var left_indent = parseInt($('#slides ul').css('left')) - item_width; //slide the item $('#slides ul').animate({'left' : left_indent}, 200, function () { //move the first item and put it as last item $('#slides li:last').after($('#slides li:first')); //set the default item to correct position $('#slides ul').css({'left' : left_value}); }); //cancel the link behavior return false; }); //if mouse hover, pause the auto rotation, otherwise rotate it $('#slides').hover( function() { clearInterval(run); }, function() { run = setInterval('rotate()', speed); } ); //a simple function to click next link //a timer will call this function, and the rotation will begin :) function rotate() { $('#next').click(); }

    Read the article

  • Execute TSQL statement with ExecuteStoreQuery in entity framework 4.0

    - by Jalpesh P. Vadgama
    I was playing with entity framework in recent days and I was searching something that how we can execute TSQL statement in entity framework. And I have found one great way to do that with entity framework ‘ExecuteStoreQuery’ method. It’s executes a TSQL statement against data source given enity framework context and returns strongly typed result. You can find more information about ExcuteStoreQuery from following link. http://msdn.microsoft.com/en-us/library/dd487208.aspx So let’s examine how it works. So Let’s first create a table against which we are going to execute TSQL statement. So I have added a SQL Express database as following. Now once we are done with adding a database let’s add a table called Client like following. Here you can see above Client table is very simple. There are only two fields ClientId and ClientName where ClientId is primary key and ClientName is field where we are going to store client name. Now it’s time to add some data to the table. So I have added some test data like following. Now it’s time to add entity framework model class. So right click project->Add new item and select ADO.NET entity model as following. After clicking on add button a wizard will start it will ask whether we need to create model classes from database or not but we already have our client table ready so I have selected generate from database as following. Once you process further in wizard it will be presented a screen where we can select the our table like following. Now once you click finish it will create model classes with for us. Now we need a gridview control where we need to display those data. So in Default.aspx page I have added a grid control like following. <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="EntityFramework._Default" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> Welcome to ASP.NET! </h2> <p> To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>. </p> <p> You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409" title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>. <asp:GridView ID="grdClient" runat="server"> </asp:GridView> </p> </asp:Content> Now once we are done with adding Gridview its time to write code for server side. So I have written following code in Page_load event of default.aspx page. protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { using (var context = new EntityFramework.TestEntities()) { ObjectResult<Client> result = context.ExecuteStoreQuery<Client>("Select * from Client"); grdClient.DataSource = result; grdClient.DataBind(); } } } Here in the above code you can see that I have written create a object of our entity model and then with the help of the ExecuteStoreQuery method I have execute a simple select TSQL statement which will return a object result. I have bind that object result with gridview to display data. So now we are done with coding.So let’s run application in browser. Following is output as expected. That’s it. Hope you like it. Stay tuned for more..Till then happy programming.

    Read the article

  • Computer Networks UNISA - Chap 8 &ndash; Wireless Networking

    - by MarkPearl
    After reading this section you should be able to Explain how nodes exchange wireless signals Identify potential obstacles to successful transmission and their repercussions, such as interference and reflection Understand WLAN architecture Specify the characteristics of popular WLAN transmission methods including 802.11 a/b/g/n Install and configure wireless access points and their clients Describe wireless MAN and WAN technologies, including 802.16 and satellite communications The Wireless Spectrum All wireless signals are carried through the air by electromagnetic waves. The wireless spectrum is a continuum of the electromagnetic waves used for data and voice communication. The wireless spectrum falls between 9KHZ and 300 GHZ. Characteristics of Wireless Transmission Antennas Each type of wireless service requires an antenna specifically designed for that service. The service’s specification determine the antenna’s power output, frequency, and radiation pattern. A directional antenna issues wireless signals along a single direction. An omnidirectional antenna issues and receives wireless signals with equal strength and clarity in all directions The geographical area that an antenna or wireless system can reach is known as its range Signal Propagation LOS (line of sight) uses the least amount of energy and results in the reception of the clearest possible signal. When there is an obstacle in the way, the signal may… pass through the object or be obsrobed by the object or may be subject to reflection, diffraction or scattering. Reflection – waves encounter an object and bounces off it. Diffraction – signal splits into secondary waves when it encounters an obstruction Scattering – is the diffusion or the reflection in multiple different directions of a signal Signal Degradation Fading occurs as a signal hits various objects. Because of fading, the strength of the signal that reaches the receiver is lower than the transmitted signal strength. The further a signal moves from its source, the weaker it gets (this is called attenuation) Signals are also affected by noise – the electromagnetic interference) Interference can distort and weaken a wireless signal in the same way that noise distorts and weakens a wired signal. Frequency Ranges Older wireless devices used the 2.4 GHZ band to send and receive signals. This had 11 communication channels that are unlicensed. Newer wireless devices can also use the 5 GHZ band which has 24 unlicensed bands Narrowband, Broadband, and Spread Spectrum Signals Narrowband – a transmitter concentrates the signal energy at a single frequency or in a very small range of frequencies Broadband – uses a relatively wide band of the wireless spectrum and offers higher throughputs than narrowband technologies The use of multiple frequencies to transmit a signal is known as spread-spectrum technology. In other words a signal never stays continuously within one frequency range during its transmission. One specific implementation of spread spectrum is FHSS (frequency hoping spread spectrum). Another type is known as DSS (direct sequence spread spectrum) Fixed vs. Mobile Each type of wireless communication falls into one of two categories Fixed – the location of the transmitted and receiver do not move (results in energy saved because weaker signal strength is possible with directional antennas) Mobile – the location can change WLAN (Wireless LAN) Architecture There are two main types of arrangements Adhoc – data is sent directly between devices – good for small local devices Infrastructure mode – a wireless access point is placed centrally, that all devices connect with 802.11 WLANs The most popular wireless standards used on contemporary LANs are those developed by IEEE’s 802.11 committee. Over the years several distinct standards related to wireless networking have been released. Four of the best known standards are also referred to as Wi-Fi. They are…. 802.11b 802.11a 802.11g 802.11n These four standards share many characteristics. i.e. All 4 use half duplex signalling Follow the same access method Access Method 802.11 standards specify the use of CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) to access a shared medium. Using CSMA/CA before a station begins to send data on an 802.11 network, it checks for existing wireless transmissions. If the source node detects no transmission activity on the network, it waits a brief period of time and then sends its transmission. If the source does detect activity, it waits a brief period of time before checking again. The destination node receives the transmission and, after verifying its accuracy, issues an acknowledgement (ACT) packet to the source. If the source receives the ACK it assumes the transmission was successful, – if it does not receive an ACK it assumes the transmission failed and sends it again. Association Two types of scanning… Active – station transmits a special frame, known as a prove, on all available channels within its frequency range. When an access point finds the probe frame, it issues a probe response. Passive – wireless station listens on all channels within its frequency range for a special signal, known as a beacon frame, issued from an access point – the beacon frame contains information necessary to connect to the point. Re-association occurs when a mobile user moves out of one access point’s range and into the range of another. Frames Read page 378 – 381 about frames and specific 802.11 protocols Bluetooth Networks Sony Ericson originally invented the Bluetooth technology in the early 1990s. In 1998 other manufacturers joined Ericsson in the Special Interest Group (SIG) whose aim was to refine and standardize the technology. Bluetooth was designed to be used on small networks composed of personal communications devices. It has become popular wireless technology for communicating among cellular telephones, phone headsets, etc. Wireless WANs and Internet Access Refer to pages 396 – 402 of the textbook for details.

    Read the article

  • Computer Networks UNISA - Chap 10 &ndash; In Depth TCP/IP Networking

    - by MarkPearl
    After reading this section you should be able to Understand methods of network design unique to TCP/IP networks, including subnetting, CIDR, and address translation Explain the differences between public and private TCP/IP networks Describe protocols used between mail clients and mail servers, including SMTP, POP3, and IMAP4 Employ multiple TCP/IP utilities for network discovery and troubleshooting Designing TCP/IP-Based Networks The following sections explain how network and host information in an IPv4 address can be manipulated to subdivide networks into smaller segments. Subnetting Subnetting separates a network into multiple logically defined segments, or subnets. Networks are commonly subnetted according to geographic locations, departmental boundaries, or technology types. A network administrator might separate traffic to accomplish the following… Enhance security Improve performance Simplify troubleshooting The challenges of Classful Addressing in IPv4 (No subnetting) The simplest type of IPv4 is known as classful addressing (which was the Class A, Class B & Class C network addresses). Classful addressing has the following limitations. Restriction in the number of usable IPv4 addresses (class C would be limited to 254 addresses) Difficult to separate traffic from various parts of a network Because of the above reasons, subnetting was introduced. IPv4 Subnet Masks Subnetting depends on the use of subnet masks to identify how a network is subdivided. A subnet mask indicates where network information is located in an IPv4 address. The 1 in a subnet mask indicates that corresponding bits in the IPv4 address contain network information (likewise 0 indicates the opposite) Each network class is associated with a default subnet mask… Class A = 255.0.0.0 Class B = 255.255.0.0 Class C = 255.255.255.0 An example of calculating  the network ID for a particular device with a subnet mask is shown below.. IP Address = 199.34.89.127 Subnet Mask = 255.255.255.0 Resultant Network ID = 199.34.89.0 IPv4 Subnetting Techniques Subnetting breaks the rules of classful IPv4 addressing. Read page 490 for a detailed explanation Calculating IPv4 Subnets Read page 491 – 494 for an explanation Important… Subnetting only applies to the devices internal to your network. Everything external looks at the class of the IP address instead of the subnet network ID. This way, traffic directed to your network externally still knows where to go, and once it has entered your internal network it can then be prioritized and segmented. CIDR (classless Interdomain Routing) CIDR is also known as classless routing or supernetting. In CIDR conventional network class distinctions do not exist, a subnet boundary can move to the left, therefore generating more usable IP addresses on your network. A subnet created by moving the subnet boundary to the left is known as a supernet. With CIDR also came new shorthand for denoting the position of subnet boundaries known as CIDR notation or slash notation. CIDR notation takes the form of the network ID followed by a forward slash (/) followed by the number of bits that are used for the extended network prefix. To take advantage of classless routing, your networks routers must be able to interpret IP addresses that don;t adhere to conventional network class parameters. Routers that rely on older routing protocols (i.e. RIP) are not capable of interpreting classless IP addresses. Internet Gateways Gateways are a combination of software and hardware that enable two different network segments to exchange data. A gateway facilitates communication between different networks or subnets. Because on device cannot send data directly to a device on another subnet, a gateway must intercede and hand off the information. Every device on a TCP/IP based network has a default gateway (a gateway that first interprets its outbound requests to other subnets, and then interprets its inbound requests from other subnets). The internet contains a vast number of routers and gateways. If each gateway had to track addressing information for every other gateway on the Internet, it would be overtaxed. Instead, each handles only a relatively small amount of addressing information, which it uses to forward data to another gateway that knows more about the data’s destination. The gateways that make up the internet backbone are called core gateways. Address Translation An organizations default gateway can also be used to “hide” the organizations internal IP addresses and keep them from being recognized on a public network. A public network is one that any user may access with little or no restrictions. On private networks, hiding IP addresses allows network managers more flexibility in assigning addresses. Clients behind a gateway may use any IP addressing scheme, regardless of whether it is recognized as legitimate by the Internet authorities but as soon as those devices need to go on the internet, they must have legitimate IP addresses to exchange data. When a clients transmission reaches the default gateway, the gateway opens the IP datagram and replaces the client’s private IP address with an Internet recognized IP address. This process is known as NAT (Network Address Translation). TCP/IP Mail Services All Internet mail services rely on the same principles of mail delivery, storage, and pickup, though they may use different types of software to accomplish these functions. Email servers and clients communicate through special TCP/IP application layer protocols. These protocols, all of which operate on a variety of operating systems are discussed below… SMTP (Simple Mail transfer Protocol) The protocol responsible for moving messages from one mail server to another over TCP/IP based networks. SMTP belongs to the application layer of the ODI model and relies on TCP as its transport protocol. Operates from port 25 on the SMTP server Simple sub-protocol, incapable of doing anything more than transporting mail or holding it in a queue MIME (Multipurpose Internet Mail Extensions) The standard message format specified by SMTP allows for lines that contain no more than 1000 ascii characters meaning if you relied solely on SMTP you would have very short messages and nothing like pictures included in an email. MIME us a standard for encoding and interpreting binary files, images, video, and non-ascii character sets within an email message. MIME identifies each element of a mail message according to content type. MIME does not replace SMTP but works in conjunction with it. Most modern email clients and servers support MIME POP (Post Office Protocol) POP is an application layer protocol used to retrieve messages from a mail server POP3 relies on TCP and operates over port 110 With POP3 mail is delivered and stored on a mail server until it is downloaded by a user Disadvantage of POP3 is that it typically does not allow users to save their messages on the server because of this IMAP is sometimes used IMAP (Internet Message Access Protocol) IMAP is a retrieval protocol that was developed as a more sophisticated alternative to POP3 The single biggest advantage IMAP4 has over POP3 is that users can store messages on the mail server, rather than having to continually download them Users can retrieve all or only a portion of any mail message Users can review their messages and delete them while the messages remain on the server Users can create sophisticated methods of organizing messages on the server Users can share a mailbox in a central location Disadvantages of IMAP are typically related to the fact that it requires more storage space on the server. Additional TCP/IP Utilities Nearly all TCP/IP utilities can be accessed from the command prompt on any type of server or client running TCP/IP. The syntaxt may differ depending on the OS of the client. Below is a list of additional TCP/IP utilities – research their use on your own! Ipconfig (Windows) & Ifconfig (Linux) Netstat Nbtstat Hostname, Host & Nslookup Dig (Linux) Whois (Linux) Traceroute (Tracert) Mtr (my traceroute) Route

    Read the article

  • Partial sync of Mysql databases on two remote computers

    - by Beck
    Does mysql replication supports delayed sync if remote slave server is OFF? For example I want to make my developing server have a fresh copy of databases each morning. It should be partial sync, not full copy of databases each morning. And synchronization should be only ONE way, not duplex, to avoid deleting something of master server. What utilities are out there or native functionality of mysql itself? Thanks!

    Read the article

  • lots of dns requests from China, should I worry?

    - by nn4l
    I have turned on dns query logs, and when running "tail -f /var/log/syslog" I see that I get hundreds of identical requests from a single ip address: Apr 7 12:36:13 server17 named[26294]: client 121.12.173.191#10856: query: mydomain.de IN ANY + Apr 7 12:36:13 server17 named[26294]: client 121.12.173.191#44334: query: mydomain.de IN ANY + Apr 7 12:36:13 server17 named[26294]: client 121.12.173.191#15268: query: mydomain.de IN ANY + Apr 7 12:36:13 server17 named[26294]: client 121.12.173.191#59597: query: mydomain.de IN ANY + The frequency is about 5 - 10 requests per second, going on for about a minute. After that the same effect repeats from a different IP address. I have now logged about 10000 requests from about 25 ip addresses within just a couple of hours, all of them come from China according to "whois [ipaddr]". What is going on here? Is my name server under attack? Can I do something about this?

    Read the article

  • What is the point of PPPoE?

    - by aaa90210
    I am trying to expand my knowledge of networking beyond the basics. I have started reading about PPP, and how it is used in DSL modems with PPPoE and PPPoA. My first impression of PPP was "well that seems pretty similar to Ethernet". They are both data link layer protocols. They both have fields to identify the encapsulated protocol (e.g. IP). They both have related protocols to assign IP addresses (DHCP and NCP). So my first question was "so what's the point of PPP, why not just use Ethernet?". The answer to that was fairly straightforward - Ethernet is not supported over a wide range of media like serial lines, and is a fairly specific technology to LAN's using CAT5 or similar. HOWEVER - then I was reading about PPPoE, and the obvious thought was "well if we are doing something over Ethernet, then Ethernet must be available and in use, so why not just use it?". In other words, PPPoE seems to be encapsulating one data-link layer protocol in another very similar protocol. Why do IP-inside-PPP-inside-Ethernet when we could just be doing IP-inside-Ethernet, and use DHCP rather than NCP to assign the IP address to the home router? Thanks

    Read the article

  • Uninstall php5 installed from source

    - by diegomichel
    I have tried to install php5 from source , and it worked... Then for some reason need to install the official packets, so i tried a make uninstall and for my surprise there is such make uninstall... so i tried delete all the installed files by hand. Then installed the official debian packages and it worked fine... till i need install sqlite module, which give me the following error: php --version PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/pdo_sqlite.so' - /usr/lib/php5/20090626/pdo_sqlite.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 PHP 5.3.1-5 with Suhosin-Patch (cli) (built: Feb 22 2010 22:46:05) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies So i remember that manual install i did, and i think there is some old lib installed causing that problem, the bad thing is that there is not such make uninstall on the source code of php5... php-5.2.13 > make uninstall make: *** No rule to make target `uninstall'. Stop. I have tried reinstall and purge all php related packages via aptitude with not success. OS: Debian Squeeze. uname -a Linux desktop 2.6.32-trunk-amd64 #1 SMP Sun Jan 10 22:40:40 UTC 2010 x86_64 GNU/Linux Any idea how to fix that?

    Read the article

  • Unusually high memory usage on a CentOS VPS with 512 guaranteed RAM

    - by Andrei Bârsan
    I'm working on a medium-sized web application written in PHP that's running on a VPS with 512mb ram. The webapp hasn't been officially launched yet, so there isn't too much traffic going on, just me and a few other people working on it. There is another slightly smaller webapp also hosted on this machine, among 4-5 other small static sites. We are running Centos 5 32-bit & cPanel/WHM. This is the result of running ps aux and, as you can see, it's not using 100% of the RAM. However, on the hypanel overview, it's always shown as using aroun 500MB ram, just for running apache, mysql, and the lowest-memory-footprint versions of the mail server, ftp server etc. -bash-3.2# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 2156 664 ? Ss 12:08 0:00 init [3] root 1123 0.0 0.0 2260 548 ? S<s 12:08 0:00 /sbin/udevd -d root 1462 0.0 0.0 1812 568 ? Ss 12:08 0:00 syslogd -m 0 named 1496 0.0 0.0 3808 820 ? Ss 12:08 0:00 nsd named 1497 0.0 0.0 10672 756 ? S 12:08 0:00 nsd named 1499 0.0 0.0 3880 584 ? S 12:08 0:00 nsd root 1514 0.0 0.1 7240 1064 ? Ss 12:08 0:00 /usr/sbin/sshd root 1522 0.0 0.0 2832 832 ? Ss 12:08 0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid root 1534 0.0 0.1 3712 1328 ? S 12:08 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql - mysql 1667 0.0 2.9 225680 30884 ? Sl 12:08 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql - mailnull 1766 0.0 0.1 9352 1100 ? Ss 12:08 0:00 /usr/sbin/exim -bd -q60m root 1797 0.0 0.0 2156 708 ? Ss 12:08 0:00 /usr/sbin/dovecot root 1798 0.0 0.0 2632 1012 ? S 12:08 0:00 dovecot-auth root 1816 0.0 3.0 38580 32456 ? Ss 12:08 0:01 /usr/local/bin/spamd -d --allowed-ips=127.0.0.1 --pidfi root 1839 0.0 1.6 63200 17496 ? Ss 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL root 1846 0.0 0.1 5416 1468 ? Ss 12:08 0:00 pure-ftpd (SERVER) root 1848 0.0 0.1 6212 1244 ? S 12:08 0:00 /usr/sbin/pure-authd -s /var/run/ftpd.sock -r /usr/sbin root 1856 0.0 0.1 4492 1112 ? Ss 12:08 0:00 crond root 1864 0.0 0.0 2356 428 ? Ss 12:08 0:00 /usr/sbin/atd dovecot 1927 0.0 0.1 5196 1952 ? S 12:08 0:00 pop3-login dovecot 1928 0.0 0.1 5196 1948 ? S 12:08 0:00 pop3-login dovecot 1929 0.0 0.1 5316 2012 ? S 12:08 0:00 imap-login dovecot 1930 0.0 0.2 5416 2228 ? S 12:08 0:00 imap-login root 1939 0.0 0.1 3936 1964 ? S 12:08 0:00 cPhulkd - processor root 1963 0.0 0.8 15876 8564 ? S 12:08 0:00 cpsrvd (SSL) - waiting for connections root 1966 0.0 0.7 15172 7748 ? S 12:08 0:00 cpdavd - accepting connections on 2077 and 2078 root 1990 0.0 0.2 5008 3136 ? S 12:08 0:00 queueprocd - wait to process a task root 2017 0.0 2.9 38580 31020 ? S 12:08 0:00 spamd child root 2018 0.0 0.5 8904 5636 ? S 12:08 0:00 /usr/bin/perl /usr/local/cpanel/bin/leechprotect nobody 2021 0.0 3.2 66512 33724 ? S 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 2022 0.0 3.1 67812 33024 ? S 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 2024 0.0 1.9 64364 20680 ? S 12:08 0:00 /usr/local/apache/bin/httpd -k start -DSSL root 2027 0.0 0.4 9000 4540 ? S 12:08 0:00 tailwatchd root 2032 0.0 0.1 4176 1836 ? SN 12:08 0:00 cpanellogd - sleeping for logs nobody 3096 0.0 1.9 64572 20264 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 3097 0.0 2.8 66008 30136 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 3098 0.0 2.8 65704 29752 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 3099 0.0 3.1 67260 32816 ? S 12:09 0:00 /usr/local/apache/bin/httpd -k start -DSSL andrei 3448 0.0 0.1 3204 1632 ? S 12:50 0:00 imap nobody 3537 0.0 1.9 64308 20108 ? S 13:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 3614 0.0 1.9 64576 20628 ? S 13:10 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 3615 0.0 1.3 63200 14672 ? S 13:10 0:00 /usr/local/apache/bin/httpd -k start -DSSL root 3626 0.0 0.2 10232 2964 ? Rs 13:14 0:00 sshd: root@pts/0 root 3648 0.0 0.1 3844 1600 pts/0 Ss 13:14 0:00 -bash root 3826 0.0 0.0 2532 908 pts/0 R+ 13:21 0:00 ps aux Lately, without any significant changes to the configuration, the memory usage started peaking and going over 512, causing the virtual server to kill apache, basically murdering our site in the process. Do you have any idea if this is normal and more resources should be acquired? I don't think... since there isn't too much data or traffic online yet.

    Read the article

  • Slow disk transfer rate

    - by Nooklez
    I have problem with slow disk transfer rate. It's static files server for our website. I was making backup of data and noticed that tar is very slow. So I did hdparm -t and... hdparm -t /dev/sda3 /dev/sda3: Timing buffered disk reads: 6 MB in 4.70 seconds = 1.28 MB/sec It's low traffic hour now on our site, so huge I/O traffic is not a reason (iotop show less than 1 MB/s). It's RAID10 setup (2x2 SATA drives). Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy ------------------------------------------------------------------------------ u0 RAID-10 OK - - 64K 1396.96 W ON VPort Status Unit Size Type Phy Encl-Slot Model ------------------------------------------------------------------------------ p0 OK u0 698.63 GB SATA 0 - WDC WD7500AADS-00M2 p1 OK u0 698.63 GB SATA 1 - WDC WD7500AADS-00M2 p2 OK u0 698.63 GB SATA 2 - WDC WD7500AADS-00M2 p3 OK u0 698.63 GB SATA 3 - WDC WD7500AADS-00M2 We have recently changed almost all components of server (excluding 3ware controller + disks). And I think problems started since then. Can it be configuration problem or hardware? EDIT: I found something like that in dmesg [166843.625843] irq 16: nobody cared (try booting with the "irqpoll" option) [166843.625846] Pid: 0, comm: swapper Not tainted 3.1.5-gentoo #3 [166843.625847] Call Trace: [166843.625848] <IRQ> [<ffffffff810859d5>] __report_bad_irq+0x35/0xc1 [166843.625856] [<ffffffff81085cec>] note_interrupt+0x165/0x1e1 [166843.625859] [<ffffffff8108445f>] handle_irq_event_percpu+0x16f/0x187 [166843.625861] [<ffffffff810844a9>] handle_irq_event+0x32/0x51 [166843.625863] [<ffffffff8108640b>] handle_fasteoi_irq+0x75/0x99 [166843.625866] [<ffffffff810039d7>] handle_irq+0x83/0x8b [166843.625868] [<ffffffff810036ad>] do_IRQ+0x48/0xa0 [166843.625871] [<ffffffff8155082b>] common_interrupt+0x6b/0x6b [166843.625872] <EOI> [<ffffffff812981e8>] ? acpi_safe_halt+0x22/0x35 [166843.625877] [<ffffffff812981e2>] ? acpi_safe_halt+0x1c/0x35 [166843.625879] [<ffffffff81298216>] acpi_idle_do_entry+0x1b/0x2b [166843.625881] [<ffffffff81298276>] acpi_idle_enter_c1+0x50/0x99 [166843.625884] [<ffffffff813b792a>] cpuidle_idle_call+0xed/0x171 [166843.625886] [<ffffffff81001257>] cpu_idle+0x55/0x81 [166843.625888] [<ffffffff81532a69>] rest_init+0x6d/0x6f [166843.625891] [<ffffffff81aa1aca>] start_kernel+0x329/0x334 [166843.625893] [<ffffffff81aa12a6>] x86_64_start_reservations+0xb6/0xba [166843.625894] [<ffffffff81aa139c>] x86_64_start_kernel+0xf2/0xf9 [166843.625896] handlers: [166843.625898] [<ffffffff812dc8de>] twl_interrupt [166843.625900] Disabling IRQ #16 It's related to problem? EDIT #2: Based on feedback in comments, here is more informations. cat /proc/interrupts 16: 390813 0 0 0 IO-APIC-fasteoi 3w-sas Controller model: [ 1.095350] 3ware Storage Controller device driver for Linux v1.26.02.003. [ 1.095467] 3ware 9000 Storage Controller device driver for Linux v2.26.02.014. [ 1.095641] LSI 3ware SAS/SATA-RAID Controller device driver for Linux v3.26.02.000. [ 1.095787] 3w-sas 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 1.095881] 3w-sas 0000:01:00.0: setting latency timer to 64 [ 1.910801] 3w-sas: scsi0: Found an LSI 3ware 9750-4i Controller at 0xfe560000, IRQ: 16. [ 2.216537] 3w-sas: scsi0: Firmware FH9X 5.08.00.008, BIOS BE9X 5.07.00.011, Phys: 8. [ 2.216836] scsi 0:0:0:0: Direct-Access LSI 9750-4i DISK 5.08 PQ: 0 ANSI: 5 And motherboard: description: Motherboard product: P8H67-M vendor: ASUSTeK Computer INC.

    Read the article

  • Ubuntu based VPN server behind NAT router?

    - by maartenn88
    I have a small intranet- and file-server inside our company, which can only be reached from inside our own network. I'd like to be able to reach the intranet and files on the server from outside the network, however I don't really like the idea of completely opening security by forwarding the ports on our NAT-router, so I'd prefer to enable a VPN possibility for this. So I have a router, which is the DHCP server and has NAT function, and I have an Ubuntu Server with the files and intranet on it. How do I configure these two so that I can make a VPN connection with my network in order to reach the server? thanks in advance for any answer!

    Read the article

  • Windows 7 to search a network drive

    - by John
    Is there any way that I can have windows 7 clients be able to go to "start" and type in the name of a file that is located on a network drive? I have read that this is possible through indexing, but to get through the indexing steps I need to make files available offline. This network drive I speak of has about 2tb of files on it. How in the heck can I keep all this straight. I imagine there would be syncing errors everywhere if I were to make all of these files available offline. Not to mention not all files being current due to the large amounts of files. Anyone have suggestions?

    Read the article

  • PPP kernel module fails to load

    - by Harel
    I am trying to deal with a problem on a server I don't normally deal with. Out of the blue a script using ppp started failing saying that the ppp kernel module is not loaded. When I try to modprobe it it complains about files missing. Note below that the kernel version the server thinks it at, does not match the kernel version directory in /lib/modules. I'm not sure how this could have happened. Could the other maintainers of the server botched a kernel upgrade? My question is how can I fix this discrepancy. Can I simply rename the lib directory and hope for the best? I don't want to break stuff for the people who actually maintain the server but I do need to fix the PPP issue. $ sudo /sbin/modprobe -v ppp FATAL: Could not load /lib/modules/2.6.35.4-rscloud/modules.dep: No such file or directory $ cat /proc/version Linux version 2.6.35.4-rscloud ([email protected]) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #8 SMP Mon Sep 20 15:54:33 UTC 2010 $ ls /lib/modules/ 2.6.33.5-rscloud

    Read the article

  • Prestashop is not saving Memcached settings

    - by ianenri
    I have a issue with the admin site of prestashop. I'm trying to activate the caching system but it doesn't save the setting. When I add a server (I'm using an Amazon ElasticCache server) saves it, but when I select the enable option and click Save, it redirects me to "Back Office Preferences Performance" but with a blank page and the admin tabs visible. I go back to those settings again and i see that the caching option is disabled. Also, there is a warning: "To use Memcached, you must install the Memcache PECL extension on your server. http://www.php.net/manual/en/memcache.installation.php" , even if i already installed memcached via yum. I tried also, by modifying the settings.inc.php file editing define('_PS_CACHE_ENABLED_', '0'); to: define('_PS_CACHE_ENABLED_', '1'); But i get 500 Internal Server Error in every page, so i prefer to leave it as before. Any ideas? I'm using PrestaShop 1.4.6.2 with Nginx 1.0.11 and PHP-FPM 5.3.8 in a CentOS 5.7 system.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >