I have a view controller that can fetch many different types of entities from my MOC. How can I tell what the entity is for an object of the type NSManagedObject?
After using Git from the command line for a while, I am ready for the convenience a GUI plugin (for Eclipse) can offer.
However, I prefer a Git plugin similar to to MS Visual Studio's Git Source Control Provider which is only a wrapper around the already installed msysgit. I really don't want two different Git implementations accessing the same repository.
EGit sounds perfect - if it can use the already installed msysgit in my PC.
But can it?
Hi ,
I have generated a Google map key by login as a [email protected] . Is there any restriction in generating the number of keys for each user. Since we have 2 different domains and i need to generate key for that too.
Actually i am not sure about of how many keys the person who used this id has created..
And is there any way to find of how many keys had already been created for the same account previously???
Hello,
I would like to use this function in C#, but I need to get 2 types of processes.
Is it possible to do something like this:
process.getprocessesbyname("process1", "process2");
How can I get the instances of 2 processes with different names?
TY
Hi lads,
After obtaining the urls for various blogspots, tumblr and wordpress pages, I faced some problems processing the html pages. The thing is, i wish to distinguish between the content,title and date for each blog post. I might be able to get the date through regex, but there are so many custom scripts people are using now that the html classes and structure is so different.
Does anyone has a solution that may help?
Hi,
What is a good book to learn about networking 'theory' (i.e. different layers: physical, tcp/ip, etc.). I don't want anything too technical -- just something so I can apply it to network programming.
Thanks.
I want to create two UIViews in quartz 2D application.
First UIView for static text, it will redraw automatically after each one second.
Second UIView for animated text, it will be redrawn automatically after each .1 second.
How can i create multiple Views/Layers? Is there drawRect methods will be different?
hi
I have a warehouse_products table which defines how many products in the warehouses
so lets say I have 20 records/rows in the table, some rows may contain the same product id but in a different warehouse
I need to create select statement that give every product one row, and in this row I must have the quantity in warehouse A and warehouse B ..
so in the end I will get for example 10 rows that contain all the data
I was using the Fiddler core .Net library as a local proxy to record the user activity in web. However I ended up with a problem which seems dirty to solve. I have a web browser say Google Chrome, and the user opened like 10 different tabs each with different web URLs. The problem is that the proxy records all the HTTP session initiated by each pages separately, causing me to figure out using my intelligence the tab which the corresponding HTTP session belonged to. I understand that this is because of the stateless nature of HTTP protocol. However I am just wondering is there an easy way to do this? I ended up with below c# code for that in Fiddler. Still its not a reliable solution due to the heuristics.
This is a modification of the sample project bundled with Fiddler core for .NET 4. Basically what it does is filtering HTTP sessions initiated in last few seconds to find the first request or switching to another page made by the same tab in browser. It almost works, but not seems to be a universal solution.
Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS)
{
//exclude other HTTP methods
if (oS.oRequest.headers.HTTPMethod == "GET" || oS.oRequest.headers.HTTPMethod == "POST")
//exclude other HTTP Status codes
if (oS.oResponse.headers.HTTPResponseStatus == "200 OK" || oS.oResponse.headers.HTTPResponseStatus == "304 Not Modified")
{
//exclude other MIME responses (allow only text/html)
var accept = oS.oRequest.headers.FindAll("Accept");
if (accept != null)
{
if(accept.Count>0)
if (accept[0].Value.Contains("text/html"))
{
//exclude AJAX
if (!oS.oRequest.headers.Exists("X-Requested-With"))
{
//find the referer for this request
var referer = oS.oRequest.headers.FindAll("Referer");
//if no referer then assume this as a new request and display the same
if(referer!=null)
{
//if no referer then assume this as a new request and display the same
if (referer.Count > 0)
{
//lock the sessions
Monitor.Enter(oAllSessions);
//filter further using the response
if (oS.oResponse.MIMEType == string.Empty || oS.oResponse.MIMEType == "text/html")
//get all previous sessions with the same process ID this session request
if(oAllSessions.FindAll(a=>a.LocalProcessID == oS.LocalProcessID)
//get all previous sessions within last second (assuming the new tab opened initiated multiple sessions other than parent)
.FindAll(z => (z.Timers.ClientBeginRequest > oS.Timers.ClientBeginRequest.AddSeconds(-1)))
//get all previous sessions that belongs to the same port of the current session
.FindAll(b=>b.port == oS.port ).FindAll(c=>c.clientIP ==oS.clientIP)
//get all previus sessions with the same referrer URL of the current session
.FindAll(y => referer[0].Value.Equals(y.fullUrl))
//get all previous sessions with the same host name of the current session
.FindAll(m=>m.hostname==oS.hostname).Count==0 ) //if count ==0 that means this is the parent request
Console.WriteLine(oS.fullUrl);
//unlock sessions
Monitor.Exit(oAllSessions);
}
else
Console.WriteLine(oS.fullUrl);
}
else
Console.WriteLine(oS.fullUrl);
Console.WriteLine();
}
}
}
}
};
I often have to add my signature to a document. The document can be of different kinds.
My signature is stored as an image in signature.jpg.
I would like to write a Java program that automatically places this image in the clipboard, so that I only have to paste it into the document.
I have to load an array of doubles from a file, multiply each element by a value in a table (different values for different elements), do some work on it, invert the multiplication (that is, divide) and then save the data back to file.
Currently I implement the multiplication and division process in two separate methods. Now there is some extra work behind the scenes but apart from the specific statements where the multiplication/division occurs, the rest of the code is identical. As you can imagine, with this approach you have to be very careful making any changes. The surrounding code is not trivial, so its either a case of manually editing each method or copying changes from one method to the other and remembering to change the * and / operators.
After too many close calls I am fed up of this and would like to make a common function which implements the common logic and two wrapper functions which pass which operator to use as a parameter.
My initial approach was to use function pointers:
MultiplyData(double data)
{ TransformData(data, &(operator *)); }
DivideData(double data)
{ TransformData(data, &(operator /)); }
TransformData(double data, double (*func)(double op1, double op2))
{ /* Do stuff here... */ }
However, I can't pass the operators as pointers (is this because it is an operator on a native type?), so I tried to use function objects. Initially I thought that multiplies and divides functors in <functional> would be ideal:
MultiplyData(double data)
{
std::multiplies<double> multFunct;
TransformData(data, &multFunct);
}
DivideData(double data)
{
std::divides<double> divFunct;
TransformData(data, &divFunct);
}
TransformData(double data, std::binary_function<double, double, double> *funct)
{ /* Do stuff here... */ }
As you can see I was trying to use a base class pointer to pass the functor polymorphically. The problem is that std::binary_function does not declare an operator() member for the child classes to implement.
Is there something I am missing, or is the solution to implement my own functor heirarchy (which really seems more trouble than it is worth)?
I used the assertRaises() to validation there will be an exception thrown and there is no problem of this.
My question is, is there any way to get the exception message from assertRaises()? I would like to assert for different types of exceptiosn as well by parsing the exception message..
Can we set two thread or two task to execute with different processor affinity in C#.net Application?
I have read about SetThreadAffinityMask but there is no example to have that used..
or Is there any way TPL(Task Parellel Libray) executes two thread/Task in with high priorty to use 100% cpu ?
Using SQL profiler, I was able to find the query generated from Nhibernate was executed in the
EXEC sp_executesql N'select ...'
fashion.
I am wondering if there is any way to force Nhibernate to generate the plain
Select ...
statement instead.
The reason I want this is because apparently SQL Server generated different execution plans for them, and in my scenario, the plain "select ..." runs MUCH faster.
Hi Everyone, I need excel automation expert here.
I have chart with x-axis contains label: Jan,Feb,Mar,Apr
and y-axis contains label: 10,20,30,40.
Chart type is Bar.
Can anyone show me a csharp code how to change to Bar color to different color if the month is Mar?
I hope you guy understand my question since I can't put the image on stackoverflow.
thank you
What's the biggest performance improvement you've had with the smallest change? For example, I once improved the performance of a certain page on a high-profile web app by a factor of 10, just by moving "where customerID = ?" to a different place inside a complicated SQL statement (before my change it had been selecting all customers in a join, then later selecting out the desired customer).
I had code on Download.aspx for downloading different type of file like doc, xls, pdf etc. I usually call the page to download a file. In one of my instance i am calling this from a java script code which works fine for http://loaclhost/tp/howwuworks/howwuworks.aspx but if i put ipaddress instead of localhost then its not working.
We are in the process of switching from the C# Guid.NewGuid() random-ish guid generator to the sequential guid algorithm suggested in this post. While this seems to work well for MS SQL Server, I am unsure about the implications for Oracle databases, in which we store guids in a raw(16) field. Does anyone have any insight as to whether this algorithm would be good for creating sequential guids for Oracle as well as for MS SQL Server, or if a different variant should be used.
Thanks!
I would like to show a Navigation Controller after clicking a button. Every tutorial assumes the navigation controller will be the first screen so it links it to the App Delegate, but App delegate only appears at MainWindow.xib.
How do you guys add a navigation controller to a view different than the MainWindow?
Thanks!
Lately I've been seeing behavior where after an update svn shows certain files as "conflicted" but when I try to edit the conflicts, there are none (The "next conflict" and "previous conflict" buttons are disabled and if I scroll through the file, none of the lines are marked red).
This seems to have started after I started working from a different repository than I had been working with, but I'm not sure if that's related.
i want to write an event for the segment controller.By clicking First Tab i want to perform some calculation and by clicking Second Tab i want to perform some different operation.please help me.
Hello,
I have divised a page with a TabContainer.
Before, this page worked with a CascadingDropDown that populate a DropDownList.
Now this DropDownList is in another tab. So I catch an exception "Object Reference Null" when I try to see this page.
How did runs to load a DropDownList in another Tab when I change a value in a different Tab ?
Thank you.
Currently there exists a need to create an application that will serve 5 different customers each requiring their own specific URL and content repository. My question is when designing this application what should my considerations be for protecting the content of the individual customers while meeting the requirements of the unique URL. The system will be sitting on Windows with a postgres database and java as the implementation language.
Hi, I want to use email for signing in, and to allow users to have similar names. One way to do this is to rename login/username field to something different. However, I want to do it just by setting up authlogic. I tried the following
acts_as_authentic do |c|
c.login_field :email
c.validate_login_field false
c.validate_email_field true
end
but it still complains that the login already exists. What must be done to avoid username validation without renaming the field?
I've been trying to implement a mySQL Proxy solution that can separate out the queries into per-database logs. Everything I've Googled has pointed to mySQL Proxy but I can only seem to capture the database a connection was opened to, not which the current query is being issued against.
Is it even possible? Is there a different tool to use?
Thanks for any suggestions.