instruction
stringlengths
0
30k
The first thing I would check is to make sure that your normal login is mapped to a role with the correct system-level permissions. The item-level role definitions don't make a difference for the "Report Builder" button. From the browser-based report manager interface: * Click "site settings" * In the Security ...
What you want to do is called "Serializing" your object, and .Net has a few different ways to go about it. One is the XmlSerializer class in the System.Xml.Serialization namespace. Another is in the System.Runtime.Serialization namespace. This has support for a SOAP formatter, a binary formatter, and a base class ...
|icalendar|rfc2445|language-agnostic|
I'm generating ICalendar (.ics) files. Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calandrier ***BUT NOT*** in MS Outlook 2007 How do I get them to work for Outlook ? Thanks Tom
|language-agnostic|icalendar|rfc2445|
I'm generating ICalendar (.ics) files. Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar ***BUT NOT*** in MS Outlook 2007 - it just creates a second event How do I get them to work for Outlook ? Thanks Tom
|language-agnostic|icalendar|rfc2445|
### Usage ### Merge tracking is managed by the client and stored in a property ([svn:mergeinfo][1]). To use merge tracking you just merge as usual but without the revision range: svn merge trunkURL The client will take care of reading the properties to see what revision(s) need to be merged in and then up...
Keep away from the second approach, best bet would be the autoboxing if you're using java 1.5, anything earlier your first example would be best.
The solution using the String method is not so good for a variety of reasons. Some are aesthetic reasons others are practical. On a practical front more objects get created by the String version than the more normal form (as you have expressed in your first example). On an aesthetic note, I think that the second...
I've found <a href="http://samba.anu.edu.au/rsync/">rsync</a> extremely useful for synchronizing directory trees across multiple systems. If you have shell access to your server from a development workstation, you can regularly check out code locally and run rsync, which will transfer only the files that have changed t...
This still uses a temp file, but at least it is on one line: echo "text"|cat - yourfile > /tmp/out && mv /tmp/out yourfile Credit: [BASH: Prepend A Text / Lines To a File][1] [1]: http://www.cyberciti.biz/faq/bash-prepend-text-lines-to-file/
You could sort the keys first, then loop through the items in the properties file and write them to the xml file.
You could sort the keys first, then loop through the items in the properties file and write them to the xml file. public static void main(String[] args){ String propFile = "/tmp/test2.xml"; Properties props = new Properties(); props.setProperty("key", "value"); props.setProperty("...
You could try this: Make a new class that does what java.util.XMLUtils does but in the save method change this: Set keys = props.keySet(); Iterator i = keys.iterator(); to Set keys = props.keySet(); List<String> newKeys = new ArrayList<String>(); for(Object key : keys) { newKeys.add(...
I think the clear answer is yes, but depending on the domain you are referring to, it could be REALLY yes, or less so yes. If you are building high level .Net or Java apps, then I think this is the latter, as OO is basically built into the language. On the other hand if you are working on embedded apps, then the da...
I think your question should read, "Can you over Architecture your application?" And of course the answer is yet. OO is just an approach to design. If you spend your time building unnecessary complexity into a system because "Polymorphism Rocks!". Then yes maybe you're over OOing. The very XP answer is that **...
IMHO, Firebug is going to be your best bet. It will tell you which file the style came from and you can click on the filename to be transported instantly to the relevant line in the file. Note: You can hit ctrl+shift+C on any page to select and inspect an element with the mouse.
DVCS achieve better merges by tracking the parent revisions of merges. In Subversion, when you merge one branch into another, you lose information about where the merge originated from. In a DVCS like Bazaar or Git, the "merged" revision ends up with two parent revisions. Renaming is handled differently between DVCS...
Why do you want to add the extra property? Or, put a different way, what do you intend to do with the property once you have it in your new IEnumerable source?
Why do you want to add the extra property? Or, put a different way, what do you intend to do with the property once you have it in your new IEnumerable source? If you need it for data binding, I have a helper class that might help you.
Backup for MySQL
|mysql|backup|
How do I do backups in MySQL? I'm hoping there'll be something better than just running mysqldump every "x" hours. Is there anything like SQL Server has, where you can take a full backup each day, and then incrementals every hour, so if your DB dies you can restore up to the latest backup? Something like the...
How do I do backups in MySQL?
You might want to look at [incremental backups][1]. [1]: http://dev.mysql.com/doc/refman/5.0/en/backup.html
How do I read and write raw ip packets from java on a mac?
|java|macos|network-programming|
What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for?
|java|macos|networking|
What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for? I want to be able to do what wireshark does, i.e. record all incomming packets on an interface, and in addition be able to send back my o...
How about this? using System; using System.Linq; using System.Linq.Expressions; using System.Reflection; class EventRaiser { public event EventHandler SomethingHappened; } class Handler { public void HandleEvent() { /* ... */} } class EventProxy ...
If you want to, for example, only use void methods without any arguments as event handlers for events of any type, you can compile expression trees to do that. This can be modified to accomodate other event handler types, but you'll have to map the event handler's parameters to the event's somehow. using System;...
If you want to, for example, only use void methods without any arguments as event handlers for events of any type, you can compile expression trees to do that. This can be modified to accomodate other event handler types, but you'll have to map the event handler's parameters to the event's somehow. using System;...
If you think you're going to be IO/memory bound, I don't think partitioning is going to be helpful. As usual, benchmarking first will help you figure out the best direction. If you don't have spare servers with 64GB of memory kicking around, you can always ask your vendor for a 'demo unit'. I would lean towards shar...
With Java 5's [autoboxing](http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html), you can simply do: Integer a = new Integer(2); Integer b = a * 10; System.out.println(b);
With Java 5's [autoboxing](http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html), you can simply do: Integer a = new Integer(2); // or even just Integer a = 2; a *= 10; System.out.println(a);
Choosing a folder with .NET 3.5
|c#|.net|winforms|wpf|
In a C# .NET 3.5 app (a mix of WinForms and WPF) I want to let the user select a folder to import a load of data from. At the moment, it's using System.Windows.Forms.FolderBrowserDialog but that's a bit lame. Mainly because you can't type the path into it (so you need to map a network drive, instead of typing a UNC pat...
The string approach is amusing, but almost certainly a bad way to do it. Getting the int value of an Integer, and creating a new one will be very fast, where as parseInt would be fairly expensive to call. Overall, I'd agree with your original approach.
The string approach is amusing, but almost certainly a bad way to do it. Getting the int value of an Integer, and creating a new one will be very fast, where as parseInt would be fairly expensive to call. Overall, I'd agree with your original approach (which, as others have pointed out, can be done without so muc...
To become an Oracle Developer there is a bit more to learn than jdbc. You should take a look at the Oracle web site. It is kind of slow and not very intuitive but has a lot of good information. There are OUGs that have good info as well. If you just want to access Oracle via JAVA then you should use a framework such...
There's [a closed jQuery ticket][1] for a sort that should work, but just wasn't included in the core. jQuery.fn.sort = function() { return this.pushStack( [].sort.apply( this, arguments ), []); }; Referenced from [a Google Groups thread][2], I think you just pass in a function that is used to sor...
Yes, you can. As an example, if you find yourself creating Interfaces or abstract classes before you have two subtypes for them, then you're over-doing it. I see this kind of thinking often when developers (over)design up front. I use Test-Driven Development and Refactoring techniques to avoid this behavior.
The simplest hack would be to override keySet. A bit of a hack, and not guaranteed to work in future implementations: new Properties() { @Override Set<Object> keySet() { return new TreeSet<Object>(super.keySet()); } } (Disclaimer: I have not even tested that it compiles.) ...
[Debian Live](http://debian-live.alioth.debian.org/) provides the best tools for building a Linux Live CD. [Webconverger](http://webconverger.com) uses Debian Live for example. It's very easy to use. sudo apt-get install [live-helper](http://packages.qa.debian.org/l/live-helper.html) # from Debian unstable, which...
Not possible without a temp file, but here goes a oneliner { echo foo; cat oldfile; } > newfile && mv newfile oldfile
Not possible without a temp file, but here goes a oneliner { echo foo; cat oldfile; } > newfile && mv newfile oldfile You can use other tools such as ed or perl to do it without temp files.
in Firefox use the DOM inspector, firebug, or inspect this.<br/> in IE, use the IE dev toolbar <br /> In Google Chrome, use the built-in "inspect element" functionality
in Firefox use the DOM inspector, firebug, or inspect this.<br/> in IE, use the IE dev toolbar (or, maybe better, [Firebug Lite][1])<br /> In Google Chrome, use the built-in "inspect element" functionality [1]: http://getfirebug.com/lite.html
Follow-up: in the end, after adding annotations, I have it working with EhCache, i.e. <property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider" />
How do I (or can I) SELECT DISTINCT on multiple columns (postgresql)?
|sql|postgresql|
I need to retrieve all rows from a table where 2 columns combined are all different. So I want all the sales that do not have any other sales that happened on the same day for the same price. The sales that are unique based on day and price will get updated to an active status. So I'm thinking: UPDATE s...
How to host 2 WCF services in 1 Windows Service?
|wcf|windows-services|
I have a WCF application that has two Services that I am trying to host in a single Windows Service using net.tcp. I can run either of the services just fine, but as soon as I try to put them both in the Windows Service only the first one loads up. I have determined that the second services ctor is being called but the...
There's [a closed jQuery ticket][1] for a sort that should work, but just wasn't included in the core. jQuery.fn.sort = function() { return this.pushStack( [].sort.apply( this, arguments ), []); }; Referenced from [a Google Groups thread][2], I think you just pass in a function that is used to sor...
ActiveX default property discovery
|activex|vb6|
Is it possible to determine which property of an ActiveX control is the default property?
ActiveX control default property discovery
|vb6|activex|
Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default!
Is it possible to determine which property of an ActiveX control is the default property? For example, what is the default property of the VB6 control CommandButton and how would I found out any other controls default! **/EDIT:** Without having source to the object itself
I like changing the default location that new projects are saved to. Tools->Options (Select Projects and Solutions tab) This "tab" has all sorts of goodness. Not just the ability to change the default locations and avoid saving new projects automatically but other nice things as well. For example: Track A...
I use [Puppet][1], Makefiles to build RPMs and [Bamboo][2] to do this for me. My system doesn't directly apply, and I'm not to familiar with the Windows world, but there are some transferable patterns. My make setup allows me to build RPM's for everything (php libs, php websites, perl modules, C apps, etc) that make...
It's not really a simple problem, because if you're going to display things back to the user, you'll need to also sanitise the input to ensure you don't create any [cross site scripting][1] vulnerabilities. That said, you could probably do something pretty simple as you describe most easily with a regular expression...
I think [Context Free Art](http://www.contextfreeart.org/index.html) might be a good choice, with output of graphics, it makes it a lot of fun learning about [context-free grammar](http://en.wikipedia.org/wiki/Context-free_grammar).
It can be done with XPath 1.0. Say you have <foo> <bar/> </foo> If you want to test if `foo` has a `baz` child, substring("N/A", 4 * number(boolean(/foo/baz))) will return "N/A" if the expression `/foo/baz` returns an empty node-set, otherwise it returns an empty string.
Comet was actually coined by Alex Russell from Dojo Toolkit ( http://www.dojotoolkit.org ). Here is a link to more infomration http://cometdproject.dojotoolkit.org/
Personally, I don't see the point of making it a property at all if you're not going to do anything at all beyond the auto-property. Just leave it as a field. The encapsulation benefit for these item are just red herrings, because there's nothing behind them to encapsulate. If you ever need to change the underlying...
I usually use `Request.Url.ToString()` to get the full url (including querystring), no concatenation required.
It is definitely possible to create RESTful web services using ASP.NET. If you are starting a new project I would definitely look into creating RESTful web services using WCF. The 3.5 .NET Framework allows you to specify RESTful endpoint along with a regular old SOAP endpoint and still deliver the same service. All ...
I ran the aformentioned sunspider javascript benchmark on FF3 and Chrome and got over a 2x speed increase moving from [FF3][1] to [Chrome][2] (on a Vista 64 system - Core 2 duo 6600 2.4GHz, 2GB RAM). The links above show you my results - I'm very interested to see what, if any, difference the underlying OS makes. ...
What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for? EDIT: I want to be able to do what wireshark does, i.e. record all incomming packets on an interface, and in addition be able to send bac...
I've run into similar problems before. I assume you're using the length() function to determine the size of the file? If so, it;s likely the data that you're posting is UTF-8 encoded, instead of ASCII. To get the correct count you may need to add a "use bytes;" pragma to the top of your script, or wrap the length...
You're using "Value" as a column alias, and I don't think the alias can appear in the where clause. It's simply used to name the returned column value. Your where clause should refer to the original column name: SELECT "Ugly OLAP name" as "Value" FROM OpenQuery( OLAP, 'OLAP Query') WHERE "Ugly OLAP na...
If by "static class" you mean a class that has only static variables, then they actually can maintain state. My understanding is the that the only difference would be how you access this thing. For example: MySingleton().getInstance().doSomething(); versus MySingleton.doSomething(); The internals ...
There is a [page][1] on the Wireshark wiki that addresses the problem. Short answer is, you can't do it on a Windows machine, but there might be some workarounds. [1]: http://wiki.wireshark.org/CaptureSetup/Loopback
What I've done is obfuscate it when it's rendered and hide it, then use javascript to fix the obfuscation and show the link. For example, you can render this from the server: <a href="mailto:some_address^^some_domain$$com" style='display:none'>Email me</a> then using Javascript you can use regex to swap ^^ for...
Singletons should never be used (unless you consider a class with no mutable state a singleton). "static classes" should have no mutable state, other than perhaps thread-safe caches and the like. Pretty much any example of a singleton shows how not to do it.
Yeah I'd like to take VS out of the equation so that a build from VS is just simply compiling the code and references. I can manage the NAnt script... I'm just wondering if people have advice around having 1 NAnt script, or possibly one for each project which can push the code into the projects rather than being pul...
Unfortunately, things have moved on, and we have (almost) made the decision not to use InfoPath for this requirement. It's only partially to do with the xs:any issue, but more to do with (external) audit trails, calls to custom code and web services, and a couple of other factors.
mmap should be faster, but I don't know how much. It very much depends on your code. If you use mmap it's best to mmap the whole file at once, that will make you life a lot easier. One potential problem is that if your file is bigger than 4GB (or in practice the limit is lower, often 2GB) you will need a 64bit architec...
Using Greg's suggestion I found the following works. As mentioned I'm not a C++ programmer but just needed something practical. **myclass.cpp** #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { ...
Using Greg's suggestion I found the following works. As mentioned I'm not a C++ programmer but just needed something practical. **myclass.cpp** #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserve...
There are numerous JavaScript libraries that are worth at least a cursory review to see if they suit your particular need. First, come up with a short list of criteria to guide your selection and evaluation process. Then, check out a [high level framework comparison/reviews somewhere like Wikipedia][1], select a few...
I use StarTeam here and it allows you to "share" objects (files, change requests, requirements etc) across multiple folders. Not sure if Subversion (SVN) has that feature. If it doesn't, here's another trick you can use: create a junction from the primary location of the controls to a location in the other projects. A ...
WPF Listbox style with a button
|c#|wpf|
I have a ListBox that has a style defined for ListBoxItems. Inside this style, I have some labels and a button. One that button, I want to define a click event that can be handled on my page (or any page that uses that style). How do I create an event handler on my WPF page to handle the event from my ListBoxItems s...
Is Mono ready for prime time?
|.net|opensource|mono|
Has anyone used Mono, the open source .NET implementation on a large or medium sized project? I'm wondering if it's ready for real world, production environments. Is it stable, fast, compatible, ... enough to use? Does it take a lot of effort to port projects to the Mono runtime, or is it really, _really_ compatible en...
|.net|open-source|mono|
Quicksort: Until I got to college, I had never questioned whether brute force Bubble Sort was the most efficient way to sort. It just seemed intuitively obvious. But being exposed to non-obvious solutions like Quicksort taught me to look past the obvious solutions to see if something better is available.
This really depends on the Wiki syntax you're using as there are several different ones. Obviously the wiki software has this functionality somewhere; if you can't find a software package that does this for you, you could start looking for the relevant code in your wiki software.
Write the process as a server-side script in whatever language (php/bash/perl/etc) is handy and then call it from the process control functions in your php script. The function probably detects if standard io is used as the output stream and if it is then that will set the return value..if not then it ends P...