instruction stringlengths 0 30k ⌀ |
|---|
|monitoring|msmq| |
Is there anything which can help with msmq monitoring? I'd like to get some event/monit when a message appears in queue and the same on leave. |
Have you considered building your data ahead of time? In otherwords are there groups of data that are requested again and again? If so have them ready before the user asks. I'm not exactly talking about caching, but I think that is part of the equation.
It might be worth it to take a step back from the code and examine the usage patterns of the system. For example, if you are showing people monthly inventory or sales information do they look at it at only at the end of the month? If so just build the data on the last day and store it. If they look at it daily, maybe try building each previous days results and storing the results and avoid the calculation. I guess ultimately I am pushing you in to a [Dynamic Programming](http://en.wikipedia.org/wiki/Dynamic_programming) solution; if you know an answer don't solve it again. |
Joseph's code is good but, if you don't want or need to use a VBA function, try this.
Assuming that the value of n is in cell A2
Use this function:
- =MID(ADDRESS(1,A2),2,LEN(ADDRESS(1,A2))-3) |
As Webjedi says, metrics are your friend.
Also look at your stack and see where there are opportunities for caching - then employ mercilessly wherever possible! |
As I said in [another question][1]:
> **Use a profiler.** Yes they cost money, and using them can occasionally be a bit awkward, but they do provide you with a great deal more real evidence rather than guesswork.
> Human beings are universally bad at guessing where performance bottlenecks are. It just seems to be something our brains aren't build to do very well. It may seem obvious, you may have great ideas about what the problem is, but the real world often turns out to be doing something different. And optimising the wrong part of code means, at best, lots of work for minimal benefit. More often it makes things slower, and sometimes it breaks things entirely. So before you make any changes for the sake of optimisation, you should always have real evidence from a profiler or other accurate tool.
[1]: http://stackoverflow.com/questions/12927/if-you-have-a-java-application-that-is-consuming-cpu-when-it-isnt-doing-anythin#19767 |
How to configure a Java Socket to fail-fast on disconnect |
|java|socket|networking|exception| |
I have a listening port on my server that I'm connecting to using a Java class and the Socket interface, i.e.
Socket mySocket = new Socket(host,port);
I then grab an OutputStream, decorate with a PrintWriter in autoflush mode and I'm laughing - except if the listening port closes. Then I get
tcp4 0 0 *.9999 *.* LISTEN
tcp 0 0 127.0.0.1.45737 127.0.0.1.9999 CLOSE_WAIT
and I can't seem to detect the problem in the program - I've tried using the isConnected() Socket method but it doesn't seem to know that the connection is closed.
I want to be aware of the problem the next time I try and write to the Socket so that I can try and reconnect and report the issue.
Any advice please?
Thanks all
|
Configure a Java Socket to fail-fast on disconnect? |
|java|exception|sockets|networking| |
I'd be curious if the System.DirectoryServices.AccountManagement is fully managed. I've used System.DirectoryServices.ActiveDirectory which is a wrapper for COM Interop which has led to many headaches... |
I found Bruce Eckel's Thinking in Java to be very helpful. He compares the different collections very well. I used to keep a diagram he published showing the inheritance heirachy on my cube wall as a quick reference. One thing I suggest you do is keep in mind thread safety. Performance usually means not thread safe. |
From the testing Bible:
[Testing Computer Software][1]
![Testing Computer Software][2]
p. 31: "Testing [...] accounts for 45% of initial development of a product." A good rule of thumb is thus to allocate about half of your total effort to testing during initial development.
[1]: http://www.amazon.com/gp/product/0471358460?ie=UTF8&tag=compandsmarbu-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=0471358460
[2]: https://images-na.ssl-images-amazon.com/images/I/51EZ3VV7STL._SL160_.jpg |
The July release of [TFS 2008 PowerTools][1] adds an "Alert Editor" to Team Explorer. Adding Alerts is a breeze. It has a query tool similar to the Query tool.
[1]: http://msdn.microsoft.com/en-us/tfs2008/bb980963.aspx |
I'm not sure a singleton class is absolutely necessary, do you absolutely need global access at all times? Is the list large?
I assume you will have a refresh method on the singleton class for when the properties need to change and also that you have some way of notifying the singleton to update when the list changes.
Both solutions are viable. I think LINQ will populate the collection faster in the constructor (but not noticeably faster). Traditional collection based approaches are fine. Personally, I would choose the LINQ version if only because it is new tech and I like to use it. Assuming your deployment environment has .NET 3.5...
Do you have a method on your webservice for getting branches by Id? That would be the third option if the branch info is needed infrequently. |
How Much Time Should be Allotted for Testing & Bug Fixing |
|project-management|estimation| |
Every time I have to estimate time for a project (or review someone else's estimate), time is allotted for testing/bug fixing that will be done between the alpha and production releases. I know very well that estimating so far into the future regarding a problem-set of unknown size is not a good recipe for a successful estimate. However for a variety of reasons, a defined number of hours invariably gets assigned at the outset to this segment of work. And the farther off this initial estimate is from the real, final value, the more grief those involved with the debugging will have to take later on when they go "over" the estimate.
So my question is: what is the best strategy you have seen with regards to making estimates like this? A flat percentage of the overall dev estimate? Set number of hours (with the expectation that it will go up)? Something else? |
Every time I have to estimate time for a project (or review someone else's estimate), time is allotted for testing/bug fixing that will be done between the alpha and production releases. I know very well that estimating so far into the future regarding a problem-set of unknown size is not a good recipe for a successful estimate. However for a variety of reasons, a defined number of hours invariably gets assigned at the outset to this segment of work. And the farther off this initial estimate is from the real, final value, the more grief those involved with the debugging will have to take later on when they go "over" the estimate.
So my question is: what is the best strategy you have seen with regards to making estimates like this? A flat percentage of the overall dev estimate? Set number of hours (with the expectation that it will go up)? Something else?
Something else to consider: how would you answer this differently if the client is responsible for testing (as opposed to internal QA) and you have to assign an amount of time for responding to the bugs that they may or may not find (so you need to figure out time estimates for bug fixing but not for testing) |
Here's one that works - I don't know if it's more efficient, and it's SQL Server 2005+
with scores as (
select 1 userid, 100 points
union select 2, 75
union select 3, 50
union select 4, 50
union select 5, 50
union select 6, 25
),
results as (
select userid, points, RANK() over (order by points desc) as ranking
from scores
)
select userid, points, ranking
from results
where ranking <= 3
Obviously the first "with" is to set up the values, so you can test the second with, and final select work - you could start at "with results as..." if you were querying against an existing table. |
I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false.
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/>
</httpModules>
</system.web>
</location>
Now any virtual directories will not inherit the settings in this location section. |
I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false.
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/>
</httpModules>
</system.web>
</location>
Now any virtual directories will not inherit the settings in this location section.
@GateKiller This isn't another website, its a virtual directory so inheritance does occur.
@petrich I've had hit and miss results using <remove />. I have to remember to add it to every virtual directory which is a pain. |
I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false.
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/>
</httpModules>
</system.web>
</location>
Now any virtual directories will not inherit the settings in this location section.
@GateKiller This isn't another website, its a virtual directory so inheritance does occur.
@petrich I've had hit and miss results using `<remove />`. I have to remember to add it to every virtual directory which is a pain. |
var result = from o in objList where intList.Contains(o.ID) select o
The other code doesn't work. |
var result = from o in objList where intList.Contains(o.ID) select o
/EDIT: bogus. |
Filter linq list on property value |
|linq|linq-to-objects|.net| |
I have a `List<int>` and a `List<customObject>`. The customObject class has an ID property. How can I get a `List<customObject>` containing only the objects where the ID property is in the `List<int>` using LINQ?
|
I've used SQL Reporting Services for this purpose. You can design a report template in Visual Studio or generate the XML for the report on the fly in code. You can then have SSRS export the report to about 10 different formats and send to the client including pdf, excel, html, etc. You can also write your own plugin to export to your own format.
Crystal Reports has a similar product thats more expensive but has a better report designer. |
public static final String IPV4_REGEX = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
public static final String IPV6_HEX4DECCOMPRESSED_REGEX = "\\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) ::((?:[0-9A-Fa-f]{1,4}:)*)(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
public static final String IPV6_6HEX4DEC_REGEX = "\\A((?:[0-9A-Fa-f]{1,4}:){6,6})(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
public static final String IPV6_HEXCOMPRESSED_REGEX = "\\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)\\z";
public static final String IPV6_REGEX = "\\A(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\\z";
Got these from some blog. Someone good w/ regexes should be able to come up with a single regex for all IPv6 address types. Actually, I guess you could have a single regex that matches both IPv4 and IPv6. |
javascript can match regex:
emailAddress.match( / some_regex /);
Here's an RFC22 regular expression for emails:
`^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(((?!-)[a-zA-Z\d\-]+(?<!-)\.)+[a-zA-Z]{2,}|\[(((?(?<!\[)\.)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d\-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\\\[\]]|\\[\x01-\x7f])+)\])(?(angle)>)$` |
var q = from x in list
group x by x.Bar into g
select g
|
var q = from x in list
group x by x.Bar into g
select g;
foreach (var group in q)
{
Console.WriteLine("Group " + group.Key);
foreach (var item in group)
{
Console.WriteLine(item.Bar);
}
}
|
Do you have
<pre>
(setq-default indent-tabs-mode nil)
</pre>
in your <tt>.emacs</tt>? It works fine for me in emacs 23.0.60.1 when I do that. js2-mode uses the standard emacs function <tt>indent-to</tt>, which respects <tt>indent-tabs-mode</tt>, to do its indenting. |
How long are your strings? Unless you choose an int representation that's longer than the string, collisions will always be possible no matter what conversion you're using. So if you're using a 32 bit integer, you can only uniquely represent strings of up to 4 bytes. |
Chrome has a bug where it [obeys alternate stylesheets][1]. Do you have an alternate stylesheet that makes links red?
[1]: http://jeremyjarratt.com/2008/09/03/google-chrome-obeys-alternate-css/ |
Error in TFS Merge |
|teamfoundationserver|merge| |
I agree with [this comment](http://stackoverflow.com/questions/44905/c-switch-statement-limitations-why#44941) that using a table driven approach is often better.
In C# 1.0 this was not possible because it didn't have generics and anonymous delegates.
New versions of C# have the scaffolding to make this work. Having a notation for object literals is also helps. |
I'm a noob myself, but you can use `setf` and `nth` to do number 2 and 3.
(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
No clue about number one. |
I'm a noob myself, but you can use `setf` and `nth` to do number 2 and 3.
(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
No clue about number one.
`EDIT:` For number one you can use [the `position` function](http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/html/cltl/clm/node145.html). Ha.
let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101)
(position 101 myList))
4
I found these all [in this index](http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/html/cltl/clm/index.html). |
I'm a noob myself, but you can use `setf` and `nth` to do number 2 and 3.
(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
No clue about number one.
`EDIT:` For number one you can use [the `position` function](http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/html/cltl/clm/node145.html). Ha.
(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101)
(list myList (position 101 myList)))
((1 2 3 4 101 6) 4)
I found these all [in this index](http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/html/cltl/clm/index.html). |
If your asking what I think your asking, you can find them [Here][1]. Page 476 and on.
It's written around optimization techniques for python, It's mostly Big-O notation of time efficiencies not much memory.
Hope it still helps.
Brian Gianforcaro
[1]: http://books.google.com/books?id=vpTAq4dnmuAC&pg=RA1-PA476&lpg=RA1-PA476&dq=Big-O+of+Python+data+structures&source=web&ots=AOM5B5D7yA&sig=deLGb6VrftTpnNYN6fILVbiirXM&hl=en&sa=X&oi=book_result&resnum=7&ct=result#PRA1-PA479,M1 |
You might want to take a look at the [March/April issue](http://www.acmqueue.org/modules.php?name=Content&pa=list_pages_issues&issue_id=48) of ACM's [*Queue*](http://www.acmqueue.org) magazine, which has several articles on GPUs and how best to use them (besides doing graphics, of course). |
Please don't vote up Professor Internet's answer -- he posted a few times with fake/misleading information. That one just seems to have slipped through the cracks. It is certainly not industry standard.
There are two common ways to do this: use JNI to set urgency hints on the taskbar's window, and create a notification icon/message. I prefer the second way, since it's cross-platform and less annoying.
See [documentation on the `TrayIcon` class](http://java.sun.com/javase/6/docs/api/java/awt/TrayIcon.html), particularly the [`displayMessage()`](http://java.sun.com/javase/6/docs/api/java/awt/TrayIcon.html#displayMessage\(java.lang.String,%20java.lang.String,%20java.awt.TrayIcon.MessageType\)) method.
The following links may be of interest:
* [New System Tray Functionality in Java SE 6](http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/)
* [Java Programming - Iconified window blinking](http://forums.sun.com/thread.jspa?threadID=5130669&messageID=9469354)
* [`TrayIcon` for earlier versions of Java](https://jdic.dev.java.net/documentation/incubator/tray/) |
You can't just ORDER BY RAND(), as you know, because it will only generate one value. So use a key for a seed value.
<pre>
SELECT RAND(object_id), object_id, name
FROM sys.objects
ORDER BY 1
</pre> |
How do I generate Emma code coverage reports using Ant? |
|ant|code-analysis|emma| |
How do I setup an Ant task to generate [Emma](http://emma.sourceforge.net) code coverage reports? |
@Domenic this does not work. width auto does nothing more then the default behavior of that element because the initial value of width is auto ( see page 164, Cascading Style Sheets Level 2 Revision 1 Specification). Assigning a display of type block does not work either, this simply tell the broswer to use a block box when displaying the element and does not assign a default behavior of taking as muc space as possible like a div does ( see page 121, Cascading Style Sheets Level 2 Revision 1 Specification). That behavior is handeled by the visual user agent not CSS or HTML difinition. |
What about this:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); |
This is a duplicate of [SO# 19412][1]. Here's the answer I gave there:
select top 1 * from mytable order by newid()
In SQL Server 2005 and up, you can use TABLESAMPLE to get a random sample that's repeatable:
SELECT FirstName, LastName FROM Contact TABLESAMPLE (1 ROWS) ;
[1]: http://stackoverflow.com/questions/19412/how-to-request-a-random-row-in-sql
|
I'm not sure if I understand the question... My assumption is that you have *n* number of records coming into SSIS from your data source, and you want your output to have *n**2 records.
In order to do this, you can do the following:
- multicast to create multiple copies of your input data
- derived column transforms to set the "preset" values on the copies
- sort
- merge
Am I on the right track w/ what you're trying to accomplish? |
I'm not sure if I understand the question... My assumption is that you have *n* number of records coming into SSIS from your data source, and you want your output to have *n* * 2 records.
In order to do this, you can do the following:
- multicast to create multiple copies of your input data
- derived column transforms to set the "preset" values on the copies
- sort
- merge
Am I on the right track w/ what you're trying to accomplish? |
string path = Path.GetDirectoryName(typeof(DaoTests).Module.FullyQualifiedName); |
One of the things I've discovered is that how you as a developer design your code greatly affects what the designer can do with it. Often you download a Silverlight or WPF sample application from the web and open it up in Blend, just to have Blend crash on you because the code doesn't run well inside the designer. If it doesn't crash, it seldom look anything like the running application.
I recently gave a talk at Tech Ed Australia and New Zealand about techniques you can apply to "design for designability". A short bulled list is included:
1. Write code that can take advantage of data binding. The Model-View-ViewModel or the presentation pattern is a good fit for this.
2. Supply "design time" stubs for your service dependencies. If the class you are binding against makes web service calls be sure to replace the web service client with a stub class that returns "dummy data" that the designer consumes inside blend. This can easily be done through IoC and Dependency Injection, injecting one implementation if HtmlPage.IsEnabled == false.
3. By using data binding you can limit the number of "named elements" you have in your XAML file. If you write allot of code behind you end up coupling your C# code against named elements such as txtName or txtAddress, making it easy for the designer to "screw up".
4. Use a command pattern instead of code behind click event handlers. By loosely couple the invoker of an event from the handler you can have less named elements, and you give the designer the freedom to choose between a Button or a Menu Item to invoke a specific command.
5. Test your code in Blend! Even if you consider your self a pure developer you should test that your code is consumable by a tool, and strive to get a best possible experience at design time. Some would argue that a tool shouldn't effect your software design, just as some one complains about "design for testability", and making software design decisions just to make the code more testable. I think it's a smart thing to do, and the only way you can get some real designer-developer work flow going.
Other tips would be to start small. If your designer is new to XAML, WPF and Silverlight, start by introducing them to the project team, and have them do some basic designs in the tools they know. Let them do some buttons and illustrations in Adobe Illustrator, and export it to XAML, and show them how you can leverage their design assets directly. Continue by introducing more and more, and hopefully they get interested and want to make the switch to Blend. It's quite a learning curve, but it sure is worth it!
Good luck!
PS: I have written allot about patterns and making designer friendly code on my blog at [http://jonas.follesoe.no][1]. You can also find links to a video recording of my Tech Ed talk, as well as lots of links to further reading on the topic.
[1]: http://jonas.follesoe.no |
Okay, I found a way to make the balloon clickable, and clicking it does indeed stop it from popping up again. (On the other site I referenced in the original question the question asker claims that this is not the case. Though he was in VS2005 and I'm using VS2008.)
Anyway, I inserted a pause line in the macro so it would run for long enough for me to click the balloon:
System.Threading.Thread.Sleep(2000)
It would still be nice to know if there's a dialog somewhere for turning this back on, in case I have a crazy change of heart. |
The easy way to do it is to use background-image then just put an <img> in that element.
The other way to do is using css layers. There is a ton a resources available to help you with this, just search for [css layers][1].
[1]: http://www.google.com/search?q=css+layers |
php execute a background process |
|php| |
I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware of the time it take for the copy to complete.
Any suggestions would be much appreciated. |
I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware of the time it takes for the copy to complete.
Any suggestions would be much appreciated. |
This is a barebones look at what I've done to float one image over another.
<style type="text/css">
.imgA1 { position:absolute; top: 25px; left: 25px; z-index: 1; }
.imgB1 { position:absolute; top: 75px; left: 80px; z-index: 3; }
</style>
<img class=imgA1 src="http://full.path.to/imageA.jpg">
<img class=imgB1 src="http://full.path.to/imageB.jpg">
[Source][1]
[1]: http://www.webmasterworld.com/css/3193750.htm |
This is a barebones look at what I've done to float one image over another.
<style type="text/css">
.imgA1 { position:absolute; top: 25px; left: 25px; z-index: 1; }
.imgB1 { position:absolute; top: 25px; left: 25px; z-index: 3; }
</style>
<img class=imgA1 src="http://full.path.to/imageA.jpg">
<img class=imgB1 src="http://full.path.to/imageB.jpg">
[Source][1]
[1]: http://www.webmasterworld.com/css/3193750.htm |
If the backend database is Oracle 10g it will probably be easier for you to use Oracle Lite - that way you don't have to use two completely different SQL dialects in the same project.
BTW, In my product I use SQLite as the desktop database |
You might want to experiment with a not-strictly-database solution like a [Java Content Repository][1] implementation (e.g. [Apache Jackrabbit][2]) and use a search engine built on top of that like [Apache Lucene][3].
This solution with the appropriate caching mechanisms would possibly yield better performance than a home-grown solution.
However, I don't really think that in a small or medium-sized application you would require a more sophisticated implementation than the normalized database mentioned in earlier posts.
EDIT: minor typo corrected.
[1]: http://en.wikipedia.org/wiki/Content_repository_API_for_Java
[2]: http://en.wikipedia.org/wiki/Apache_Jackrabbit
[3]: http://en.wikipedia.org/wiki/Apache_Lucene |
|.net|linq|linq-to-objects| |
I have a `List<int>` and a `List<customObject>`. The customObject class has an ID property. How can I get a `List<customObject>` containing only the objects where the ID property is in the `List<int>` using LINQ?
**Edit**: I accepted Konrads answer because it is easier/more intuitive to read. |
This gets part of the way there (using a whitelist of valid characters):
new Regex("[^a-zA-Z-_]").Replace(s, "-")
It does, however, give you a string that ends with "--". So perhaps a second regex to trim those from the beginning/end of the string, and maybe replace any internal "--" to "-". |
**Bourne Shell: Functional:**
factorial() {
if [ $1 -eq 0 ]
then
echo 1
return
fi
a=`expr $1 - 1`
expr $1 \* `factorial $a`
}
|
**Bourne Shell: Functional**
factorial() {
if [ $1 -eq 0 ]
then
echo 1
return
fi
a=`expr $1 - 1`
expr $1 \* `factorial $a`
}
Also works for Korn Shell and Bourne Again Shell. :-) |
SugarCRM 5 - Create a sub panel for invoices in Account Panel |
|sugar|crm| |
I'm customizing a SugarCRM 5, and in my **SugarCRM database** I've all invoices, which were imported from our ERP. Now, I would like to know if it is possible to create a new Sub panel in the Accounts Panel **without editing the original SugarCRM files**, so that my client invoices index are visible in that interface.
Thanks
|
|sugarcrm|crm| |
|crm|sugar-crm| |
Viewing event log via a web interface |
|asp.net|iis|logging|monitoring| |
I'd like to be able to view the event log for a series of asp.net websites running on IIS. Can I do this externally, for example, through a web interface? |
Good reasons NOT to use a relational database? |
|sql|database| |
Can you please point to alternative data storage tools and give good reasons to use them instead of good-old relational databases? Imo most applications rarely use full power of SQL, it would be interesting to see how to build a SQL-free application. |
O'Reilly's Practical RDF has a chatper titled [Commercial Uses of RDF/XML](http://safari.oreilly.com/0596002637/pracrdf-CHP-15-SECT-1). The table at the left lists the subsections: [Chandler](http://chandlerproject.org/), [RDF Gateway](http://www.intellidimension.com/), [Seamark](http://siderean.com/), and Adobe's [XMP](http://www.adobe.com/products/xmp/) stuff. |
How do I implement a chromeless window with WPF? |
|wpf|user-interface| |
What is the best way to gzip and cache static images in Asp.net mvc |
|asp.net-mvc|.net-2.0| |
I'm trying to find the best way to speed up the delivery of the static images that compose the design of an mvc site. The images are not gzipped, nor cached in the server or on the client (with content expire). Options are:
1. Find why images are not cached and gzipped direcly from IIS6
2. Write a specialized http handler
3. Register a special route for static images and write a bynary actionresult method
What could be the best solution in terms of performance? |
|asp.net|asp.net-mvc|.net-2.0|gzip| |
Asp.net MVC User Control ViewData |
|asp.net-mvc|viewdata|viewusercontrol| |
When a controller renders a view based on a model you can get the properties from the ViewData collection using the indexer (ie. ViewData["Property"]). However, I have a shared user control that I tried to call using the following:
return View("Message", new { DisplayMessage = "This is a test" });
and on my Message control I had this:
<%= ViewData["DisplayMessage"] %>
I would think this would render the DisplayMessage correctly, however, null is being returned. After a heavy dose of tinkering around, I finally created a "MessageData" class in order to strongly type my user control:
public class MessageControl : ViewUserControl<MessageData>
and now this call works:
return View("Message", new MessageData() { DisplayMessage = "This is a test" });
and can be displayed like this:
<%= ViewData.Model.DisplayMessage %>
Why wouldn't the DisplayMessage property be added to the ViewData (ie. ViewData["DisplayMessage"]) collection without strong typing the user control? Is this by design? Wouldn't it make sense that ViewData would contain a key for "DisplayMessage"? |
|asp.net|asp.net-mvc|viewdata|viewusercontrol| |
user controls and asp.net mvc |
|asp.net-mvc|user-controls| |
Here is one trivial question, but I am not sure how to handle that.
I need to display list of categories on every page, and to be able to choose items from specific category to be displayed. I use asp.net mvc, and chosen to create user control that will display categories. My question is: What is the best approach to pass data to user control. I already found some blog posts
[http://weblogs.asp.net/stephenwalther/archive/2008/08/12/asp-net-mvc-tip-31-passing-data-to-master-pages-and-user-controls.aspx][1]
[http://blog.matthidinger.com/2008/02/21/ASPNETMVCUserControlsStartToFinish.aspx][2]
I would like also to hear your opinion.
PS. I'd like to hear Jeff's opinion, especially because of his experience with UC's on Stackoverflow
[1]: http://weblogs.asp.net/stephenwalther/archive/2008/08/12/asp-net-mvc-tip-31-passing-data-to-master-pages-and-user-controls.aspx
[2]: http://blog.matthidinger.com/2008/02/21/ASPNETMVCUserControlsStartToFinish.aspx |
|asp.net|asp.net-mvc|user-controls| |
SqlHelper class from the older version of the MS Enterprise App Blocks. It is far from perfect, but hard to beat its simplicity for simple CRUD apps. |
The only minor problem I had was that I installed 03 after 08, and all my solutions then became assigned to 03. Assigning them to the version selector instead was all I needed to do. |