I would like to use newId to generate random numbers. Usually tou would use it just once, but I might be generating up to 10 randim numbers per newId.
Is it random enough?
I have 10 tables from which 4 contain each up to million rows. All values are inserted at once, and afterwards I only read the data many times. I am searching for a database that would perform greatly when it comes to selecting, joining or other reading etc.
What is the most recommended option?
I've seen this issue in php and javascript. I have this number: float 0.699
if I do this:
0.699 x 100 = 69.89999999999999
why?
edit
round(0.699 x 10, 2): float 69.90000000000001
Team,
Can you please help me to understand why I m getting the following exception.
05-07 10:57:20.652: ERROR/AndroidRuntime(470): android.database.sqlite.SQLiteException: near "1": syntax error: , while compiling: SELECT Id,Name FROM act WHERE Id 1-IJUS-1
Thanks in advance,
I'm new to JSON and moving around in it in jQuery. I'm fine until I hit a '[', as in:
"gd$when": [{
"startTime": "2006-11-15",
"endTime": "2006-11-17",
"gd$reminder": [{"minutes": "10"}]
}],
I tried to do a
eventTime = event["gd$when"]["startTime"];
to get to the 'startTime' (Yes, event is the variable for ajax stuff, it's all working fine until I hit the '[')
Thanks for any help.
Well after fiddling with MVVM light to get my button to enable and disable when I want it to... I sort of mashed things together until it worked.
However, I just know I'm doing something wrong here. I have RaiseCanExecuteChanged and CanExecute in the same area being called. Surely this is not how it's done?
Here's my xaml
<Button Margin="10, 25, 10, 25" VerticalAlignment="Center" HorizontalAlignment="Center" Width="50" Height="50" Grid.Column="1" Grid.Row="3" Content="Host">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<mvvmLight:EventToCommand Command="{Binding HostChat}" MustToggleIsEnabled="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
And here's my code
public override void InitializeViewAndViewModel()
{
view = UnityContainer.Resolve<LoginPromptView>();
viewModel = UnityContainer.Resolve<LoginPromptViewModel>();
view.DataContext = viewModel;
InjectViewIntoRegion(RegionNames.PopUpRegion, view, true);
viewModel.HostChat = new DelegateCommand(ExecuteHostChat, CanHostChat);
viewModel.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(ViewModelPropertyChanged);
}
void ViewModelPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "Name" || e.PropertyName == "Port" || e.PropertyName == "Address")
{
(viewModel.HostChat as DelegateCommand).RaiseCanExecuteChanged();
(viewModel.HostChat as DelegateCommand).CanExecute();
}
}
public void ExecuteHostChat()
{
}
public bool CanHostChat()
{
if (String.IsNullOrEmpty(viewModel.Address) ||
String.IsNullOrEmpty(viewModel.Port) ||
String.IsNullOrEmpty(viewModel.Name))
{
return false;
}
else
return true;
}
See how these two are together? Surely that can't be right. I mean... it WORKS for me... but something seems wrong about it. Shouldn't RaiseCanExecuteChanged call CanExecute? It doesn't... and so if I don't have that CanExecute in there, my control never toggles its IsEnabled like I need it to.
(viewModel.HostChat as DelegateCommand).RaiseCanExecuteChanged();
(viewModel.HostChat as DelegateCommand).CanExecute();
What does this do exactly?
var counts = new Dictionary<string, int>();
for (int i = 0; i < 10; i++)
counts[string.Format("STA Thread Queue Worker Thread No. {0}", i + 1)] = 0;
Thanks
Rails is setting and returning a remember_token cookie like this:
= cookies[:remember_token]
= value6c69b17681d2bf316f8eexpiresThu Jun 10 14:55:00 -0400 2010
In other words, when I'm calling the cookie I don't just get the value. Why is this?
I am setting the cookie as follows:
cookies[:remember_token] = { :value => @user.remember_me, :expires => 1.year.from_now}
What's going on here?
Hi,
Suppose I have this array:
$array = array('10', '20', '30.30', '40', '50');
Questions
What is the fastest/easiest way to remove the first item from the above array?
What is the fastest/easiest way to remove the last item from the above array?
So the resulting array contains only these values:
'20'
'30.30'
'40'
hi
how to send 2-3 param's to Winform C# program ?
for example: i'll send something like MyProg.exe 10 20 "abc"
and in my program i can receive those values
(i dont want to show MyProg.exe - it will work background)
thank's in advance
I'm working on a python class that is being shared between two products. 90% of the functionality applies to both products. For the 10% that's different the code is littered with this kind of thing:
#Start of file
project = 'B'
#Some line of code
if project == 'A':
import moduleA
elif project == 'B':
import moduleB
#Many lines of code
if project == 'A':
print moduleA.doA(2)
elif project == 'B':
print moduleB.doB(2)
This doesn't seem very elegant or very readable, has anyone encountered this sort of thing before? Are there better ways of doing it?
Hello,
I chose new actionscript file(3.0) and wrote as simple as trace("Hello World");, but it is not working. I have flash player 10 and i also made sure i have not checked omit trace statements in publish settings. Where am i going wrong? Please help.
I have about 10+ iframes in a page, and it's slowing down Firefox3.6.x substantially.
Is there anything I can do about this? i.e. modify the DOM somehow, or suspending certain events etc etc ?
Hey,
I have a list of around 30 divs (see below.) and would like to hear any suggestions on the best way to rotate through them by sliding in one at the top and removing one from the bottom at a set time. Something like every 5-10 seconds. Also even though there are 30 on the page I would only like to show a list of 10 and have the rest show as mentioned.
A great example would be www.foursquare.com and their recent activity section. I would like to do the same except with a predetermined amount of divs instead of real-time using ajax.
Any suggestions or a bit of help pointing me in the right direction would be greatly appreciated.
<div class="recent-questions">
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
<div class="recent-question"></div>
</div>
Thanks in advance for any help or thoughts!
I have anywhere from 5 to 10 generic list in an ASP.NET VB.NET web app. I would like to write a method to pass them all into, and return only the elements they all have in common.
I'm looking for some ideas how to accomplish this the easiest and cleanest way possible.
Is there a more efficient way than using numpy.asarray() to generate an array from output in the form of a list?
This appears to be copying everything in memory, which doesn't seem like it would be that efficient with very large arrays.
(Updated) Example:
import numpy as np
a1 = np.array([1,2,3,4,5,6,7,8,9,10]) # pretend this has thousands of elements
a2 = np.array([3,7,8])
results = np.asarray([np.amax(np.where(a1 > element)) for element in a2])
Let's say I have something like 30-10-2025 12:53, how could I convert that to an NSDate? I guess there's some class that takes this plus an format string that tells it how the date looks as a string, so it can parse it... where must I look?
In an app I'm profiling, I found that in some scenarios this function is able to take over 10% of total execution time.
MSVC++ 2008 compiler is being used, for reference... I don't recall if modf maps to a single instruction or if there is likely any way to make it faster.
see also here for similar question on sqrt function
What's the easiest way to change a text's color based on a variable?
For example: If $var is between 1-5, green. Between 6-10, Orange. Greater than 11, Red.
I know how to do it mathematically, but i want it now to do it in c++ using some easy algorithm. Is is possible?
The question is that i need some methods/ideas for writing a number N in base M, for example 1410 in base 3: (14)10 = 2*(3^0) + 1*(3^1) + 1*(3^2) = (112)3 etc.
I have two database say DB_A and DB_B. In DB_A database, table having huge data (few tables are having 2 to 10 million data). I want to move the all table data from DB_A to DB_B database. Please help me on writing stored procedures to move efficiently (fast) the data from one database to another.