Daily Archives

Articles indexed Tuesday March 9 2010

Page 14/49 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • C# : WHAT KIND OF CONNECTION SHOULD I USE ? [closed]

    - by Harun
    I am developing a network based application. I need to retrieve data through internet. The scenario is like this - a client machine will send data through internet to the server machine and data size will be big enough. So should i use simple TCP/IP socket concept or else? Because i never did a socket program which will retrieve data through internet..... Any suggestion will be very helpful....... Thanks.

    Read the article

  • Help to understand the issue with protected method

    - by zeroed
    I'm reading Sybex Complete Java 2 Certification Study Guide April 2005 (ISBN0782144195). This book is for java developers who wants to pass java certification. After a chapter about access modifiers (along with other modifiers) I found the following question (#17): True or false: If class Y extends class X, the two classes are in different packages, and class X has a protected method called abby(), then any instance of Y may call the abby() method of any other instance of Y. This question confused me a little. As far as I know you can call protected method on any variable of the same class (or subclasses). You cannot call it on variables, that higher in the hierarchy than you (e.g. interfaces that you implement). For example, you cannot clone any object just because you inherit it. But the questions says nothing about variable type, only about instance type. I was confused a little and answered "true". The answer in the book is False. An object that inherits a protected method from a superclass in a different package may call that method on itself but not on other instances of the same class. There is nothing here about variable type, only about instance type. This is very strange, I do not understand it. Can anybody explain what is going on here?

    Read the article

  • School Project for final year

    - by pundit
    Hi people, I'm in final year of my degree and it is required that i do a final year project. I have decided to do something on adaptive websites that implements customisation, personalisation and basically adaptation via heat maps and weblogs. So for a prototype i would be designing a website for tertairy level students and see if these technologies improve the usbability of the site. i would model it after my school's website. So here's the question, What would be a better language to use.. i have some knowledge in struts 2 framework and some knowledge in php. could say a newbie at both.. so i was wondering what would be the easier and faster way to go. php or the struts2 framework? thanks.

    Read the article

  • What kinds of problems are most likely to occur? (question rewritten)

    - by ChrisC
    If I wrote 1) a C# SQL db app (a simple program consisting of a gui over some forms with logic for interfacing with the sql db) 2) for home use, that doesn't do any network communication 3) that uses a simple, reliable, and appropriate sql db 4) whose gui is properly separated from the logic 5) that has complete and dependable input data validation 6) that has been completely tested so that 100% of logic bugs were eliminated ... and then if the program was installed and run by random users on their random Windows computers Q1) What types of technical (non-procedural) problems and support situations are most likely to occur, and how likely are they? Q2) Are there more/other things I could do in the first place to prevent those problems and also minimize the amount of user support required? I know some answers will apply to my specific platforms (C#, SQL, Windows, etc) and some won't. Please be as specific as is possible. Mitch Wheat gave me some very valuable advice below, but I'm now offering the bounty because I am hoping to get a better picture of the kinds of things that I'm most reasonably likely to encounter. Thanks.

    Read the article

  • How to edit datagridview using SqlCeDataAdapter?

    - by DanSogaard
    I've a frmEdit with datagridview that's bouned to this: string sqlqry1 = "select p_Name from Items where p_Id=" + p_Id; using (SqlCeDataAdapter a = new SqlCeDataAdapter(sqlqry1, conn)) { DataTable dt1 = new DataTable(); a.Fill(dt1); dataGridView1.DataSource = dt1; } How to edit cells and save them back to the db?, tried using this: using (SqlCeDataAdapter a = new SqlCeDataAdapter(sqlqry1, conn)) { DataTable dt1 = new DataTable(); a.Fill(dt1); dataGridView1.DataSource = dt1; a.Update(dt1); } Nothing. Is there anyway?.

    Read the article

  • removing contents of div using Jquery "empty" doesn't work

    - by Andrew
    I'm trying to remove contents of particular div which are basically list items and a heading by using jquery empty so that I could replace with new contents. What happens when I run the code is, the whole div element blinked and flash the replaced content and then the old one reappear. Can anyone tell me what am I doing wrong? Here's an excerpt of my code - <pre> $("#msg_tab").bind("click",function(){ $("#sidebar1").remove(); var html="<ul><li><h2>test</h2><ul><li><a href='#'>Compose New Message</a></li><li><a href='#'>Inbox</a></li><li><a href='#'>Outbox</a></li><li><a href='#'>Unread</a></li><li><a href='#'>Archive</a></li></ul></li></ul>"; $("#sidebar1").append(html); }); <div id="sidebar1" class="sidebar"> <ul> <li> <h2>Messages</h2> <ul> <li><a href="#">Compose New Message</a></li> <li><a href="#">Inbox</a></li> <li><a href="#">Outbox</a></li> <li><a href="#">Unread</a></li> <li><a href="#">Archive</a></li> </ul> </li> </ul> </div> Another question is, how do I write multiple line html code string in javascript so that java would recognize as a string value? Placing forward slash at the end is ok when the string is not a html code but, in html code, I can't figure out how to escape forward slash from ending tags.I've tried escaping it with backward slash but doesn't work. I would be appreciated if anyone could shed a light on this matter as well.

    Read the article

  • Override System Preference Pane?

    - by DisappointedIdealist
    Is there a way to override / disable a system preference pane? I'm wanting to put an application together that would disable or override the Energy Saver preference pane, and would put it's own rules in place for putting a machine into standby, turning off the monitor, or other various energy saving activities.

    Read the article

  • Implementing a Patricia Trie for use as a dictionary

    - by Regis Frey
    I'm attempting to implement a Patricia Trie with the methods addWord(), isWord(), and isPrefix() as a means to store a large dictionary of words for quick retrieval (including prefix search). I've read up on the concepts but they just aren't clarifying into an implementation. I want to know (in Java or Python code) how to implement the Trie, particularly the nodes (or should I implement it recursively). I saw one person who implemented it with an array of 26 child nodes set to null/None. Is there a better strategy (such as treating the letters as bits) and how would you implement it?

    Read the article

  • FormCollection in VB.NET

    - by fireBand
    Hi, I want to detect if a window form is open and if it is then I would like to bring it in front rather than opening it again. I know I need a form collection for this but I want to know if there is a built in form collection that holds all the forms in VB.NET or I need to implement my own. Thank you.

    Read the article

  • sequential search homework question

    - by Phenom
    Consider a disk file containing 100 records a. How many comparisons would be required on the average to find a record using sequential search, if the record is known to be in the file? I figured out that this is 100/2 = 50. b. If the record has a 68% probability of being in the file, how many comparisons are required on average? This is the part I'm having trouble with. At first I thought it was 68% * 50, but then realized that was wrong after thinking about it. Then I thought it was (100% - 68%) * 50, but I still feel that that is wrong. Any hints?

    Read the article

  • How do I properly display all content in a JTabbedPane?

    - by maleki
    I am nesting a JPanel inside a JTabbedPane. I am having trouble displaying all the content inside of the JTabbedPane. The outside borders of the internal content get chopped off. I am currently not using a Layout Manager for my JTabbedPane or dummy Panel because it stretches my content automatically. How do I add a JPanel inside the JTabbedPane so that I can have an even border around all the content.My attempts to create a dummy panel and setting a border for the inner panel using BorderFactory haven't worked. Is there a convention that I need to know to do this correctly? JTabbedPane tabPane = new JTabbedPane(); GridPane tab1 = new GridPane(); GridPane tab2 = new GridPane(); tabPane.add("My Pieces",tab1); tabPane.add("Opponent Pieces",tab2); public class GridPane extends JPanel { public GridPane() { this.setPreferredSize(new Dimension(400,160)); this.setLayout(new GridLayout(4,10)); this.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); for (int i = 0; i < 4; i++) { for (int j = 0; j < 10; j++) { boardSquares[i][j] = new JPanel(); boardSquaresArr.add(boardSquares[i][j]); this.add(boardSquares[i][j]); } } } }

    Read the article

  • Swing data binding frameworks

    - by Ahe
    Hi Almost the same question has been asked a year ago, but the there has been some new development in this area. Selecting a (data binding) framework for swing application seems to be quite difficult. JSR-295 is abandoned, many swing frameworks which provide binding are work-in-progress, abandoned or too heavy for my quite simple app. JGoodies Swing suite is expensive, but luckily its libraries are free. Has anyone any real-world experience of new UFaceKit. It looks promising, but quite immature. I am particularly interested in Swing implementation and documentation. Any insight on UFaceKits development schedule would be appreciated, because I can hold by framework choice for a while. Requirements are not anything fancy, just working binding with a nice API. I also found Mogwai dataBinding, but it seems quite incomplete and requires manual synchronization activation, which makes it useless compared to coarse grained synchronization easily written by hand. Incomplete frameworks include at least Spring RCP and many JSR-296 forks. So, is the JGoodies data binding really the only realistic choice? Or are there any other viable solutions available?

    Read the article

  • JQuery input elements

    - by codeasp
    I need to get all input elements within a div and then attach event handlers, so that whenever values change it updates a hidden field. Children elements within the div might already contain event handlers, if so the attach should chain it. Any help is much appreciated.

    Read the article

  • How to create a language these days?

    - by Mike
    I need to get around to writing that programming language I've been meaning to write. How do you kids do it these days? I've been out of the loop for over a decade; are you doing it any differently now than we did back in the pre-internet, pre-windows days? You know, back when "real" coders coded in C, used the command line, and quibbled over which shell was superior? Just to clarify, I mean, not how do you DESIGN a language (that I can figure out fairly easily) but how do you build the compiler and standard libraries and so forth? What tools do you kids use these days?

    Read the article

  • accessing associations within GORM Events

    - by Don
    Hi, My Grails app has a User class and a Role class. The User class has an authorities property which holds the roles assigned to that user, e.g. class User { static hasMany = [authorities: Role] // This method is called automatically after a user is inserted def afterInsert() { this.authorities.size() } } If I create a user and assign them a role, a NullPointerException is thrown from the GORM event method afterInsert(), because authorities is null. If I comment out afterInsert() the user is saved correctly along with the assigned role. Is there some reason why I can't access associations from GORM event methods. Is is possible that this event is fired after the User row is inserted, but before the row is added to the User-Role join table? Thanks, Don

    Read the article

  • .Net Dynamically Load DLL

    - by hermiod
    I am trying to write some code that will allow me to dynamically load DLLs into my application, depending on an application setting. The idea is that the database to be accessed is set in the application settings and then this loads the appropriate DLL and assigns it to an instance of an interface for my application to access. This is my code at the moment: Dim SQLDataSource As ICRDataLayer Dim ass As Assembly = Assembly. _ LoadFrom("M:\MyProgs\WebService\DynamicAssemblyLoading\SQLServer\bin\Debug\SQLServer.dll") Dim obj As Object = ass.CreateInstance(GetType(ICRDataLayer).ToString, True) SQLDataSource = DirectCast(obj, ICRDataLayer) MsgBox(SQLDataSource.ModuleName & vbNewLine & SQLDataSource.ModuleDescription) I have my interface (ICRDataLayer) and the SQLServer.dll contains an implementation of this interface. I just want to load the assembly and assign it to the SQLDataSource object. The above code just doesn't work. There are no exceptions thrown, even the Msgbox doesn't appear. I would've expected at least the messagebox appearing with nothing in it, but even this doesn't happen! Is there a way to determine if the loaded assembly implements a specific interface. I tried the below but this also doesn't seem to do anything! For Each loadedType As Type In ass.GetTypes If GetType(ICRDataLayer).IsAssignableFrom(loadedType) Then Dim obj1 As Object = ass.CreateInstance(GetType(ICRDataLayer).ToString, True) SQLDataSource = DirectCast(obj1, ICRDataLayer) End If Next EDIT: New code from Vlad's examples: Module CRDataLayerFactory Sub New() End Sub ' class name is a contract, ' should be the same for all plugins Private Function Create() As ICRDataLayer Return New SQLServer() End Function End Module Above is Module in each DLL, converted from Vlad's C# example. Below is my code to bring in the DLL: Dim SQLDataSource As ICRDataLayer Dim ass As Assembly = Assembly. _ LoadFrom("M:\MyProgs\WebService\DynamicAssemblyLoading\SQLServer\bin\Debug\SQLServer.dll") Dim factory As Object = ass.CreateInstance("CRDataLayerFactory", True) Dim t As Type = factory.GetType Dim method As MethodInfo = t.GetMethod("Create") Dim obj As Object = method.Invoke(factory, Nothing) SQLDataSource = DirectCast(obj, ICRDataLayer) EDIT: Implementation based on Paul Kohler's code Dim file As String For Each file In Directory.GetFiles(baseDir, searchPattern, SearchOption.TopDirectoryOnly) Dim assemblyType As System.Type For Each assemblyType In Assembly.LoadFrom(file).GetTypes Dim s As System.Type() = assemblyType.GetInterfaces For Each ty As System.Type In s If ty.Name.Contains("ICRDataLayer") Then MsgBox(ty.Name) plugin = DirectCast(Activator.CreateInstance(assemblyType), ICRDataLayer) MessageBox.Show(plugin.ModuleName) End If Next I get the following error with this code: Unable to cast object of type 'SQLServer.CRDataSource.SQLServer' to type 'DynamicAssemblyLoading.ICRDataLayer'. The actual DLL is in a different project called SQLServer in the same solution as my implementation code. CRDataSource is a namespace and SQLServer is the actual class name of the DLL. The SQLServer class implements ICRDataLayer, so I don't understand why it wouldn't be able to cast it. Is the naming significant here, I wouldn't have thought it would be.

    Read the article

  • Can't start apache in linux, because of proxy module

    - by Silmaril89
    When I try to start apache or run the command, httpd -M each fail and print the following error: httpd: Syntax error on line 137 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf.d/proxy_ajp.conf: Cannot load /etc/httpd/modules/mod_proxy_ajp.so into server: /etc/httpd/modules/mod_proxy_ajp.so: undefined symbol: proxy_module Any ideas on how to fix this? Thanks.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >