Could you please share some good books, blogs, sites on practical problem decomposition, thanks
P.S. Please only practical ones not the scientific/theoretical resources.
Does the RTOS play a major role or processor play a major role in determining the time for context switch ? What is the percentage of share between these two major players in determining the context switch time .
Can anyone tell with respect to uC/OS-II RTOS ?
Hi every one !
I have a little problem. I have to code a simple C application that creat a process and his child (fork()) and I have to do an operation. Parent initialize the values and child calculate. I write this :
#include
#include
#include
#include
#include
typedef struct {
int op1;
char op;
int op2;
}Operation;
Operation *varOP;
void finalResult()
{
float result = 0;
if(varOP-op == '+') result = (varOP-op1 + varOP-op2);
if(varOP-op == '-') result = (varOP-op1 - varOP-op2);
if(varOP-op == '*') result = (varOP-op1 * varOP-op2);
if(varOP-op == '+') result = (varOP-op1 / varOP-op2);
printf("%f",result);
}
int main () {
int p;
varOP = (Operation *)malloc(sizeof(Operation));
p = fork();
if(p == 0) // If child
{
signal(SIGUSR1, finalResult );
pause();
}
if(p 0) // If parent
{
varOP-op = '+';
varOP-op1 = 2;
varOP-op2 = 3;
kill(p, SIGUSR1);
wait(NULL);
}
return 0;
}
But my child is never called. Is there something wrong with my code?
Thanks for your help !
I know how I do to place a icon in the systray. But what the best method to perform systray icon animation? animated gifs? timers?
Preferentially using C# and/or WPF. Thanks!
Is there a way to improve this:
private static int CountNewlines(string s)
{
int len = s.Length;
int c = 0;
for (int i=0; i < len; i++)
{
if (s[i] == '\n') c++;
}
return c;
}
I'm particularly concerned about the Item accessor on the string. Not sure if it is just pointer arithmetic like C/C++.
>> XOR(X,X)
??? Undefined function or method 'XOR' for input arguments of type 'logical'.
Why XOR can't be used for logical matrix?
And I tried a more simple example:
>> A=[1 0;1 0];
>> B=[1 1;0 0];
>> XOR(A,B)
??? Undefined function or method 'XOR' for input arguments of type 'double'.
How can I properly use XOR?
Few of our clients are regularly getting invalid cast exception, with variations
i.e. InvalidCastException / ProviderException, but both generating from
method call: System.Web.Security.SqlRoleProvider.GetRolesForUser(String username)
The other variation is:
Exception type: InvalidCastException
Exception message: Unable to cast object of type System.Int32 to type System.String.
I had a look at application event log which shows:
Stack trace:
at System.Web.Security.SqlRoleProvider.GetRolesForUser(String username)
at System.Web.Security.RolePrincipal.IsInRole(String role)
at System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(StringCollection roles, IPrincipal principal)
at System.Web.Configuration.AuthorizationRule.IsUserAllowed(IPrincipal user, String verb)
at System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(IPrincipal user, String verb)
at System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)*
Has anyone come across this issue, and if so what is the fix?
Thanks
JS
I am having trouble understanding the difference between a 32 bit processor and 64 bit processor. I know that a 32 bit processor can access 32 bits at a time while a 64 bit processor can access 64 bits at a time. But what exactly does it mean to access a certain number of bits at one time?
hello everyone,
Can anyone please tell the way to find out the mac address of a system which is:
Shutdown
Power plugged in
Connected to Lan
Nic card ON.
Kindly post the solution as i urgently need it in my project...
thank you
Update
I am asking how to find out the mac address of some other system which is already shutdown.... and which is on lan..
I want to find out its mac from my system.... and to be clear... i want to tell that.. arp table can be populated by using ping .. i.e. if 172.16.3.12 is not in arp table then it can be added by just ping 172.16.3.12 but a system can be pinged only if its on ... a shutdown system can't be pinged...
Hello I have a project using webforms. I applied routing on one of the page. My route is structure like this : http://localhost:3576/Request/Admin/Rejected/ = http://localhost:3576/Request/{role}/{action}/{id}
Everything works great but i have a javascript error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Fri, 7 May 2010 13:35:54 UTC
Message: Syntax error
Line: 3
Char: 1
Code: 0
URI: http://localhost:3576/Request/Admin/Rejected/JScript1.js
I think it's trying to route to the file where i stored my javascript functions.
Any suggestion?
In my python script, I need to call within a for loop an executable, and waiting for that executable to write the result on the "output.xml".
How do I manage to use wait() & how do I know when one of my executable is finished generating the result to get the result? How do I close that process and open a new one to call again the executable and wait for the new result?
import subprocess
args = ("bin/bar")
popen = subprocess.Popen(args)
I need to wait for the output from "bin/bar" to generate the "output.xml" and from there, read it's content.
for index, result in enumerate(results):
myModule.callSubProcess(index)
#this is where the problem is.
fileOutput = open("output.xml")
parseAndStoreInSQLiteFileOutput(index, file)
I want to be able to detect and abort OS shutdown from my application, preferably by using the Windows API. I know that it is possible to do this manually using the command shutdown -a In the worst case, I could ShellExecute this, but I was wondering if there was a better way.
Also, how do I find out programatically that the OS is about to shut down, via the Win32 API?
Is there a way to improve this:
private static int CountNewlines(string s)
{
int len = s.Length;
int c = 0;
for (int i=0; i < len; i++)
{
if (s[i] == '\n') c++;
}
return c;
}
I'm particularly concerned about the Item accessor on the string. Not sure if it is just pointer arithmetic like C/C++.
I just read a pretty interesting article on how android (and i assume other OSs) work when low on memory. How is this done theoretically? Is it similar to Java's object serialization?
I have a solution which I developed in VS2008 and which I am trying to add to Source Control (TFS 2010, though the issue happened in TFS 2008 as well). I have several TFS workspaces on my computer and I have access to several Team Projects.
When I right click the solution in my Solution Explorer and choose the "Add Solution to Source Control" option I am never given an option of choosing which Workspace or which Team Project to add the existing solution too. VS2008 then proceeds to add it to the same team project every time. I have tried selecting an alternate workspace/team project in every window where I can see an option for it but it always adds it back to the same one. I even tried changing the name of my new workspace so that alphabetically it was the first thinking that it might be somehow related to that... no luck.
I then tried goign to the Change Source Control window where you can add/remove bindings on a solution/project but that window also defaults to the same Team Project as trying to add the solution directly does...
Any help would be greatly appreciated with this, maybe I'm just missing something?
I'm trying to format an RDLC report file in Visual Studio 2008 and I am having a formatting issue. I have a list at the bottom that contains a matrix that expands horizontally to the right. That pink box is just to visualize the problem I'm having.
When the report is rendered the matrix expands and instead of filling the pink box with the matrix is pushes the space in the pink box to the right resulting in an extra page when printing the reports.
One solution would be to shrink the pink box to be the size of the matrix which I've done. But then when the matrix grows the fields at the top of the report get pushed to the right by the same amount as the growth of the matrix.
Can someone please let me know what they think the solution would be? Thank you!
Operating systems read from disk more than what a program actually requests, because a program is likely to need nearby information in the future. In my application, when I fetch an item from disk, I would like to show an interval of information around the element. There's a trade off between how much information I request and show, and speed. However, since the OS already reads more than what I requested, accessing these bytes already in memory is free. What API can I use to find out what's in the OS caches?
Alternatively, I could use memory mapped files. In that case, the problem reduces to finding out whether a page is swapped to disk or not. Can this be done in any common OS?
Hello,
I'm reading "Understanding Linux Kernel". This is the snippet that explains how Linux uses Segmentation which I didn't understand.
Segmentation has been included in 80 x
86 microprocessors to encourage
programmers to split their
applications into logically related
entities, such as subroutines or
global and local data areas. However,
Linux uses segmentation in a very
limited way. In fact, segmentation
and paging are somewhat redundant,
because both can be used to separate
the physical address spaces of
processes: segmentation can assign a
different linear address space to each
process, while paging can map the same
linear address space into different
physical address spaces. Linux prefers
paging to segmentation for the
following reasons:
Memory management is simpler when all
processes use the same segment
register values that is, when they
share the same set of linear
addresses.
One of the design objectives of Linux
is portability to a wide range of
architectures; RISC architectures in
particular have limited support for
segmentation.
All Linux processes running in User
Mode use the same pair of segments to
address instructions and data. These
segments are called user code segment
and user data segment , respectively.
Similarly, all Linux processes running
in Kernel Mode use the same pair of
segments to address instructions and
data: they are called kernel code
segment and kernel data segment ,
respectively. Table 2-3 shows the
values of the Segment Descriptor
fields for these four crucial
segments.
I'm unable to understand 1st and last paragraph.
I am trying to set the the source field of a template using the query notation (or xpath - whichever works), but none of them seems to be working.
My content tree is a multisite content tree:
France
--Page 1
----Page1A
-------Page1AA
--Page 2
--Page 3
--METADATA
----Regions
US
--Page 1
----Page1A
-------Page1AA
--Page 2
--Page 3
--METADATA
----Regions
Each site has its own METADATA folder, and I want it so that when adding a page inside each of the main country nodes, I want the values to reflect whatever is in the METADATA of that site. I have two different fields for now - a droplink and a treelistex field. So I thought I can just get the parent item that is a country site, and get the metadata folder for that. When I put the following query in both the fields, I get different results:
query:./ancestor::*[@@templatename='CountryHome']/METADATA/Regions/*
For the droplink field, I get only the first Region (one item)
For the treelistex field, I get the entire content tree
I then tried to modify the query a little bit and took the 'query' notation out
./ancestor::*[@@templatename='CountryHome']/METADATA/Regions/*
If I go to the developer center/xpath builder, and set the context node to any item underneath the main country site, it returns me exactly what I need, but when I put this in the source, I get the entire content tree in both the cases.
Help!
Microsoft's implementation of System.Net.Mail does not provide a robust mailing solution. I would like to use Mono's implementation of System.Net.Mail instead, however that namespace is embedded in the System.dll shipped with Mono, and has exact same namespaces as the original .net framework.
What I would like to do is instead extract System.Net.Mail from the mono solution and rename namespaces to Mono.System.Net.Mail. Then I can compile this in its own DLL and finally have a mailing solution that works!
Can anyone tell me how this can be done?
Hi
I need to call a method from an exe file
ProcessStartInfo startInfo = new ProcessStartInfo(@"exeParser.exe");
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.CreateNoWindow = false;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
startInfo.Arguments = ??
I don't know how to call a method and pass parameters
Any help please??
The executable is mine but I'm having trouble using the things in a web app so I thought it would be better to call it as a process
Thanks
Can any one guide me on how i can send emails with a return path in ASP.net 3.5 / C# 3.5. I know this was possible few years back but now due to spoofing issues this is not possible. I have been looking on internet but no use. I want the emails if bounced, should reach my bounce mail box, which could be like [email protected].
Please guide. Really stuck ...
Best regards,
Haroon