Daily Archives

Articles indexed Friday March 12 2010

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

  • Plugin architecture in .net: unloading

    - by henchman
    Hello everybody, I need to implement a plugin architecture within c#/.net in order to load custom user defined actions data type handling code for a custom data grid / conversion / ... from non-static linked assembly files. Because the application has to handle many custom user defined actions, Iam in need for unloading them once executed in order to reduce memory usage. I found several good articles about plugin architectures, eg: ExtensionManager PluginArchitecture ... but none of them gave me enough sausage for properly unloading an assembly. As the program is to be distributed and the user defined actions are (as the name states) user defined: how to i prevent the assembly from executing malicious code (eg. closing my progra, deleting files)? Are there any other pitfalls one of you has encountered?

    Read the article

  • novice question file read

    - by user248247
    while(getline(fileIn,line)) { fileOut <<line<<endl; } while(getline(fileIn,line)) { if(fileIn,eof()) break; fileOut <<line<<endl; } i have tried both piece of code and it still reads past and does not break. can anyone tell me why? I am just reading from file and writing to it. thanks

    Read the article

  • Why is the W3C box model considered better?

    - by Mel
    Why do most developers consider the W3C box-model to be better than the box-model used by Internet Explorer? I know it's very frustrating developing pages that look the way you want them on Internet Explorer, but I find the W3C box-model to be counter-intuitive. For example, if margins, padding, and border were factored into the width, I could assign fixed width values for all my columns without having to worry about how many columns I have and what changes I make to my padding and margins. Under W3C box model I have to worry about how many columns I have, and develop something akin to a mathematical formula to calculate my values. Changing them would nightmarish, especially for complex layouts. My novice opinion is that it's more restrictive. Consider this small frame-work I wrote: #content { margin:0 auto 30px auto; padding:0 30px 30px 30px; width:900px; } #content .column { float:left; margin:0 20px 20px 20px; } #content .first { margin-left:0; } #content .last { margin-right:0; } .width_1-4 { width:195px; } .width_1-3 { width:273px; } .width_1-2 { width:430px; } .width_3-4 { width:645px; } .width_1-1 { width:900px; } These values I have assigned here will falter unless there are three columns, and thus the margins at 0(first)+20+20+20+20+0(last). It would be a disaster if I wanted to add padding to my columns too, as my entire setup would have to be re calibrated. Now imagine if column width incorporated all the other elements, all I would need to do is change one associated value, and I have my layout. I'm less criticizing it and more hoping to understand why it's better, or why I'm finding it more difficult. Am I doing this whole thing wrong? I don't know very much about this topic, but it seems counter intuitive to use W3C's box-model. Some advice would be really appreciated. Thanks

    Read the article

  • JSON Feed Returning null while using jQuery getJSON

    - by Oscar Godson
    http://portlandonline.com/shared/cfm/json.cfm?c=27321 It's returning null. I don't really have access to this. I have to have a server admin update the feed to my liking, so if you can tell me how to get this to work as is, without adding tags to my HTML please let me know. I will be using this with jQuery, and ive been trying to use getJSON which is what returns null. $.getJSON('http://portlandonline.com/shared/cfm/json.cfm?c=27321',function(json){ alert(json); }); that returns null. But if i use a flickr feed for example, it works fine. it returns what it should, [onject Object]. Any ideas?

    Read the article

  • Weirdest occurence ever, UIButton @selector detecting right button, doing wrong 'else_if'?

    - by Scott
    So I dynamically create 3 UIButtons (for now), with this loop: NSMutableArray *sites = [[NSMutableArray alloc] init]; NSString *one = @"Constution Center"; NSString *two = @"Franklin Court"; NSString *three = @"Presidents House"; [sites addObject: one]; [one release]; [sites addObject: two]; [two release]; [sites addObject: three]; [three release]; NSString *element; int j = 0; for (element in sites) { UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; //setframe (where on screen) //separation is 15px past the width (45-30) button.frame = CGRectMake(a, b + (j*45), c, d); [button setTitle:element forState:UIControlStateNormal]; button.backgroundColor = [SiteOneController myColor1]; [button addTarget:self action:@selector(showCCView:) forControlEvents:UIControlEventTouchUpInside]; [button setTag:j]; [self.view addSubview: button]; j++; } The @Selector method is here: - (void) showCCView:(id) sender { UIButton *button = (UIButton *)sender; int whichButton = button.tag; NSString* myNewString = [NSString stringWithFormat:@"%d", whichButton]; self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; self.view.backgroundColor = [UIColor whiteColor]; UINavigationBar *cc = [SiteOneController myNavBar1:@"Constitution Center Content"]; UINavigationBar *fc = [SiteOneController myNavBar1:@"Franklin Court Content"]; UINavigationBar *ph = [SiteOneController myNavBar1:@"Presidents House Content"]; if (whichButton = 0) { NSLog(myNewString); [self.view addSubview:cc]; } else if (whichButton = 1) { NSLog(myNewString); [self.view addSubview:fc]; } else if (whichButton = 2) { NSLog(myNewString); [self.view addSubview:ph]; } } Now, it is printing the correct button tag to NSLog, as shown in the method, however EVERY SINGLE BUTTON is displaying a navigation bar with "Franklin Court" as the title, EVERY SINGLE ONE, even though when I click button 0, it says "Button 0 clicked" in the console, but still performs the else if (whichButton = 1) code. Am I missing something here?

    Read the article

  • Regular expression in BASH

    - by Ryan
    Hello everyone, I was hoping someone could answer my quick question as I am going nuts! I have recently started learning regular expressions in my Java programming however am a little confused how to get certain features to work correctly directly in BASH. For example, the following code is not working as I think it should. echo 2222 | grep '2\{2\}' I am expecting it to return: 22 I have tried variations of it including: echo 2222 | grep '2{2}' echo 2222 | grep -P '2\{2\}' echo 2222 | grep -E '2\{2\}' However I am completely out of ideas. I'm sure this is a simple parameter / syntax fix and would love some help! P.S I've done tons of googling and every reference I find does not work in BASH; regex's can run on so many different platforms and engines =/

    Read the article

  • Can one aliased Type not be accessed by another?

    - by jdk
    good stuff // ok to alias a List Type using AliasStringList = System.Collections.Generic.List<string>; // and ok to alias a List of Lists like this using AliasListOfStringList1 = System.Collections.Generic.List<System.Collections.Generic.List<string>>; bad stuff // However **error** to alias another alias using AliasListOfStringList2 = System.Collections.Generic.List<AliasStringList>; Produces the compile error The type or namespace name 'AliasStringList' could not be found (are you missing a using directive or an assembly reference?)

    Read the article

  • how to print a char from struct

    - by make
    Hi Could someone please tell us to print a char when receiving data as a struct? Here is an example: ... struct rcv{ int x1; float x2; char *x3; }; rcv data_rcv; ... if (recv(socket, &data_rcv, sizeof(data_rcv), 0) < 0) printf("recv() failed"); ... printf("x1 = %d\n", data_rcv.x1); printf("x2 = %f\n", data_rcv.x2); printf("x3 = %s\n", data_rcv.x3); // it doesn't print anything, why? ... Thanks for your replies-

    Read the article

  • pipelined function

    - by user289429
    Can someone provide an example of how to use parallel table function in oracle pl/sql. We need to run massive queries for 15 years and combine the result. SELECT * FROM Table(TableFunction(cursor(SELECT * FROM year_table))) ...is what we want effectively. The innermost select will give all the years, and the table function will take each year and run massive query and returns a collection. The problem we have is that all years are being fed to one table function itself, we would rather prefer the table function being called in parallel for each of the year. We tried all sort of partitioning by hash and range and it didn't help. Also, can we drop the keyword PIPELINED from the function declaration? because we are not performing any transformation and just need the aggregate of the resultset.

    Read the article

  • How do I wrap a selection with an HTML tag in Visual Studio?

    - by dansays
    This seems like the most basic question in the world, but damned if I can find an answer. Is there a keyboard shortcut, either native to Visual Studio or through Code Rush or other third-party plug-in, to wrap the current selection with an HTML tag? I'm tired of typing the opening tag, cutting the misplaced closing tag to the clipboard, moving the cursor, and pasting it at the end where it belongs. Update: This is how TextMate handles surrounding a selection with a tag. Frankly, I'm stunned that Visual Studio doesn't seem to have a similar feature. Creating a macro or snippet for every conceivable tag I might want to use seems absurd.

    Read the article

  • Model objects versions in Django

    - by pablo
    Hi I'm building an e-commerce website. I have a Product and Order models. It's possible that a customer order a product and then the admin change its price or other fields before the customer actually get it. A possible solution is to add a 'version' field to the Product model. When the admin update a product field I'll add a timestamp and create a new object instead of updating the old one. An Order will have a reference to a specific product version. Does this make sense? Will overriding the Product Save method be sufficient to make it work? Thanks

    Read the article

  • Reset scale/width/zoom of Safari on iPhone using JavaScript/onorientationchange

    - by dwarbi
    I am displaying different content depending on how the user is holding his/her phone using the onorientationchange call in the body tag. This works great - I hide one div while making the other visible. The div in portrait mode looks great on first load. I use this to get the right scale/zoom: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" /> Even if the content in portrait mode run over, the width is correct and the user can scroll down. The display in landscape mode is perfect too. However, if content in landscape mode requires the user the scroll down, then when the user returns to portrait mode, the screen is "zoomed out" so to speak. This happens whether or not the user scrolled down while in landscape mode. I've tried many different things to try to get the scale/zoom/width of the screen right, but no luck. Is there any way to do this? Thanks in advance!

    Read the article

  • NSFetchedResultsController Mac OSX COCOA equivalent

    - by Lukasz
    Hi! I am porting some Core data code from iPhone to Mac OS X. PRoblem is that CoreData Framework on Mac OS X does not have NSFetchedResultsController.h nor NSFetchedResultsControllerDelagete protocol declared. At least I am not able to force COCOA application to see this class even if I drag Core Framework from iPhone project to link with Mac Application? Anyone faced this problem?

    Read the article

  • Upload big file to servlet?

    - by Harry Pham
    I try to upload file using Apache Common File Upload. The servlet throw an exception FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); //This line is where it died Edit: Here is my console log SEVERE: Servlet.service() for servlet UploadServlet threw exception javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:637)

    Read the article

  • subsonic . navigate among records ,view,query

    - by gmo camilo
    hello everybody i'm some newbie in this matter of .net i'm trying understand this new paradigm i began with linq for SQl but i found this library, kind of framework of T4 more specifically: subsonic T4 i think it could be very usefull but the support docs outside are very scarce my first intention is use them in the very simple form: a catalog lets say... Users so... how can i use the model generated with subsonic ( using the iactiverecord) to implement the record-navigational part.,...???!!! i mean i want a simple form to create, delete or modify records and that is fairy easy but what about to move among records ? i found how to get the first, the last record.. but how can i advance or go back among them??? how can i order the records..? it seems everytime imust query the table.. its so? but how can imove among the records i already got? all of the exmples found are very simple dont touch the matter and/ or are repetitive everywhere so.. please if anybody can help me or give more references... i'd thank you a lot gmo camilo

    Read the article

  • Read Only Domain Controllers and DNS zone updates

    - by Mike M
    I have a Windows 2003 domain and just added a new DC that runs 2008 R2. I updated the schema accordingly for both forest and domain levels. I also made sure to run /rodcprep at the time I did this. I have a branch office with a 2008 R2 file/print server that is a read-only domain controller (DC). The one problem I have been having is with AD-integrated DNS records updates. In the data center, we had to make an IP address change on a particular server. All our other sites' DCs (2003) updated the record fine. The 2008 R2 DC in the data center also updates its record fine. However, the RODC in the branch office does not. So if I nslookup the target server on a 2003 DC, the IP address is correct. Same with the 2008 R2 DC in the data center. But an nslookup on the branch office RODC still pulls in the old IP address. Moreover, any new records we've created (e.g., just added a new terminal server) do not get updated on the branch RODC either. Is there something simple I'm missing? How do I get the RODC to sync its AD-integrated DNS records with the rest of my world? Thank you in advance for your responses. Mike

    Read the article

  • SSL certificate fail apache

    - by Murkin
    Hello, I have setup a certificate on Apache server. When I access my site's https pages, I see the certificate flashing (in FireFox's url tab) and disappearing immediately. The browser stays in the same windows (https) but now certificate info is not displayed and the connection is not encrypted. Can anyone recommend on how I can even start checking what is wrong ? (Certificate fail ? Bad config ?) Thanks

    Read the article

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