If i replace a single-core processor with a dual-core processor, Will it increase the throughput by two times ? If No, why throughput does not get doubled ?
This is a bit of a naive / simple question. I'm having a hard time finding this info online. Basically, does rspec run rake db:test:prepare between every rspec group? Or is it between every example or model? Or does the schema get loaded once and then truncated between each. I need to add a rake task directly after this call to create a view since they are not supported in schema.rb.
Either a link or explanation would be greatly appreciated so that I know where to insert my rake task to create a view. Or whether there is a callback like rake db:test:after_prepare
thx
I'm trying to update my Silverlight 4 UI approx every 1/2 second with new data. I've hooked into a WCF service using net.tcp binding and issuing callbacks from the server. To make sure I get the data from the service as quickly as possible I've started up my proxy on a backround worker inside of my Silverlight App.
My question is, how do I get the results from the callback and update the ObservableCollection that is bound to a datagird? I've tried a number of different ways and keep getting the dreaded cross-thread error.
Hi,
I need in animation of sequence of more PNG files (300 png files and size is 320x480).
I've try make it with 12 fps, but sometime iPhone 3g have lags... 3gs working fine. I think 2g working with lags always.
I've use one UIImageView and loading images in NStimer callback by UIImage:imageWithContentOfFile.
May be this is not best way to animation png files ?
note: previously i've used ImageOptim to pack (or strip ??) all my images (from 20% to 80% of size strip).
regards,
Hello All,
i want to update my status on twitter by PHP application. i surf a lot that how to use twitter API ( whatever it is called, i really don't know) to tweet from php application.
i did try a lot.... it goes to twitter page, ask to access that application and after that it comes back to my local application as i set callback URL to
http://localhost/myproject/shareWIthTweet.php
but that status is not shown on my twitter home page??
will someone please tell me the updated tutorial of twitter.
i seen all tutorial are written on either 2009 or in early 2010,
whereas on twitter developer website said that
October 19, 2010 Twitter's ID format
is changing. Please read, this affects
nearly everyone
Update
i m using below code snippetgit
Thanks
A complete noob question, but how exactly do I get values (e.g.
path_info) from inside the callback? From the docs, I thought it was
a list of tuples, which I thought would make it accessible via
lists:keyfind, but I've had no luck. So far, all the examples I've
found only show how to print everything with io_lib but not how to
access the values by key...
Thanks,
--tim
The docs:
Module:Function(SessionID, Env, Input)- _
Types
SessionID = term()
Env = [EnvironmentDirectives] ++ ParsedHeader
EnvironmentDirectives = {Key, Value}
Key = query_string | content_length | server_software | gateway_interface | server_protocol | server_port | request_method | remote_addr | script_name. <v>Input = string()
Hi all,
In the MSDN is writen about TreeNode that:
"By default, a node is in selection mode."
"To put a node into selection mode, set the node's NavigateUrl property to an empty string."
"When a node is in selection mode, use the SelectAction property to specify which event or events are raised when a node is selected."
"Setting TreeNodeSelectAction value TreeNodeSelectAction.Select Raises the SelectedNodeChanged event when a node is selected."
Please see TreeNode
Here is the problem and possibly a bug in the control:
When I set the TreeNode object PopulateOnDemand value to true and call the Collapse() function on that node.
Then the TreeNodeExpanded event is raised in addition to the SelectedNodeChanged event.
This is in complate contradiction to what is writen in the MSDN.
According to the MSDN this sould happen only if TreeNodeSelectAction Property is set to
TreeNodeSelectAction.SelectExpand value.
Does some know whats the cause for that?
Here is the code:
<asp:TreeView ID="TreeView1" runat="server" AutoGenerateDataBindings="False"
onselectednodechanged="TreeView1_SelectedNodeChanged"
ontreenodepopulate="TreeView1_TreeNodePopulate">
</asp:TreeView>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string path = Server.MapPath(".");
PopulateTopNodes(path);
}
}
//MSDN : Occurs when a node with its PopulateOnDemand property set to true is expanded in //the TreeView control.
protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
LoadChildNode(e.Node);
}
private void PopulateTopNodes(string pathToRootFolder)
{
DirectoryInfo dirInfo = new DirectoryInfo(pathToRootFolder);
DirectoryInfo[] dirs = dirInfo.GetDirectories();
foreach (DirectoryInfo dir in dirs)
{
string relativePath = (dir.FullName).Replace(pathToRootFolderPrefix, "");
TreeNode folderNode = new TreeNode(dir.Name, relativePath);
if (dir.GetDirectories().Length > 0)
{
folderNode.PopulateOnDemand = true;
folderNode.Collapse();
}
folderNode.NavigateUrl = "";
folderNode.SelectAction = TreeNodeSelectAction.SelectExpand;
TreeView1.Nodes.Add(folderNode);
}
}
private void LoadChildNode(TreeNode treeNode)
{
string d = treeNode.NavigateUrl;
string action = treeNode.SelectAction.ToString();
string fullPath = Path.Combine(pathToRootFolderPrefix, treeNode.Value);
DirectoryInfo dirInfo = new DirectoryInfo(fullPath);
DirectoryInfo[] dirs = dirInfo.GetDirectories();
foreach (DirectoryInfo dir in dirs)
{
string relativePath = (dir.FullName).Replace(pathToRootFolderPrefix, "");
TreeNode folderNode = new TreeNode(dir.Name, relativePath);
if(dir.GetDirectories().Length>0){
folderNode.PopulateOnDemand = true;
folderNode.Collapse();
}
folderNode.NavigateUrl = "";
folderNode.SelectAction = TreeNodeSelectAction.SelectExpand;
treeNode.ChildNodes.Add(folderNode);
}
}
//MSDN:Occurs when a node is selected in the TreeView control.
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
}
Thanks
Hi, I need replace the same value for variables {place} and {other_place} in the record op.
#op{
action = [walk, from, {place}, to, {other_place}],
preconds = [[at, {place}, me], [on, floor, me],
[other_place, {place}, {other_place}]],
add_list = [[at, {other_place}, me]],
del_list = [[at, {place}, me]]
}
But erlang don´t share variables. Is there any data type for that?
Hi,
I'm currently working on an IPhone App that should make the phone vibrate if a special event occurs.
The checks to trigger the alert is done in a thread.
Unfortunately the phone won't vibrate if I call
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
from inside the thread. (It works fine if I call this in my "viewDidAppear" method).
I even tried to do a callback from inside the thead like this:
inside Thread:
[self performSelectorOnMainThread:@selector(doAlarm)
withObject:nil
waitUntilDone:true];
-(void)doAlarm {
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}
which has the same result: No vibration on the phone.
How do I make the phone vibrate from inside a thread ??
Thanks in advance
Hi guys.
Got some basic problem again.
I need to modify a function that previously returned a in code written object.
Im now trying to get the object from json through $.getJSON
function getEventData() {
var result = '';
$.getJSON("ajax.php?cmd=getbydate&fromdate=&todate=", function(data){
result = data;
});
return result;
}
Problem is that result isn't set in the callback function for obvious reasons.
Do you guys have a solution for this?
i have tried to copy euro symbol from Wikipedia...and echo it (in my parent page),at that time it is working.but when i replace the same html content using jquery(used same symbol to echo in the other page).it is not displaying.why is it so..(or is der any way to display the same thing using html)?
How do we substitute a hardcoded data with a for loop in sencha and extjs?
Say, I have below hardcoded one
Ext.application({
launch: function() {
Ext.create('Ext.List', {
fullscreen: true,
itemTpl: '{title}',
data: [{
title: 'Item 1'
}, {
title: 'Item 2'
}, {
title: 'Item 3'
}, {
title: 'Item 4'
}]
});
}
});
In the above one, how to replace data to something like below
Ext.application({
launch: function() {
Ext.create('Ext.List', {
fullscreen: true,
itemTpl: '{title}',
data: [
for(int i=0;i<5;i++){
{title: 'Item '+i},
}
]
});
}
});
We have moderate application using Spring but we started using GWT in another application and are completely sold on Guice. Now, considering converting from Spring to Guice or using both where Guice is used for IoC is an option. Did you have to make similar decisions? Did you keep Spring for other components or had to replace it with alternative framework(s) completely?
I have two classes X and Y, like this:
class X implements Serializable
{
int val1;
Y val2;
}
class Y implements Serializable
{
int val;
}
I want to transmit an object of type X from a client to server but i can't because the class X has a field of type Y. I replace the field of type Y with a field of type X in class X and it works.
Running the following simple query in SSMS:
UPDATE tblEntityAddress
SET strPostCode= REPLACE(strPostCode,' ','')
The update to the data (at least in memory) is complete in under a minute. I verified this by performing another query with transaction isolation level read uncommitted. The update query, however, continues to run for another 30 minutes. What is the issue here? Is this caused by a delay to write to disk?
TIA
Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function.
When I subscribe to preference service and add observer, the observe callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group.
What I want is observe to be called just once for group of preferences. Say
extensions.myextension.interval1
extensions.myextension.site
extensions.myextension.retry
so if one or all of those preferences are changed, I receive only 1 notification about it.
I'm using Greasemonkey to redirect certain URLs to another but I would like to redirect before the URL to be redirect loads.
Currently I'm using this simple script:
//==UserScript==
// @name Redirect Google
// @description Redirect Google to Yahoo!
// @include http://*.google.com/*
//==/UserScript==
window.location.replace("http://www.yahoo.com")
In the above, google appears for a second and then redirected to google. I want to go yahoo immediately. Is it possible, and how?
The architecture of the application is straight forward. There is a web application which maintain account holder data. This data is processed and the status of account holders is updated based on number of business rules. This process is initiated using a button on the page and is a long running process (say 15 mins). A component is developed to do this data processing which internally calls stored procedures. Most of the business rules are kept in stored procedure.
To handle timeouts the processing is done asynchornously(using Thread Pool or custom thread or Async Callback Delegates). The entire process run under a transaction. I would like to know your view on what happens to the transaction if the app pool is recycled or the worker process is terminated forcefully?
I've been using MonoDevelop and Make to execute some build taks on a C project under linux, but I decided to abandon Make and switch to NAnt since I am more proficient in writing C# programs than Make/shell scripts, so I decided to write a custom NAnt task in C# to replace my Makefile. So, how can I invoke GCC or other shell commands from C#?
I have a HTML string and want to replace all links to just a text.
E.g. having
Some text <a href="http://google.com/">Google</a>.
need to get
Some text Google.
What regex should I use?
Hi everyone,
I'm using jquery $.getJSON to retrieve list of cities.
Everything works fine, but I'm from Estonia (probably most of you don't know much about this country =D) and we are using some characters like õ, ü. ä, ö.
When I pass letters like this to callback function, I keep getting empty strings. I've tried to base64 encode(server-side)-decode(jquery base64 plugin) strings (i thought it was a good idea as long as I can compress pages with php, so I don't have to worry about bandwidth), but in this way I end up with some random chinese symbols.
What would be the best workaround for this problem.
Thank you.
I had setup an app to play a video using the library suggested here this worked great for me for a long time until my machine was upgraded. In windows 7 I get the following exception that I'd never seen under XP:
`System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
at MainApp.Controls.MediaControl.StopVideo()
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)`
I've installed the June 2010 DirectX SDK and I'm still getting this error. Is there a different library I should be using or some setting that needs to be changed?
I'm trying to do something really simple but it's taking me ages to figure out how to do it properly. I want to have a button that simply deletes a member from a group.
So in my view I have
<div id="del-role">{{=A('Delete Role',_class="btn btn-danger", callback=URL('test'),delete='#del-role')}}</div>
However, when I click the button, the only thing I get is a Javascript prompt asking whether I'm sure I want to delete the specified object, yes/no. That's fine but, what I'd really like to do is just auth.del_membership('role')
What needs to go in my controller? I do not want any page redirection, I just want to auth.del_membership(role) This seemingly simple thing is taking me forever to understand.
Thanks!
I am looking for a way to develop a plugin for Delphi 2010IDE and have yet to find any information on that topic, not even on how to get started.
What I want to accomplish is some kind of auto-spellchecker wich can be given a list of common typos (flase instead of false, .cerate instead of .create and the like) and replace them with the intended word.
Do you know of a tutorial on plugin development, or maybe an open source plugin which i could base my work on?