Search Results

Search found 5 results on 1 pages for 'fdsa'.

Page 1/1 | 1 

  • How to throttle email server wide on a shared server?

    - by fdsa
    I have multiple programs that send email on a shared server with a relatively low email limit. These programs are completely separate and can each individually throttle mail but cannot do so in relation to the others. Currently, whenever the hourly limit is reached, our host just starts dropping the emails. They say they have no way to change this behavior and basically suggested that I ask around. Does anyone know of any programs that will throttle email server wide on a shared server?

    Read the article

  • readonly keyword

    - by nmarun
    This is something new that I learned about the readonly keyword. Have a look at the following class: 1: public class MyClass 2: { 3: public string Name { get; set; } 4: public int Age { get; set; } 5:  6: private readonly double Delta; 7:  8: public MyClass() 9: { 10: Initializer(); 11: } 12:  13: public MyClass(string name = "", int age = 0) 14: { 15: Name = name; 16: Age = age; 17: Initializer(); 18: } 19:  20: private void Initializer() 21: { 22: Delta = 0.2; 23: } 24: } I have a couple of public properties and a private readonly member. There are two constructors – one that doesn’t take any parameters and the other takes two parameters to initialize the public properties. I’m also calling the Initializer method in both constructors to initialize the readonly member. Now when I build this, the code breaks and the Error window says: “A readonly field cannot be assigned to (except in a constructor or a variable initializer)” Two things after I read this message: It’s such a negative statement. I’d prefer something like: “A readonly field can be assigned to (or initialized) only in a constructor or through a variable initializer” But in my defense, I AM assigning it in a constructor (only indirectly). All I’m doing is creating a method that does it and calling it in a constructor. Turns out, .net was not ‘frameworked’ this way. We need to have the member initialized directly in the constructor. If you have multiple constructors, you can just use the ‘this’ keyword on all except the default constructors to call the default constructor. This default constructor can then initialize your readonly members. This will ensure you’re not repeating the code in multiple places. A snippet of what I’m talking can be seen below: 1: public class Person 2: { 3: public int UniqueNumber { get; set; } 4: public string Name { get; set; } 5: public int Age { get; set; } 6: public DateTime DateOfBirth { get; set; } 7: public string InvoiceNumber { get; set; } 8:  9: private readonly string Alpha; 10: private readonly int Beta; 11: private readonly double Delta; 12: private readonly double Gamma; 13:  14: public Person() 15: { 16: Alpha = "FDSA"; 17: Beta = 2; 18: Delta = 3.0; 19: Gamma = 0.0989; 20: } 21:  22: public Person(int uniqueNumber) : this() 23: { 24: UniqueNumber = uniqueNumber; 25: } 26: } See the syntax in line 22 and you’ll know what I’m talking about. So the default constructor gets called before the one in line 22. These are known as constructor initializers and they allow one constructor to call another. The other ‘myth’ I had about readonly members is that you can set it’s value only once. This was busted as well (I recall Adam and Jamie’s show). Say you’ve initialized the readonly member through a variable initializer. You can over-write this value in any of the constructors any number of times. 1: public class Person 2: { 3: public int UniqueNumber { get; set; } 4: public string Name { get; set; } 5: public int Age { get; set; } 6: public DateTime DateOfBirth { get; set; } 7: public string InvoiceNumber { get; set; } 8:  9: private readonly string Alpha = "asdf"; 10: private readonly int Beta = 15; 11: private readonly double Delta = 0.077; 12: private readonly double Gamma = 1.0; 13:  14: public Person() 15: { 16: Alpha = "FDSA"; 17: Beta = 2; 18: Delta = 3.0; 19: Gamma = 0.0989; 20: } 21:  22: public Person(int uniqueNumber) : this() 23: { 24: UniqueNumber = uniqueNumber; 25: Beta = 3; 26: } 27:  28: public Person(string name, DateTime dob) : this() 29: { 30: Name = name; 31: DateOfBirth = dob; 32:  33: Alpha = ";LKJ"; 34: Gamma = 0.0898; 35: } 36:  37: public Person(int uniqueNumber, string name, int age, DateTime dob, string invoiceNumber) : this() 38: { 39: UniqueNumber = uniqueNumber; 40: Name = name; 41: Age = age; 42: DateOfBirth = dob; 43: InvoiceNumber = invoiceNumber; 44:  45: Alpha = "QWER"; 46: Beta = 5; 47: Delta = 1.0; 48: Gamma = 0.0; 49: } 50: } In the above example, every constructor over-writes the values for the readonly members. This is perfectly valid. There is a possibility that based on the way the object is instantiated, the readonly member will have a different value. Well, that’s all I have for today and read this as it’s on a related topic.

    Read the article

  • What is the best practice for ouputting data from a collection on an ASP.net Page?

    - by bshacklett
    I've ported a page from classic ASP to ASP.net. Part of what happens in this page is that a collection of custom types is generated and then displayed via Response.Write() commands. I'd like to get the business logic separated out into a code behind file (and maybe move this all into a user control), but I can't seem to figure out how I'd actually display the collection once it's been generated. I want to specify a master page here, too, so the code can't stay inline. Here's a very stripped down version of the current code: <% Dim objs as ArrayList = New ArrayList() For i = 0 To 2 Dim obj as Obj = New Obj() obj.setProp1("ASDF") obj.setProp2("FDSA") objs.Add(obj) Next i %> <table> <thead> <tr> <th scope="col">Property 1</th> <th scope="col">Property 2</th> </tr> </thead> <tbody> <% For Each obj As Obj In objs Dim objProp1 As String = obj.getProp1 Dim objProp2 As String = obj.getProp2 %> <tr> <td><% Response.Write(objProp1)%></td> <td><% Response.Write(objProp2)%></td> </tr> <% Next %> </tbody> </table> What is the ".net" way of doing this?

    Read the article

  • Simple Remote Shared Object with Red5 Flash Server

    - by John Russell
    Hello, I am trying to create a simple chat client using the red5 media server, but I seem to be having a slight hiccup. I am creating a shared object on the server side, and it seems to be creating it successfully. However, when I make changes to the object via the client (type a message), the SYNC event fires, but the content within the shared object remains empty. I suspect I am doing something wrong on the java end, any advice? Console Results: Success! Server Message: clear Server Message: [object Object] Local message: asdf Server Message: change Server Message: [object Object] Local message: fdsa Server Message: change Server Message: [object Object] Local message: fewa Server Message: change Server Message: [object Object] Server Side: package org.red5.core; import java.util.List; import org.red5.server.adapter.ApplicationAdapter; import org.red5.server.api.IConnection; import org.red5.server.api.IScope; import org.red5.server.api.service.ServiceUtils; import org.red5.server.api.so.ISharedObject; // import org.apache.commons.logging.Log; // import org.apache.commons.logging.LogFactory; public class Application extends ApplicationAdapter { private IScope appScope; // private static final Log log = LogFactory.getLog( Application.class ); /** {@inheritDoc} */ @Override public boolean connect(IConnection conn, IScope scope, Object[] params) { appScope = scope; createSharedObject(appScope, "generalChat", false); // Creates general chat shared object return true; } /** {@inheritDoc} */ @Override public void disconnect(IConnection conn, IScope scope) { super.disconnect(conn, scope); } public void updateChat(Object[] params) { ISharedObject so = getSharedObject(appScope, "generalChat"); // Declares and stores general chat data in general chat shared object so.setAttribute("point", params[0].toString()); } } Client Side: package { import flash.display.MovieClip; import flash.events.*; import flash.net.*; // This class is going to handle all data to and from from media server public class SOConnect extends MovieClip { // Variables var nc:NetConnection = null; var so:SharedObject; public function SOConnect():void { } public function connect():void { // Create a NetConnection and connect to red5 nc = new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); nc.connect("rtmp://localhost/testChat"); // Create a StoredObject for general chat so = SharedObject.getRemote("generalChat", nc.uri, false); so.connect(nc); so.addEventListener(SyncEvent.SYNC, receiveChat) } public function sendChat(msg:String) { trace ("Local message: " + msg); nc.call("updateChat", null, msg) } public function receiveChat(e:SyncEvent):void { for (var i in e.changeList) { trace ("Server Message: " + e.changeList[i].code) trace ("Server Message: " + e.changeList[i]) } } // Given result, determine successful connection private function netStatusHandler(e:NetStatusEvent):void { if (e.info.code == "NetConnection.Connect.Success") { trace("Success!"); } else { trace("Failure!\n"); trace(e.info.code); } } } }

    Read the article

  • How to extract innermost table from html file with the help of the html agility pack ?

    - by Harikrishna
    I am parsing the tabular information from the html file with the help of the html agility pack. Now I can do it and it works. But when the table what I want to extract is inner most. Or I don't know at which position it is in nested tables.And there can be any number of nested tables and from that I want to extract the information of the table which has column name name,address. Ex. <table> <tr><td>PHONE NO.</td><td>OTHER INFO.</td></tr> <tr><td> <table> <tr><td>AMOUNT</td></tr> <tr><td>50000</td></tr> <tr><td>80000</td></tr> </table> </td></tr> <tr><td> <table> <tr><td> <table> <tr><td> <table> <tr><td> NAME </td><td>ADDRESS</td> <tr><td> ABC </td><td> kfks </td> <tr><td> BCD </td><td> fdsa </td> </table> </tr></td> </table> </td></tr> </table> </td></tr> </table> There are many tables but I want to extract the table which has column name name,address. So what should I do ?

    Read the article

1