Does Scala have iterators with 'set' and 'remove' methods for
iterating (and modifying) mutable collections like array?
If there is no such iterator then is there a good reason for that?
Hi,
I have need to communicate between two iframes of the same domain, which live inside a parent page on a different domain that I have no control over.
This is a Facebook app and the basic layout is this
apps.facebook.com/myapp
L iframe1 (src='mysite.com/foo')
L iframe2 (src='mysite.com/bar')
I need frame1 to talk to frame2, but in Opera I can't access window.parent.frames['frame2']
to do the usual cross-domain methods (updating location.hash for example)
Is there an alternate way to accomplish this in Opera?
Thanks for your help in advance
I need to convert an integer to it's ASCII representation from within the Linux Kernel. How can I do this? I can't find any built-in conversion methods. Are there any already in the kernel or do I need to add my own?
Hi
I am looking into methods to inject javascript into any webpage loaded in the browser, so that I can traverse through the page's DOM. I use JQUERY for my scripting needs.
Method should work in all browsers.
I tried using IFRAME and adding some html into it, but I cant. Please suggest some ways.
Currently ISPs deal out addresses via DHCP for IPv4 dynamic (single) addresses.
What protocol will/are ISPs going to use for IPv6 when they can hand a customer an entire /64 (or /48 if they are nice) block? DHCPv6, RA?
For ISPs that support true end-to-end IPv6 will they provide gateway devices (similar to cable modem or true DSL bridges for example) that receive border information for that specific customer?
I'm just trying to get an idea of how your common residential service customer will have to configure things in an IPv6 Internet (whenever that comes). Will it be something customers are expected to statically configure on their home wireless router?
Today with IPv4 I do it like this: Modem (bridge) passes public IPv4 obtained via DHCPv4 from ISP to second device (wireless router). It in turn has its own DHCPv4 service it provides on the internal lan.
Hi,
I am using JNI to call my C++ function from Java. One of the C++ function's arguments is jobject thiz (as far as I know, all JNI native functions have this argument). The function takes quite long to complete and I want to report progress back to the jobject thiz Java object, so that I can show the progress to the user. How can I call jobject's methods from C++?
The TouchUtils class in the android documentation has functions like drag() [http://developer.android.com/intl/de/reference/android/test/TouchUtils.html#drag(android.test.InstrumentationTestCase,%20float,%20float,%20float,%20float,%20int)], but they do not support multi touch gestures, like a two finger swipe.
Looking at the MotionEvent.obtain() methods, there does not seem to be any way of invoking a "virtual" multi touch event from a testcase.
Anyone has got it working?
While Authenticating users from Active Directory Am getting the following Error.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
Hello, Where I can download sources of .net frameworke. I mean sources of libraries. I need sources of reflection methods like invoke and other.
Thanks.
VB 6.0 does not have any global handler.To catch runtime errors,we need to add a handler in each method where we feel an error can occur.But, still some places might be left out.So,we end up getting runtime errors.Adding error handler in all the methods of an application,the only way?
Hey All,
I am a newbie in C# and curious about the better solution of my case.
I have a method which gets the DataTable as a parameter and creates a List with MyClass's variables and returns it.
public static List<Campaigns> GetCampaignsList(DataTable DataTable)
{
List<Campaigns> ListCampaigns = new List<Campaigns>();
foreach (DataRow row in DataTable.Rows)
{
Campaigns Campaign = new Campaigns();
Campaign.CampaignID = Convert.ToInt32(row["CampaignID"]);
Campaign.CustomerID = Convert.ToInt32(row["CustomerID"]);
Campaign.ClientID = Convert.ToInt32(row["ClientID"]);
Campaign.Title = row["Title"].ToString();
Campaign.Subject = row["Subject"].ToString();
Campaign.FromName = row["FromName"].ToString();
Campaign.FromEmail = row["FromEmail"].ToString();
Campaign.ReplyEmail = row["ReplyEmail"].ToString();
Campaign.AddDate = Convert.ToDateTime(row["AddDate"]);
Campaign.UniqueRecipients = Convert.ToInt32(row["UniqueRecipients"]);
Campaign.ClientReportVisible = Convert.ToBoolean(row["ClientReportVisible"]);
Campaign.Status = Convert.ToInt16(row["Status"]);
ListCampaigns.Add(Campaign);
}
return ListCampaigns;
}
And one of my another DataTable method gets the DataTable from the database with given parameters. Here is the method.
public static DataTable GetNewCampaigns()
{
DataTable dtCampaigns = new DataTable();
Campaigns Campaigns = new Campaigns();
dtCampaigns = Campaigns.SelectStatus(0);
return dtCampaigns;
}
But the problem is that, this GetNewCampaigns method doesnt take parameters but other methods can take parameters. For example when I try to select a campaign with a CampaignID, I have to send CampaignID as parameter. These all Database methods do take return type as DataTable but different number of parameters.
public static DataTable GetCampaignDetails(int CampaignID)
{
DataTable dtCampaigns = new DataTable();
Campaigns Campaigns = new Campaigns();
dtCampaigns = Campaigns.Select(CampaignID);
return dtCampaigns;
}
At the end, I want to pass a Delegate to my first GetCampaignList Method as parameter which will decide which Database method to invoke. I dont want to pass DataTable as parameter as it is newbie programming.
Could you pls help me learn some more advance features.
I searched over it and got to Func< delegate but could not come up with a solution.
What advantage is there to implementing the four delegate methods:
(void)controllerWillChangeContent:(NSFetchedResultsController *)controller
(void)controller:(NSFetchedResultsController *)controller didChangeSection:(id )sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
(void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath
(void)controllerDidChangeContent:(NSFetchedResultsController *)controller
rather than implement:
(void)controllerDidChangeContent:(NSFetchedResultsController *)controller
Any help appreciated // :)
This may be a really dumb question but how can you open a port on multiple interfaces without defining the interfaces? For example how do I open port 22 on all interfaces?
On my machine I have some interfaces that are dynamic and may or may not be available so I have to set "generic" rules.
This code is not working for me but I can't figure out why:
# My default policy is to drop the input.
# The other policies are required like that.
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t mangle -P OUTPUT ACCEPT
$IPTABLES -t mangle -P PREROUTING ACCEPT
#Open port 22 on all interfaces ?
$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT
So apparently there's something wrong with the last line... but I can't see it?
I have a BlockingQueue that's being used in a producer-consumer situation. I would like to decorate this queue so that every object that's taken from it is logged. I know what the straightforward implementation would look like: simply implement BlockingQueue and accept a BlockingQueue in the constructor to which all of the methods would delegate. Is there another way that I'm missing? A library perhaps? Something with a callback interface?
I usually dig in the c source code with cscope from method to method more than 4-5 level and I have to step between the methods back and forth.
How can I see the search history in cscope so I don't have to remember the previous method name.
or it will be better if it's a stack.
Most mainstream IDEs use code-completion in the form of a linear list of suggestions (typically methods).
Are there any IDEs (mainstream or not) or IDE plugins that use a non-linear widget, such as a tree? (e.g., pick category first, then the actual recommendation)?
I'm working on an IDE feature and want to make sure I'm not reinventing the wheel or infringing some patent.
I'm writing a game an I've got a console for developers to interact with javascript methods in the game. I have a problem though, I can figure out how to drop javascript errors to the console. is there anyway to write errors to a div or HTML element?
I'm writing a game and I've got a console for developers to interact with JavaScript methods in the game. I have a problem though; I can't figure out how to drop JavaScript errors to the console. Is there anyway to write errors to a div or HTML element?
Is there any practical difference between these two extension methods?
class Extensions
{
public static void Foo<T>(this T obj) where T : class { ... }
public static void Foo(this object obj) { ... }
}
I was poking around in Extension Overflow and I came across the first form, which I haven't used before. Curious what the difference is.
Is it possible to create a decorator which can be __init__'d with a set of arguments, then later have methods called with other arguments?
For instance:
from foo import MyDecorator
bar = MyDecorator(debug=True)
@bar.myfunc(a=100)
def spam():
pass
@bar.myotherfunc(x=False)
def eggs():
pass
If this is possible, can you provide a working example?
When I run my C# program it throws an Stack Overflow exception in one of the methods on a DLL that I have a reference to it in my solution.
but no debugging info is available to me because it says it is an stack overflow exception and no info is available.
what are the next debugging steps that I should follow to understand what is going on and why ?
thanks
Edit: here is the code that stops at:
static public Collection SortCollection(Collection oCollection, string sPropertyName, string sKeyPropertyName)
{
return SortCollection(oCollection, sPropertyName, sKeyPropertyName);
}
I need to find a way of taking a hibernate object and discovering at runtime all of the getter methods that relate to persistable fields. I'm using annotations in the classes but have previously had difficulties working with them (I ran into a 2 year old bug the java developers still haven't fixed).
Does anyone know how I can do this please, ideally without using annotations? Thanks.
PS - What I'm trying to do here is to update a new object with values from an existing object dynamically.
I have to get the message structure of a protobuf message transfered to me without the message's definition. Using UnknownFieldSet methods, I was able to get a string representation of the message as below:
1: "a"
2: {
3:"b"
4:"c"
}
What data structure does field 2 represent ? Using UnknownFieldSet.Field.getGroupList i was able to get the content of field 3 and 4, does that means field 2 has the "deprecated" group structure ?
Hi i get the following error when trying to install, have you any idea how to fix?
apt-get install php5-suhosin
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php5-suhosin : Depends: phpapi-20090626
E: Unable to correct problems, you have held broken packages.
I get the following error in my apache2 error log
[Mon May 07 21:43:15 2012] [error] [client ip] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0