Public Function CastToT(Of T)(ByVal GenericType(Of Object) data) As GenericType(Of T)
Return DirectCast(data, GenericType(Of T))
End Function
The above clearly does not work. Is there any way to perform this cast if I know that all objects inside data are in fact of Type T?
I'm hand-editing HTML files in a plain text editor (vim) via SharePoint Designer. Problem is, as soon as I save the files, SharePoint automatically adds width and height attributes to all the img-tags.
Anyone know if it's possible to disable this "feature"?
I don't want it to mess around with my code. Yeah, shouldn't be using SharePoint Designer…
I have the interesting problem of representing complex schedule data in a database. As a guideline, I need to be able to represent the entirety of what the iCalendar -- ics -- format can represent, but in a database. I'm not actually implementing anything relating to ics, but it gives a good scope of the type of rules I need to be able to model.
…
Hi,
i always like to real-time edit a web page source in the browser and updated as i type, but firebug really sucks, i can't insert scripts in the current page, some times the changes i type aren't updated at all, Is there any robust firefox/chrome extension for that?
i try to temporarely edit/add code to an existing web page in the internet,…
This seems like it should be easy to do, but I just can make it work. I'm hooked on the convention plugin in Struts 2.1. However, I need to define some package-level configuration such as a new interceptor stack and exception mappings. I'd like to use the struts.xml file for this, but I can't get the convention-based packages matched to the…
I have a RadioButtonList control and I would like to do a Javascript "confirm" when a user tries to change the index. Currently AutoPostBack is set to TRUE. I can, of course, just call __doPostBack from within a javascript function, etc. I tried a few things with jQuery but you have to worry about mousedown vs. click and then there is…
Hi,
i have the following code to update a google map:
function updateit(c1,c2){
alert(c1+"-"+c2); // This works
map.setCenter(new GLatLng(c1, c2), 13); // But this doesn't
}
updateit(37.4419, -122.1419);
The alert is working and show the two coordinations, but i think the GLatLng() doesn't receive them, so the map is not updated…
How do you write a procedure which shows that one field's value cannot be higher than another field value, in terms of numbers... ive never done one before
say. employee salary field cant be higher than his manager salary
I'm running CentOS 5, and am trying to get a django application working with mod_wsgi. I'm using .wsgi settings I got working on Ubuntu.
Here is the error:
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] SystemError: dynamic module not initialized properly
[Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251] mod_wsgi…
I don't know how php.ini was configured since I don't have access to it. But on top of my php code file I have
error_reporting(E_ALL);
ini_set('display_errors', '1');
But still, if there is an error, e.g. missing a ")", the page is blank. It is so painful to debug without error message. Why were the errors not shown?
I'm working with a MySQL query that writes into an outfile. I run this query once every day or two and so I want to be able to remove the outfile without having to resort to su or sudo. The only way I can think of making that happen is to have the outfile written as owned by someone other than the mysql user. Is this…
I have created a server in perl that sends messages or commands to the client. I can send commands just fine, but when i am being prompted for the command on my server i have created, if i press 'enter', the server messes up. Why is this happening?
Here is part of my code:
print "\nConnection recieved from IP address…
Hi Folks,
Can you think of one type of error that might be found using White-Box testing, and one type using Black-Box testing. i.e. an error that would be found by one and not the other.
For WBT there would null else statements, but what would you catch with BBT and not WBT???
BTW this question is just based on my…
I am encountering a problem when using LINQ in C#, I am constantly getting "Specified cast is not valid". This is what I am trying to do.
I create a class in which I declare all the columns of the table.
[Table(Name="tbl_Aff")]
public class Affiliate
{
[Column]
public string name;
…
Hi all, I'm trying to use boost::normal_distribution in order to generate a normal distribution with mean 0 and sigma 1.
The following code uses boost normal classes. Am I using them correctly?
#include <boost/random.hpp>
#include <boost/random/normal_distribution.hpp>
int main()
{
boost::mt19937 rng;…
I have a dialog popup to indicate how long I want an activity to run.
Seems simple enough, but its difficult to determine when the activity is really starting.
If the user opens the keyboard on a G1 and thereby goes into landscape, that reruns the activities onCreate method.
I can't have a static for the class or…
I'm writing some software that modifies a Windows Server's configuration (things like MS-DNS, IIS, parts of the filesystem). My design has a server process that builds an in-memory object graph of the server configuration state and a client which requests this object graph. The server would then serialize the…
I basically want to use the XML parser from Qt in my existing project. I have only used Qt once before, and that was with Qt Designer, and I am not having much luck finding anything on Google about how to just use the XML library.
I have downloaded a web page that has one large list, and I want to parse it…
I posted a question a few months ago about sharing resource dictionaries across assemblies. It turns out you can do that using the Component Resource Key markup extension. At the time, I could only get it working with a WPF Custom Control project, not with a plain Class Library project.
Now I need to use…
I'm setting up a build system for a Flash Builder 4 (Flex 4) based project; and I'm struggling to get a setup that compiles in the IDE the same as it does from the command line on the build server.
I come from a C# background; and my expectation is that I'll be able to create a "solution" with a…
For instance, what I have right now is the following:
Page.Response.Redirect("Default.aspx", false);
Needing to hardcode the string just seems odd to me. The Default.aspx page is already in my project. So is there a way to do the redirect something like the following:
…
I would like to check a large number of HTML files with inline JavaScript for JavaScript errors. What I'm envisioning doing is this: Script a browser to load a given page, wait a few seconds, and finally check the browser logs. I'm unsure though both on how to script a…
here is the original code:
public static int getInt ()
{
Scanner in = new Scanner (System.in) ;
if (in.hasNextInt())
{
int a = in.nextInt() ;
return a ;
}
else
{
System.out.println ("try again:") ;
return getInt ()…
I have a form on my website in which one is able to submit a cat. The form contains inputs such as "Name" and "Gender", but I am just trying to get the auto completion to work with the "Name" field. Here is what my jquery looks like :
$(document).ready(function() {
$(…