instruction stringlengths 0 30k ⌀ |
|---|
I would first determine what requirements are needed from the library:
1. Debug/Release
2. Unicode support
3. And so on..
With that determined you can then create configurations for each combination required by yourself or other library users.
When compiling and linking it is very important that you keep ... |
I would first determine what requirements are needed from the library:
1. Debug/Release
2. Unicode support
3. And so on..
With that determined you can then create configurations for each combination required by yourself or other library users.
When compiling and linking it is very important that you keep ... |
Did you try adding a Javascript that checks for the value of the first dropdown when the page is loaded?
As in, something like <body onload="checkDropdowns()">? Do tell me if the snippet below helps you out or do you need specifics with your code?
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//... |
Did you try adding a Javascript that checks for the value of the first dropdown when the page is loaded?
As in, something like <body onload="checkDropdowns()">? Do tell me if the snippet below helps you out or do you need specifics with your code?
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//... |
How do you get the asp:Menu to follow the url provided in the Web.sitemap? |
|asp.net| |
I have a _simple_ asp:menu item that uses the Web.sitemap to get the menu items. The page will postback but fails to get the page associated to the clicked item. I will mention that the navigation bar code is within the masterpage file.
<div>
<asp:SiteMapDataSource ID="SiteMapDataSource1" ShowStart... |
I have a _simple_ asp:menu item that uses the Web.sitemap to get the menu items. The page will postback but fails to get the page associated to the clicked item. I will mention that the navigation bar code is within the masterpage file.
<div>
<asp:SiteMapDataSource ID="SiteMapDataSource1" ShowStart... |
You have (at least) 2 issues - the complexity of the environment (the server) and the complexity of the GUI.
There are many tools for automating GUI testing. All of them are more or less fragile and require pretty much constant maintenance in the face of changing layout. There is benefit to be gained from using them... |
We used TeX (MikTeX) and it was perfect because:
- plaint text - edit in Vim/Notepad - just everywhere
- powerful formatting using predefined macros one of us did
- onclick generation to PDF
The only problem was to get diagrams (from ArgoUML) in.
At another project I saw using Word templates - awful stuff di... |
Microsoft Word. I know it doesn't meet with your requirements but in every job I've had I've used Microsoft Word for the specifications. You can, and I have, put Word documents in a source control system - The only thing you lose is the ability to diff between documents. Although I do vaguely remember reading somewhere... |
We are using [opencms][1].
I haven't tried to extend it beyond changing page templates (writing JSPs) but where usage is concerned it gets the job done, albeit the feeling you get is that you fight the system all the way through.
Memory consumption on the JVM running opencms is right now 161 Mb, the JVM running si... |
I don't know java but I think that xpath is far better than classic regular expressions in order to get one (or more) html elements.
It is also easier to write and to read.
<html>
<body>
<a href="1.html">1</a>
<a href="2.html">2</a>
<a href="3.html">3</a>
</bod... |
This isn't as simple as just checking whether the file name contains any of <a href="http://msdn.microsoft.com/en-us/library/system.io.path.getinvalidfilenamechars.aspx">System.IO.Path.GetInvalidFileNameChars</a> (as mentioned in a couple of other answers already).
For example what if somebody enters a name that con... |
You could have a look at [OpenC++][1] or [XRTTI][2]. I've never used either of them, so I can't tell you how (im)practical they are.
[1]: http://opencxx.sourceforge.net/
[2]: http://www.ischo.com/xrtti/ |
You could have a look at the two tools below. I've never used either of them, so I can't tell you how (im)practical they are.
**[XRTTI][2]**:
> Xrtti is a tool and accompanying C++ library which extends the standard runtime type system of C++ to provide a much richer set of reflection information about classes an... |
topics to look at:
1. ADO.NET basics
2. LINQ to SQL
3. Managed database providers
|
Should I mysql_real_escape_string all the cookies I get from the user to avoid mysql injection in php? |
|php|validation| |
When a user goes to my site, my script checks for 2 cookies which store the user id + part of the password, to automatically log them in. Its possible to edit contents of cookies via a cookie editor, so I guess its possible to add some malicious content to a written cookie?
Should I add mysql_real_escape_string (or ... |
Id don't know if this will help you, but in Delphi the standard Message library states:
**WM_MOUSEWHEEL = $020A;**
It would also be helpful if you let as know which language you are using.
|
If it is a web application here are some good resources for getting started with data access in .NET:
[http://weblogs.asp.net/scottgu/archive/2007/04/14/working-with-data-in-asp-net-2-0.aspx][1]
[1]: http://weblogs.asp.net/scottgu/archive/2007/04/14/working-with-data-in-asp-net-2-0.aspx |
The Bass library works on Mac and Windows, and has good documentation and SDK examples:
http://www.un4seen.com/
|
Add the following to the preprocessor definitions:
_CRT_NOFORCE_MANIFEST |
You should mysql_real_escape_string ***anything*** that could be potentially harmful. Never trust any type of input that can be altered by the user. |
Did you try running "mvn -U -cpu site:site" to update all the maven dependencies?
Maybe this question is better asked in the Maven forum :) |
Reads like a beginner question. That calls for beginner video demos.
[http://www.asp.net/learn/data-videos/][1]
They are ASP.NET focused, but pay attention to the database aspects.
[1]: http://www.asp.net/learn/data-videos/ |
[Type.IsAssignableFrom][1]
if(typeof(IMyInterface).IsAssignableFrom(typeof(T)))
{
// something
}
else
{
// something else
}
[1]: http://msdn.microsoft.com/en-us/library/system.type.isassignablefrom.aspx
|
sp_help tablename will show you all |
The system stored procedure sp_help will give you this information. Execute the following statement:
execute sp_help tablename |
The best way to evaluate RCP is to create a small project ... I started with the tutorial here: [http://www.ibm.com/developerworks/edu/os-dw-os-ecl-rcpapp.html][1] and gradually created a less trivial application.
Probably the best single resource I've found is the "Eclipse Rich Client Platform" book (which I initia... |
Use this:
<pre><code>Request.Url.AbsoluteUri</code></pre>
That will get you the full path (including http://...) |
I think
if (typeof (IMyInterFace).IsAssignableFrom(typeof(T))
should also work: but i don't see an advantage... |
I'm not sure if this works for you, but when I do small solo PHP projects with Eclipse, the first thing I set up is an Ant script for deploying the project to a remote testing environment. I code away locally, and whenever I want to test it, I just hit the shortcut which updates the remote site.
Eclipse has good An... |
Multiple relations to the same model in Rails |
|ruby-on-rails| |
Let's say I have two models, Classes and People. A Class might have one or two People as instructors, and twenty people as students. So, I need to have multiple relationships between the models -- one where it's 1->M for instructors, and one where it's 1->M for students.
I'm sure this is quite easy, but Google isn't... |
Let's say I have two models, Classes and People. A Class might have one or two People as instructors, and twenty people as students. So, I need to have multiple relationships between the models -- one where it's 1->M for instructors, and one where it's 1->M for students.
Edit: Instructors and Students *must* be the ... |
Is using MS SQL Server you can do the following:
--List all tables primary keys
select * from information_schema.table_constraints
where constraint_type = 'Primary Key'
You can also filter on the table_name column if you want a specific table. |
I'd use the find command.
find . -lname /particular/folder
That will recursively search the current directory for symlinks to `/particular/folder`. Note that it will only find absolute symlinks. A similar command can be used to search for all symlinks pointing at objects called "folder":
find . -lname ... |
A few of the answers above have a counter-argument: If the users pick the same username they use on the other sites, then they are also likely to pick the same or similar passwords for the financial site, lowering security.
A reason not to do it: If you impose more restrictions than they are used to on the users, th... |
find / -lname 'fullyqualifiedpathoffile' |
For hardlinks, you can get the inode of your directory with one of the "ls" options (-i, I think).
Then a find with -inum will locate all common hardlinks.
For softlinks, you may have to do an ls -l on all files looking for the text after "->" and normalizing it to make sure it's an absolute path. |
They have totally different semantics.
AddRange modifies the list by adding the other items to it.
Concat returns a new sequence containing the list and the other items, without modifying the list.
Choose whichever one has the semantics you want. |
There isn't really any direct way to check for such symlinks. Consider that you might have a filesystem that isn't mounted all the time (eg. an external USB drive), which could contain symlinks to another volume on the system.
You could do something with:
for a in `find / -type l`; do echo "$a -> `readlink $a... |
How can I do offline reasoning with Pellet? |
|semantic-web|owl|pellet|rdfs|semweb| |
I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/20... |
How to retrieve params from GET HTTP method using javax.ws.rs.* and Glassfish? |
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void indexChanged(object sender, EventArgs e)
{
Label1.Text = " I did something! ... |
See this KB Article. [How to configure SQL Server 2005 to allow remote connections][1].
Oh, and remember that the SQLServer name will probably be MyMachineName\SQLExpress
[1]: http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
|
> when you added the listview, did you add it to the toolbox and then add it to the form?
No, I just edited `Main.Designer.cs` and changed it from `System.Windows.Forms.ListView` to `MyApp.Controls.SortableListView<Image>`
Suspecting it might have been due to the generics led me to actually finding a solution.
... |
@Balloon
$rev and others like it are revisions for the individual files, so they won't change unless the file changes. The number on the webpage is (most likely, I'm assuming here) the svn revision number for the whole project. That is different than the file revisions, which others have been pointing to.
In this... |
Apparently, it's not quite that simple, but [still possible](http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx), if you have Windows Mobile 5.0 or newer. |
I've evaluated the [Telerik](http://www.telerik.com/) grid as well as [Infragistics](http://www.infragistics.com/Default.aspx) version. In the end we took an approach similar to what tags2k suggested. We just wrote our own javascript and called [.Net PageMethods](http://www.singingeels.com/Articles/Using_Page_Methods... |
> Apparently, it's not quite that
> simple, but still possible, if you
> have Windows Mobile 5.0 or newer.
Wow...definitely not worth it if I have to put all that code in (and do native interop!)
Good to know though, thanks for the link. |
My personal favorite is [EditPad Pro][1]. Not because it is superior in any way, but because it was the one I started to use.
[1]: http://www.editpadpro.com/ |
I'm assuming you mean Linq To Sql
For any CRUD command it's easy to profile the performance of a stored procedure vs. any technology. In this case any difference between the two will be negligible. Try profiling for a 5 (simple types) field object over 100,000 select queries to find out if there's a real difference.... |
Can't help you with your original question, but are you aware that you can access Excel files using an OleDbConnection, and therefore treat it as a database? You can then read worksheets into a DataTable, perform all the changes you need to the data in your application, and then save it all back to the file using an Ol... |
The best code is no code, and with stored procedures you have to write at least some code in the database and code in the application to call it , whereas with LINQ to SQL or LINQ to Entities, you don't have to write any additional code beyond any other LINQ query aside from instantiating a context object. |
Linq, Sql server will cache the query plans, so there's no performance gain for sprocs.
Your linq statements, on the other hand, will be logically part of and tested with your application. Sprocs are always a bit separated and are harder to maintain and test.
If I was working on a new application from scratch ri... |
Linq to Sql.
Sql server will cache the query plans, so there's no performance gain for sprocs.
Your linq statements, on the other hand, will be logically part of and tested with your application. Sprocs are always a bit separated and are harder to maintain and test.
If I was working on a new application from... |
You want StructLayoutAttribute (<http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.structlayoutattribute(VS.71).aspx>)
[StructLayout(LayoutKind.Explicit, Size=8, CharSet=CharSet.Ansi)]
public struct Foo
{ [FieldOffset(0)]public ushort original_or_copy;
[FieldOffset(1)]publ... |
|java|jakarta-ee|glassfish| |
I just installed Glassfish V2 on my local machine just to play around with it.
I was wondering if there is a way to retrieve a param passed in by the GET HTTP method.
For instance,
http://localhost:8080/HelloWorld/resources/helloWorld?name=ABC
How do I retrieve the "name" param in my Java code? |
Apart from looking at all other folders if there are links pointing to the original folder, i don't think it is possible. If it is, I would be interested.
|
DocBook edited with XXE, translated to pdf with xslt when needed to be sent to clients.
Best change ever, so much easier to write, so much easier to merge, and when it's converted it doesn't look so godawfully unprofessional as MSWord.
Plus the structured document style is already there, unlike bloody word which ... |
Google has [ClientLocation][1] as part of their AJAX APIs. You'll need to load Google's AJAX API (requires an API key) and it'll try to resolve the user's location data for you.
[1]: http://code.google.com/apis/ajax/documentation/#ClientLocation |
Start seleniumRC from Fitnesse |
|tfs|selenium|fitnesse|fit| |
I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on TFS.
In an attempt to make it self contained I would like to start the seleniumRC server only when it's needed from fitness.
I've seen that there is a "Command Line Fixture" but it's written in java can I use that?
|
[JSAN (JavaScript Archive Network)][1] sounds like the kind of thing you're looking for, but I've never personally used anything from it apart from Test.Builder.
As long as your JavaScript can be dropped in to people's projects without polluting the global namespace or doing things which are liable to cause breakage... |
Tools for finding unused function declarations? |
|c++|function|header| |
Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the .cpp file. Does anyone know of a tool that could find (and strip) these automatically? |
Courtesy of Judith Bishop, [http://patterns.cs.up.ac.za/][1]
This singleton pattern implementation ensures lazy initialisation.
using System;
// Singleton Pattern Judith Bishop Nov 2007
// The public property protects the private constructor
public class S... |
There's a [list](http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis#C.2B.2B). There is also a putative [C++ frontend on splint](http://splintpp.sourceforge.net/). |
According to stack object dump "ASI.ParadigmPlus.GrilleApp.GA1000" is 96872 bytes. You might want to figure out what that object is all about. That's a pretty big chunk of your stack space right there.
|
It looks as if new_task_attributes= is expecting an array of hashes, but you're passing it a hash. Try this:
def test_adding_task_to_project
p = Project.new
new_tasks_attributes = [{ "name" => "paint fence"}]
p.new_tasks_attributes = (new_tasks_attributes)
p.save
assert p.tasks... |
Pex users: what are your Impressions of Pex and Automated Exploratory Testing in general? |
|testing|automated-tests|parameterized-unit-tests|pex| |
Those of you who have used [Pex][1], what do you think its advantages and disadvantages are of Pex as a tool?
Also, what do you think are the advantages and disadvantages of "Automated Exploratory Testing" in general, **in addition to** TDD/Unit Testing?
[1]: http://research.microsoft.com/Pex/ |
|unit-testing|testing|automated-tests|pex| |
Those of you who have used [Pex][1], what do you think its advantages and disadvantages are of Pex as a tool?
Also, what do you think are the advantages and disadvantages of "Automated Exploratory Testing" in general, **as a supplement to** TDD/Unit Testing?
[1]: http://research.microsoft.com/Pex/ |
If you want to get really hard-core, do some static analysis, and figure out exactly what libraries are needed when, and only include those.
If you use "include" and not "include_once", then there is a bit of a speed savings there as well.
All that said, Matt's answer about the Zend Optimizer is right on the mo... |
Also, mod can be used like this:
int a = 7;
a %= 2;
Just like most other operators. |
Also, mod can be used like this:
int a = 7;
a %= 2;
<code>a</code> would now equal 1. Because <code>7 % 2 = 1</code>.
Just like most other operators. |
www.google.com is not accessible by HTTPS. It redirects to insecure HTTP. To get to mail, you should be going go https://mail.google.com |
Use the word joiner character, U+2060 (i.e. `⁠`) |
import socket
socket.setdefaulttimeout(30000)
sock = socket.socket()
sock.connect(('www.google.com', 443))
ssl = socket.ssl(sock)
ssl.server()
--> '/C=US/ST=California/L=Mountain View/O=Google Inc/CN=www.google.com'
It works just fine. I can't reproduce your error. |
> So then what if the processing requires jumping around in the data for multiple files and multiple buffers? Is constant opening and closing of binary files going to become expensive?
I'm a big fan of *'memory mapped i/o'*, aka *'direct byte buffers'*. In Java they are called **[Mapped Byte Buffers][1]** are are ... |
> So then what if the processing requires jumping around in the data for multiple files and multiple buffers? Is constant opening and closing of binary files going to become expensive?
I'm a big fan of *'memory mapped i/o'*, aka *'direct byte buffers'*. In Java they are called **[Mapped Byte Buffers][1]** are are ... |
Make a second property that is protected or internal(?)
<Column(Name:="totalLogins", Storage:="_TotalLogins", DbType:="Int", UpdateCheck:=UpdateCheck.Never)> _
protected Property TotalLogins2() As System.Nullable(Of Integer)
Get
Return Me._TotalLogins
End Get
... |
What is your session management strategy for NHibernate in desktop applications? |
|.net|nhibernate| |
I find it much more difficult to manage your session in a desktop application, because you cannot take advantage of such a clear bondary like HttpContext.
So how do you manage your session lifetime to take advantage of lazy loading but without having one session open for the entire application? |
I have successfully used [GNU utilities for Win32][1] for quite some time and it has a good grep as well as tail and other handy gnu utils for win32. I avoid the packaged shell and simply use the executables right in win32 command prompt.
The Tail that is packaged is quite a good little application as well.
[... |
I've recently worked on a AAA PC title that used FMOD. Our audio programmer loved it and was very productive with it, so I'd give FMOD a thumbs up. We only used FMOD on Windows so I can't speak to the cross-platform aspects of it at all. |
HWND is a handle to a window.
This type is declared in WinDef.h as follows:
>typedef HANDLE HWND;
HANDLE is handle to an object.
This type is declared in WinNT.h as follows:
>typedef PVOID HANDLE;
Finally, PVOID is a pointer to any type.
This type is declared in WinNT.h as follows:
>typedef void *PVOID;
... |
I agree with you. It is possible to modify the cookies and send in malicious data.
I believe that it is good practice to filter the values you get from the cookies before you use them. As a rule of thumb I do filter any other input that may be tampered with. |