instruction stringlengths 0 30k ⌀ |
|---|
|regex|visual-c++|utilities| |
Guidelines for writing a framework |
|framework| |
I'm faced with writing a framework to simplify working with a large and complex object library ([ArcObjects][1]). What guidelines would you suggest for creating a framework of this kind? Are static methods preferred? How do you handle things like logging? How do you future proof your framework code from changes that a vendor might introduce?
I think of all of the various wrappers and helpers I've seen for NHibernate, log4net, and code I've read from projects like NLog and [NetTopologySuite][2] and I see so many good approaches, but honestly I'm at a loss where to start.
BTW - I'm working in C# 3.5 but honestly it's more about recommended approach rather than language.
[1]: http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/ao_start.htm
[2]: http://code.google.com/p/nettopologysuite/ "NetTopologySuite" |
I'm faced with writing a framework to simplify working with a large and complex object library ([ArcObjects][1]). What guidelines would you suggest for creating a framework of this kind? Are static methods preferred? How do you handle things like logging? How do you future proof your framework code from changes that a vendor might introduce?
I think of all of the various wrappers and helpers I've seen for NHibernate, log4net, and code I've read from projects like NLog and [NetTopologySuite][2] and I see so many good approaches, but honestly I'm at a loss where to start.
BTW - I'm working in C# 3.5 but it's more about recommended approach rather than language.
[1]: http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/ao_start.htm
[2]: http://code.google.com/p/nettopologysuite/ "NetTopologySuite" |
|frameworks| |
What is a good barebones CMS or framework? |
|content-management-system|framework| |
I'm about to start a project for a customer who wants CMS-like functionality. They want users to be able to log in, modify a profile, and a basic forum. They also wish to be able to submit things to a front page.
Is there a framework or barebones CMS that I could expand on or tailor to my needs? I don't need anything as feature-rich or fancy as Drupal or Joomla. I would actually prefer a framework as opposed to a pre-packaged CMS.
I am confident I could code all this from scratch, but would prefer not to, as something like a framework would significantly cut down on my time spent coding, and more on design and layout. |
|framework|content-management-system| |
I'm about to start a project for a customer who wants CMS-like functionality. They want users to be able to log in, modify a profile, and a basic forum. They also wish to be able to submit things to a front page.
Is there a framework or barebones CMS that I could expand on or tailor to my needs? I don't need anything as feature-rich or fancy as Drupal or Joomla. I would actually prefer a framework as opposed to a pre-packaged CMS.
I am confident I could code all this from scratch, but would prefer not to, as something like a framework would significantly cut down on my time spent coding, and more on design and layout.
Edit: I should have been more specific. I'm looking for a Content Management System that will be run on a Debian server. So no .net preferably. |
**This answer is incomplete and flawed! It only works from TortoisSVN to Fogbugz, but not the other way around. I still need to know how to get it to work backwards from Fogbugz (like it's designed to) so that I can see the Revision number a bug is addressed in from Fogbugz while looking at a bug.**
----------
Helpful URLS
------------
[http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html][1]
[http://tortoisesvn.net/issuetracker_integration][2]
----------
## Set the "Hooks" ##
1. Go into your fogbugz account and click Extras > Configure Source Control Integration
2. Download "post-commit.bat" and the VBScript file for Subversion
3. Create a "hooks" directory in a common easily accessed location (preferably with no spaces in the file path)
4. Place a copy of the files in the hooks directories
5. Rename the files without the ".safe" extension
6. Right click on any directory.
7. Select "TortoiseSVN > Settings" (in the right click menu from the last step)
8. Select "Hook Scripts"
![TortoiseSVN > Settings > Hook Scripts][3]
1. Click "Add"
2. Set the properties thus:
* Hook Type: Post-Commit Hook
* Working Copy Path: C:\\\\Projects (or whatever your root directory for all of your projects is. If you have multiple you will need to do this step for each one.)
* Command Line To Execute: C:\\\\subversion\\\\hooks\\\\post-commit.bat (this needs to point to wherever you put your hooks directory from step 3)
* I also selected the checkbox to Wait for the script to finish...
**WARNING: Don't forget the double back-slash! "\\\\"**
Click OK...
![Adding a Hook Script][4]
*Note: the screenshot is different, follow the text for the file paths, NOT the screenshot...*
At this point it would seem you could click "Issue Tracker Integration" and select Fogbugz. nope. It just returns "There are no issue-tracker providers available".
1. Click "OK" to close the whole
settings dialogue window
Configure the Properties
------------------------
2. Once again, Right click on the root directory of the checked out
project you want to work with (you need to do this "configure the properties" step for each project you want to integrate with fogbugz)
3. Select "TortoiseSVN > Properties" (in the right click menu
from the last step)
4. Add five property value pairs by clicking "New..." and inserting the
following in "Property Name" and
"Property Value" respectively:
> bugtraq:label BugzID:
> bugtraq:message BugzID: %%BUGID%%
>
> bugtraq:number true
>
> bugtraq:url http://[your fogbugz URL
> here]/default.asp?%BUGID%
>
> bugtraq:warnifnoissue false
![properties window][5]
![adding new property][6]
15. Click "OK"
Commiting Changes and Viewing the Logs
-------------------------------------
Now when you are commiting, you can specify one bug that the commit addresses. This kind of forces you to commit after fixing each bug...
![specifying bug addressed when commiting][7]
When you view the log (Right click root of project, TortoiseSVN > show log) you can see the bug id that each checking corresponds to (1), and you can click the bug id number to be taken to fogbugz to view that bug automatically if you are looking at the actual log message. Pretty nifty!
![Bug IDs now show in log][8]
[1]: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-propertypage.html
[2]: http://tortoisesvn.net/issuetracker_integration
[3]: http://www.chomperstomp.com/img/tortoiseSVNSettings.png
[4]: http://www.chomperstomp.com/img/addHook.png
[5]: http://www.chomperstomp.com/img/tortoiseSVNProperties.png
[6]: http://www.chomperstomp.com/img/addingNewProperty.png
[7]: http://www.chomperstomp.com/img/commit.png
[8]: http://www.chomperstomp.com/img/viewLog.png |
|performance|object-oriented|comparison|interpreted|maintainability|procedural| |
|performance|oop|maintainability|interpreted|procedural| |
Using 'in' to match an attribute of Python objects in an array |
|python|array|objects|iteration| |
I don't remember whether I was dreaming or not but I seem to recall there being a function which allowed something like,
<pre><code>foo in iter_attr(array of python objects, attribute name)</code></pre>
I've looked over the docs but this kind of thing doesn't fall under any obvious listed headers |
|python|object-oriented|arrays|iteration| |
|python|arrays|iteration| |
How Does One Sum Dimmensions of an Array Specified at Runt-Time? |
|array|index|dynamic|c|c++| |
I am working on a function to establish the entropy of a distribution. It uses a copula, if any are familiar with that. I need to sum up the values in the array based on which dimensions are "cared about."
Example: Consider the following array...
Dimension 0 (across)
_ _ _ _ _ _ _ _ _ _ _ _ _
|_ 0 _|_ 0 _|_ 0 _|_ 2 _| Dimension 1
|_ 1 _|_ 0 _|_ 2 _|_ 0 _| (down)
|_ 0 _|_ 3 _|_ 0 _|_ 6 _|
|_ 0 _|_ 0 _|_ 0 _|_ 0 _|
I "care about" dimension 0 only, and "don't care" about the rest (dim 1).
Summing this array with the above specifications will
"collapse" the "stacks" of dimension 1 down to a single 4 x 1 array:
_ _ _ _ _ _ _ _ _ _ _ _ _
|_ 1 _|_ 3 _|_ 2 _|_ 8 _|
This can then be summed, or have any operation performed.
I need to do this with an array of 'n' dimensions, which could feasibly be 20. Also, I need to be able to do this, caring about certain dimensions, and collapsing the rest. I am having an especially hard time with this because I cant visualize 20 dimensions :p . If anyone could help me set up some c/c++ code to do this, I would be very very grateful.
Thanks in advance |
How Does One Sum Dimmensions of an Array Specified at Runtime? |
How Does One Sum Dimmensions of an Array Specified at Runt-Time? |
I am working on a function to establish the entropy of a distribution. It uses a copula, if any are familiar with that. I need to sum up the values in the array based on which dimensions are "cared about."
Example: Consider the following array...
Dimension 0 (across)
_ _ _ _ _ _ _ _ _ _ _ _ _
|_ 0 _|_ 0 _|_ 0 _|_ 2 _| Dimension 1
|_ 1 _|_ 0 _|_ 2 _|_ 0 _| (down)
|_ 0 _|_ 3 _|_ 0 _|_ 6 _|
|_ 0 _|_ 0 _|_ 0 _|_ 0 _|
I "care about" dimension 0 only, and "don't care" about the rest (dim 1).
Summing this array with the above specifications will
"collapse" the "stacks" of dimension 1 down to a single 4 x 1 array:
_ _ _ _ _ _ _ _ _ _ _ _ _
|_ 1 _|_ 3 _|_ 2 _|_ 8 _|
This can then be summed, or have any operation performed.
I need to do this with an array of 'n' dimensions, which could feasibly be 20. Also, I need to be able to do this, caring about certain dimensions, and collapsing the rest. I am having an especially hard time with this because I cant visualize 20 dimensions :p . If anyone could help me set up some c/c++ code to collapse/sum, I would be very very grateful.
Thanks in advance |
Because of the way the [Box-Modell][1] is defined and implemented I don't think there is a css-only solution to this problem. (Apart from what [Matthew][2] described: using percentage for the padding as well, e.g. width: 94%; padding: 0 3%;)
You could however build some Javascript-Code to calculate the width dynmically on page-load... hm, and that value would of course also have to be updated every time the browserwindow is resized.
Interesting by-product of some testing I've done: Firefox **does** set the width of an input field to 100% if additionally to `width: 100%;` you also set max-width to 100%. This doesn't work in Opera 9.5 or IE 7 though (haven't tested older versions).
[1]: http://reference.sitepoint.com/css/boxmodel
[2]: http://stackoverflow.com/questions/52563/css-textbox-to-fill-parent-container#52896 |
Don't know if this is an option, but it would work very similar to Zend's pdf library, but you don't need to load a bunch of extra code (the zend framework). It just extends FPDF.
[http://www.setasign.de/products/pdf-php-solutions/fpdi/][1]
Here you can basically do the same thing. Load the PDF, write over top of it, and then save to a new PDF. In FPDI you basically insert the PDF as an image so you can put whatever you want over it.
But again, this uses FPDF, so if you don't want to use that, then it won't work.
[1]: http://www.setasign.de/products/pdf-php-solutions/fpdi/ |
It might be something really simple, believe it or not I coded exactly the same thing today, i think the issue might be that the content disposition doesnt tell the browser its an attachment and therefore able to be saved.
<pre><code>
Response.AddHeader("Content-Disposition", "attachment;filename=myfile.doc");
</code></pre>
failing that i've included my code below as I know that works over https://
<pre>
<code>
private void ReadFile(string URL)
{
try
{
string uristring = URL;
WebRequest myReq = WebRequest.Create(uristring);
NetworkCredential netCredential = new NetworkCredential(ConfigurationManager.AppSettings["Username"].ToString(),
ConfigurationManager.AppSettings["Password"].ToString(),
ConfigurationManager.AppSettings["Domain"].ToString());
myReq.Credentials = netCredential;
StringBuilder strSource = new StringBuilder("");
//get the stream of data
string contentType = "";
MemoryStream ms;
// Send a request to download the pdf document and then get the response
using (HttpWebResponse response = (HttpWebResponse)myReq.GetResponse())
{
contentType = response.ContentType;
// Get the stream from the server
using (Stream stream = response.GetResponseStream())
{
// Use the ReadFully method from the link above:
byte[] data = ReadFully(stream, response.ContentLength);
// Return the memory stream.
ms = new MemoryStream(data);
}
}
Response.Clear();
Response.ContentType = contentType;
Response.AddHeader("Content-Disposition", "attachment;");
// Write the memory stream containing the pdf file directly to the Response object that gets sent to the client
ms.WriteTo(Response.OutputStream);
}
catch (Exception ex)
{
throw new Exception("Error in ReadFile", ex);
}
}
</code>
</pre> |
I read the [book][1] suggested by Thomas and it's really worth reading, although not very up-to-date.
[1]: http://www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612/ref=pd_bbs_1?ie=UTF8&s=books&qid=1218461741&sr=8-1 |
I have used an httpmodule for url rewriting from [www.urlrewriting.net][1] with great success (albeit I believe a much earlier, simpler version)
If you have very few actual rewriting rules then url mappings built in to .NET 2.0 are probably an easier option, there are a few write ups of these on the web, the [4guysfromrolla][2] one seems fairly exhaustive but as you can see they don't support regular expression mappings are are as such rendered fairly useless in a dynamic environment (assuming "smith" in your example is not a special case then these would be of no use)
[1]: http://www.urlrewriting.net/
[2]: https://web.archive.org/web/20210513223749/http://aspnet.4guysfromrolla.com/articles/011007-1.aspx |
Although I don't have personal experience, a few friends of mine did Eclipse RCP development, and they used the book "[Eclipse Rich Client Platform: Designing, Coding, and Packaging Java(TM) Applications][1]". They seemed to like it a lot, and I looked it at myself, and it seemed useful. If I was going to do RCP development on Eclipse, I would probably get this book.
[1]: http://www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612/ref=pd_bbs_1?ie=UTF8&s=books&qid=1218461741&sr=8-1 |
Although I don't have personal experience, a few friends of mine did Eclipse RCP development, and they used the book "[Eclipse Rich Client Platform: Designing, Coding, and Packaging Java(TM) Applications][1]". They seemed to like it a lot, and I looked it at myself, and it seemed useful. If I was going to do RCP development on Eclipse, I would probably get this book.
To clarify - this book is geared toward Eclipse 3.1, and since I haven't done any RCP development of my own, I'm not sure how much things have changed.
[1]: http://www.amazon.com/Eclipse-Rich-Client-Platform-Applications/dp/0321334612/ref=pd_bbs_1?ie=UTF8&s=books&qid=1218461741&sr=8-1 |
Have you thought about [Java Web Start][1]? [Here][2] is a tutorial specifically for deploying an SWT application with Java Web Start.
[1]: http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp
[2]: http://www.ibm.com/developerworks/opensource/library/os-jws/ |
According to the .Net Framwork, the [MouseDown Event Handler on a TextBox][1] is supported. What happens when you try to run the code?
[1]: http://www.csharpfriends.com/quickstart/aspplus/samples/classbrowser/cs/classbrowser.aspx?assembly=System.Windows.Forms,%20Version=1.0.5000.0,%20Culture=neutral,%20PublicKeyToken=b77a5c561934e089&namespace=System.Windows.Forms&class=TextBox |
What I usually do to debug databindings, is add a converter where I can set a breakpoint in VS.NET..
so the Binding would be something like this:
<pre><code>{Binding ElementName=PART_Track, Path=Height, Mode=OneWay, Converter={StaticResources DebugConverter}}
</code></pre>
Then the converter can be an empty implementation of an IValueConverter, set a breakpoint in the Convert method and see what the Height is being set to...
Don't forget to add your converter to your Resources...
Perhaps the value is NaN ? |
<a href = "http://tryruby.hobix.com/">Try Ruby (In Your Browser)</a> |
I'd shoot for XHTML Transitional 1.0. There are still a few nuances out there that don't like XHTML strict, and most editors I've seen now will give you the proper nudges to make sure that things are done right. |
Anything that renders your page is will do so regardless of which popular standard you use. XHTML is stricter and probably "better" but I can't see what advantages you will get with one standard over another. |
Personally, I prefer XHTML 1.0 Transitional.
XHTML is XML based, so it allows easier parsing and you can also use the XML Components of most IDEs to programatically query and insert stuff.
Transitional is not as strict as strict, which makes it relatively easy to work with, compared to strict which can often be a PITA. [Comparison between Transistional and Strict][1]
1.0 is "more compatible" than 1.1 and 1.1 seems to be still under some sort of development.
[1]: http://brainstormsandraves.com/archives/2003/10/21/xhtml/ |
Dillie-O is right on with his answer of XHTML 1.0 Transitional but I would suggest shooting for XHTML 1.0 Strict and only falling back on Transitional if there's some piece of functionality you absolutely need that Strict is not allowing. |
I make heavy use of this tool: [http://www.dswsoft.com/sqlbalance.php][1], Unfortunately; its windows only... but works like a charm to move databases around, data or no data, merge or compare.
/mp
[1]: http://www.dswsoft.com/sqlbalance.php |
Have you tried the ADO driver for SQLite?
There is a great quick start guide (thanks to another thread here) that you can get here:
<http://www.mikeduncan.com/sqlite-on-dotnet-in-3-mins> |
A simple trunk branch contains the most current code, then cut a branch whenever we go live. This seems to work pretty effectively. You can easily go to the previous branch whenever the current branch that you cut for the live system fails. Also, it is easy to fix bugs on the branch that is currently live, and since the branch effectively dies when you cut a new one, there is only ever 1 real branch you need to work on (and then merge fixes from there to the live branch). |
Dump your schema into a file and add it to source control. Then a simple diff will show you what changed. |
HTML version choice |
|html|xml|xhtml| |
When developing a new web based application which version of html should you aim for? |
When developing a new web based application which version of html should you aim for?
EDIT:
cool I was just attempting to get a feel from others I tend to use XHTML 1.0 Strict in my own work and Transitional when others are involved in the content creation.
I marked the first XHTML 1.0 Transitional post as the 'correct answer' but believe strongly that all the answers given at that point where equally valid. |
You could try signal averaging, i.e. for each point, average the value with the surrounding 3 or more points. If the noise blips are huge, then even this may not help.
I realise that this was language agnostic, but guessing that you are using LabView, there are lots of pre-packaged signal processing VIs that you can use to do smoothing and noise reduction. The [NI forums][1] are a great place to get more specialised help on this sort of thing.
[1]: http://forums.ni.com/ |
|frameworks|content-management-system| |
Microsoft .Net framework 3.5 SP1 Setup Fails |
|.net|framework|installation| |
On my Vista machine I cannot install the .Net framework 3.5 SP1. Setup ends few moments after ending the download of the required files, stating in the log that:
[08/26/08,09:46:11] Microsoft .NET Framework 2.0SP1 (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 2.0SP1 (CBS). MSI returned error code 1
[08/26/08,09:46:13] WapUI: [2] DepCheck indicates Microsoft .NET Framework 2.0SP1 (CBS) is not installed.
First thing I did was trying to install 2.0 SP1, but this time setup states that the "product is not supported on Vista system". Uhm.
The real big problem is that this setup fails also when it is called by the Visual Studio 2008 SP1.
Now, I searched the net for this, but I'm not finding a real solution... Any idea / hint? Did anybody have problems during SP1 install?
Thanks
|
|.net|frameworks|installation| |
How Popular is the Seam Framework |
|java|framework|jboss|seam| |
I'm using JBoss Seam Framework, but it's seems to me isn't very popular among java developers.
I want to know how many java programmers here are using it, and in what kind of projects.
Is as good as django, or RoR? |
|java|frameworks|jboss|seam| |
Determining if an assembly is part of the .net framework |
|.net|framework|assembly|reflection| |
How can I tell from the assemblyName, or Assembly class (or others like it), whether an assembly is part of the .net framework (ie System.windows.Forms)?
So far I've considered the PublicKeyToken, and CodeBase properties, but these are not always the same for the whole framework. |
|.net|framework|reflection|assembly| |
How can I tell from the assemblyName, or Assembly class (or others like it), whether an assembly is part of the .net framework (ie System.windows.Forms)?
So far I've considered the PublicKeyToken, and CodeBase properties, but these are not always the same for the whole framework.
----------
**Edit:** The reason I want this info is to get a list of assemblies that my exe is using that need to be on client machines, so I can package the correct files in a setup file without using the Visual Studio setup system. The problem is, I don't want to pick up any Framework assemblies, and I want it to be an automatic process that is easy to roll out whenever a major update is finished.
The ultimate solution would be that there is an IsFramework property....:) |
|.net|frameworks|reflection|assembly| |
You could do this with jQuery but it may make additional maintenance a nightmare. I would recommend against doing this / screen scraping because if the source ever changes so does your work around. |
Another option, related to Kevin's, is use __FILE__, but instead replace the php file name from within it:
<?php
$docRoot = str_replace($_SERVER['SCRIPT_NAME'], '', __FILE__);
require_once($docRoot . '/lib/include.php');
?>
I've been using this for a while. The only problem is sometimes you don't have $_SERVER['SCRIPT_NAME'], but sometimes there is another variable similar. |
HTML meta keyword/description element, useful or not? |
|html|seo| |
Does filling out HTML meta description/keyword tags matter for SEO? |
You might be able to fake it using javascript. You could either use AJAX to load the page, then insert the HTML, or load "url.asp" in a hidden iframe and copy the HTML from there.
One downside (or maybe this is what you want) is that the pages aren't completely independent, so CSS rules from the outer page will affect the embedded page. |
I would suggest you start by downloading the SDK:
<https://www.paypal.com/IntegrationCenter/ic_sdk-resource.html>
The SDK includes the following:
- Client libraries that call PayPal APIs
- API documentation for SDK components
- Sample code for Website Payments Pro and various administrative APIs
- Testing console that can verify connectivity to PayPal and submit API calls
|
I would suggest you start by downloading the SDK:
<https://www.paypal.com/IntegrationCenter/ic_sdk-resource.html>
The SDK includes the following:
- Client libraries that call PayPal APIs
- API documentation for SDK components
- Sample code for Website Payments Pro and various administrative APIs
- Testing console that can verify connectivity to PayPal and submit API calls
You may also want to take a look at [Encore Systems .NET* Class Library for PayPal SOAP API][1]
[1]: http://paypal.encoresystems.net/ |
Can I depend on the values of GetHashCode() to be consistant? |
|hash|c#| |
Is the return value of GetHashCode() guaranteed to be consistent assuming the same string value is being used? (C#/ASP.NET)
I uploaded my code to a server today and to my surprise I had to reindex some data because my server (win2008 64-bit) was returning different values compared to my desktop computer. |
Can I depend on the values of GetHashCode() to be consistent? |
|c#|hash| |
Like all good answers to architecture and programming questions, the answer is "it depends".
It depends on how unique your data access and object design needs are. It may also depend on how you plan on supporting your application in the long term. Finally, it greatly depends on the skill level of your developers.
There isn't a one-size-fits-all answer to this question, but generally, if your main focus is on cranking out software that provides some business value, pick out an existing framework and run with it. Don't spend your cycles building something that won't immediately drive business profits (i.e. increases revenues and/or decreases costs).
For example, one of my organization's projects is core to the operations of the company, needs to be developed and deployed as soon as possible, and will have a long life. For these reasons, we picked CSLA with some help from Enterprise Library. We could have picked other frameworks, but the important thing is that we picked a framework that seemed like it would fit well with our application and our developer skillset and we ran with it.
It gave us a good headstart and a community from which we can get support. We immediately started with functionality that provided business value and were not banging our heads against the wall trying to build a framework.
We are also in the position where we can hire people in the future who have most likely had exposure to our framework, giving them a really good headstart. This should reduce long-term support costs.
Are there things we don't use and overhead that we may not need? Perhaps. But, I'll trade that all day long for delivering business value in code early and often.
|
Visual Studio 2005 crashes on start-up |
|visual-studio|crash|intellisense| |
In my work environment, Visual Studio currently crashes every time I start our main project unless I delete the .suo (solution options) and .ncb (C++ Intellisense symbols) files.
Obviously, I've found a workaround. Is there a more permanent solution than this? |
I think it'll take a huge buy-in from a site that millions of people use; for example, [MySpace is soon supporting OpenID][1], so now the number of users that OpenID supports has just jumped by a huge amount. If more of the high activity sites on the net follow this lead, there you go!
[1]: http://developer.myspace.com/Community/blogs/devteam/archive/2008/07/24/openid-coming-to-a-myspace-profile-near-you.aspx |
From [MSDN][1]:
> The OnCreated event is raised as soon
> as a file is created. If a file is
> being copied or transferred into a
> watched directory, the OnCreated event
> will be raised immediately, followed
> by one or more OnChanged events.
Your FileSystemWatcher could be modified so that it doesn't do its read/rename during the "OnCreated" event, but rather:
1. Spanws a thread that polls the file status until it is not locked (using a FileInfo object)
2. Calls back into the service to process the file as soon as it determines the file is no longer locked and is ready to go
[1]: http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.created.aspx |
I think we need to see OpenID offered as a login method more consumer oriented websites. There are a lot of big consumer sites that can be used as OpenID providers, but the only place I recall seeing OpenID available as a login before Stackoverflow is to comment on Blogger. Being a provider is great and all, but it's pretty much invisible to consumers. Seeing an actual place to use OpenID, on the other hand, will probably garner somewhat more interest. |
No, it's certainly not a good practice. 2XX status codes mean (among other things) that the **request is valid**. Which is just the contrary to raising a HttpRequestValidationException.
I don't know how to make IE behave correctly, sadly. A slightly better way than to send a 200 would be to redirect it to an error page, but still far from perfect.
|
Does your load balancer supports sticky sessions? With this on, the balancer will route the same IP to the same server over and over within a certain time window. This way, all requests (AJAX or otherwise) from one client would always hit the same server in the cluster/farm. |
I've already got something like MyXAML - my screens are loaded from xml files already. It suffers the same problem as MyXAML which is that you still have to position the controls with pixel positions whereas I want something like html with the automatic flow and tables and such.
I think TableLayoutPanel might be what I'm looking for. |
If it's a hardware load balancer, you shouldn't have an issue, because all that is known there is the request URL, in which the server would compile the requested page and serve it.
the only issue i can think of that you might have is with session and view state. |
Sum Dimensions of an Array Specified at Runtime? |
How Does One Sum Dimmensions of an Array Specified at Runt-Time? |
How Does One Sum Dimmensions of an Array Specified at Run-Time? |
|c++|c|arrays|index|microsoft-dynamics| |
I am working on a function to establish the entropy of a distribution. It uses a copula, if any are familiar with that. I need to sum up the values in the array based on which dimensions are "cared about."
Example: Consider the following example...
Dimension 0 (across)
_ _ _ _ _ _ _ _ _ _ _ _ _
|_ 0 _|_ 0 _|_ 0 _|_ 2 _| Dimension 1
|_ 1 _|_ 0 _|_ 2 _|_ 0 _| (down)
|_ 0 _|_ 3 _|_ 0 _|_ 6 _|
|_ 0 _|_ 0 _|_ 0 _|_ 0 _|
I "care about" dimension 0 only, and "don't care" about the rest (dim 1).
Summing this array with the above specifications will
"collapse" the "stacks" of dimension 1 down to a single 4 x 1 array:
_ _ _ _ _ _ _ _ _ _ _ _ _
|_ 1 _|_ 3 _|_ 2 _|_ 8 _|
This can then be summed, or have any operation performed.
I need to do this with an array of 'n' dimensions, which could feasibly be 20. Also, I need to be able to do this, caring about certain dimensions, and collapsing the rest. I am having an especially hard time with this because I cant visualize 20 dimensions :p . If anyone could help me set up some c/c++ code to collapse/sum, I would be very very grateful.
Thanks in advance |
Using object property as default for method property |
|php|oo|parameters|methods|methoddefaults| |
I'm trying to do this (which produces an unexpected T_VARIABLE error):
public function createShipment($startZip, $endZip, $weight = $this->getDefaultWeight()){}
I don't want to put a magic number in there for weight, since the object I am using has a "defaultWeight" parameter that all new shipments get if you don't specify a weight. I can't put the defaultWeight in the shipment itself, because it changes from shipment group to shipment group. Is there a better way to do it than the following?
public function createShipment($startZip, $endZip, weight = 0){
if($weight <= 0){
$weight = $this->getDefaultWeight();
}
} |
|php|object-oriented|methods|parameters|method-defaults| |
|php|oop|parameters|methods|method-defaults| |
pass by reference or pass by value? |
|language-agnostic|oo|oop|byvalue|byreference|parameters| |