What could be the easiest way to match all links and e-mail addresses in a string to a list array? I was using preg_match in PHP but in C# it looks like it will be way different.
I have a project that involves recording data from a device directly into a sql table.
I do very little processing in code before writing to sql server (2008 express by the way)
typically i use the sqlhelper class's ExecuteNoneQuery method and pass in a stored proc name and list of parameters that the SP expects.
This is very convenient, but i need a much faster way of doing this.
Thanks.
Cant get this to work can any one help.
List the part number, part description, and on_hand value of each part whose number of units on hand is more than the average number of units onhand for all parts use a subquery?
SELECT PART_NUM, DESCRIPTION, SUM(ON_HAND * PRICE) ON_HAND_VALUE
FROM PART;
WHERE MAX(ON_HAND);
(AVG(ON_HAND) > ON_HAND);
Hi
What are the possible ways of representing data in memory in .Net (or in general)?
It would be great if data could be sorted and looked up by key (or multiple keys).
We are thinking to use collections, arrays, list of collections/arrays. One object would be in several collections (one sorted asc, other desc, etc.).
Maybe this is not a good idea, and we would like to hear some other possible solutions.
Thank you
I am trying to Drag a toolbar button to a tree node. Is it possible? I have noticed that drag start is never fired. Is there any list of components/classes available that currently allow to be dragged?
Hi,
I've been messing with Haskell few days and stumbled into a problem.
I need a method that returns a random list of integers ( Rand [[Int]] ).
So, I defined a type: type Rand a = StdGen -> (a, StdGen).
I was able to produce Rand IO Integer and Rand [IO Integer] ( (returnR lst) :: StdGen -> ([IO Integer], StdGen) ) somehow. Any tips how to produce Rand [[Int]]?
Hi ,
I have country table,
i fetch all values and moved into array ,
these value i like to populate into combo/dropdown list ,
here i want to do some magic things,
that is , for my site most of the users coming from uk,us,Australia,Romain and few,
So i like to populate by my preference ,
is there any array will do this magic work, else is it possible mysql query ,
So final question is ,
Populate country name into combo based on my prefernce ,
Thanks
I need to write a software, which launches DRM jobs in a customer environment and monitors those jobs status.
It should work with various customer environments and DRMs - like LSF, Sun Grid and others.
Can you recommend some 3rd party library, which hides DRM differences from me and has API like "launch job", "get list of jobs", "get job status" etc. ?
Both Java and native libraries are good for me.
Was discussing over lunch why several ports of languages to the .net framework are prefixed with 'Iron'.
e.g.
IronPython
IronRuby
IronLisp
IronScheme
IronPHP
Anyone out there know?
(language list sourced from http://www.dotnetpowered.com/languages.aspx)
I was wondering if the foreach statement in perl iterates the items in an array in consistent order ? That is, do I get different results if I use foreach multiple times on the same array or list ?
Thanks.
I'm using a list of siteMapProviders in my web.config file.
To retrieve these values in code, I need to specify the names in strings.
Understandably, these is always a mismatch at runtime.
Is there a way to return a strongly typed enum vlaues of these?
I have problem that i just cant figure out right now.
I am trying to develop a Windows-8 style app and im stuck implementing this functionality.
I have a MainWindow which contains a ListBox and a Button (lets say addButton).
When i click the button i navigate to a new page, lets say AddCustomerPage with this.Frame.Navigate(typeof (AddCustomerPage));
AddCustomerPage has 1 textBox and 1 button (lets say doneButton. When i click the button i want the string in the textBox to be added to the ListBox on the previous page.
This is my current functionality:
1. MainWindow is created.
Click addButton
AddCustomer page is created. MainWindow is destroyed(problem).
Click doneButton
A MainWindow object is created with a ListBox with 1 item.
Repeat the add process, i always get a MainWindow with a ListBox with 1 item.
Thanks for the help. Here is the code:
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
this.brainPageController = new PageController();
// add items from the List<String> to the listBox
listGoals.ItemsSource = brainPageController.GetListGoals();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var parameter = e.Parameter as String;
// a simple controller that adds a string to a List<string>
brainPageController.AddGoal(parameter);
}
private void addButton_Click(object sender, RoutedEventArgs e)
{
this.Frame.Navigate(typeof (GoalsInfo));
}
// VARIABLES DECLARATION
private PageController brainPageController;
}
public sealed partial class GoalsInfo : WinGoalsWIP.Common.LayoutAwarePage
{
public GoalsInfo()
{
this.InitializeComponent();
this.brainPageController = new PageController();
}
protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
{
}
protected override void SaveState(Dictionary<String, Object> pageState)
{
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
brainPageController.AddGoal(nameTextBox.Text);
this.Frame.Navigate(typeof(MainPage), nameTextBox.Text);
}
// VARIABLES DECLARATION
PageController brainPageController;
}
I'm trying to create a link that will hide or show a part of my page. The link should be reusable and display one of two images, depending on state.
Adding the two subcomponents on every page where I use the link is kind of clunky so I wanted to create a component that behaves like a link while automatically adding its content.
This is the Link component:
public class ToggleVisibilityLink extends AjaxFallbackLink<Boolean>
{
public ToggleVisibilityLink(final String id, final IModel<Boolean> model)
{
super(id, model);
setOutputMarkupId(true);
add(new Image("collapseImage")
{
@Override
public boolean isVisible()
{
return !getModelObject();
}
});
add(new Image("expandImage")
{
@Override
public boolean isVisible()
{
return getModelObject();
}
});
}
@Override
public void onClick(final AjaxRequestTarget target)
{
setModelObject(!getModelObject());
if (target != null)
{
target.add(this);
send(this.getParent(), Broadcast.EXACT, target);
}
}
}
And this is how I currently use it in HTML (this is added to the page or panel where I use the link):
<a href="#" wicket:id="collapseExpandLink" class="collapseExpandLink">
<wicket:link>
<img src="collapse.png" wicket:id="collapseImage" class="collapseExpandImage collapse">
</wicket:link>
<wicket:link>
<img src="expand.png" wicket:id="expandImage" class="collapseExpandImage expand">
</wicket:link>
</a>
And the corresponding Java call:
add(new ToggleVisibilityLink("collapseExpandLink", new PropertyModel(this, "hidden")));
But I want to be able to skip the body inside the link as one would have to know about the internals of ToggleVisibilityLink.
I experimented with IMarkupResourceStreamProvider, using Dynamic markup in Wicket as a starting point. By googling I found another example where the poster was only able to get that to work when using a Panel, and I was able to do that as well. But I'd really like to keep the link and not package it inside a Panel, as I would not be able to style the link in the markup.
I'm also open to alternatives to encapsulate the link and its body.
It starts to bore me that I always have to ask questions about trifles.
I simply need a list of all plugged in USB devices and have the user select one to let the console application receive any data the USB device sends.
I can then start playing around with the data in my program.
I don't want to use library's, only standard C++ functions, and the program should work in Windows 98.
Hi,
list<Dog*> dog;
.............
............
So I added many dog objects to it.
If I call dog.pop_front();
Does memory automatically gets deallocated ?
There is a way to bundle FireFox with a fixed list of extensions and that users won't be able to install/uninstall them after ?
A big company with lots of IE6 search a way to do that, they'are afraid about extensions and security if users can install anythings.
Any idea ?
I have a category system that is related many-to-many with posts. How can I select a list of those categories that are related to one or more posts?
$q = Doctrine_Query::create()
->from('Category c')
->where('<DONT KNOW WHAT TO WRITE>')
->select('c.name');
I have an ArrayList containing Objects that have a date value.
Now I want to manage to create a new ArrayList for each year that contains all the Objects from the main ArrayList that have the same year in their date Value.
So all Objects from 2010 go in one List, all from 1999 in another.
The thing is that there are number of items in the HTML select list. I want to click on any of the items, then query the database on the id of that item, retrieve the value and then display that in the textbox. How would I query the database?
I would really appreciate that if someone provides a code sample for querying the database.
I created a high memory utilization dump and using !dumpheap -stat and !dumpheap -mt I got the address of two large string generic list of 30 MB each.
I want to know more about these lists. What they contain or which piece of code is using them.
Is there a way to find them out?
0:000 !do 2b370038
Name: System.Object[]
MethodTable: 71e240bc
EEClass: 71c0da54
Size: 33554448(0x2000010) bytes
Array: Rank 1, Number of elements 8388608, Type CLASS
Element Type: System.Collections.Generic.List`1[[System.String, mscorlib]]
Fields:
None
I have a simple function that creates a generic List:
function test()
{
$genericType = [Type] "System.Collections.Generic.List``1"
[type[]] $typedParameters = ,"System.String"
$closedType = $genericType.MakeGenericType($typedParameters)
[Activator]::CreateInstance($closedType)
}
$a = test
The problem is that $a is always null no matter what I try. If I execute the same code outside of the function it works properly.
Thoughts?
Here is a simple header file for six different programs that used to work right, but then my files also include other files. This needs to get changed so that if the dependencies change the files that include those dependencies get updated.
all: load list show add delete btree
%: %.cpp
g++ $< -g -o $@
I'm talking specifically about the kind you get if you click and hold on an app in the dock, or a folder if list view is enabled. Is it a menu style, or a window flag I can set like the brushed metal-style?
Lots of little free apps seem to use it. http://bambooapps.com/free-stuff/ is a good example.
I have created a project using the following maven webapp project in eclipse:
When adding a package to the project (right click project - new - package), the package gets added as a folder (I added a package named core). It does not have the usual package icon:
If I try to create a new class and select a package, there are no entries in the list box. I have tried creating packages in a normal eclipse dynamic web project and these work correctly.
How do I get packages in Maven enabled webapp projects?
From what I understand about apply, it unpacks a list and turns the elements into arguments for a function.
I see that (apply + [1 2 3]) works as expected, i.e: it's equivalent to (+ 1 2 3).
Why then is (apply or [true false]) invalid? Isn't it equivalent to (or true false) ?