Daily Archives

Articles indexed Tuesday April 6 2010

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

  • SQL Server Import table keeping default values

    - by Chrissi
    I am importing a table from one database to another in SQL Server 2008 by right-clicking the target database and choosing Tasks Import Data... When I import the table I get the column names and types and all the data fine, but I lose the primary key, identity specifications and all the default values that were set in the source table. So now I have to set all the default values for each column again manually. Is there any way to get the default values with the import, or even after with a Query? I am VERY new to this and flailing in the dark, so forgive me if this is a really stupid question...

    Read the article

  • Getting traceback from Python C API

    - by TheObserver
    I have a Python C API extension module which occassionally falls over with an uninformative "MemoryError". It's clearly not an error that's catered for by the module's exception handlers. How do I get a more informative error traceback so I can figure out what's gone wrong in the extension module?

    Read the article

  • How to Avoid PHP Object Nesting/Creation Limit?

    - by Will Shaver
    I've got a handmade ORM in PHP that seems to be bumping up against an object limit and causing php to crash. Here's a simple script that will cause crashes: <? class Bob { protected $parent; public function Bob($parent) { $this->parent = $parent; } public function __toString() { if($this->parent) return (string) "x " . $this->parent; return "top"; } } $bobs = array(); for($i = 1; $i < 40000; $i++) { $bobs[] = new Bob($bobs[$1 -1]); } ?> Even running this from the command line will cause issues. Some boxes take more than 40,000 objects. I've tried it on Linux/Appache (fail) but my app runs on IIS/FastCGI. On FastCGI this causes the famous "The FastCGI process exited unexpectedly" error. Obviously 20k objects is a bit high, but it crashes with far fewer objects if they have data and nested complexity. Fast CGI isn't the issue - I've tried running it from the command line. I've tried setting the memory to something really high - 6,000MB and to something really low - 24MB. If I set it low enough I'll get the "allocated memory size xxx bytes exhausted" error. I'm thinking that it has to do with the number of functions that are called - some kind of nesting prevention. I didn't think that my ORM's nesting was that complicated but perhaps it is. I've got some pretty clear cases where if I load just ONE more object it dies, but loads in under 3 seconds if it works.

    Read the article

  • Authentication settings in IIS Manager versus web.config versus system.serviceModel

    - by Joe
    I'm new to ASP.NET :) I have a WCF web service, and I want to use Basic authentication. I am getting lost in the authentication options: In IIS 6 Manager, I can go in to the properties of the web site and set authentication options. In the web site's web.config file, under system.web, there is an <authentication mode="Windows"/> tag In the web site's web.config file, under system.serviceModel, I can configure: <wsHttpBinding <binding name="MyBinding" <security mode="Transport" <transport clientCredentialType="Basic"/ </security </binding </wsHttpBinding What is the difference between these three? How should each be configured? Some context: I have a simple web site project that contains a single .svc web service, and I want it to use Basic authentication over SSL. (Also, I want it to not use Windows accounts, but maybe that is another question.)

    Read the article

  • Is there a Delphi dropdown notification component?

    - by Mason Wheeler
    You know how in Firefox, if something happens that requires your attention but isn't immediately urgent enough to require a modal dialog, it will drop down a little strip at the top of the tab with a question on it? I'd like to be able to put functionality like that in a Delphi app, but I don't know if there's a component for that. Does anyone know of one?

    Read the article

  • Ftp file watcher like SystemFileWatcher in .net?

    - by nrk
    Hi, In my project I need to watch multiple FTP Folders continuosly, if any new file comes i need pick the filename and do some process. If that is normal Windows/Local File System folder I can achieve this by using SystemFileWatcher of .net. Is there any thing like SystemFilewatcher to watch FTP folders? Thanksnrk

    Read the article

  • ASP.NET Build Images Links Dynamically

    - by coson
    Good Day, I am developing a website that has product images on an external server. I have code that tests to see if the image exists like (pseudo code): DynamicString = FunctionThatCreatesDynamicString() ' DynamicString = "http://external_server/path/to/file1.jpg" If ImageExists(DyanmicString) = StatusCode.200 Then ' Embed link in ASP.NET page Else ' Embed not found image in ASP.NET page End If My code builds fine and appears to execute. The problem occurs when I attempt to view the external link in a browser, the image appears properly (I have to authenticate first, but that's OK considering I'm on an internal network and this app will be used internally). However, when I attempt the view the source in my generated HTML page, I am seeing the image to the "Not Found" image when I know the image is there. I compared all the characters in my dynamically assembled to the external link and all the characters are matching up correctly. I'm wondering if the authentication has anything to do with why the image is not rendering properly on my rendered HTML. Any thoughts? TIA, coson

    Read the article

  • shortcut to menu

    - by netmajor
    Hey, How to create shortcut to menu in WinForms. I think about something like in Visual Studio and Firefox, where I press Alt and mainly menu items shortcut letters have been underline. How to do this??

    Read the article

  • Is my objective possible using WCF (and is it the right way to do things?)

    - by David
    I'm writing some software that modifies a Windows Server's configuration (things like MS-DNS, IIS, parts of the filesystem). My design has a server process that builds an in-memory object graph of the server configuration state and a client which requests this object graph. The server would then serialize the graph, send it to the client (presumably using WCF), the server then makes changes to this graph and sends it back to the server. The server receives the graph and proceeds to make modifications to the server. However I've learned that object-graph serialisation in WCF isn't as simple as I first thought. My objects have a hierarchy and many have parametrised-constructors and immutable properties/fields. There are also numerous collections, arrays, and dictionaries. My understanding of WCF serialisation is that it requires use of either the XmlSerializer or DataContractSerializer, but DCS places restrictions on the design of my object-graph (immutable data seems right-out, it also requires parameter-less constructors). I understand XmlSerializer lets me use my own classes provided they implement ISerializable and have the de-serializer constructor. That is fine by me. I spoke to a friend of mine about this, and he advocates going for a Data Transport Object-only route, where I'd have to maintain a separate DataContract object-graph for the transport of data and re-implement my server objects on the client. Another friend of mine said that because my service only has two operations ("GetServerConfiguration" and "PutServerConfiguration") it might be worthwhile just skipping WCF entirely and implementing my own server that uses Sockets. So my questions are: Has anyone faced a similar problem before and if so, are there better approaches? Is it wise to send an entire object graph to the client for processing? Should I instead break it down so that the client requests a part of the object graph as it needs it and sends only bits that have changed (thus reducing concurrency-related risks?)? If sending the object-graph down is the right way, is WCF the right tool? And if WCF is right, what's the best way to get WCF to serialise my object graph?

    Read the article

  • Websphere exception handling

    - by Benjamin
    Hi all, From a security standpoint, what is the best solution to handle application errors with Websphere? I've been thinking of creating a class that is called every time an application error is generated, log the error and display a generic error message to the users. In PHP this can be achieved using the set_exception_handler() function. Is there something similar for websphere that could be configured in the web.xml? I've found codes like this on the internet: <error-page> <error-code>500</error-code> <location>/servlet/ExceptionHandlerServlet</location> </error-page> But that would only work with "500" HTTP error codes. I really want something generic that catches everything. Something like a class that implements a certain interface which can have access to all information about the error. Thanks for your time.

    Read the article

  • Import CSV into Org-mode properties

    - by lecodesportif
    I would like to import a CSV into Org-mode. Others have already asked about importing CSV to Org-mode tables. That's not what I am trying to do. I need to import CSV to Org-mode properties. For example, a CSV like this: Name,Tel,Mobile,Fax John,11111,22222,33333 should become: :PROPERTIES: :Name: John :Tel: 11111 :Mobile: 22222 :Fax: 33333 :END: Do you happen to know a painless way to do it?

    Read the article

  • Do most front and rear USB connections deliver the same power and performance?

    - by Bratch
    I was reading this Three Monitors For Every User and there were some comments about rear USB ports being able to deliver more power than front USB ports because they are directly connected to the motherboard and closer to the power supply (by circuit board runs). Even though the front USB ports may have connectors farther from the power supply, and there are cables from the motherboard to the front ports, I think that the difference in power would be negligible (unless the case is over 5 meters long). Anyone know for sure if they are the same or different? Note that I'm not talking about an older case where the front might have been USB 1.1 and the rear USB 2.0. A modern case would have USB 2.0 on all ports. And of course using a powered hub would deliver plenty of power.

    Read the article

  • Socket Programing UDP GetSocketOpt.

    - by Steve
    A third Party library gives us just the created socket on which listen data. Now this socket can be udp or tcp, I am not able to figure out which options to give to getsockopt to figure out whether the socket is udp or tcp. SOL_SOCKET, SO_BROADCAST doesn't seem to serve this purpose.

    Read the article

  • How to send web browser a loading page, then some time later a results page

    - by Kurt W. Leucht
    I've wasted at least a half day of my company's time searching the Internet for an answer and I'm getting wrapped around the axle here. I can't figure out the difference between all the different technology choices (long polling, ajax streaming, comet, XMPP, etc.) and I can't get a simple hello world example working on my PC. I am running Apache 2.2 and ActivePerl 5.10.0. JavaScript is completely acceptable for this solution. All I want to do is write a simple Perl CGI script that when accessed, it immediately returns some HTML that tells the user to wait or maybe sends an animated GIF. Then without any user intervention (no mouse clicks or anything) I want the CGI script to at some time later replace the wait message or the animated GIF with the actual results from their query. I know this is simple stuff and websites do it all the time using JavaScript, but I can't find a single working example that I can cut and paste onto my machine that will work in Perl. Here is my simple Hello World example that I've compiled from various Internet sources, but it doesn't seem to work. When I refresh this Perl CGI script in my web browser it prints nothing for 5 seconds, then it prints the PLEASE BE PATIENT web page, but not the results web page. So the Ajax XMLHttpRequest stuff obviously isn't working right. What am I doing wrong? #!C:\Perl\bin\perl.exe use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; sub Create_HTML { my $html = <<EOHTML; <html> <head> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="-1" /> <script type="text/javascript" > var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } </script> <title>Ajax Streaming Connection Demo</title> </head> <body> Some header text. <p> <div id="response">PLEASE BE PATIENT</div> <p> Some footer text. </body> </html> EOHTML return $html; } my $cgi = new CGI; print $cgi->header; print Create_HTML(); sleep(5); print "<script type=\"text/javascript\">\n"; print "\$('response').innerHTML = 'Here are your results!';\n"; print "</script>\n";

    Read the article

  • LINQ to remove duplicated property

    - by Shawn Mclean
    I have a LINQ statement like this: var media = (from p in postService.GetMedia(postId) select new { PostId = postId, SynthId = p.SynthId }); There are many(possibly thousands) of records returned with the same SynthId. I want to select one one, any random one. So when I'm finished, media should contain records with distinct SynthId. SynthId can be null, I want all nulls to be in media (the distinct should not affect them). My DAL is EntityFramework, if that will help. How do I accomplish this in the most efficient way?

    Read the article

  • How can I make a resizable array in Java?

    - by Soren Johnson
    What is the best way to do a resizable array in Java? I tried using Vector, but that shifts all elements over by when when you do an insert, and I need an array that can grow but the elements stay in place. I'm sure there's a simple answer for this, but I still not quite sure.

    Read the article

  • MySQL fields terminated by tab

    - by Brian
    I am trying to upload a tab delimitted file with MySQL. I want a query something likes this: LOAD DATA LOCAL INFILE 'file' INTO TABLE tbl FIELDS TERMINATED BY 'TAB' Is there something I can subsitute for TAB to make this work?

    Read the article

  • Python begineer confused by a piece of code

    - by Protean
    I understand the gist of the code, that it forms permutations; however, I was wondering if someone could explain exactly what is going on in the return statement. def perm(l): sz = len(l) print (l) if sz <= 1: print ('sz <= 1') return [l] return [p[:i]+[l[0]]+p[i:] for i in range(sz) for p in perm(l[1:])]

    Read the article

  • C++ Winsock non-blocking/async UDP socket

    - by Ragnagard
    Hi all! I'm developping a little data processor in c++ over UDP sockets, and have a thread (just one, and apart the sockets) that process the info received from them. My problem happens when i need to receive info from multiple clients in the socket at the same time. How could i do something like: Socket foo; /* init socket vars and attribs */ while (serving){ thread_processing(foo_info); } for multiple clients (many concurrent access) in c++? I'm using winsocks atm on win32, but just get standard blocking udp sockets working. No gui, it's a console app. I'll appreciate so much an example or pointer to one ;). Thanks in advance.

    Read the article

  • excel - inserting data with OleDb c#

    - by Cmptrb
    Hi, my code is below: private string connectionstring = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myexcel.xls; Extended Properties=""Excel 8.0;HDR=YES;"""; this is my connection string, the excel file is created writable (not readonly) either my command to insert any data is : string commandstring = "insert into [mus$] (name, surname) values('mickey', 'mouse')"; But my commandstring does not work and gives the error: "number of query values and destination fields are not the same" Where I do mistake ?

    Read the article

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