Daily Archives

Articles indexed Saturday March 27 2010

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

  • .Net Remoting: Serialize Object and implementation

    - by flogo
    Hi, In my scenario there is a client-side assembly that contains a class (Task). This class implements an interface (ITask) that is known on the server. I'm trying to send a Task object from client to server without copying the assembly of the client manually to the server. If I just serialize the task object, the server obviously complains about the missing assembly. I then tried to serialze typeof(Task).Assembly but could not derserialize it on the server. Next I tried to File.ReadAllBytes(typeof(Task).Assembly.Location) and saved it to a temporary file on the server, which threw an exception on Assembly.LoadFrom(@".\temporary.dll"); Why am I doing this? Java RMI has a neat feature to request the implementation of an object that is received through remoting but is stil "unkown" (this JVM doesn't have the *.class file). This can be used for a compute server that just knows the interface of a "task" containing a run() method and downloads the implementation of this method on demand. This way the server doesn't have to be changed for new tasks. I'm trying to achieve something like this in .Net.

    Read the article

  • How to benchmark apache/nginx setup

    - by Saif Bechan
    I am planning to setup nginx as reverse proxy. I will have apache to deliver my dynamic content, and nginx will deliver the static content. My configuration i have now is just Apache with fastCGI. This gives me no configuration problems and runs great. After I have set up nginx I want to run some benchmarks to see if I really got some performance increases, else i will switch back. Does anyone know how I can benchmark this type of setup? Or maybe someone did this already and have some canned results, I will be glad to hear them.

    Read the article

  • Add a background color to text, but with space blank space between lines of paragraph

    - by Chris
    Hi, I was wondering if something was possible to do in CSS. Basically i want to recreate the text on the RHS of the image using html/css, but currently I'm getting the LHS of the image. The HTML: <div id="banner"> <div id="text"> <p>This is an example of what I have</p> </div> </div> The CSS: div#banner { background: green; width:300px; height:300px;} div#text { margin: 20px auto; } div#text p { background:#fff; padding: 5px; margin: 5px; font-size: 2em; } Now I realise that this can be done already either by: Using an image Using separate p tags (By Point 2 I mean: <div id="banner"> <div id="text"> <p>This is an</p> <p>example of</p> <p>what I have</p> </div> </div> ) But what I would really like to know is if it's actually possible to do what is on the RHS of the image, using only css and a single p tag?

    Read the article

  • MissingMethodException thrown when calling new form in Compact Framework

    - by Boerema
    I'm updating an old mobile device application for better flexibility. I had basically added the ability to configure the address of our SQL server in the case that we want to use our test server as opposed to our production server. I don't think this is causing the problem, but I wanted to state it. I also upgraded the project from a VS 2000 project to a VS 2005 project. The issue I am having is that when I try to run the program in the VS emulator for Pocket PC, I get an error. It occurs after our "main menu" form loads and the user selects the next form to load. The form is initialized without issue, but when we try to run the .ShowDialog() method, it throws a System.MissingMethodException. I don't have a lot of experience with the Compact Framework and really have no idea where to start looking for problems. I stepped the debugger through the entire initializing process for the new form and it ran without issue. But, again, when we come to the ShowDialog call, it throws the error. Any ideas in where to start looking or known issues would be greatly appreciated.

    Read the article

  • Change color of text within a WinForms RichTextBox

    - by Addie
    I have a RichTextBox that I write a string to every time I click a Form button. The string ends with a newline so each time I add a string, it appends to the bottom of the RichTextBox. Each string begins with the string "Long" or "Short" and ends with Environment.NewLine. I'd like to color each line red if it beings with "Long" and blue if it begins with "Short". How can I do this? If you need further clarification of the question comment below.

    Read the article

  • Instantiate dynamic array Magento

    - by Tegan Snyder
    Kick me if I'm being silly but some some reason I'm having a heck of time building a dynamic array in magento. Example: $data = array(); $data[0] = 'test'; $data[1] = 'what'; I keep getting an ERROR: Notice: Undefined offset: 0 Any ideas? Do I need to handle these arrays differently since they are in a class?

    Read the article

  • Can't resolve "UnauthorizedAccessException" with MVC 2 application running under IIS7

    - by Daniel Crenna
    We use MVC controllers that access System.File.IO in our application and they work fine in localhost (IIS 6.0-based Cassini). Deploying to IIS7, we have problems getting the controllers to work because they throw UnauthorizedAccessExceptions. We have done the following to try to resolve the issue: - Set NETWORK SERVICE and IUSR accounts to have permission on the files and folders in question - Ensured the App Pool is running under NETWORK SERVICE and loading the user profile - Application is running under full trust - We tried adding impersonation to web.config and giving NETWORK SERVICE write permissions Now, we alternate between getting UnauthorizedAccessException and an IIS7 404 page that suggests the routes are being ignored completely (for example we serve "/favicon.ico" via a controller when the physical file actually lives at /content/images/favicon.ico). We used ProcessMonitor to try to track down the issue but weren't successful.

    Read the article

  • Texture loading at joGL

    - by Nour
    hi I've been trying to load a bmp picture to use it as a texture at my program I've used a IOstream Class to extend DataInputStream to read the pixels at the photo with this code "based on a texture loader code for c++ " : //class Data members public static int BMPtextures[]; public static int BMPtexCount = 30; public static int currentTextureID = 0; //loading methode static int loadBMPTexture(int index, String fileName, GL gl) { try { IOStream wdis = new IOStream(fileName); wdis.skipBytes(18); int width = wdis.readIntW(); int height = wdis.readIntW(); wdis.skipBytes(28); byte buf[] = new byte[wdis.available()]; wdis.read(buf); wdis.close(); gl.glBindTexture(GL.GL_TEXTURE_2D, BMPtextures[index]); gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, 3, width, height, 0, GL.GL_BGR, GL.GL_UNSIGNED_BYTE, buf); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); currentTextureID = index; return currentTextureID; } catch (IOException ex) { // Utils.msgBox("File Error\n" + fileName, "Error", Utils.MSG_WARN); return -1; } } and IOStream code : public class IOStream extends DataInputStream { public IOStream(String file) throws FileNotFoundException { super(new FileInputStream(file)); } public short readShortW() throws IOException { return (short)(readUnsignedByte() + readUnsignedByte() * 256); } public int readIntW() throws IOException { return readShortW() + readShortW() * 256 * 256; } void read(Buffer[] buf) { } } and the calling: GTexture.loadBMPTexture(1,"/BasicJOGL/src/basicjogl/data/Font.bmp",gl); after debugging I figured out that when it come to this line : IOStream wdis = new IOStream(fileName); an IOExeption occurred and it's a dispatchException .. what this impose to mean ?? and how can I solve it ? by the way i tried to : 1- use \ and \ and / and // 2- change the path of the photo and take all the path from c:\ to the photoname.bmp 3- rename the photo using numbers like 1.bmp but nothing seems to work :(

    Read the article

  • Assign to an array and replace emerged nil values

    - by Tobias
    Greetings! When assigning a value to an array as in the following, how could I replace the nils by 0? array = [1,2,3] array[10] = 2 array # => [1, 2, 3, nil, nil, nil, nil, nil, nil, nil, 2] If not possible when assigning, how would I do it the best way afterwards? I thought of array.map { |e| e.nil? ? 0 : e }, but well… Thanks!

    Read the article

  • Connecting to SQL Server 2005 using classic ASP

    - by IXMonkey
    I have installed both IIS and SQL Server 2005 on my laptop. Both work individualy, however when I try to connect to an DB from an ASP page I keep getting the following error: Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "DB1" requested by the login. The login failed. /testFiles/Connection/Connection.inc, line 5 Line 5 says: con.open "DSN=DB1" Can anybody tell me what the problem is? Thanks

    Read the article

  • iPhone: Can access files in documents directory in Simulator, but not device

    - by Kevin Cupp
    Hi there! I'm writing an app that copies some contents of the bundle into the applications Document's directory, mainly images and media. I then access this media throughout the app from the Document's directory. This works totally fine in the Simulator, but not on the device. The assets just come up as null. I've done NSLog's and the paths to the files look correct, and I've confirmed that the files exist in the directory by dumping a file listing in the console. Any ideas? Thank you! EDIT Here's the code that copies to the Document's directory NSString *pathToPublicationDirectory = [NSString stringWithFormat:@"install/%d",[[[manifest objectAtIndex:i] valueForKey:@"publicationID"] intValue]]; NSString *manifestPath = [[NSBundle mainBundle] pathForResource:@"content" ofType:@"xml" inDirectory:pathToPublicationDirectory]; [self parsePublicationAt:manifestPath]; // Get actual bundle path to publication folder NSString *bundlePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:pathToPublicationDirectory]; // Then build the destination path NSString *destinationPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%d", [[[manifest objectAtIndex:i] valueForKey:@"publicationID"] intValue]]]; NSError *error = nil; // If it already exists in the documents directory, delete it if ([fileManager fileExistsAtPath:destinationPath]) { [fileManager removeItemAtPath:destinationPath error:&error]; } // Copy publication folder to documents directory [fileManager copyItemAtPath:bundlePath toPath:destinationPath error:&error]; I am figuring out the path to the docs directory with this method: - (NSString *)applicationDocumentsDirectory { return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; } And here's an example of how I'm building a path to an image path = [NSString stringWithFormat:@"%@/%d/%@", [self applicationDocumentsDirectory], [[thisItem valueForKey:@"publicationID"] intValue], [thisItem valueForKey:@"coverImage"]];

    Read the article

  • ImageView bounds are larger than expected in android layout

    - by Hamy
    Hey all, This is a layout that I have defined in an app. As you can see, I would like the TextView "@details/image_time_counter" to be aligned with the bottom right of the image. Unfortunately, this is currently what shows - app - hierarchy viewer all - HV part 2. HierarchyViewer reports that the ImageView has bounds much bigger than what I am expecting. Can anyone explain these bounds, or just tell me how to make the bounds be the same as the image size? Thanks, Hamy <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> </RelativeLayout>

    Read the article

  • Does the optimizer filter subqueries with outer where clauses

    - by Mongus Pong
    Take the following query: select * from ( select a, b from c UNION select a, b from d ) where a = 'mung' Will the optimizer generally work out that I am filtering a on the value 'mung' and consequently filter mung on each of the queries in the subquery. OR will it run each query within the subquery union and return the results to the outer query for filtering (as the query would perhaps suggest) In which case the following query would perform better : select * from ( select a, b from c where a = 'mung' UNION select a, b from d where a = 'mung' ) Obviously query 1 is best for maintenance, but is it sacrificing much performace for this? Which is best?

    Read the article

  • C++ Linker Error SDL Image - could not read symbols

    - by Matt H
    Hi, I'm trying to use the SDL_Image library and I've added the .so to the link libraries list for my project (I'm using Code::Blocks, by the way). After doing this, when I go to compile, I get this error: Linking console executable: bin/Debug/ttfx /usr/lib32/libSDL_image-1.2.so: could not read symbols: File in wrong format What does this mean and how can I get it working? Thanks!

    Read the article

  • Flex DataGrid with row number column

    - by philcruz
    I want to extend the DataGrid component so that there is a (read-only) column for the row number like you see in spreadsheets. I came across this article http://www.cflex.net/showFileDetails.cfm?ObjectID=735 but it depends on the data being unique for each row so that it can index into the array. If the data is not unique (like for an empty grid) it doesn't work. How can I implement that?

    Read the article

  • Show dialog on outbound calls

    - by jgauffin
    I want to be able to show a dialog on outbound calls. The dialog is used to ask the user if he wants 1. dial the phone number directly 2. Dial through the PBX. If option two is chosen, i want to dial a specific number and send the dialed number as DTMF. How do I catch and stop outgoing calls? How do I get the dialed number?

    Read the article

  • Is there a way to create a python object that will be not sortable?

    - by Graf
    Is there a possibility to create any python object that will be not sortable? So that will be an exception when trying to sort a list of that objects? I created a very simple class, didn't define any comparison methods, but still instances of this class are comparable and thus sortable. Maybe, my class inherits comparison methods from somewhere. But I don't want this behaviour.

    Read the article

  • How to non-greedy multiple lookbehind matches

    - by ArtK
    Source: <prefix><content1><suffix1><prefix><content2><suffix2> Engine: PCRE RegEx1: (?<=<prefix>)(.*)(?=<suffix1>) RegEx2: (?<=<prefix>)(.*)(?=<suffix2>) Result1: <content1> Result2: <content1><suffix1><prefix><content2> The desired result for RegEx2 is just <content2> but it is obviously greedy. How do I make RegEx2 non-greedy and use only the last matching lookbehind? [I hope I have translated this correctly from the NoteTab syntax. I don't do much RegEx coding. The <prefix>, <content> & <suffix> terms are just meant to represent arbitrary strings. Only the "<" in the "?<=" lookbehind command is significant.] I suspect it is something simple but after too many hours of searching I'm giving up on solving it myself. Thanks for the help Art

    Read the article

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