My datagrid view contains three columns, column types are checkbox, textbox and combobox.
If I check one row, it will load corresponding rows combobox only. How can I do it?
I'm doing course 3354 (Implementing System Types and Interfaces in the .NET Framework 2.0) and it is said that for simple classes, with members variables and functions, it is better to use a struct than a class because of overhead.
I have never heard of such a thing, what is the validity of this claim?
Hi folks,
I'll briefly explain what I'm trying to do:
I need to sort a set of content-types within a paginated page. Also I need to add filtering to the page, for example each content-type should have a set of tags and the filter needs to filter through these tags.
This is a basic mockup of what this page consists of:
I'm finding it quite hard figuring out the best way to do it, and if this can be done.
Help would be very much appreciated!!
my wrapper from managed to unmanaged is handling a lot of data and this Guy would call new for each of them, which is a big hit for me. So my question is :
can I allocate a chunk of unmanaged memory and use it to convert the managed data types to unmanaged by hand.
I use windows 7. I set the ClassPath like this:
D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\jsf-api.jar;D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\jsf-impl.jar;D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\primefaces-2.2.RC1.jar
And I alse do this:
Window Preferences General Content Types Text JSP Add (xhtml)
But, it doesn't works.
When I use netbeans. I do nothing, but the autocomplete function works well.
We currently have an iPhone app and would like to build a mobile website that has similar functionalities so it is accessible on multiple types of handsets.
what programming language should we best use for this? our app would like to use geolocation, camera/photo upload and access to the phone's contacts.
hope you can help us out!
best,
Robbert
Hi,
I would like create a very simple Paint application using MAF on WPF.
The Add Ins I would like to create are:
Main Image Processor - Shown the current paint
Tool Box - The user can select some types of drawings tools
Layers - The user can select the layers to display, delete layers and select on which layer to work on
the question is: How I can interact between the different Add-Ins without using the host?
Thanks,
Ronny
Im asp.net mvc3 c# code returns json list like this:
return Json(new { name = UserNames, imageUrl = ImageUrls });
UserNames and ImageUrls are both List types
And this is my jquery
function StartSearch(text) {
$.ajax({
url: '/Shared/Search',
type: 'POST',
data: { SearchText: text },
dataType: 'json',
success: function (result) {
$.each(result, function (i, item) {
alert(result[i].name);
});
}
});
}
How i can get names and umageUrls?
Thanks
Every now and then (once every day or so) we're seeing the following types of errors in our logs for an ASP.NET 3.5 application
Invalid viewstate
Invalid postback or callback argument
Are these something that "just happens" from time-to-time with an ASP.NET application? Would anyone recommend we spend a lot of time trying to diagnose what's causing the issues?
What software (or types of software) can be condsidered as innovative?
What distinctive parameters or features of product can be considered as innovative?
I'd like to dynamically create a module from a dictionary, and I'm wondering if adding an element to sys.modules is really the best way to do this. EG
context = { a: 1, b: 2 }
import types
test_context_module = types.ModuleType('TestContext', 'Module created to provide a context for tests')
test_context_module.__dict__.update(context)
import sys
sys.modules['TestContext'] = test_context_module
My immediate goal in this regard is to be able to provide a context for timing test execution:
import timeit
timeit.Timer('a + b', 'from TestContext import *')
It seems that there are other ways to do this, since the Timer constructor takes objects as well as strings. I'm still interested in learning how to do this though, since a) it has other potential applications; and b) I'm not sure exactly how to use objects with the Timer constructor; doing so may prove to be less appropriate than this approach in some circumstances.
EDITS/REVELATIONS/PHOOEYS/EUREKAE:
I've realized that the example code relating to running timing tests won't actually work, because import * only works at the module level, and the context in which that statement is executed is that of a function in the testit module. In other words, the globals dictionary used when executing that code is that of main, since that's where I was when I wrote the code in the interactive shell. So that rationale for figuring this out is a bit botched, but it's still a valid question.
I've discovered that the code run in the first set of examples has the undesirable effect that the namespace in which the newly created module's code executes is that of the module in which it was declared, not its own module. This is like way weird, and could lead to all sorts of unexpected rattlesnakeic sketchiness. So I'm pretty sure that this is not how this sort of thing is meant to be done, if it is in fact something that the Guido doth shine upon.
The similar-but-subtly-different case of dynamically loading a module from a file that is not in python's include path is quite easily accomplished using imp.load_source('NewModuleName', 'path/to/module/module_to_load.py'). This does load the module into sys.modules. However this doesn't really answer my question, because really, what if you're running python on an embedded platform with no filesystem?
I'm battling a considerable case of information overload at the moment, so I could be mistaken, but there doesn't seem to be anything in the imp module that's capable of this.
But the question, essentially, at this point is how to set the global (ie module) context for an object. Maybe I should ask that more specifically? And at a larger scope, how to get Python to do this while shoehorning objects into a given module?
For some reason, all of the objects in my ASP.NET markup are now null when I try to assign values to their properties in the code behind.
My project was going fine and then now when I try to assign a data source to a GridView, I get a null reference error.
I have no idea why it's doing this. I am not doing nothing special. I am just trying to assign a value to a property to an asp.net element in on the page. The intellisense knows that the element is there and I get no errors when I build the project. It's just when I am running the website I get the null reference.
I have been trying to fix this issue for a couple weeks now. Please Help.
Thanks.
Here is the code:
protected void Page_PreRender(object sender, EventArgs e)
{
LoadData();
}
private void LoadData()
{
Entities context = new Entities();
var types = (from t in context.CustomerTypes
select t).OrderBy(t => t.TypeName);
gvCustomerTypes.DataSource = types;
gvCustomerTypes.DataBind();
}
and on in the markup the gridview looks like this:
<asp:GridView ID="gvCustomerTypes" runat="server" ShowHeader="true" GridLines="Both"
AutoGenerateColumns="false" AlternatingRowStyle-BackColor="AliceBlue" Width="100%">
<Columns>
<asp:TemplateField HeaderText="Customer Type Name" HeaderStyle-HorizontalAlign="Left"
ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblType" runat="server" Text='<%# Eval("TypeName") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" NavigateUrl='<%#Eval("CustomerTypeID", "CreateEditCustomerType.aspx?ID={0}") %>'
Text="Edit" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" CommandName='<%#Eval("CustomerTypeID") %>' OnClientClick="javascript:return confirm('Are you sure you want to delete this Customer Type?');"
OnCommand="DeleteCustomerType" Text="Delete" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
I want to create a method sum that I can call on different types, specifically sum(1,2).
def sum[A](a1: A, a2: A) = a1 + a2
This fails because the compiler can't tell if A has a method '+'
I tried to define a structural type:
type Addable = {def +(a: Addable)}
This fails because of an illegal cyclic reference
How can I achieve this in a type safe way without requiring A to extend a specific trait?
When building gtk2hs-buildtools with ghc 7.4.2, I get the following warning:
c2hs/toplevel/C2HSConfig.hs:110:1:
Warning: newtype `CInt' is used in an FFI declaration,
but its constructor is not in scope.
This will become an error in GHC 7.6.1.
When checking declaration:
foreign import ccall safe "static bitfield_direction" bitfield_direction
:: CInt
I get similar warnings with FFI calls, even though I have import Foreign.C.Types(CInt).
What is the correct way of getting rid of this warning?
Hi,
I'm working on a Rewriterule in order to have URLs like these: http://www.myhost.com/var1/var2/
RewriteRule ^(.*)\/(.*)\/$ index.php?var1=$1&var2=$2 [L]
What I would like to add is that when someone types myhost.com/var1/var2 (without the end slash), it still goes to the same page.
Is there a better way to do it than this?
RewriteRule ^(.*)\/(.*)\/$ index.php?band=$1&song=$2 [L]
RewriteRule ^(.*)\/(.*)$ index.php?band=$1&song=$2 [L]
I have a table in my database called "OrderItemType" which has about 5 records for the different OrderItemTypes in my system. Each OrderItem contains an OrderItemType, and this gives me referential integrity. In my middletier code, I also have an enum which matches the values in this table so that I can have business logic for the different types.
My dev manager says he hates it when people do this, and I am not exactly sure why. Is there a better practice I should be following?
Hello, I wrote this code:
public static bool MyMethod(int someid, params string[] types)
{...}
How could I write that using Func?
public static Func < int, ?params?, bool > MyMethod = ???
Thanks :-)
I'm running PHP 5.3.0. I've found that the curly string syntax only works when the first character of the expression is $. Is there a way to include other types of expressions (function calls, etc)?
Trivial example:
<?php
$x = '05';
echo "{$x}"; // works as expected
echo "{intval($x)}"; // hoped for "5", got "{intval(05)}"
I have the following (doctored) class in a system I'm working on and Findbugs is generating a SE_BAD_FIELD warning and I'm trying to understand why it would say that before I fix it in the way that I thought I would. The reason I'm confused is because the description would seem to indicate that I had used no other non-serializable instance fields in the class but bar.model.Foo is also not serializable and used in the exact same way (as far as I can tell) but Findbugs generates no warning for it.
import bar.model.Foo;
import java.io.File;
import java.io.Serializable;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Demo implements Serializable {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final File file;
private final List<Foo> originalFoos;
private Integer count;
private int primitive = 0;
public Demo() {
for (Foo foo : originalFoos) {
this.logger.debug(...);
}
}
...
}
My initial blush at a solution is to get a logger reference from the factory right as I use it:
public DispositionFile() {
Logger logger = LoggerFactory.getLogger(this.getClass());
for (Foo foo : originalFoos) {
this.logger.debug(...);
}
}
That doesn't seem particularly efficient, though.
Thoughts?
i have one form and i am using PHPMailer to send data from that form to my email. Users can send attachments as well, but i have one rpoblem: how to make PHPMailer to deny attachments larger than 2Mb and to allow only iamge attachments (no other types of documents)?
This is code i using for multiply email attachments with PHPMailer:
foreach(array_keys($_FILES['fileAttach']['name']) as $key) {
$source = $_FILES['fileAttach']['tmp_name'][$key];
$filename = $_FILES['fileAttach']['name'][$key];
$mail->AddAttachment($source, $filename);
}
Is it possible to create and manage custom permission types in Jetspeed. In addition to the default - folder, page, link, portlet I would like to add document as a type.
I want to then use the list of permissions of type "document" that a principal has to manage access to documents.
Thanks
I want to use selenium test to cover my rails project ! but i just find little documents on selenium test . I want someone to give me some documents for selenium test of all types !like website ,pdf ,text etc. you can sent them to my gmail [email protected] Thank you ,and best regards!
As we know, in C# structs are passed by value, not by reference. So if I have a struct with the following data members:
private struct MessageBox
{
// data members
private DateTime dm_DateTimeStamp; // a struct type
private TimeSpan dm_TimeSpanInterval; // also a struct
private ulong dm_MessageID; // System.Int64 type, struct
private String dm_strMessage; // an object (hence a reference is stored here)
// more methods, properties, etc ...
}
So when a MessageBox is passed as a parameter, a COPY is made on the stack, right?
What does that mean in terms of how the data members are copied?
The first two are struct types, so copies should be made of DateTime and TimeSpan. The third type is a primitive, so it's also copied. But what about the dm_strMessage, which is a reference to an object? When it's copied, another reference to the same String is created, right? The object itself resides in the heap, and is NOT copied (there is only one instance of it on the heap.) So now we have to references to the same object of type String. If the two references are accessed from different threads, it's conceivable that the String object could be corrupted by being modified from two different directions simultaneously. The MSDN documentation says that System.String is thread safe. Does that mean that the String class has a built-in mechanism to prevent an object being corrupted in exactly the type of situation described here?
I'm trying to figure out if my MessageBox struct has any potential flaws / pitfalls being a structure vs. a class.
Thanks for any input.
Source.Energy.
I know that you can instantiate anonymous types with Linq but I am looking to instantiate an object I have already defined. Every time I do, all the properties are returned with their defaults (null, 0, etc.) Is there a way to make this work?
I've tried something like this:
ServiceDepartment[] serviceDepartments = (from d in departments
orderby d.department_name
select new ServiceDepartment
{
DepartmentID = d.department_id,
DepartmentName = d.department_name
}).ToArray();
Hi I have a task as that
a dropdown list to choose an input type
selections are
textbox
datetime
number
while choosing one of those types, I have to open the selected input(for example if user chose datetime I have to open a datetime input)
For this task which is most suitable
using aspview(each input type one view)
for each one a usercontrol so when user select
a type loading it's usercontrol at runtime
or do you have any better ideas?