instruction stringlengths 0 30k ⌀ |
|---|
|modalpopupextender|sharepoint| |
Whenever I show a ModalPopupExtender on my Sharepoint site, the popup shown creates both horizontal and vertical scrollbars. If you scroll all the way to the end of the page, the scrollbar refreshes, and there is more page to scroll through. Basically, I think the popup is setting its bounds beyond the end of the pag... |
ModalPopupExtender adding scrollbars in SharePoint |
|sharepoint|modalpopupextender| |
Probably namespace issues and maybe one with current context. For source (with added namespace declaration to make it well-formed xml)
<svc:ElementList xmlns:svc="svc">
<svc:Element>
<Year>2007</Year>
</svc:Element>
<svc:Element>
<Year>2006</Year>
</svc:Element>
... |
If you are writing unmanaged C++, it is occasionally invaluable to know at least basic x86 assembly, binary number systems, etc. I primarily do C/C++ development, and I occasionally need to debug production code for errors that are so specific to the machine-code representation produced by the compiler that the only w... |
MySQL prior to version 5 did not allow aggregate functions in ORDER BY clauses.
You can get around this limit with the deprecated syntax:
SELECT COUNT(id), `Tag` from `images-tags`
GROUP BY `Tag`
ORDER BY 1 DESC
LIMIT 20
1, since it's the first column you want to group on. |
Which resolution to target for a Mobile App? |
|mobile| |
When desinging UI for mobile apps in general which resolution could be considered safe as a general rule of thumb. My interest lies specifically in web based apps. The iPhone has a pretty high resolution for a hand held, and the Nokia E Series seem to oriented differently. Is 240×320 still considered safe? |
Auto-properties are as much a black magic as anything else in C#. Once you think about it in terms of compiling down to IL rather than it being expanded to a normal C# property first it's a lot less black magic than a lot of other language constructs. |
I first used triggers a couple of weeks ago. We changed over a production server from SQL 2000 to SQL 2005 and we found that the drivers were behaving differently with NText fields (storing a large XML document), dropping off the last byte. I used a trigger as a temporary fix to add an extra dummy byte (a space) to t... |
You need to use `-removeObserver:forKeyPath:` to remove the observer before `-[NSObject dealloc]` runs, so yes, doing it in the `-dealloc` method of your class would work.
Better than that though would be to have a deterministic point where whatever owns the object that's doing the observing could tell it it's done ... |
Using a library is almost always preferably to rolling your own. Here's a quick list of "Oh I'll never need that/I didn't think about that" points which will end up coming to bite you later down the line:
- Escaping characters. What if you want a : in the key or ] in the value?
- Escaping the escape character... |
Honestly the only time I use triggers to simulate a unique index that is allowed to have NULL that don't count for the uniqueness. |
Preventing Memory Leaks with Attached Behaviours |
|.net|wpf|memory| |
I've created an "attached behaviour" in my WPF application which lets me handle the Enter keypress and move to the next control. I call it EnterKeyTraversal.IsEnabled, and you can see the code on my blog [here][1].
My main concern now is that I may have a memory leak, since I'm handling the PreviewKeyDown event on U... |
@gradonmantank: Because he wants that file to be updated with the latest revision number. Did you read his question completely?
The pre-commit hook might work. |
If you're really looking for an application that you can modify try out [Family.Show][1] on CodePlex.
[1]: http://www.codeplex.com/familyshow |
I used to have a manual way of doing that. I'd run a script that would use sed to replace a comment with the current timestamp in my $Rev$ file. That way, the file contents would change and Subversion would commit it.
What I didn't do was to take that to the next step: using [Subversion's repository hooks][1] to aut... |
try querying with a trailing dot to explicitly set the root:
host dlksfhoiahdsfiuhsdf.com. |
This should return the text value of the selected value
var vSkill = document.getElementById('newSkill');
var vSkillText = vSkill.options[vSkill.selectedIndex].innerHTML);
alert(vSkillText); |
This should return the text value of the selected value
var vSkill = document.getElementById('newSkill');
var vSkillText = vSkill.options[vSkill.selectedIndex].innerHTML;
alert(vSkillText); |
This should return the text value of the selected value
var vSkill = document.getElementById('newSkill');
var vSkillText = vSkill.options[vSkill.selectedIndex].innerHTML;
alert(vSkillText);
Props: @Tanerax for reading the question, knowing what was asked and answering it before others fi... |
This should return the text value of the selected value
var vSkill = document.getElementById('newSkill');
var vSkillText = vSkill.options[vSkill.selectedIndex].innerHTML;
alert(vSkillText);
Props: @Tanerax for reading the question, knowing what was asked and answering it before others fi... |
AS3 - How to fix "multiple describeType entries for 'selectedItem' on type 'mx.controls::ComboBox'" |
|apache-flex|actionscript-3|air| |
Does anyone know why when using BindingUtils on the selectedItem property of a ComboBox you get the following warning? Any ideas how to resolve the issue?
The binding still works properly, but it would be nice to get rid of the warning.
warning: multiple describeType entries for 'selectedItem' on type 'mx.con... |
Chrome uses Webkit, the same engine as is used by Safari, OmniWeb, iCab and more. Just code everything based on the standards and verify in each browser. |
You could automate this using the open source command line tool ffmpeg. Parse the RSS to get the video files, fetch them over the net if needed, then spit each one out to a line command line like this:
ffmpeg -i episode1.mov -ab 128000 episode1.mp3
The -ab switch sets the output bit rate to 128 kbits/s on the... |
You could automate this using the open source command line tool ffmpeg. Parse the RSS to get the video files, fetch them over the net if needed, then spit each one out to a command line like this:
ffmpeg -i episode1.mov -ab 128000 episode1.mp3
The -ab switch sets the output bit rate to 128 kbits/s on the audi... |
How do I get js2-mode to use spaces instead of tabs in Emacs? |
|javascript|ide|emacs|js2-mode| |
I am using [js2-mode][1] to edit Javascript in Emacs, but I can't seem to get it to stop using tabs instead of spaces for indentation. My other modes work fine, just having issues w/ js2.
[1]: http://code.google.com/p/js2-mode/ |
Any javascript book will tell you not to put handlers on the body element like that.
I'f you're using jquery:
$(function() {
$("#Box1").focus();
});
or prototype:
Event.observe(window, 'load', function() {
$("Box1").focus();
});
or plain javascript:
window.onload = ... |
Will,
It is not possible to find out whether an object implements some interface by looking at XAML.
With constraints given you can find xml element that has a child named <anything.TheCollection>.
You can use following code:
It will return all elements having child element which name ends with **.TheCollecti... |
Can you disable the back button in a JFace wizard? |
|java|eclipse|rcp|wizard|jface| |
I wouldn't cache the connection object, that will defeat the built-in connection pooling -- ADO.NET will handle connections (assuming you instantiate and close them) efficiently by itself.
As far as the connection string itself, you shouldn't need to cache it if you load it from connection -- the connection manager ... |
Best java tools for emacs |
|java|ide|debugging|emacs|javadoc| |
I'm a long-time emacs user, and I'm now working about 1/2 time in Java.
What are the best emacs libraries for
1. Debugging Java
2. Code Completion/Intellisense
3. Javadoc browsing
? |
I usually cache the connection string in a global configuration object in my application. This value is loaded up at the beginning of program execution from where ever it is stored -- file, encrypted file, config file, etc. ADO.NET is very good at caching connection objects to the database so I would not cache the Sq... |
Since the objects of different classes will have different sizes, you would end up running into the slicing problem if you store them as values.
One reasonable solution is to store container safe smart pointers. I normally use boost::shared_ptr which is safe to store in a container. Note that std::auto_ptr is not.
... |
How to Convert a StreamReader into an XMLReader object in .Net 2.0/C# |
|xml|c#|.net|xslt|stream| |
Here's a quick question I've been banging my head against today.
I'm trying to convert a .Net dataset into an XML stream, transform it with an xsl file in memory, then output the result to a new XML file.
Here's my current code:
BufferedStream stream = new BufferedStream(new MemoryStream());
Da... |
Here's a quick question I've been banging my head against today.
I'm trying to convert a .Net dataset into an XML stream, transform it with an xsl file in memory, then output the result to a new XML file.
Here's my current code:
BufferedStream stream = new BufferedStream(new MemoryStream());
Da... |
Do you mean actual genetic programming, as opposed to genetic algorithms in general?
If so, C#/.net isn't the best language for it. LISP, for example, has always been a mainstay of GP.
However, if you must, you're probably going to want to dynamically generate CIL / MSIL. You could do this using [System.Reflect... |
Make sure event referencing elements are with in the object they are referencing, like text boxes in the form control. Or if that can't be prevented. Create a static event on a global helper class and then monitor the global helper class for events. If these two steps cannot be done try using a WeakReference, they a... |
You might be able to implement genetic programming using LINQ expression trees -- it's more likely to generate something usable than random IL generation. |
> As to reducing the amount of work: databases are stunningly efficient when they don't have to deal with the outside world; you'd be really surprised how much even process switching hurts performance. That's another upside of stored procedures: rather than a dozen calls to the database (and all the associated round tr... |
There are two options, change the selected rows disabled colors. Or change all the other rows to simulate they are disabled except for the selected one. The first option is obviously the easiest, and the second option obviously is going to need some extra protections.
I have actually done the first option before... |
For a lightweight & completely option, you can use Springloops integrated with Basecamp (+ an SVN client).
- Hosted SVN: SpringLoops: <a>http://www.springloops.com/</a> (free for a single project & user)
- Basecamp: <a>http://basecamphq.com/</a> (also free for a single project)
Note: SpringLoops integration ... |
For a lightweight & completely free option, you can use Springloops integrated with Basecamp (+ an SVN client).
- Hosted SVN: SpringLoops: <a>http://www.springloops.com/</a> (free for a single project & user)
- Basecamp: <a>http://basecamphq.com/</a> (also free for a single project)
Note: SpringLoops integra... |
I'm writing a wizard for an Eclipse RCP application. After doing some processing on a file and taking some user input, I don't want to let the user go back to make changes. At this point they must either accept or reject the changes they are about to make to the system.
What I can't seem to find is a method call t... |
I'm sure filing a bug report really helps with all those IE rendering issues!
Realistically, you need to test your application in each browser, no browser 100% follows the W3C standards so ultimately you can't rely on following that at all. You need to test everything you do in any browser you wish to support.
... |
Counting number of views for a page ignoring search engines? |
|search-engine| |
I notice that Stack Overflow has a views count for each question and that these view numbers are fairly low and accurate.
I have a similar thing on one of my sites. It basically logs a "hit" whenever the page is loaded in the backend code. Unfortunately it also does this for search engine hits giving bloated and in... |
|search-engine|websites| |
|search-engine|website-metrics| |
|search-engine|website-metrics| |
I have used [Visual Build Pro][1] for years, It's quite slick and easy to use and has many standard operations (like the ones you mentioned) built in.
[1]: http://www.kinook.com/VisBuildPro/ |
I was on the DOM Working Group in the early days; I'm sure we *meant* for textNode to contain the new joined value, but if we didn't *say* it in the spec, it's possible that *some* implementation *might* create a new node instead of reusing textNode, though that would require more work for the implementors.
When in ... |
|web-applications|mobile| |
Not necessarily, it depends what you want to do. Could you elaborate a bit? AJAX doesn't need access to cookies to work, it can make requests on its own to extract information, the page request that the AJAX call makes could access the cookie data & pass that back to the calling script without Javascript having to dir... |
I've been using an attached property to allow the user to use the up and down keys to change the values in the text box. To use it, you just use
<TextBox local:TextBoxNumbers.SingleDelta="1">100</TextBox>
This doesn't actually address the validation issues that are referred to in this question, but it... |
Regular cast vs. static_cast vs. dynamic_cast |
|c++|c|pointers|casting| |
I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts (i.e.
MyClass *m = (MyClass *)ptr;
all over the place, but there seem to be two other types of casts, and I don't know the difference. What's... |
G'day,
I learnt PDP assembler when I did my Elect. Eng. degree in the late '70's. The last dialect of assembler that I really used had four different modes of memory addressing. Last dialect I ooked at had 17 modes!
Not sure what learning assembler really gives you nowadays. Back then it was an essential part of ... |
Use the ANSI information_schema views, this will also work in MySQL
select table_name
from information_schema.columns
where column_name = 'classtypeid' |
When do you use table clusters? |
|database|performance|oracle-database| |
How do you determine when to use [table clusters][1]? There are two types, index and hash, to use for different cases. In your experience, have the introduction and use of table clusters paid off?
If none of your tables are set up this way, modifying them to use table clusters would add to the complexity of the set ... |
No, the page that the AJAX call requests has access to cookies too & that's what checks whether you're logged in.
You can do other authentication with the Javascript, but I wouldn't trust it, I always prefer putting any sort of authentication checking in the back-end. |
|productivity|desktop|monitor|windows-xp| |
From MSDN:
> If one of the specified paths is a zero-length string, this method returns the other path. If path2 contains an absolute path, this method returns path2.
In your example, path2 is absolute. |
For digital audio data, the term "clipping" doesn't really carry a lot of meaning other than "max amplitude". In the analog world, audio data comes from some hardware which usually contains a "clipping register", which allows you the possibility of a maximum amplitude that isn't clipped.
What might be better suited... |
Since version 1.5.6 there is an ignorecase option available in the [core] section of .git/config
e.g. add "ignorecase = true" entry
|
Do something like this.
Type type = typeof(Repository<MessageCategory);
string assemblyQualifiedName = type.AssemblyQualifiedName;
get the value of assemblyQualifiedName and paste it into the TypeName field. Note that Type.GetType(string), the value passed in must be
>The assembly-qualified name of th... |
Do something like this.
Type type = typeof(Repository<MessageCategory);
string assemblyQualifiedName = type.AssemblyQualifiedName;
get the value of assemblyQualifiedName and paste it into the TypeName field. Note that Type.GetType(string), the value passed in must be
>The assembly-qualified name of th... |
This is kind of a philosophical question (which perhaps only Microsoft can truly answer), since it's doing exactly what the documentation says.
[System.IO.Path.Combine][1]
"If path2 contains an absolute path, this method returns path2."
I don't know what the rationale is. I guess the solution is to strip off ... |
You can return null from the getPreviousPage() method in your wizard page implementation. |
There’s also [ILOG JViews Charts][1] which looks pretty feature-complete… if you can afford it.
[Here][2] is some additional infos on using it with eclipse.
[1]: http://www.ilog.com/products/jviews/charts/
[2]: http://blogs.ilog.com/jviews/2008/06/17/jviews-shines-through-on-eclipse/ |
@David in Dakota:
Console.WriteLine( "-".PadRight( 21, '-' ) );
I used to do this, until I discovered that the String class has a constructor that allows you to do the same thing in a cleaner way:
new String('-',22);
|
From a UI perspective this seems rather bad. Your users are going to get frustrated if they make a mistake and want to go back and correct it and you don't let them. I think it would be much better to change the application to allow going back rather than looking for ways to prevent it. |
MySQL Partitioning / Sharding / Splitting - which way to go? |
|mysql|partitioning|sharding| |
We have an InnoDB database that is about 70 GB and we expect it to grow to several hundred GB in the next 2 to 3 years. About 60 % of the data belong to a single table. Currently the database is working quite well as we have a server with 64 GB of RAM, so almost the whole database fits into memory, but we’re concerned ... |
You need to use javascript:
<BODY onLoad="document.getElementById('myButton').focus();"> |
You need to use javascript:
<BODY onLoad="document.getElementById('myButton').focus();">
----------
@Ben notes that you should not add event handlers like this. While that is another question, he recommends that you use this function:
function addLoadEvent(func) {
var oldonload = window... |
Have you tried the tool called <a href="http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx">handle</a> from sysinternals?
Anyway, neither windows does this (display the name of the application that locked the device): when you try to eject an USB device, Windows just says that the device is currently in u... |
Total fan,
but really have to use it sparingly when,
- Need to maintain consistency (especially when dimension tables are used in a warehouse and we need to relate the data in the fact table with their proper dimension . Sometime, the proper row in the dimension table can be very expensive to compute so you want... |
As an alternative to a dot or an underscore, you could use the dollar sign character:
var namespaces$com$example = "data";
|
Think of a database as a great big object - after each call to it, it ought to be in a logically consistent state.
Databases expose themselves via tables, and keeping tables and rows consistent can be done with triggers. Another way to keep them consistent is to disallow direct access to the tables, and only allowi... |
Think of a database as a great big object - after each call to it, it ought to be in a logically consistent state.
Databases expose themselves via tables, and keeping tables and rows consistent can be done with triggers. Another way to keep them consistent is to disallow direct access to the tables, and only allowi... |
Think of a database as a great big object - after each call to it, it ought to be in a logically consistent state.
Databases expose themselves via tables, and keeping tables and rows consistent can be done with triggers. Another way to keep them consistent is to disallow direct access to the tables, and only allowi... |