I put the RichTextBox in my Silverlight App. Do I have to create my own set of buttons to use it? I want to have a standard set of editing buttons for the text box.
I can:
declare @idOrder int
set @idOrder = 21319
I want:
declare @idOrder int
set @idOrder = (21319, 21320)
for use in a series of statements where the 'WHERE' clause uses the IN operator
delete Orders where idOrder in @idOrder
instead of
delete Orders where idOrder in (21319, 21320)
I want to do permutation in Perl. For example I have three arrays: ["big", "tiny", "small"] and then I have ["red", "yellow", "green"] and also ["apple", "pear", "banana"].
How do I get:
["big", "red", "apple"]
["big", "red", "pear"]
..etc..
["small", "green", "banana"]
I understand this is called permutation. But I am not sure how to do it. Also I don't know how many arrays I can have. There may be three or four, so I don't want to do nested loop.
We have many SVN Repo's but many of them have nested projects. I need some way of finding the trunk directories only and creating a list of them.
So, the svn path to trunk might be svn://svnserver/repos/myproject/trunk or it might be svn://svnserver/repos/myproject/mysubproject/trunk
I need to generate a list of /trunk directories from several different servers. Is there a method for doing that? Has anyone seen a script (sh, perl, whatever) for doing something similar? I just need a hint on how to get started.
I have HTML content stored in a variable. How do I extract data that is found between a set of common tags in the page? For example, I am interested in the data (represented by DATA kept between a set of tags which one line after the other:
...
<td class="jumlah">*DATA*</td>
<td class="ud"><a href="">*DATA*</a></td>
...
When should it be considered dangerous to use a private field all over the place in the methods of your class? I mostly just create the variable and set it to a default value like null. Then in my methods reference it and set it to an instance of that object type from the methods.
I don't know if my question makes sense but let me know if it doesn't and I'll clarify.
I'm using Entity Framework for creation of my Data Access Layer and I want for all of my classes to be internal.
I know it is possible to manually assign it manually in the designer for each class. But looks like it also requires to set internal modifier for each single property in every class! I have about 30+ entities and it will be a huge work to do.
Do you know any ideas how to set a 'default access' for the entire model?
I have the following dilemma: I have a list of strings, and I want to find the set of string which start with a certain prefix. The list is sorted, so the naive solution is this:
Perform binary search on the prefixes of the set, and when you find an element that starts with the prefix, traverse up linearly until you hit the top of the subset.
This runs in linear time, however, and I was wondering if anyone can suggest a more efficient way to do it.
hi,
here i am performing nested grid operation where in my first datagrid . have name,age,address
once user clicks the row we will be showing another grid that is with data Subject name and Score
untill here the functionality works fine .
1:now the Question is that i should be displaying an image along with score in the same column( how can i achive this one)
2:Depending on the score i need to show an image( binding different image based on score)
1 :that is if score is 20 show ( ~images/image1.jpg)
2 :that is if score is 40 show ( ~images/image2.jpg)
3 :that is if score is 20 show (~images/ image3.jpg)
output [ in a grid format]
subject score
science 45 image3
maths 50 image2
Computer 60 image1
general 78 image1
how do we solve this issue . any idea how to go ahead. please let me know.
hope my question is clear
thanks in advance
prince
Hi. Can anyone point out how to check if a select query returns non empty result set?
For example I have next query:
SELECT * FROM service s WHERE s.service_id = ?;
Should I do something like next:
ISNULL(SELECT * FROM service s WHERE s.service_id = ?)
to test if result set is not empty?
Hi guys,
I'm just preparing the release of a library site builded in asp.net:
http://213.133.103.5/gramma_prod/Site/Index.aspx
All it's working great on FF and Chrome but on IE the asp button click event is not working.
Please notice the most important buttons: "Adauga in cos" (Add to basket)...
I'm just struggling to find out the problem...
I've checked the forms to not have nested ones but they seems ok.
Could you provide any other ideea?
ps: I did not post any code because this problem occurs on all pages...
Thanks in advance.
Edit:
Code for "Add to basket"(Adauga in cos) button from the index:
<asp:ImageButton ID="imgBtnCosBooksFeatured" runat="server"
OnCommand="addProductToBasket_Click"
CommandName="Click" CommandArgument='<%# Eval("Carti_id").ToString()+","+Eval("Titlu").ToString()+","+Eval("Autor").ToString()%>'
ImageUrl="../Site/images/featured-cos.jpg" ToolTip="Adauga in cos" />
works ok on ff and chrome. Fails on IE :(
I have 2 activities in my application.
In activity1, I set some configuration and I modify the state of some component (ex: set button state disabled). And I navigate to activity2.
In activity2 I do some stuff and at end, I finish this activity and come back to activity1.
But In activity1, my components state are the same when I leave this activity.
How to reset the components state with valuesdeclared in XML file (layout) ?
My code does not update the thread field. It is null. Anyone have any ideas?
INSERT INTO [Messages]([Sender], [Receiver], [Job_Number], [Subject], [MessageText], [DateSent])
VALUES(@Sender, @Receiver, @Job_Number, @Subject, @MessageText, @DateSent)
SET @ThreadID = SCOPE_IDENTITY()
UPDATE [Messages]
SET Thread = @ThreadID
WHERE MessageID = @ThreadID
I have some two nested resources, so that a Product can have many Bookings. On one page in a different controller I want to create a new booking and since it's a "general" booking I want a select menu to appear in a modal window where the user is able to pick one of the existing products and then go to the booking page.
How can I do this?
I have no problem setting up the modal and the "New booking" page is already there. What I need is a form that generates a list of existing products, picks the selected product id and then gets /products/:product_id/bookings/new .
Any help appreciated! I realize my title does not describe my problem very good so better suggestions are highly welcome!
I have created activex control in vb6. It has standard label with its backstyle property set as transperant. Also activex control form itself has property backstyle set as transperant. In Vc++ I placed this activex control in property sheet page. But i am not getting this activex control displayed in running mode. If we change backstyle property to opaque then it is working fine. How to resolve this issue
Is there any way to format this so it's a valid expression, without adding another step?
<<One:8,_:(One*8)>> = <<1,9>>.
* 1: illegal bit size
These work
<<One:8,_:(1*8)>> = <<1,9>>.
<<1,9>>
<<Eight:8,_:Eight>> = <<8,9>>.
<<8,9>>
I'm trying to parse a binary with nested data with list comprehensions instead of stacking accumulators.
According to javadoc... Collections.fill() is written as below :
public static <T> void fill(List<? super T> list, T obj) {
int size = list.size();
if (size < FILL_THRESHOLD || list instanceof RandomAccess) {
for (int i=0; i<size; i++)
list.set(i, obj);
} else {
ListIterator<? super T> itr = list.listIterator();
for (int i=0; i<size; i++) {
itr.next();
itr.set(obj);
}
}
}
Its easy to understand why they didn't use listIterator for
if (size < FILL_THRESHOLD || list instanceof RandomAccess)
condition as of RandomAccess. But whats the use of size < FILL_THRESHOLD in above?
I mean is there any significant performance benefit over using iterator for size>=FILL_THRESHOLD and not for size < FILL_THRESHOLD ?
I see the same approach for Collections.copy() also :
public static <T> void copy(List<? super T> dest, List<? extends T> src) {
int srcSize = src.size();
if (srcSize > dest.size())
throw new IndexOutOfBoundsException("Source does not fit in dest");
if (srcSize < COPY_THRESHOLD ||
(src instanceof RandomAccess && dest instanceof RandomAccess)) {
for (int i=0; i<srcSize; i++)
dest.set(i, src.get(i));
} else {
ListIterator<? super T> di=dest.listIterator();
ListIterator<? extends T> si=src.listIterator();
for (int i=0; i<srcSize; i++) {
di.next();
di.set(si.next());
}
}
}
FYI:
private static final int FILL_THRESHOLD = 25;
private static final int COPY_THRESHOLD = 10;
I have sql statement one;
select linkscat.id, linkscat.category
from linkscat, contentlinks, links
where contentlinks.linksid = links.id
and contentlinks.contentid = @contentid
and links.linkscatid = linkscat.id
order by linkscat.category
and sql statement 2 takes a parameter called @linkscat which is 'id' from the statement above;
select * from links where linkscatid= @linkscat
I'm running into all types of trouble trying to use many sqldatareaders, nested repeaters etc, but it would be great if all the work could be done in the one statement? Is this possible and if so please can you help by posting the final statement?
Thanks greatly, any help much appreciated!
Is it possible to define a current user?
I found a stored procedure 'sp_mgGetConnectedUsers'. It returns a result set with the only unique field 'Address'. How could I associate an executing query with such 'Address'.
Please advice.
Note: As far as I understand, another way to get the current user is to set a unique application Id for each connection, but I don't like this way much.
I need a set of tasks that need to be executed exactly once for the entire solution. This will run tasks that will modify each project to run a separate set of tasks for each project. We had done this earlier using a separate project to the solution which had the solution level tasks, but we want to move away from that. Has anyone done this or does anyone have any suggestions on how to implement this?
Hi,
I would like to set the selected value to a known value. However, after InititializeComponent() has been called, the data is not yet filled in a databound Combobox so I can't set my selected value there.
Which event is triggered when the data has finished to be added in the combobox from the databound object ? Is there any other way you would suggest handling this ?
Many thanks
For simplicity, assume that I have a simple has-many-through relationship
class User < ActiveRecord::Base
has_many :courses, :through => :registrations
end
class Registration < ActiveRecord::Base
belongs_to :user
belongs_to :course
end
class Course < ActiveRecord::Base
has_many :users, :through => :registrations
end
I want to keep my app secure, so I use attr_accessible to whitelist my attributes.
My question is twofold:
How would I set up my whitelist attributes such that I could create a new Registration object through a form (passing in :user and :course, but not risk allowing those foreign keys to be maliciously updated later?
How would I set up my validations such that both belongs_to associations are required BUT also allow for Registration objects to be created in nested forms?
I have searched through the google and also joomla forums but didn't got what exactly I was looking for.
My main purpose is to set the joomla session live for ever.
Many forums says its not good to keep a higher value (security issues) but I don't want to consider that right now.
My question is :
What if I set the session lifetime value to "0" (Zero), will the session be active for ever? or the user will NOT be able to login completely?
Thanks,
Tanmay
I saw somewhere what seemed to be nested selects, one "master" select on the "outside" and a series of selects inside- is this possible? I'm not talking about joins as there is particular relation between the selects.
I seem not to be explaining myself very well. I want to do a single query which will pull out a series of stats from various tables latest order, latest customer, largest order. Obviously I can do that with a series of selects.
The example I saw was something like
select (
select ... from tbl_1 where ..,
select ... from tbl_2 where ..,
select ... from tbl_3 where ..,
...
)