instruction stringlengths 0 30k ⌀ |
|---|
|xfdl|language-agnostic|ruby| |
The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.
I know how to view XFDL files using a file viewer I found <a href = "http://www.e-publishing.af.mil/viewerdownload.asp">here</a>. I can also modify and save these files by doing File:Save/Save As. I'd like, however, to modify these files on the fly. Any suggestions? Is this even possible?
Update #1: I have now successfully decoded and unziped a .xfdl into an XML file which I can then edit. Now, I am looking for a way to re-encode the modified XML file back into base64-gzip (using Ruby) |
How can I modify .xfdl files? (Update #1) |
|ruby|language-agnostic|xfdl| |
The .XFDL file extension identifies XFDL Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.
I know how to view XFDL files using a file viewer I found <a href = "http://www.e-publishing.af.mil/viewerdownload.asp">here</a>. I can also modify and save these files by doing File:Save/Save As. I'd like, however, to modify these files on the fly. Any suggestions? Is this even possible?
Update #1: I have now successfully decoded and unziped a .xfdl into an XML file which I can then edit. Now, I am looking for a way to re-encode the modified XML file back into base64-gzip (using Ruby or the command line) |
ASP.NET built in user profile, Vs old stile user class/tables |
|asp.net|profile| |
I am looking for the spiritual guidance of what is the best practice around the use of Profile feature in ASP.NET.
How do you decide what should be kept in the built in user Profile, or if you should just go and create your own DB Table and add a column for that? For example, a user has a zip code, should I save the zip code in my own table, or should I add it to the web.config xml profile and then access it via the user profile ASP.NEt mechanize?
The pros/cons I can think of are that since I don't know the profile so well, (it is a bit of a *Matrix* right now) I probably can do whatever I want if I go the table route (like, SQL to get all the users in the same zip code as the current user), I don't know ifI can do the same if I use the ASP.NET profile. |
I tested your scenario using 2 sample pages using XmlHttpRequest option.
Custom headers are available in the aspx page posted to, using XmlHttpRequest.
Create the following 2 pages. Make sure the aspx page is in a solution , so that you can run the in the debugger, set break point and inspect the Request.Header collection.
<html>
<head>
< script language="javascript">
function SendRequest()
{
var r = new XMLHttpRequest();
r.open('get', 'http://localhost/TestSite/CheckHeader.aspx');
r.setRequestHeader('X-Test', 'one');
r.setRequestHeader('X-Test', 'two');
r.send(null);
}
< script / >
</head>
<body>
<form>
<input type="button" value="Click Me" OnClick="SendRequest();" />
</form>
</body>
</html>
--------------------------------------------------------------------------------------
CheckHeader.aspx
using System;
using System.Web;
using System.Web.UI;
public partial class CheckHeader : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string value = string.Empty;
foreach (string key in Request.Headers)
value = Request.Headers[key].ToString();
}
}
Man.. This html editor sucks.. or i do not know how to use it...
|
Entity-SQL (eSQL) allows you to do things such as dynamic queries more easily than LINQ to Entities. However, if you don't have a scenario that requires eSQL, I would be hesitant to rely on it over LINQ because it will be much harder to maintain (e.g. no more compile-time checking, etc).
I believe LINQ allows you to precompile your queries as well, which might give you better performance. Rico Mariani [blogged about LINQ performance][1] a while back and discusses compiled queries.
[1]: http://blogs.msdn.com/ricom/archive/2007/07/05/dlinq-linq-to-sql-performance-part-4.aspx |
Have you tried using the DefaultValueAttribute or ShouldSerialize and Reset methods in conjunction with the constructor? I feel like one of these two methods is necessary if you're making a class that might show up on the designer surface or in a property grid.
Hmm... the markdown editor doesn't seem to be doing the right thing above. Here's the links separately because I can't seem to get them to work properly:
http://msdn.microsoft.com/en-us/library/system.componentmodel.defaultvalueattribute.aspx
http://msdn.microsoft.com/en-us/library/53b8022e`(VS.71`).aspx |
Have you tried using the [DefaultValueAttribute][1] or <a href="http://msdn.microsoft.com/en-us/library/53b8022e%28VS.71%29.aspx">ShouldSerialize and Reset methods</a> in conjunction with the constructor? I feel like one of these two methods is necessary if you're making a class that might show up on the designer surface or in a property grid.
[1]: http://msdn.microsoft.com/en-us/library/system.componentmodel.defaultvalueattribute.aspx
|
Continuations are extremely versatile and are a way to save execution state and resume it later. Here is a small example of a cooperative multithreading environment using continuations in Scheme:
(Assume that the operations enqueue and dequeue work as expected on a global queue not defined here)
(define (fork)
(display "forking\n")
(call-with-current-continuation
(lambda (cc)
(enqueue (lambda ()
(cc #f)))
(cc #t))))
(define (context-switch)
(display "context switching\n")
(call-with-current-continuation
(lambda (cc)
(enqueue
(lambda ()
(cc 'nothing)))
((dequeue)))))
(define (end-process)
(display "ending process\n")
(let ((proc (dequeue)))
(if (eq? proc 'queue-empty)
(display "all processes terminated\n")
(proc))))
This provides three verbs that a function can use - fork, context-switch, and end-process. The fork operation forks the thread and returns #t in one instance and #f in another. The context-switch operation switches between threads, and end-process terminates a thread.
Here's an example of their use:
(define (test-cs)
(display "entering test\n")
(cond
((fork) (cond
((fork) (display "process 1\n")
(context-switch)
(display "process 1 again\n"))
(else (display "process 2\n")
(end-process)
(display "you shouldn't see this (2)"))))
(else (cond ((fork) (display "process 3\n")
(display "process 3 again\n")
(context-switch))
(else (display "process 4\n")))))
(context-switch)
(display "ending process\n")
(end-process)
(display "process ended (should only see this once)\n"))
The output should be
entering test
forking
forking
process 1
context switching
forking
process 3
process 3 again
context switching
process 2
ending process
process 1 again
context switching
process 4
context switching
context switching
ending process
ending process
ending process
ending process
ending process
ending process
all processes terminated
process ended (should only see this once)
Those that have studied forking and threading in a class are often given examples similar to this. The purpose of this post is to demonstrate that with continuations you can achieve similar results within a single thread by saving and restoring its state - its continuation - manually.
P.S. - I think I remember something similar to this in On Lisp, so if you'd like to see professional code you should check the book out. |
I tested the **<wbr>**, **&#8203;** and **&shy;** techniques. All three worked well in IE 7, Firefox 3 and Chrome.
The only one that did not break the copy/paste was the **<wbr>** tag. |
You can [load sos][1] and your memory dump into Visual Studio to at least insulate you from the 'interesting' ui that WinDbg presents.
[1]: http://blogs.msdn.com/vijaysk/archive/2007/11/15/sos-your-visual-studio.aspx |
How about an evironment variable? Set developers machines with the tomcat name and production with the Weblogic name. You can even set your code to use a default one (WebLogic) in case the variable don't exist. |
perfmon from Microsoft can monitor each individual CPU. perfmon also works remote and you can monitor farious aspects of Windows.
I'm not sure if it helps to find run-away processes because the Windows scheduler dos not execute a process always on the same CPU -> on your 8 CPU machine you will see 12.5 % usage on all CPU's if one process runs away. |
Python 2.3, or 2.2 if you can live without the many modules that were added (e.g. datetime, csv, logging, optparse, zipimport), aren't using SSL, and are willing to add boilerplate for True/False.
2.4 added decorators. generator expressions, reversed(), sorted(), and the subprocess and decimal modules. Although these are all nice, it's easy to write Pythonic code without them (assuming that your project wouldn't make heavy use of them).
2.5 added with, relative imports, better 64 bit support, and quite a bit of speed. You could live without all of those easily enough.
2.6 isn't released (although it's very close), so while it might appeal to developers, it doesn't have the compatibility you're after.
Take a look at the release notes for 2.3, 2.4, 2.5, and the upcoming 2.6 (use http://www.python.org/download/releases/2.Y/highlights/ where 'Y' is the minor version).
FWIW, for SpamBayes we support 2.2 and above (2.2 requires installing the email package separately). This isn't overly taxing, but the 2.3 additions are useful enough and 2.3 old enough that we'll probably drop 2.2 before long. |
Embedding a remote Python shell in an application |
|python|networking| |
You can embed the [IPython](http://ipython.scipy.org/) shell inside of your application so that it launches the shell in the foreground. Is there a way to embed a telnet server in a python app so that you can telnet to a certain port and launch a remote IPython shell?
Any tips for redirecting the input/output streams for IPython or how to hook it up to a telnet server library or recommendations for other libraries that could be used to implement this are much appreciated. |
Individual CPU usage is available through the standard windows performance counters. You can monitor this in perfmon.
However, it won't give you the result you are looking for. Unless a thread/process has been explicitly bound to a single CPU then a run-away process will not spike one core to 100% while all the others idle. The run-away process will bounce around between all the processors. I don't know why windows schedules threads this way, presumably because there is no gain from forcing affinity and some loss due to having to handle interrupts on particular cores.
You can see this easily enough just in task manager. Watch the individual CPU graphs when you have a single compute bound process running. |
How about this? You could expand this pattern to do "years" messages, and you could put in a check for "1 day" or "1 hour" so it wouldn't say "1 days ago"...
I like the CASE statement in SQL.
drop function dbo.time_diff_message
GO
create function dbo.time_diff_message (
@input_date datetime
)
returns varchar(200)
as
begin
declare @msg varchar(200)
declare @hourdiff int
set @hourdiff = datediff(hour, @input_date, getdate())
set @msg = case when @hourdiff < 0 then ' from now' else ' ago' end
set @hourdiff = abs(@hourdiff)
set @msg = case when @hourdiff > 24 then convert(varchar, @hourdiff/24) + ' days' + @msg
else convert(varchar, @hourdiff) + ' hours' + @msg
end
return @msg
end
GO
select dbo.time_diff_message('Dec 7 1941') |
On a related, or actually, on the completely opposite note - if you're the user of the aforementioned form and want to re-enable the autocomplete functionality, use the 'remember password' bookmarklet from this [bookmarklets page](https://www.squarefree.com/bookmarklets/forms.html). It removes all 'autocomplete="off"' attributes from all forms on the page. Keep fighting the good fight!
|
Considering the comment of wcm (top value = xfd), you can calculate it like this;
function IntToExcel(n: Integer); string;
begin
Result := '';
for i := 2 down to 0 do
begin
if (n div 26^i)) > 0 then
Result := Result + Char(Ord('A')+(n div (26^i)));
n := n mod (26^i);
end;
end;
There are 26 characters in the alphabet and we have a number system just like hex or binary, just with an unusual character set (A..Z), representing positionally the powers of 26: (26^2)(26^1)(26^0). |
Considering the comment of wcm (top value = xfd), you can calculate it like this;
function IntToExcel(n: Integer); string;
begin
Result := '';
for i := 2 down to 0 do
begin
if ((n div 26^i)) > 0) or (i = 0) then
Result := Result + Char(Ord('A')+(n div (26^i)) - IIF(i>0;1;0));
n := n mod (26^i);
end;
end;
There are 26 characters in the alphabet and we have a number system just like hex or binary, just with an unusual character set (A..Z), representing positionally the powers of 26: (26^2)(26^1)(26^0). |
Here are some tips from A List Apart for cleaning user input to avoid potential problems
http://www.alistapart.com/articles/secureyourcode
|
As Jason said, I would focus more on cleaning the data on the server side. You don't really have any real control on the client side unless you're using Silverlight / Flex and even then you'd need to check the server.
That being said, Here are some tips from A List Apart you may find helpful regarding server side data cleaning.
http://www.alistapart.com/articles/secureyourcode
|
WebDev.WebServer.EXE Crashes After VS 2008 SP1 Install |
|asp.net|webserver| |
Since, for various reasons, I can't use IIS for an ASP.NET website I'm developing, I run Cassini from the command line to test the site. However, after installing Visual Studio 2008 SP1, I get a System.Net.Sockets.SocketException when I try to start up the web server. Is anyone else having this problem, and if so, how did you fix it? |
|ajax|ruby-on-rails| |
|ajax|ruby-on-rails| |
|ajax|ruby-on-rails| |
|ruby-on-rails|ajax| |
I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type certain special chars.
1. ? => causes the variable not to be found in the params object
2. (pound) => causes an invalid authenticity error
3. % => stops the div from being updated
4. & => every thing after the & is no longer passed into the variable on the server.
Is there a way to solve this?
--- code sample ---
this is the view. ( 'postbody' is a text area)
<%= observe_field 'postbody',
:update => 'preview',
:url => {:controller => 'blog', :action => 'textile_to_html'},
:frequency => 0.5,
:with => 'postbody' -%>
this is the controller that is called
def textile_to_html
text = params['postbody']
if text == nil then
@textile_to_html = '<br/>never set'
else
r = RedCloth.new text
@textile_to_html = r.to_html
end
render :layout => false
end
and this is the javascript that is created:
new Form.Element.Observer('postbody', 0.5, function(element, value) {new Ajax.Updater('preview', '/blog/textile_to_html', {asynchronous:true, evalScripts:true, parameters:'postbody=' + value + '&authenticity_token=' + encodeURIComponent('22f7ee12eac9efd418caa0fe76ae9e862025ef97')})})
|
Best place I've found for commercial toolbar icons etc is [glyfx.com][1].
[1]: http://glyfx.com |
Where can I get free Vista style developer graphics? |
|graphics| |
What is the best source of free Vista style graphics for application development? I want 32x32 and 16x16 that I can use in a Winforms application. |
|winforms|graphics| |
If you're using Visual Studio Professional or above, you've got a zip file of icons in your VS path under `Common7\VS2008ImageLibrary`. Some of the images use the Vista style. |
Why does TreeNodeCollection not implenent IEnumerable<TreeNode>? |
|.net|winforms| |
TreeNodeCollection, like some of the other control collections in System.Windows.Forms, implements IEnumerable. Is there any design reason behind this or is it just a hangover from the days before generics? |
Checking the results of a Factory in a unit test |
|unit-testing|tdd|java| |
I have developed some classes with similar behavior, they all implement the same interface. I implemented a factory that creates the appropriate object and returns the interface. I am writing a unit test for the factory. All you get back is an interface to the object.
What is the best way to test that the factory has worked correctly?
I would like to know the answer in Java, but if there is a solution that crosses languages I would like to know it. |
I'm not necessarily looking for the fastest but a nice balance, some of the server that this code is being developed for are fairly slow, the script that hashes and stores the password is taking 5-6 seconds to run, and I've narrowed it down to the hashing (if I comment the hashing out it runs, in 1-2 seconds).
It doesn't have to be the MOST secure, I'm not codding for a bank (right now) but I certainly ***WILL NOT*** store the passwords as plain-text. |
I concur with the Dragon Book reference; IMO, it is the definitive guide to compiler construction. Get ready for some hardcore theory, though.
If you want a book that is lighter on theory, [Game Scripting Mastery](http://www.amazon.com/Scripting-Mastery-Premier-Press-Development/dp/1931841578/ref=sr_1_1?ie=UTF8&s=books&qid=1217890983&sr=8-1) might be a better book for you. If you are a total newbie at compiler theory, it provides a gentler introduction. It doesn't cover more practical parsing methods (opting for non-predictive recursive descent without discussing LL or LR parsing), and as I recall, it doesn't even discuss any sort of optimization theory. Plus, instead of compiling to machine code, it compiles to a bytecode that is supposed to run on a VM that you also write.
It's still a decent read, particularly if you can pick it up for cheap on Amazon. If you only want an easy introduction into compilers, Game Scripting Mastery is not a bad way to go. If you want to go hardcore up front, then you should settle for nothing less than the Dragon Book. |
In my experience its best to keep an the info in the profile to a bare minimum, only put the essentials in there that are directly needed for authentication. Other information such as addresses should be saved in your own database by your own application logic, this approach is more extensible and maintainable. |
I think that depends on how many fields you need. To my knowledge, Profiles are essentially a long string that gets split at the given field sizes, which means that they do not scale very well if you have many fields and users.
On the other hand, they are built in, so it's an easy and standardized way, which means there is not a big learning curve and you can use it in future apps as well without needing to tweak it to a new table structure.
Rolling your own thing allows you to put it in a properly normalized database, which drastically improves performance, but you have to write pretty much all the profile managing code yourself. |
I think that depends on how many fields you need. To my knowledge, Profiles are essentially a long string that gets split at the given field sizes, which means that they do not scale very well if you have many fields and users.
On the other hand, they are built in, so it's an easy and standardized way, which means there is not a big learning curve and you can use it in future apps as well without needing to tweak it to a new table structure.
Rolling your own thing allows you to put it in a properly normalized database, which drastically improves performance, but you have to write pretty much all the profile managing code yourself.
Edit: Also, Profiles are not cached, so every access to a profile goes to the database first (it's then cached for that request, but the next request will get it from the database again)
If you're thinking about writing your own thing, maybe a [custom Profile Provider][1] gives you the best of both worlds - seamless integration, yet the custom stuff you want to do.
[1]: http://msdn.microsoft.com/en-us/library/0580x1f5(VS.80).aspx |
Forget about finding a IDE to write/run/compile assembler on Mac. But, remember mac is UNIX. See [http://asm.sourceforge.net/articles/linasm.html][1]. A decent guide (though short) to running assembler via GCC on Linux. You can mimic this. Macs use Intel chips so you want to look at Intel syntax.
[1]: http://asm.sourceforge.net/articles/linasm.html |
What type is selectedYear? A DateTime? If so then you might need to convert to a string. |
Is there a lightweight, preferable open source, formatable label control for dotnet? |
|.net| |
I have been looking for a way to utilize a simple markup language, or just plain html, when displaying text in WinForm applications. I would like to avoid embedding a webbrowser control since in most of the case I just want to highlight a single word or two in a sentence.
I have looked at using a RTFControl but I believe it's a bit heavy and I don't think the "language" used to do the formatting is easy.
Is there a simple control that allows me to display strings like:
This is a **sample string** *with* different formating.
I would be really neat if it was also possible to specify a font and/or size for the text. |
I have been looking for a way to utilize a simple markup language, or just plain html, when displaying text in WinForm applications. I would like to avoid embedding a webbrowser control since in most of the case I just want to highlight a single word or two in a sentence.
I have looked at using a RTFControl but I believe it's a bit heavy and I don't think the "language" used to do the formatting is easy.
Is there a simple control that allows me to display strings like:
This is a **sample string** *with* different formating.
I would be really neat if it was also possible to specify a font and/or size for the text.
Oh, dotnet 3.5 and WPF/xaml is not an option. |
The reason was that the value I was retrieving was from a form element, but the submit was done through a link + JQuery, not through a form button submit. |
Well, just use Html. We have used the following 'FREE' control in some of our applications, and its just beautiful.
We can define the UI in HTML Markup and then render it using this control.
<http://www.terrainformatica.com/htmlayout/main.whtm>
Initially, we started looking at HtmlToRTF converters so that we can use an RTF control to render UI, but there is far too many options to match between the two formats. And so, we ended up using the above control.
The only pre-condition is a mention of their name in your About Box. |
Request.Form only includes variables posted through a form, while Request.Params includes both posted form variables and get variables specified as URL parameters. |
Also worth remembering is that there are different types of MVP as well. Fowler have broken the pattern into two - Passive View and Supervising Controller.
When using Passive View your View typically implement a fain grained interface with properties mapping more or less directly to the underlaying UI widget. For instance you might have a ICustomerView with properties like Name and Address.
Your implementation might look something like this:
public class CustomerView : ICustomerView
{
public string Name
{
get { return txtName.Text; }
set { txtName.Text = value; }
}
}
Your Presenter class will talk to the model and "map" it to the view. This approach is called the "Passive View". The benefit is that the view is easy to test, and it is easier to move between UI platforms (Web/Win/XAML etc). The disadvantage is that you cant leverage things like databinding (which is _really_ powerfull in frameworks like WPF and Silverlight).
The second flavor of MVP is the Supervising Controller. In that case your View might have a property called Customer, which then again is databound to the UI widgets. You don't have to think about synchronizing and micro-manage the view, and the Supervising Controller can step in and help when needed, for instance with compled interaction logic.
The third "flavor" of MVP (or someone would perhaps call it a seperate pattern) is the Presentation Model (or sometimes refered to Model-View-ViewModel). Compared to the MVP you "merge" the M and the P into one class. You have your customer object which your UI widgets is data bound to, but you aslo have additional UI-spesific fields like "IsButtonEnabled", or "IsReadOnly" etc.
I think the best resource I've found to UI architecture is the series of blog posts done by Jeremy Miller over at [http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx][1]. He covered all the flavors of MVP, and show C# code to implement them.
I have also blogged about the Model-View-ViewModel pattern in the context of Silverlight over at [http://jonas.follesoe.no/YouCardRevisitedImplementingTheViewModelPattern.aspx][2].
[1]: http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx
[2]: http://jonas.follesoe.no/YouCardRevisitedImplementingTheViewModelPattern.aspx |
You can't link against wine as it's essentially a call interdictor/translator rather than a set of libraries you can hook into. If linux is important go OpenGL/SDL/OpenAL. |
Video Thumbnails in Java |
|java|video|jmf| |
I want to generate a thumbnail preview of videos in Java. I'm mostly JMF and video manipulation alienated.
- Is there an easy way to do it?
- What about codecs? Will I have to deal with it?
- Any video type is suported? (including Quicktime)
|
@Brian R. Bondy Thanks for the explicit help for how to do get the number of items. In fact I was all ready working my way to understanding that it could be done (for list or report view) with ListView_GetCountPerPage, and I would use you way to get it for for the others, though I don't need the ListView_ApproximateViewRect since I will all ready know the new size of the ListView.
@Lars Truijens I am already using the LVN_ODCACHEHINT and had though about using that to set the buffer size, however I need to read to the end of the SQL data to find the last item to get the number of rows returned from ODBC. Since that would be the best time to fill the 'end cache' I think I have to set up the number of items (and therefore fill the buffer) before we get a call to LVN_ODCACHEHIN.
I guess my real question is one of optimization for which I think Brian hinted at the answer. The amount of overhead in trashing your buffer and reallocating memory is smaller than the overhead of going out to the network and doing an ODBC read, some make the buffer fairly small and change it often rather.
Is this right?
I have done a little more playing around, and it seems that think that LVN_ODCACHEHINT generally fills the main buffer correctly, and only misses if a row (in report mode) is partially visible.
So I think the answer for the size of the cache is: The total number of displayed items, plus one row of displayed items (since in the icons views you have multiple items per row).
You would then re-read the cache with each WM_SIZE and LVN_ODCACHEHINT if either had a different begin and end item number.
|
If you're fine with calling something external, you can use [ghostscript][1] - look at the ps2ascii script included with the distribution. I'm not sure what you want from a graphical tool - a big button that you push to chose the input and output files? A preview? You might be able to use GSView, depending on what you want.
[1]: http://pages.cs.wisc.edu/~ghost/ |
If cost isn't an issue (*there is also an Express SKU*) then take a look at the 800,000 pound gorilla. WebSphere MQ (MQ Series). It runs on practically any platform and supports so many different queue managers and messaging patterns it really isn't appropriate to list them here.
- IBM's WebSphere MQ Site: [http://www-01.ibm.com/software/integration/wmq/][1]
- **The** MQ Support Forum: [http://www.mqseries.net/phpBB2/index.php][2]
[1]: http://www-01.ibm.com/software/integration/wmq/
[2]: http://www.mqseries.net/phpBB2/index.php |
Amazon's S3 will occasionally fail with errors during uploads or downloads -- generally "500: Internal Server" errors. The error rate is normally pretty low, but it can spike if the service is under heavy load. The error rate is never 0%, so even at the best of times the occasional request will fail.
Are you checking the HTTP response code in your autoupdater? If not, you should check that your download succeeded (HTTP 200) before you perform a checksum. Ideally, your app should retry failed downloads, because transient errors are an unavoidable "feature" of S3 that clients need to deal with.
It is worth noting that if your clients are getting 500 errors, you will probably not see any evidence of these in the S3 server logs. These errors seem to occur before the request reaches the service's logging component.
|
Git ignore file for Xcode projects |
|git|xcode| |
Which files should I include in .gitignore when using Git in conjunction with Xcode? |
|version-control|git|xcode| |
|mac|version-control|git|xcode| |
IMO you may be better off with ASP.Net. While you would have a slight learning curve, you'd be developing on a proven, reliable, scalable model rather than something thats in beta and will likely change before RTM.
Also, with AJAX these days its possible to get a pretty slick user experience out of ASP.Net.
|
I think you can avoid a commit hook script in this case by using the svn:eol-style property as described <a href="http://svnbook.red-bean.com/en/1.1/ch07s02.html"> here </a> in the Red Book.
This way SVN can worry about your line endings for you.
Good luck! |
A Hibernate session loads all data it reads from the DB into what they call the <i>first-level cache</i>. Once a row is loaded from the DB, any subsequent fetches for a row with the same PK will return the data from this cache. Furthermore, Hibernate gaurentees reference equality for objects with the same PK in a single Session.
From what I understand, your read-only server application never closes its Hibernate session. So when the DB gets updated by the read-write application, the Session on read-only server is unaware of the change. Effectively, your read-only application is loading an in-memory copy of the database and using that copy, which gets stale in due course.
The simplest and best course of action I can suggest is to close and open Sessions as needed. This sidesteps the whole problem. Hibernate Sessions are intended to be a window for a short-lived interaction with the DB. I agree that there is a performance gain by not reloading the object-graph again and again; but you need to measure it and convince yourself that it is worth the pains.
Another option is to close and reopen the Session periodically. This ensures that the read-only application works with data not older than a given time interval. But there definitely is a window where the read-only application works with stale data (although the design guarantees that it gets the up-to-date data eventually). This might be permissible in many applications - you need to evaluate your situation.
The third option is to use a <i>second level cache</i> implementation, and use short-lived Sessions. There are various caching packages that work with Hibernate with relative merits and demerits. |
* Is there anything in the Application section of the event log?
* Have you tried using a different port?
* Per [this thread][1], try:
>Unbind from Visual Source safe, delete the web project from the solution, rename the folder where the website is stored and then re add to the solution as an existing web site and then bind to source safe again.
There may be some incorrect info in your `.suo` or `.sln` file. You can safely rename the former, as it is user-specific (**s**olution **u**ser **o**ptions); the latter (the **s**o**l**utio**n** itself) would be a bit more of a hassle to recreate.
[1]: http://forums.asp.net/p/1309348/2575545.aspx |
|reporting-services| |
Personally, I think you should know how databases work as well as the relational model and the rhetoric behind it, including all forms of normalization (even though I rarely see a need to go beyond third normal form). The core concepts of the relational model do not change from relational database to relational database - implementation may, but so what?
Developers that don't understand the rationale behind database normalization, indexes, etc. are going to suffer if they ever work on a non-trivial project. |
Practical use of System.WeakReference |
|.net|.net-framework|garbage-collection| |
I understand what [System.WeakReference][1] does, but what I can't seem to grasp is a practical example of what it might be useful for. The class itself seems to me to be, well, a hack. It seems to me that there are other, better means of solving a problem where a WeakReference is used in examples I've seen. What's the canonical example of where you've really got to use a WeakReference? Aren't we trying to get <i>farther</i> away from this type of behavior and use of this class?
[1]: http://msdn.microsoft.com/en-us/library/ms404247.aspx |
|.net|garbage-collection| |
I've never used it but the tutorial here:
http://webby.rubyforge.org/tutorial/
Makes it look like the answer to your question is "yes". Specifically I'm looking under the "Making Changes" header on that page. |
Best Way To Determine If .NET 3.5 Is Installed |
|.net-3.5|installation|registry|.net-framework| |
I need to programatically determine whether .NET 3.5 is installed. I thought it would be easy:
<% Response.Write(Environment.Version.ToString()); %>
Which returns "2.0.50727.1434" so no such luck...
In my research I have that there are some rather obscure registry keys I can look at but I'm not sure if that is the route to go. Does anyone have any suggestions? |
|.net|.net-3.5|installation|registry| |
I've been getting into some pretty heavy use of NHibernate with ASP.NET MVC lately, and am really loving it. |
I think you should consider a different development strategy to prevent issues like this. One that seems to work best for me is to never do development directly on my master branch. Regardless of the changes I'm making, I always create a new branch for new code:
<pre>
git checkout -b topic/topic_name master
</pre>
From there, I can push out the changes to public repositories:
<pre>
git push pu topic/topic_name
</pre>
or eventually just merge it back in with my master branch:
<pre>
git checkout master && git merge topic/topic_name
</pre>
If you truly need to go back to an older point in time and set that as your master, you can rename the current branch to something else and then check out an older version to be your master:
<pre>
git branch -m master junk
git co -b master old_sha1_value
</pre> |
If you're looking to use powerful, higher level tools rather than building *everything* yourself, [this course page](http://www.antlr.org/wiki/display/CS652/CS652+Home) is a pretty good option. It's a languages course by the author of the Java parser engine ANTLR that I took last Spring. You can get the book for the course as a PDF from [the Pragmatic Programmers](http://www.pragprog.com/titles/tpantlr/the-definitive-antlr-reference).
The focus is more on parsing and language design, but by the end of the course for the final project we wrote a program that compiled a moderate subset of C. Because we used tools like ANTLR and LLVM, it was feasible to write the entire compiler in a single day.
LLVM, by the way, is simply fantastic. Many situations where you might normally compile down to assembly, you'd be much better off compiling to [LLVM's Intermediate Representation](http://llvm.org/docs/LangRef.html) instead. It's higher level, cross platform, and LLVM is quite good at generating optimized assembly from it. |
If you're looking to use powerful, higher level tools rather than building *everything* yourself, going through the projects and readings for [this course](http://www.antlr.org/wiki/display/CS652/CS652+Home) is a pretty good option. It's a languages course by the author of the Java parser engine ANTLR. You can get the book for the course as a PDF from [the Pragmatic Programmers](http://www.pragprog.com/titles/tpantlr/the-definitive-antlr-reference).
The course goes over the standard compiler compiler stuff that you'd see elsewhere: parsing, types and type checking, polymorphism, symbol tables, and code generation. Pretty much the only thing that isn't covered is optimizations. The final project is a program that [compiles a subset of C](http://www.antlr.org/wiki/display/CS652/C+subset+compiler). Because you use tools like ANTLR and LLVM, it's feasible to write the entire compiler in a single day (I have an existence proof of this, though I do mean ~24 hours). It's heavy on practical engineering using modern tools, a bit lighter on theory.
LLVM, by the way, is simply fantastic. Many situations where you might normally compile down to assembly, you'd be much better off compiling to [LLVM's Intermediate Representation](http://llvm.org/docs/LangRef.html) instead. It's higher level, cross platform, and LLVM is quite good at generating optimized assembly from it. |
[This website][1] might help you out a bit more. Also [this one][2].
I'm working from a fairly rusty memory of a statistics course, but here goes nothing:
When you're doing analysis of variance (ANOVA), you actually calculate the F statistic as the ratio from the mean-square variances "between the groups" and the mean-square variances "within the groups". The second link above seems pretty good for this calculation.
This makes the F statistic measure exactly how powerful your model is, because the "between the groups" variance is explanatory power, and "within the groups" variance is random error. High F implies a highly significant model.
As in many statistical operations, you back-determine Sig. using the F statistic. Here's where your Wikipedia information comes in slightly handy. What you want to do is - using the degrees of freedom given to you by SPSS - find the proper P value at which an [F table][3] will give you the F statistic you calculated. The P value where this happens [F(table) = F(calculated)] is the significance.
Conceptually, a lower significance value shows a very strong ability to reject the null hypothesis (which for these purposes means to determine your model has explanatory power).
Sorry to any math folks if any of this is wrong. I'll be checking back to make edits!!!
Good luck to you. Stats is fun, just maybe not this part. =)
[1]: http://people.richland.edu/james/lecture/m170/ch13-2wy.html
[2]: http://www.unesco.org/webworld/idams/advguide/Chapt4_3.htm
[3]: http://www.ento.vt.edu/~sharov/PopEcol/tables/f005.html |
You need to put
from project import Project
in `controllers/__init__.py`.
Note that when [Absolute imports][1] become the default (Python 2.7?), you will want to add a dot before the module name (to avoid collisions with a top-level model named `project`), i.e.,
from .project import Project
[1]: http://docs.python.org/whatsnew/pep-328.html |
It looks like WebOrb can do it: [WebOrb FAQ][1] (last entry)
> Can I stream Flash video to a Flex/Flash client through WebORB?
Yes, WebORB supports FLV video streaming. An example is included with the WebORB for .NET product distribution.
I haven't worked with WebOrb though, so I can't say for sure how easy it is.
[1]: http://www.themidnightcoders.com/weborb/dotnet/faq.shtm |
Interfaces and Versioning |
|design-patterns| |