text
stringlengths
8
267k
meta
dict
Q: iText copy form fields Is there a way in iText to copy just the PDF acroform fields from one PDF document to another PDF document? I have the code to copy the entire PDF, but I would like to be able to overlay all my fields to a new/updated PDF document. A: public void replaceBackground(String newBackground, Stri...
{ "language": "en", "url": "https://stackoverflow.com/questions/431966", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Can I iterate referenced assemblies at design-time in C#? I am attempting to write a .NET component. The component will be dropped onto a form/user control and needs to access attributes in assemblies referenced by the components parent form/user control at design-time. Is it possible to obtain these assemblies at d...
{ "language": "en", "url": "https://stackoverflow.com/questions/431967", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Keep WCF Service Connected How can I keep my WCF Service Client Connected with WinForm even if a Faulted State appened ? Thanks. A: Answer myself :) You might subscribe to InnerChannel Events svc.InnerChannel.Closed += InnerChannel_Error; svc.InnerChannel.Closing += InnerChannel_Error; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/431973", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to set the Image / Icon on a WPF Page I need to know how to set the very top left icon / image on a WPF page. I know how to do it in a WPF Window the page looks to be different. Thanks, Darren A: I don't think there's any support for changing the host window's icon based on its current page in a navigation-styl...
{ "language": "en", "url": "https://stackoverflow.com/questions/431979", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: dotfuscator slowing up execution speed? I just found out that my program is losing 5% execution speed when it go through dotfuscator community edition. is that normal? what could be an alternative(free) to dotfuscator that wouldn't do that? A: Yes, this is a side effect of obfuscation. There might be some other one...
{ "language": "en", "url": "https://stackoverflow.com/questions/431985", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do I configure ASP.net MVC to Scaffold using ADO.net dataservice? Setting up ASP.net MVC with Linq2SQL or Entity Framework's context to have scaffolding work out of the box is extremely easy. What tweaks would you make to make it work with ADO.net Data Services? A: On http://www.codeplex.com/aspnet there's a p...
{ "language": "en", "url": "https://stackoverflow.com/questions/431988", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Programming Design Help - How to Structure a Sudoku Solver program? I'm trying to create a sudoku solver program in Java (maybe Python). I'm just wondering how I should go about structuring this... Do I create a class and make each box a object of that class (9x9=81 objects)? If yes, how do I control all the objects...
{ "language": "en", "url": "https://stackoverflow.com/questions/431996", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How should I encode dictionaries into HTTP GET query strings? An HTTP GET query string is a ordered sequence of key/value pairs: ?spam=eggs&spam=ham&foo=bar Is, with certain semantics, equivalent to the following dictionary: {'spam': ['eggs', 'ham'], 'foo': bar} This happens to work well for boolean properties of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432002", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Is there a way to pass a Number as a parameter in Java? I'm allocating an array of T, T extends Number inside a class. I can do it this way: myClass test = new myClass(Double.class, 20); Then the constructor itself: myClass(Class<T> type, size) { array = (T[]) Array.newInstance(type, size); } I'd like to know ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432006", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What is Google Apps? What is google apps and why are so many startup companies using it? A: Google Apps is a collection of business software components delivered as a service, saving you from having to install Exchange, Office and the usual business stuff. Plus Google Apps allows people to write their own apps and...
{ "language": "en", "url": "https://stackoverflow.com/questions/432020", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: TinyMCE configuration to allow font tags Configuring TinyMCE to allow for tags, based on a customer requirement. My config is as follows (grabbed from the TinyMCE samples; sorry for the length, I didn't want to leave anyting out: tinyMCE.init({apply_source_formatting : true, button_tile_map : true...
{ "language": "en", "url": "https://stackoverflow.com/questions/432036", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How do I center text horizontally and vertically in a TextView? How do I center the text horizontally and vertically in a TextView, so that it appears exactly in the middle of the TextView in Android? A: Here is my answer that I had used in my app. It shows text in center of the screen. <TextView android:id="@+...
{ "language": "en", "url": "https://stackoverflow.com/questions/432037", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2292" }
Q: Line counter for ASP.NET I know the number of lines of code is completely arbitrary and a horrible metric. Even so, after a long day I like to click a little button and see that my pet project grew by 10%. (Or if I spent the day refactoring yet again it slimmed down by 10%, woohoo!) I've used two line counters that ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432038", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is there a general template for creating a UIPickerview which selects short sound files? Is there a general template or tutorial or web page that describes the procedure for creating a UIPickerview which selects short sound files and plays them upon selection or with a player? Thanks A: You'll need a delegate/data...
{ "language": "en", "url": "https://stackoverflow.com/questions/432056", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Should I return IList or List to the Controller in MVC? What is difference to the controller that gets the return with repect to rendering the List? In Linq dataContext: public IList<Response> GetResponses(int ID) { var responses = from r in this.Responses where r.ID == ID orderby r.Date select r; ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432074", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: 3D Polygons in Python As far as I am aware there is no inbuilt polygon functionality for Python. I want to create a 3D map and figured that polygons would be the best way to go about it. Not wanting to reinvent the wheel I did some googling and found that there's a lot of Python stuff out there, but I couldn't find ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432080", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Zend Framework with multiple schema/databases? I have a few tables that I've defined like the below examples: class TableA extends Zend_Db_Table_Abstract { protected $_schema = 'schema1'; protected $_name = 'tablea'; } class TableB extends Zend_Db_Table_Abstract { protected $_schema ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432086", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: NHibernate FlushMode on Save I have set the FlushMode property on an NHibernate session to FlushMode.Never, but when I call session.Save(User), a call gets made to the database anyway. Is this how this is supposed to work? I would think that it shouldn't do an insert until I call Flush(). Edit: I found the issue, ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432087", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Correct use of Lambda query Consider the following code: private static void WriteProcesses(StreamWriter sw, DateTime d) { sw.WriteLine("List of processes @ " + d.ToString()); Process[] localAll = Process.GetProcesses().Where(o => o.ProcessName.ToLower() != "svchost"); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432090", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Dynamic Proxy generation with LinFu I am trying to build a dynamic proxy for an interface with LinFu. The proxy should just implement the getter methods of the properties that are defined by the interface and return for instance a value from a dictionary, where the key is the property name. link text A: Try: // The...
{ "language": "en", "url": "https://stackoverflow.com/questions/432100", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Insert a time + n in mySQL using Zend_db_table! $data = array ( 'next' => "NOW() + 5", 'interval' => $dom["USER"][0]["STATUSES_COUNT"][0]["data"], 'good' => $good, 'tries' => $p->tries + 1 ); $where = $service->ge...
{ "language": "en", "url": "https://stackoverflow.com/questions/432103", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Do you prefer C# or Visual Basic .Net? What do you see as benefits for one over the other? As far as I know, it's just preference. I have way more experience with C# than I do with Visual Basic and was wondering if I should dabble in Visual Basic for certain types of projects? A: VB4 was my first language, with VB6...
{ "language": "en", "url": "https://stackoverflow.com/questions/432106", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Is there a NumPy function to return the first index of something in an array? I know there is a method for a Python list to return the first index of something: >>> xs = [1, 2, 3] >>> xs.index(2) 1 Is there something like that for NumPy arrays? A: If you need the index of the first occurrence of only one value, yo...
{ "language": "en", "url": "https://stackoverflow.com/questions/432112", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "621" }
Q: when to delete user's session I'm writing a webapp that will only be used by authenticated users. Some temporary databases and log files will be created during each user session. I'd like to erase all these temp files when the session is finished. Obviously, a logout or window close event would be sufficient to clo...
{ "language": "en", "url": "https://stackoverflow.com/questions/432115", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Generate Database from NHibernate config files Is it possible to generate the database tables and c# classes from NHibernate config files? Afterwards, is it possible to change the config files and update the tables and config files non-destructively? Do you recommend any tools to do this? (preferably free...) A...
{ "language": "en", "url": "https://stackoverflow.com/questions/432118", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: C# Excluding related values from a list (LINQ) Is there an exact opposite action to "join" in linQ to SQL? I want to display just the results that do not fulfill the inner join constraint from a query. I wanna do it just in one query. Here's an example of it's use (http://img165.imageshack.us/img165/4940/liststj3.jp...
{ "language": "en", "url": "https://stackoverflow.com/questions/432127", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Multiple inheritance in C++ leading to difficulty overriding common functionality In a C++ physics simulation, I have a class called Circle, and Square. These are Shapes, and have a method called push(), which applies force to it. There is then a special case of Circle, call it SpecialCircle, in which push() should...
{ "language": "en", "url": "https://stackoverflow.com/questions/432143", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Cross browser AJAX function to dynamically load HTML I'm looking for an AJAX function to dynamically request an HTML page. I already found the following: function ajaxinclude(url) { var page_request = false if (window.XMLHttpRequest) // if Mozilla, Safari etc page_request = new XMLHttpRequest() els...
{ "language": "en", "url": "https://stackoverflow.com/questions/432144", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: How to make sure redundant data is deleted in a many-to-many relationship I'm trying to make sure some data is auto-deleted when there's no more references using cascade deletes. I'll explain with a fake database based on Stack Overflow. I have a Post table. Each post has zero to many Tags. So it should look like: ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432160", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: C# Switch with String.IsNullOrEmpty Is it possible to have a switch in C# which checks if the value is null or empty not "" but String.Empty? I know i can do this: switch (text) { case null: case "": break; } Is there something better, because I don't want to have a large list of IF statements? I'mm...
{ "language": "en", "url": "https://stackoverflow.com/questions/432161", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "17" }
Q: Does anybody have a development/staging/deploying workflow with php/mysql? I'm thinking about a good workflow for php/mysql web-development. Anybody got some tips? A: I think everybody does theese things slightly different, depending on the exact application. Here's our setup: Before a release: * *Everybody comm...
{ "language": "en", "url": "https://stackoverflow.com/questions/432162", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "18" }
Q: What are the disadvantages of the Spirit parser-generator framework from boost.org? In several questions I've seen recommendations for the Spirit parser-generator framework from boost.org, but then in the comments there is grumbling from people using Spirit who are not happy. Will those people please stand forth an...
{ "language": "en", "url": "https://stackoverflow.com/questions/432173", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "42" }
Q: How to store arbitrary data for some HTML tags I'm making a page which has some interaction provided by javascript. Just as an example: links which send an AJAX request to get the content of articles and then display that data in a div. Obviously in this example, I need each link to store an extra bit of information...
{ "language": "en", "url": "https://stackoverflow.com/questions/432174", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "361" }
Q: Is Google's Protocol Buffers used in large scale production applications? Is Google's Protocol Buffers used in large scale production applications in production? What is the experience using it? A: BTW Apache ActiveMQ 6 will probably be using Protocol Buffers as its default marshalling layer. Early experiences are ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432188", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Is .NET included in Windows 7? Is the .NET Framework included in Windows 7? If so, which version? A: The current Beta includes .net 3.5. Not sure if SP1 or not though. A: Beta 1 (7000) of win7 has .NET 3.5 version 3.5.30729.715 According to this question, that means it has SP1 with a few more (most likely minor wi...
{ "language": "en", "url": "https://stackoverflow.com/questions/432189", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: Are PHP singleton classes somehow shared between requests? I am using the singleton pattern in all my PHP class files. Would it by any chance cause a user's action on the site to conflict with other user's action? For instance, when the application goes live and we have several users on the site at the same time, do...
{ "language": "en", "url": "https://stackoverflow.com/questions/432192", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "15" }
Q: Short Python Code to say "Pick the lower value"? What I mean is, I'm looking for really short code that returns the lower value. for example: a=[1,2,3,4,5,6,7,8,9,10] b=[1,2,3,4,5,6,7,8] len(a) = 10 len(b) = 8 if (fill-this-in): print(lesser-value) And I forgot to add that if b is lower than a, I want b return...
{ "language": "en", "url": "https://stackoverflow.com/questions/432211", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: How can I use a List<> as the condition for my where clause with Linq? So I've been banging my head against the proverbial wall for a few hours and I thought I'd see if anybody else has solved this problem before... I have a List<string> of values that I want to use as filters on a search. In the olden days I would ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432212", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Nested LINQ query using Contains with a bigint This is the SQL I want (ClearinghouseKey is a bigint): select * from ConsOutput O where O.ClearinghouseKey IN ( select distinct P.clearinghouseKey from Project P Inner join LandUseInProject L on L.ClearinghouseKey = P.ClearinghouseKey where P.ProjectLocationKey ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432217", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Flex: How to assign method to Image.MouseMove event programmatically? I understand how to declaratively assign a method to be called when an Image receives a MouseMove event. <mx:Image id="oneCent" mouseMove="dragIt(event, 1);" /> How do I do this programmatically in Flex/AS3? EDIT: Thank...
{ "language": "en", "url": "https://stackoverflow.com/questions/432226", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Why can I assign an existing reference to a literal value in C++? Consider the following: int ival = 1.01; int &rval = 1.01; // error: non-const reference to a const value. int &rval = ival; rval = 1.01; The first assignment of &rval to a literal value fails as expected. If I comment out that line the code compil...
{ "language": "en", "url": "https://stackoverflow.com/questions/432230", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-2" }
Q: How do I use xml to linq when I don't have the Google Reader Atom Schema? I am working on a small widget for BlogEngine.Net. My widget is going to take a person's shared items atom feed and print the title, website url, date, and atom url. To complete this task, I have begun to use Linq and XML. Here is the prob...
{ "language": "en", "url": "https://stackoverflow.com/questions/432242", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: get Image object from path name Given a path and filename how can I get the Image object: Image image = ...(filename) A: Another alternative is to use a Bitmap object (which inherits from Image) like so: Bitmap bitmap = new Bitmap(imagePath); (This works for all image formats, not just *.bmp as the name might imp...
{ "language": "en", "url": "https://stackoverflow.com/questions/432245", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: What is the best practices for directory structures in my Visual Studio project? I have this: SolutionName: Foo.sln Assembly: Foo.Bar Namespaces are: Foo.Bar.Views Foo.Bar.Model Foo.Bar.BusinessObjects Foo.Bar.Services Should the directory structure be like this? __Foo/Foo.Bar/Foo.Bar.View__ or __Foo/Bar/View__ ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432257", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Problem with Linq2Sql Many-to-Many relationship & Inserting new objects i'm trying to do a simple linq 2 sql many-to-many, insert some data, operation. here's the stock Northwind model representing a many to many: alt text http://www.iaingalloway.com/images/linq-detail.jpg Now what i'm trying to do is insert a new o...
{ "language": "en", "url": "https://stackoverflow.com/questions/432283", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Swapping information between ActionScript and Lingo I have a lingo script which runs some data processing for a Flash movie. I can call my Lingo functions from Flash by putting the following inside one of my methods: getURL("Lingo: myMethod"); and I can pass parameters from flash to lingo as follows: getURL("Lingo:...
{ "language": "en", "url": "https://stackoverflow.com/questions/432287", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: 1-1 mappings for id obfuscation I'm using sequential ids as primary keys and there are cases where I don't want those ids to be visible to users, for example I might want to avoid urls like ?invoice_id=1234 that allow users to guess how many invoices the system as a whole is issuing. I could add a database field wi...
{ "language": "en", "url": "https://stackoverflow.com/questions/432291", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: Facebook default profile box FBML I updated an application on Facebook and was trying to provide a new image to show up as a box on a user's profile when they add it. I added FBML to the default FBML box on the User Profile tab for the application, but it's still showing the old FBML from the previous application. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432292", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Which Flash SWF compiler uses compiler directives? Any existing Flash SWF compilers that can understand directives like #IF #ENDIF, etc? Some SWF Compilers: (Hopefuls) * *AS3 Compiler - Haxe *AS2 Compiler - MTASC *Adobe Flex Compiler - Mxmlc *C# to SWF Compiler - Debreuil A: I've used mtasc, and it does not s...
{ "language": "en", "url": "https://stackoverflow.com/questions/432299", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Data Modeling: What is a good relational design when a table has several foreign key constrainst to a single table? I have 2 tables: 1. Employees 2. Vouchers Employees table has a single primary key. Vouchers table has 3 foreign key constraints referencing the Employees table. The following is a sample T-SQL script...
{ "language": "en", "url": "https://stackoverflow.com/questions/432320", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: "stringWithString" vs "alloc ... initWithString ... autorelease" I've seen it claimed that the following are "pretty much equivalent": foo([NSString stringWithString:@"blah"]) # version 1 foo([[[NSString alloc] initWithString:@"blah"] autorelease]) # version 2 Are the above in fact literally...
{ "language": "en", "url": "https://stackoverflow.com/questions/432322", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: When are ASP.NET MVC Controllers garbage collected? Once a controller object is created when does it become available for garbage collection? A: Usually when no active reference to this object is detected. This is handled internally by the garbage collector and so you do not have to take care about it. So, having t...
{ "language": "en", "url": "https://stackoverflow.com/questions/432327", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: php - inserting the values of multiple checkbox selections the site i'll be refering to is http://www.iaddesignandstudio.com/offline select the quote tab if a person where to fill out this form and select more than one checkbox in either number 1 or number 3. how would i insert those selected values into a database ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432332", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Asp.Net ViewState lost with RegisterClientScriptBlock I am validating a zip code using Javascript that is generated server-side, and injected when a LinkButton is clicked. Then, I retrieve the return value by calling a server-side function when the page loads. This works nicely, but the problem is that the ViewStat...
{ "language": "en", "url": "https://stackoverflow.com/questions/432341", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to do custom-query based collection mappings in Hibernate? I have an object that is mapped to have a set of objects, very simple. However, what I really want to do is put some criteria on that mapping. Here's the current mapping: <set name="ops" inverse="true" cascade="all, delete-orphan"> <key colum...
{ "language": "en", "url": "https://stackoverflow.com/questions/432347", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you display straight quotes instead of curly quotes when using LaTeX's 'listings' package? I'm using LaTeX's "listings" package to format source code. Unfortunately I get curly quotes instead of straight quotes. Since the curly quotes don't always point in the right direction, it looks bad. How can I get stra...
{ "language": "en", "url": "https://stackoverflow.com/questions/432349", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: Does the C# switch statment need a break; Is C# true to C++, needing a break; per case:? ..Default is fall-thru - Unlike VB OR will it automatically break out of a case once found? ..Default is break - Like VB Edit: So it is a combination of both, Default is none - You have to specify either break; or goto; A: Eve...
{ "language": "en", "url": "https://stackoverflow.com/questions/432352", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Is it necessary to remember lots of Win32 Api for a C++ programmer? I always work in windows environment and most often to write the program in C/C++. Is it necessary to a Windows Application Programmer to remember Win32 APIs as more as possible?? Dazza A: Well, I can't say it would hurt, but I think that it's bet...
{ "language": "en", "url": "https://stackoverflow.com/questions/432361", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Velocity CTP2 Serious Memory Bug When you create an instance of the cachefactory and then don’t use it anymore the memory that was used during the creation of the object is not released. This will have a substantial effect on all web apps or scenarios where a cachfactory might be created multiple times. The sympto...
{ "language": "en", "url": "https://stackoverflow.com/questions/432364", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Set Custom Cursor from Resource File In my VB.net project I created a custom cursor (Window.cur). How can I assign that to the cursor without having to use the full file path to that file? VB.Net has My.Resources but it does not show the cursors that are embedded in the project. I found an example that used code li...
{ "language": "en", "url": "https://stackoverflow.com/questions/432379", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "6" }
Q: WPF - Create buttons with up and down arrows using standard buttons I want to create some up and down buttons using the standard button background but with black arrows. What is the best way to accomplish this with WPF?? Malcolm A: You can create a Polygon which represents your up and down triangles and then set th...
{ "language": "en", "url": "https://stackoverflow.com/questions/432384", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "78" }
Q: SFTP in Python? (platform independent) I'm working on a simple tool that transfers files to a hard-coded location with the password also hard-coded. I'm a python novice, but thanks to ftplib, it was easy: import ftplib info= ('someuser', 'password') #hard-coded def putfile(file, site, dir, user=(), verbose=Tru...
{ "language": "en", "url": "https://stackoverflow.com/questions/432385", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "220" }
Q: Calculate time difference between two dates, and present the answer like "2 days 3 hours ago" Are there any classes/functions written in php publicly available that will take a timestamp, and return the time passed since then in number of days, months, years etc? Basically i want the same function that generates the...
{ "language": "en", "url": "https://stackoverflow.com/questions/432398", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to create a table inner bevel in HTML/CSS? I'm designing this forum layout where I come up with a nice design to draw the forum tables, however, I'm not sure that this can be easily done in HTML/CSS. Before I continue to draw the whole layout, I need to know if this is achievable and how, otherwise, I'll have to...
{ "language": "en", "url": "https://stackoverflow.com/questions/432404", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Double-logging in Hibernate I have been using Hibernate very successfully, but today I noticed a bizarre phenomenon to do with logging. If I turn on logging (at a "debug" level) for the classes underneath org.hibernate (for instance org.hibernate.SQL or org.hibernate.impl.SessionImpl), I get twice each log line cor...
{ "language": "en", "url": "https://stackoverflow.com/questions/432413", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: fogbugz, svn integration not working. (svn hosted on wush.net) I just switched two projects over to fogbugz and so far I like it a lot. FB has a few features that just blow trac out of the water. However, I am having trouble getting FB to point back to the revisions from within the FB issues. I have set up the b...
{ "language": "en", "url": "https://stackoverflow.com/questions/432416", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: WPF - How do determine the index of the current item in a listbox from button handler i have a listbox with a data template that contains a button. When the button is clicked I want to get in the button click handler the index of the listbox item that was current?? How do I do this please? Malcolm A: More appropria...
{ "language": "en", "url": "https://stackoverflow.com/questions/432423", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Using Autofac with ASP.NET and the MVP pattern I'm trying to integrate Autofac into an exsisting ASP.NET web application. The pages follow the MVP pattern. Each page implements a View and delegate functionality to a Presenter. The View is injected into the Presenter thru the constructor. I was able to register t...
{ "language": "en", "url": "https://stackoverflow.com/questions/432425", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Distributed time synchronization and web applications I'm currently trying to build an application that inherently needs good time synchronization across the server and every client. There are alternative designs for my application that can do away with this need for synchronization, but my application quickly begin...
{ "language": "en", "url": "https://stackoverflow.com/questions/432432", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "9" }
Q: Zend_Framework- Where to Place $_GET and $_POST (HTTP Request) handling? I recently read this post which led to a series of other posts that all seem to suggest the same idea: Models do everything, the View should be able to communicate directly with the model and vice versa all while the Controller stays out of the...
{ "language": "en", "url": "https://stackoverflow.com/questions/432435", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Automatically Format Document in Visual Studio? Anyway of invoking the Edit > Advanced > Format Document" VS command automatically when switching away from a document / routinely with a timer / on entering a document? Its really irritating Ctrl+E+D'ing everytime you want to prettify your code. A: ReSharper does thi...
{ "language": "en", "url": "https://stackoverflow.com/questions/432441", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Why are there digraphs in C and C++? I learned today that there are digraphs in C99 and C++. The following is a valid program: %:include <stdio.h> %:ifndef BUFSIZE %:define BUFSIZE 512 %:endif void copy(char d<::>, const char s<::>, int len) <% while (len-- >= 0) <% d<:len:> = s<:len:>; %> %...
{ "language": "en", "url": "https://stackoverflow.com/questions/432443", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "80" }
Q: How does "do something OR DIE()" work in PHP? I'm writing a php app to access a MySQL database, and on a tutorial, it says something of the form mysql_connect($host, $user, $pass) or die("could not connect"); How does PHP know that the function failed so that it runs the die part? I guess I'm asking how the "or" pa...
{ "language": "en", "url": "https://stackoverflow.com/questions/432454", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "110" }
Q: Do you use jQuery, extJS, or other javascript libraries with Actionscript and Flex? Since Actionscript is a proper superset of javascript, it should I suppose be possible. Do you use/have you used any of the the javascript extension libraries with Actionscript/Flex/Air? A: The language itself is a proper superset,...
{ "language": "en", "url": "https://stackoverflow.com/questions/432457", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: A programmer trying to understand CANopen * *Will the CAN interface card likely be installed as a COM port? *How do I break up a message to be sent as separate frames? What about assembling data from multiple frames received into one message? Is this a valid concern? *What is the CANopen stack? If I already have...
{ "language": "en", "url": "https://stackoverflow.com/questions/432458", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Spring-ws or Axis2 or Something else for "Contract-First" approach to WS Everyone's saying "Contract-First" approach to design WS is more inclined to SOA style design. Now, if we take the available open-source frameworks available to achieve that we have Spring-ws and also Axis2(which supports both styles). I have a...
{ "language": "en", "url": "https://stackoverflow.com/questions/432461", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: WPF - Implementing a listbox that allows the items to be moved up and down This is related to my last post. i want to have up and down buttons on listbox items so that they can moved up/down ie changed its index in the list. Any ideas how I would actualy do this? Malcolm A: I would make a button that is an up butt...
{ "language": "en", "url": "https://stackoverflow.com/questions/432462", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How to achieve full-scene antialiasing on the iPhone I would like to achieve FSAA on my OpenGL ES app on the iPhone. Currently I do this by rendering the scene to a texture that is twice the width and height of the screen. I then use the nice function: void glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint...
{ "language": "en", "url": "https://stackoverflow.com/questions/432463", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Need help with a .bat script for parsing W3C logs Im trying to get a value (IP address) from a W3C logfile (kinda like a text file). This is what I have so far but with no luck: Set filename=ex%date:~-2,4%%date:~-10,2%%date:~-7,2%.log For /F "tokens=2 delims=: . " %%A in ('E:\WINDOWS\system32\LogFiles\MSFTPSVC614...
{ "language": "en", "url": "https://stackoverflow.com/questions/432464", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: UITextField focus before navigation view push? I have a UITextField set up in a UITableViewCell, for a control mimicking that in Apple's own Contacts app, when you go to edit a field. This is all mostly working fine, except for a little UI bug. The UITableView is part of a UIViewController created and loaded from a...
{ "language": "en", "url": "https://stackoverflow.com/questions/432485", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Windows XP vs Vista: NTFS Junction points Problem: I relied heavily on NTFS Junction points in Windows XP, even though they apparently were not an "official" feature of the operating system. Now MSFT has generously made NTFS Junction points an official part of Vista, but apparently they also intentionally broke them...
{ "language": "en", "url": "https://stackoverflow.com/questions/432487", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "19" }
Q: Returning a pointer to memory allocated within a function In C, something like the following would be a disaster (ie, a memory leak) because you're returning a pointer to memory that you will never be able to free: NSString* foo() { return [NSString stringWithFormat:@"%i+%i=%i", 2, 2, 2+2]; } Is that in fact tota...
{ "language": "en", "url": "https://stackoverflow.com/questions/432491", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How do you access the matched groups in a JavaScript regular expression? I want to match a portion of a string using a regular expression and then access that parenthesized substring: var myString = "something format_abc"; // I want "abc" var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString); console.log(arr);...
{ "language": "en", "url": "https://stackoverflow.com/questions/432493", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1685" }
Q: How to integrate Sharepoint Community Features I have a web site for showing different reports like these examples http://contoso.com/report.aspx?id=1 http://contoso.com/report.aspx?id=2 In each report page I want to embed a Sharepoint control that will allow me to: * *Start a discussion for each report *Add Co...
{ "language": "en", "url": "https://stackoverflow.com/questions/432499", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: System Views text in SQL Server 2005 I am looking for viewing the text of the system views and procedures in SQL Server 2005 using the object explorer or using sp_helptext. actually i am coming from the SQL Server 2000 background, where we have the feature of retreiving the code of the view and the stored procedure ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432500", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: What's the best way to save a one-to-many relationship in Linq2Sql? I'm trying to figure out the best way to save a simple one-to-many relationship in Linq2Sql. Lets assume we have the following POCO model (pseduo code btw): Person has zero to many Vechicles. class Person { IList<Vehicle> Vehicle; } class Vehic...
{ "language": "en", "url": "https://stackoverflow.com/questions/432510", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Cloud Computing need some regulations? I was involved in couple of cloud computing platform recently. First of all please note that I am not trying to criticize any platform. Cloud computing is large area but to make my point simple and understandable. Let me come up with very simple scenario and that is data stora...
{ "language": "en", "url": "https://stackoverflow.com/questions/432515", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there a O(1) way in windows api to concatenate 2 files? Is there a O(1) way in windows API to concatenate 2 files? O(1) with respect to not having to read in the entire second file and write it out to the file you want to append to. So as opposed to O(n) bytes processed. I think this should be possible at the ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432520", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Porting WPF to Cocoa (and/or vice-versa) I am in the beginning stages of creating software for a mISV-to-be. The program is a desktop application and in the long run I want to have a native version for both Windows and OS X (I have a looked at various cross-platform APIs, and none of them meet my needs). Initially t...
{ "language": "en", "url": "https://stackoverflow.com/questions/432545", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Animate a StackPanel when the property Visibility changes In WPF 3.5 (with SP1), I have simply StackPanel that I would like to animate when I change the property Visibility. I have no idea of the height of this StackPanel since its content determines its height. So when I change the property of my StackPanel to Visi...
{ "language": "en", "url": "https://stackoverflow.com/questions/432550", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: JavaScript synchronous custom prompt I need to use a custom prompt, just like the one shown in this jQuery plugin demo. The problem is, all custom prompts depend on a callback, they are asynchronized, i need them to be synchronous. I need to do something like: alert("Your name is " + myPrompt("What's your name?")); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432553", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: Running PHP after request I would like to be able to start a second script (either PHP or Python) when a page is loaded and have it continue to run after the user cancels/navigates away is this possible? A: You can send Connection:Close headers, which finishes the page for your user, but enables you to execute thin...
{ "language": "en", "url": "https://stackoverflow.com/questions/432556", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Debugging Best Practices for C++ STL/Boost with gdb Debugging with gdb, any c++ code that uses STL/boost is still a nightmare. Anyone who has used gdb with STL knows this. For example, see sample runs of some debugging sessions in code here. I am trying to reduce the pain by collecting tips. Can you please comment ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432567", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "47" }
Q: Where do I start learning about image processing and object recognition? I'm interested in writing some basic computerized object recognition application, so I figure I need some theoretical background in image processing algorithms, along with some AI for decision making capabilities. I'm a computer science graduat...
{ "language": "en", "url": "https://stackoverflow.com/questions/432569", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "36" }
Q: How to get a user token from Logonuser for a user account with no password? How can you get a user token from Logonuser for a user account with no password? In particular Logonuser will fail for accounts that do not have passwords. You can validate an account by checking for a blank password + checking for GetLastEr...
{ "language": "en", "url": "https://stackoverflow.com/questions/432570", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Naming: What would you call a rich API that wraps around a thin API I have a "thin" (SOAP) API that only knows how to set and get entities in the underlying system. I am about to to create a "rich" API that encapsulates the "thin" API and implements the logic that is required for complex operations that entail getti...
{ "language": "en", "url": "https://stackoverflow.com/questions/432580", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Is there a way to rotate text input? I have to align a textbox and some text, at about 30 degrees, like this: I would like it to work at least in IE and FF. Everything I found on the net deals with image rotation. Anyone? A: There's no good cross-browser solution. Latest Webkit supports CSS transformations, that ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432589", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: User behavior inside my web page Does anybody know if there is a way to understand what users are doing on my web page? I can see overall stats with Google Analytics but I can't really understand what users are looking at, if they are reading my content, etc. Does anybody know if there is a free or paid service that...
{ "language": "en", "url": "https://stackoverflow.com/questions/432595", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Writing custom IEnumerator with iterators How can I write a custom IEnumerator<T> implementation which needs to maintain some state and still get to use iterator blocks to simplify it? The best I can come up with is something like this: public class MyEnumerator<T> : IEnumerator<T> { private IEnumerator<T> _enum...
{ "language": "en", "url": "https://stackoverflow.com/questions/432600", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "13" }
Q: Filesystem seek performance with lots of tiny files I'm looking to build a server with lots of tiny files delivered by an XML API. It won't be doing a whole lot of iterating over directories or blocks of sequential files--we're talking lots and lots of seeks for discontinuous data. Will seek time on BSD UFS degrade ...
{ "language": "en", "url": "https://stackoverflow.com/questions/432603", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }