Daily Archives

Articles indexed Monday June 14 2010

Page 19/108 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Linq 2 SQL using base class and WCF

    - by Gena Verdel
    Hi all. I have the following problem: I'm using L2S for generating entity classes. All these classes share the same property ID which is autonumber. So I figured to put this property to base class and extend all entity classes from the base one. In order to be able to read the value I'm using the override modifier on this property in each and every entity class. Up to now it's live and kicking. Then I decided to introduce another tier - services using WCF approach. I've modified the Serialization mode to Unidirectional (and added the IsReference=true attribute to enable two directions), also added [DataContract] attribute to the BaseObject class. WCF is able to transport the whole object but one property , which is ID. Applying [DataMember] attribute on ID property at the base class resulted in nothing. Am I missing something? Is what I'm trying to achieve possible at all? [DataContract()] abstract public class BaseObject : IIccObject public virtual long ID { get; set; } [Table(Name="dbo.Blocks")] [DataContract(IsReference=true)] public partial class Block : INotifyPropertyChanging, INotifyPropertyChanged { private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); private long _ID; private int _StatusID; private string _Name; private bool _IsWithControlPoints; private long _DivisionID; private string _SHAPE; private EntitySet<BlockByWorkstation> _BlockByWorkstations; private EntitySet<PlanningPointAppropriation> _PlanningPointAppropriations; private EntitySet<Neighbor> _Neighbors; private EntitySet<Neighbor> _Neighbors1; private EntitySet<Task> _Tasks; private EntitySet<PlanningPointByBlock> _PlanningPointByBlocks; private EntityRef<Division> _Division; private bool serializing; #region Extensibility Method Definitions partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); partial void OnCreated(); partial void OnIDChanging(long value); partial void OnIDChanged(); partial void OnStatusIDChanging(int value); partial void OnStatusIDChanged(); partial void OnNameChanging(string value); partial void OnNameChanged(); partial void OnIsWithControlPointsChanging(bool value); partial void OnIsWithControlPointsChanged(); partial void OnDivisionIDChanging(long value); partial void OnDivisionIDChanged(); partial void OnSHAPEChanging(string value); partial void OnSHAPEChanged(); #endregion public Block() { this.Initialize(); } [Column(Storage="_ID", AutoSync=AutoSync.OnInsert, DbType="BigInt NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] [DataMember(Order=1)] public override long ID { get { return this._ID; } set { if ((this._ID != value)) { this.OnIDChanging(value); this.SendPropertyChanging(); this._ID = value; this.SendPropertyChanged("ID"); this.OnIDChanged(); } } } [Column(Storage="_StatusID", DbType="Int NOT NULL")] [DataMember(Order=2)] public int StatusID { get { return this._StatusID; } set { if ((this._StatusID != value)) { this.OnStatusIDChanging(value); this.SendPropertyChanging(); this._StatusID = value; this.SendPropertyChanged("StatusID"); this.OnStatusIDChanged(); } } } [Column(Storage="_Name", DbType="NVarChar(255)")] [DataMember(Order=3)] public string Name { get { return this._Name; } set { if ((this._Name != value)) { this.OnNameChanging(value); this.SendPropertyChanging(); this._Name = value; this.SendPropertyChanged("Name"); this.OnNameChanged(); } } } [Column(Storage="_IsWithControlPoints", DbType="Bit NOT NULL")] [DataMember(Order=4)] public bool IsWithControlPoints { get { return this._IsWithControlPoints; } set { if ((this._IsWithControlPoints != value)) { this.OnIsWithControlPointsChanging(value); this.SendPropertyChanging(); this._IsWithControlPoints = value; this.SendPropertyChanged("IsWithControlPoints"); this.OnIsWithControlPointsChanged(); } } } [Column(Storage="_DivisionID", DbType="BigInt NOT NULL")] [DataMember(Order=5)] public long DivisionID { get { return this._DivisionID; } set { if ((this._DivisionID != value)) { if (this._Division.HasLoadedOrAssignedValue) { throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); } this.OnDivisionIDChanging(value); this.SendPropertyChanging(); this._DivisionID = value; this.SendPropertyChanged("DivisionID"); this.OnDivisionIDChanged(); } } } [Column(Storage="_SHAPE", DbType="Text", UpdateCheck=UpdateCheck.Never)] [DataMember(Order=6)] public string SHAPE { get { return this._SHAPE; } set { if ((this._SHAPE != value)) { this.OnSHAPEChanging(value); this.SendPropertyChanging(); this._SHAPE = value; this.SendPropertyChanged("SHAPE"); this.OnSHAPEChanged(); } } } [Association(Name="Block_BlockByWorkstation", Storage="_BlockByWorkstations", ThisKey="ID", OtherKey="BlockID")] [DataMember(Order=7, EmitDefaultValue=false)] public EntitySet<BlockByWorkstation> BlockByWorkstations { get { if ((this.serializing && (this._BlockByWorkstations.HasLoadedOrAssignedValues == false))) { return null; } return this._BlockByWorkstations; } set { this._BlockByWorkstations.Assign(value); } } [Association(Name="Block_PlanningPointAppropriation", Storage="_PlanningPointAppropriations", ThisKey="ID", OtherKey="MasterBlockID")] [DataMember(Order=8, EmitDefaultValue=false)] public EntitySet<PlanningPointAppropriation> PlanningPointAppropriations { get { if ((this.serializing && (this._PlanningPointAppropriations.HasLoadedOrAssignedValues == false))) { return null; } return this._PlanningPointAppropriations; } set { this._PlanningPointAppropriations.Assign(value); } } [Association(Name="Block_Neighbor", Storage="_Neighbors", ThisKey="ID", OtherKey="FirstBlockID")] [DataMember(Order=9, EmitDefaultValue=false)] public EntitySet<Neighbor> Neighbors { get { if ((this.serializing && (this._Neighbors.HasLoadedOrAssignedValues == false))) { return null; } return this._Neighbors; } set { this._Neighbors.Assign(value); } } [Association(Name="Block_Neighbor1", Storage="_Neighbors1", ThisKey="ID", OtherKey="SecondBlockID")] [DataMember(Order=10, EmitDefaultValue=false)] public EntitySet<Neighbor> Neighbors1 { get { if ((this.serializing && (this._Neighbors1.HasLoadedOrAssignedValues == false))) { return null; } return this._Neighbors1; } set { this._Neighbors1.Assign(value); } } [Association(Name="Block_Task", Storage="_Tasks", ThisKey="ID", OtherKey="BlockID")] [DataMember(Order=11, EmitDefaultValue=false)] public EntitySet<Task> Tasks { get { if ((this.serializing && (this._Tasks.HasLoadedOrAssignedValues == false))) { return null; } return this._Tasks; } set { this._Tasks.Assign(value); } } [Association(Name="Block_PlanningPointByBlock", Storage="_PlanningPointByBlocks", ThisKey="ID", OtherKey="BlockID")] [DataMember(Order=12, EmitDefaultValue=false)] public EntitySet<PlanningPointByBlock> PlanningPointByBlocks { get { if ((this.serializing && (this._PlanningPointByBlocks.HasLoadedOrAssignedValues == false))) { return null; } return this._PlanningPointByBlocks; } set { this._PlanningPointByBlocks.Assign(value); } } [Association(Name="Division_Block", Storage="_Division", ThisKey="DivisionID", OtherKey="ID", IsForeignKey=true, DeleteOnNull=true, DeleteRule="CASCADE")] public Division Division { get { return this._Division.Entity; } set { Division previousValue = this._Division.Entity; if (((previousValue != value) || (this._Division.HasLoadedOrAssignedValue == false))) { this.SendPropertyChanging(); if ((previousValue != null)) { this._Division.Entity = null; previousValue.Blocks.Remove(this); } this._Division.Entity = value; if ((value != null)) { value.Blocks.Add(this); this._DivisionID = value.ID; } else { this._DivisionID = default(long); } this.SendPropertyChanged("Division"); } } } public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; protected virtual void SendPropertyChanging() { if ((this.PropertyChanging != null)) { this.PropertyChanging(this, emptyChangingEventArgs); } } protected virtual void SendPropertyChanged(String propertyName) { if ((this.PropertyChanged != null)) { this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } private void attach_BlockByWorkstations(BlockByWorkstation entity) { this.SendPropertyChanging(); entity.Block = this; } private void detach_BlockByWorkstations(BlockByWorkstation entity) { this.SendPropertyChanging(); entity.Block = null; } private void attach_PlanningPointAppropriations(PlanningPointAppropriation entity) { this.SendPropertyChanging(); entity.Block = this; } private void detach_PlanningPointAppropriations(PlanningPointAppropriation entity) { this.SendPropertyChanging(); entity.Block = null; } private void attach_Neighbors(Neighbor entity) { this.SendPropertyChanging(); entity.FirstBlock = this; } private void detach_Neighbors(Neighbor entity) { this.SendPropertyChanging(); entity.FirstBlock = null; } private void attach_Neighbors1(Neighbor entity) { this.SendPropertyChanging(); entity.SecondBlock = this; } private void detach_Neighbors1(Neighbor entity) { this.SendPropertyChanging(); entity.SecondBlock = null; } private void attach_Tasks(Task entity) { this.SendPropertyChanging(); entity.Block = this; } private void detach_Tasks(Task entity) { this.SendPropertyChanging(); entity.Block = null; } private void attach_PlanningPointByBlocks(PlanningPointByBlock entity) { this.SendPropertyChanging(); entity.Block = this; } private void detach_PlanningPointByBlocks(PlanningPointByBlock entity) { this.SendPropertyChanging(); entity.Block = null; } private void Initialize() { this._BlockByWorkstations = new EntitySet<BlockByWorkstation>(new Action<BlockByWorkstation>(this.attach_BlockByWorkstations), new Action<BlockByWorkstation>(this.detach_BlockByWorkstations)); this._PlanningPointAppropriations = new EntitySet<PlanningPointAppropriation>(new Action<PlanningPointAppropriation>(this.attach_PlanningPointAppropriations), new Action<PlanningPointAppropriation>(this.detach_PlanningPointAppropriations)); this._Neighbors = new EntitySet<Neighbor>(new Action<Neighbor>(this.attach_Neighbors), new Action<Neighbor>(this.detach_Neighbors)); this._Neighbors1 = new EntitySet<Neighbor>(new Action<Neighbor>(this.attach_Neighbors1), new Action<Neighbor>(this.detach_Neighbors1)); this._Tasks = new EntitySet<Task>(new Action<Task>(this.attach_Tasks), new Action<Task>(this.detach_Tasks)); this._PlanningPointByBlocks = new EntitySet<PlanningPointByBlock>(new Action<PlanningPointByBlock>(this.attach_PlanningPointByBlocks), new Action<PlanningPointByBlock>(this.detach_PlanningPointByBlocks)); this._Division = default(EntityRef<Division>); OnCreated(); } [OnDeserializing()] [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)] public void OnDeserializing(StreamingContext context) { this.Initialize(); } [OnSerializing()] [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)] public void OnSerializing(StreamingContext context) { this.serializing = true; } [OnSerialized()] [System.ComponentModel.EditorBrowsableAttribute(EditorBrowsableState.Never)] public void OnSerialized(StreamingContext context) { this.serializing = false; } }

    Read the article

  • Why is scp not overwriting my destination file?

    - by Noli
    I'm trying to back up a file via the command scp /tmp/backup.tar.gz hostname:/home/user/backup.tar.gz When I run it, the scp progress bar shows up and it looks like its transferring the file, however when I log into the destination server to check the file, the timestamp and filesize haven't changed from the older version, so it looks like scp didn't overwrite the old file at all. It only sees to work when I manually delete the file from the destination server. I'm running ubuntu, and this is happening on two servers: one cygwin ssh, and one fedora core 3. Anyone have any idea why this is happening? I thought scp would ONLY overwrite existing files.. Thanks

    Read the article

  • Minimize Windows Live Mail to the System Tray in Windows 7

    - by Asian Angel
    Are you frustrated that you can not minimize Windows Live Mail to the system tray in Windows 7? With just a few tweaks you can make Live Mail minimize to the system tray just like in earlier versions of Windows. Windows Live Mail in Windows Vista In Windows Vista you could minimize Windows Live Mail to the system tray if desired using the context menu… Windows Live Mail in Windows 7 In Windows 7 you can minimize the app window but not hide it in the system tray. The Hide window when minimized menu entry is missing from the context menu and all you have is the window icon taking up space in your taskbar. How to Add the Context Menu Entry Back Right click on the program shortcut(s) and select properties. When the properties window opens click on the compatibility tab and enable the Run this program in compatibility mode for setting. Choose Windows Vista (Service Pack 2) from the drop-down menu and click OK. Once you have restarted Windows Live Mail you will have access to the Hide window when minimized menu entry again. And just like that your taskbar is clear again when Windows Live Mail is minimized. If you have wanted the ability to minimize Windows Live Mail to the system tray in Windows 7 then this little tweak will fix the problem. Similar Articles Productive Geek Tips Make Windows Live Messenger Minimize to the System Tray in Windows 7Move Live Messenger Icon to the System Tray in Windows 7Backup Windows Mail Messages and Contacts in VistaTurn off New Mail Notification for PocoMail Junk Mail FolderPut Your PuTTY in the System Tray TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips HippoRemote Pro 2.2 Xobni Plus for Outlook All My Movies 5.9 CloudBerry Online Backup 1.5 for Windows Home Server Know if Someone Accessed Your Facebook Account Shop for Music with Windows Media Player 12 Access Free Documentaries at BBC Documentaries Rent Cameras In Bulk At CameraRenter Download Songs From MySpace Steve Jobs’ iPhone 4 Keynote Video

    Read the article

  • Les premières informations détaillées à propos d'Office 15 apparaissent, Microsoft prépare déjà le s

    Les premières informations détaillées à propos d'Office 15 apparaissent, Microsoft prépare déjà le successeur d'Office 2010 Même si les informations à ce sujet se font rare, on sait que Microsoft travaille déjà activement au développement d'Office 15 (le successeur d'Office 2010, dont le nom de code était Office 14). Le Net relaie néanmoins quelques rumeurs sur la nouvelle mouture de la site bureautique, qui se voudrait améliorée en collaboration, mobilité et connectivité avec Outlook. Plusieurs offres d'emploi publiées par Microsoft laissent filtrer quelques informations. Par exemple, à la recherche d'un test engineer, la firme explique "Outlook est incroyablement complexe. Il se connecte à différents serveurs ...

    Read the article

  • customize uipopovercontroller in ipad

    - by Jaimin
    i want to change the image of popover. it is having blue tint at the top so i want it to be of different color. how can i do it... - (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated can i do it with this method.. make my own view and place a image in that view. i read in some posts that it is not possible to change color and also i didnt fine any instance method of UIPopOverController class to do this.. thanks in advance.

    Read the article

  • php: regex remove bracket in string

    - by apis17
    hi, similiar like this example, http://stackoverflow.com/questions/1336672/php-remove-brackets-contents-from-a-string i have no idea to replace $str = '(ABC)some text' into $str = 'ABC'; currently use $str = preg_replace('/(.)/','',$str); but not works. how to fix this?

    Read the article

  • Closure Library with ASP.NET

    - by jarrett
    Google's Closure Library looks like it has a lot of great features, but I'm not seeing any examples of it used with ASP.NET sites. I'm just wondering if anyone has any experience using the two together and what parts. Is is a good or bad experience?

    Read the article

  • How to return a value when destroying/cleaning-up an object instance

    - by Mridang Agarwalla
    When I initiate a class in Python, I give it some values. I then call method in the class which does something. Here's a snippet: class TestClass(): def __init__(self): self.counter = 0 def doSomething(self): self.counter = self.counter + 1 print 'Hiya' if __name__ == "__main__": obj = TestClass() obj.doSomething() obj.doSomething() obj.doSomething() print obj.counter As you can see, everytime I call the doSomething method, it prints some text and increments an internal variable i.e. counter. When I initiate the class, i set the counter variable to 0. When I destroy the object, I'd like to return the internal counter variable. What would be a good way of doing this? I wanted to know if there were other ways apart from doing stuff like: accessing the variable directly. Like obj.counter. creating a method like getCounter. Thanks.

    Read the article

  • Is File good for Interprocess communication

    - by Karthik
    Hi, I have an EXE and DLL running in different process. From DLL I have to send large of amount of data to EXE, which would vary from 50 chars to 2000 chars and more(The data is recordid of records saved in DB). I thought about two options to do that: 1. Using SendMessage- In which data's will be sent in batch. 2. Use an Intermediate file to transfer data. Can anyone list out the pros and cons of methods. I have developed my components using C#.NET Thanks you folks.

    Read the article

  • Silverlight Not Rendering On Navigation

    - by Azmath
    I'm trying to create a site that requires login. Its entirely designed in silverlight. So my first page, home.xaml loads in mysite.aspx and it basically has a login page. AFter login, the user is redirected to another page user.aspx. in that page, i've embedded another silverlight control called nav.xaml. so now when user.aspx loads it is supposed to load a silverlight control. i've programmed app.xaml.vb such that it loads nav.xaml in the rootlayout when the page requesting is user.aspx. but for some reason its not working. my app.xaml.vb code: Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup If e.InitParams.ContainsKey("ReqPage") Then If e.InitParams("ReqPage") = "userpage" Then Me.RootVisual = New Nav() End If Else Me.RootVisual = New Home() End If End Sub in IE, half of the nav.xaml is rendered. but in firefox nothing is rendered. so wats going on exactly? pls help!

    Read the article

  • choose javascript variable based on element id from jquery

    - by phoffer
    I feel like this is a simple question, but I am still relatively new to javascript and jquery. I am developing a site for a touch interface that uses unordered lists and jquery .click functions to take input data. I have a section to input a m:ss time, with 3 divs, each containing a list of digits for time. I need to get the input for each column and set it as a variable. I originally designed the inputs to change form inputs, because I didn't understand javascript very much. It was easy to change the 3 hidden inputs by using div id's, but I can't figure out how to do it now with javascript variables. Here is my original jquery code... $("div#time>div>ul>li").click(function() { var id = $(this).parents(".time").attr("name"); var number = $(this).html(); $("input#"+id).val(number); }); The last line sets one of 3 hidden inputs equal to whatever was clicked. I need to make it so separate variables take the inputs, then I can manipulate those variables however I want. Here's a short snippet of the html, to have an idea of how jquery grabs it. <div id="time"> <h1>Time</h1> <div name="minute" class="time" id="t_minute"> M : <ul> The full time html is here: link text Thanks everyone! I've been using SO to answer many questions I've had, but I couldn't find something for this, so I figured I would join, since I'm sure I will have more questions along the way.

    Read the article

  • OutofMemoryError: bitmap size exceeds VM budget (Android)

    - by Chrispix
    Getting an Exception in the BitmapFactory. Not sure what is the issue. (Well I can guess the issue, but not sure why its happening) ERROR/AndroidRuntime(7906): java.lang.OutOfMemoryError: bitmap size exceeds VM budget ERROR/AndroidRuntime(7906): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:295) My code is pretty straight forward. I defined an XML layout w/ a default image. I try to load a bm on the SDCard (if present - it is). If not it shows the default image. Anyway.. Here is code : public class showpicture extends Activity { public void onCreate(Bundle savedInstanceState) { /** Remove menu/status bar **/ requestWindowFeature(Window.FEATURE_NO_TITLE); final Window win = getWindow(); win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); Bitmap bm; super.onCreate(savedInstanceState); setContentView(R.layout.showpicture); try { ImageView mImageButton = (ImageView)findViewById(R.id.displayPicture); bm = Bitmap.createScaledBitmap(BitmapFactory.decodeFile("/sdcard/dcim/Camera/20091018203339743.jpg"),100, 100, true); parkImageButton.setImageBitmap(bm); } catch (IllegalArgumentException ex) { Log.d("MYAPP",ex.getMessage()); } catch (IllegalStateException ex) { It fails on the bm=Bitmap.createScaledBitmap any thoughts? I did some research on the forums, and it pointed to this post I just don't know why it is not working. Any help would be great! Thanks, Chris.

    Read the article

  • java api design - NULL or Exception

    - by srini.venigalla
    Is it better to return a null value or throw an exception from an API method? Returning a null requires ugly null checks all over, and cause a major quality problem if the return is not checked. Throwing an exception forces the user to code for the faulty condition, but since Java exceptions bubble up and force the caller code to handle them, in general, using custom exceptions may be a bad idea (specifically in java). Any sound and practical advice?

    Read the article

  • Recursive Function To Create Array

    - by mTuran
    Hi, i use kohana framework and i am trying to code recursive function to create category tree. My Categories Table id int(11) NO PRI NULL auto_increment name varchar(50) NO NULL parent_id int(11) NO NULL projects_count int(11) NO NULL My Example Which Is Not Work public static function category_list($parent_id = 0) { $result = Database::instance()->query(' SELECT name, projects_count FROM project_categories WHERE parent_id = ?', array($parent_id) ); $project_categories = array(); foreach($result as $row) { $project_categories[] = $row; Project_Categories_Model::factory()->category_list($parent_id + 1); } return $project_categories; }

    Read the article

  • Microsoft espère que Dallas deviendra "l'iTunes des données", la firme croit en son service de court

    Mise à jour du 14.06.2010 par Katleen Microsoft espère que Dallas deviendra "l'iTunes des données", la firme croit en son service de courtage d'informations Microsoft a fait quelques révélations à propos de son projet Dallas, un service de courtage en données : "Dallas est un courtier de la découverte d'informations", a déclaré le responsable du programme Adam Wilson. Les données sont disponibles via des APIs La firme voit grand et espère que Dallas deviendra "L'iTunes des données". Une préversion Community Technology est déjà disponible, elle tourne sur la plateforme Cloud de Microsoft : Azure. En revanche, aucune date de sortie commerciale...

    Read the article

  • problem with the table width in IE?

    - by Harish Kurup
    I am using table to display a set of data, my HTML code goes here... <table border="1" cellspacing="0" cellpadding="0" style="width: 780px;"> <tbody> <tr> <td style="width: 780px; height: 25px;"> <pre width='100' style='width: 780px; word-wrap: break-word;'> the data goes here..... </pre> </td> </tr> <tr> <td style="width: 780px; height: 25px;"> <pre width='100' style='width: 780px; word-wrap: break-word;'> the data goes here..... </pre> </td> </tr> </tbody> </table> this table works ok in firefox, safari, and IE8. But the problem arise in IE7, IE6.. asthe table expands and goes out of the screen(i.e expands towards right hand side in x-axis).... is there any hack to fix it?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >