I would like to have a quick script listing all active hosts in a LAN, and I am a bit lost. From other posts I figured that this can be done most effectively by polling the DHCP server (in my case a Lancom router) using SNMP.
However, I am not familiar with the SNMP commands in PHP. Is snmpwalk() the correct function? Can I get snmpwalk() or any other php function to return an array that contains a list of all live hosts?
I do not understand the documentation for gprof regarding how to compile your program for profiling with gprof. In g++, is it required to compile with the -g option (debugging information) in a addition to the -pg option or not. In each case I get different results, and I would like to see where the bottlenecks in my application are in release mode, not in debug mode, where many optimizations are left out by the compiler (e.g. inlining)
In C#, I can write something like:
using (new MyDisposableClass().MethodA());
The semicolon causes a compiler warning to be shown which states possible mistaken empty statement. I haven't run the above code but won't the method still be called?
What uses is there of this type of coding convention? I saw another thread on here about this but I ask in case there areny differences now/therefore different replies.
Thanks
I've an h:dataTable to display my item information (in my case a customer support request) and for each row I'd like to put an h:inputText and h:commandButton to add a comment to the desired item. I've no problem with action, but my question is about the correct way to manage many h:inputText and related value on backbean.
I'm not sure that is correct to make all h:inputText set the value to the same backbean property. Any suggestions? Thanks all.
For some reason this function confused me:
def protocol(port):
return port == "443" and "https://" or "http://"
Can somebody explain the order of what's happening behind the scenes to make this work the way it does.
I understood it as this until I tried it:
Either A)
def protocol(port):
if port == "443":
if bool("https://"):
return True
elif bool("http://"):
return True
return False
Or B)
def protocol(port):
if port == "443":
return True + "https://"
else:
return True + "http://"
Is this some sort of special case in Python, or am I completely misunderstanding how statements work?
I know Windows close kernel handles when an application crashes, but if I want to wait on this event, can I be sure it will happen in milisec or it might take a while? I would like to trigger a new function the moment one application is crashed and I'm checking if this handle is NULL but it seems like I can't get a NULL value in this case.
Is there a place online where I can find like 16 linear gradients that match good with each other? I need them for a chart of mine and the ones generated (by Flex) aren't good enough.
So, I'm kind off searching for a library of gradients (linear in my case).
I am attempting to learn how to develop on the Android platform but do not quite understand the relationship between Activities and Views, because according to the documentation an Activity is link to a UI object that the user can interact with, but if this is the case where does the whole idea of Views come in?
There is probably a very basic explanation but I would appreciate a few pointers all the same. Thanks
Hi,
I'm hoping that someone will explain to me what preferred access point name refers to in the android system , and what is it's role . Also I'd like to know if by messing with all APN (adding a suffix to the "apn" and "type" fields to disable 3G/EDGE/GPRS connections , and the deleting this suffix ) , the preferred APN can be disrupted.
Also if it need special settings in case an APN manipulation is desired.
Does anyone know jquery plugin for more button in month view of a calendar which shows all events of a particular date in case those events are not getting accommodated in that date.
edit++
I want a jquery plugin for table row resizing. Month view of calendar is shown in table format and sometimes all the events of a particular day do not get accommodated in that table cell. So does anyone know a jquery plugin for table row resizing?
I've heard that Telecoms are the big source of Erlang jobs but I'm not sure how much of a market there is. How likely is it that someone could find a job in Erlang/Haskell if they decided to learn it? In my case I have a lot of programming experience in Java but am tired of Java and want to try something different.
Does the method get called with a null value or does it give a null reference exception?
MyObject myObject = null;
myObject.MyExtensionMethod(); // <-- is this a null reference exception?
If this is the case I will never need to check my 'this' parameter for null?
I'd like to write small scripts which feature incremental search (find-as-you-type) on the command line.
Use case: I have my mobile phone connected via USB, Using gammu --sendsms TEXT I can write text messages. I have the phonebook as CSV, and want to search-as-i-type on that.
What's the easiest/best way to do it? It might be in bash/zsh/Perl/Python or any other scripting language.
Lets say I have a function where the parameter is passed by value instead of const-reference. Further, lets assume that only the value is used inside the function i.e. the function doesn't try to modify it. In that case will the compiler will be able to figure out that it can pass the value by const-reference (for performance reasons) and generate the code accordingly? Is there any compiler which does that?
I know that:
preg_replace('<br\s*\/?>', '', $string);
will remove all br tags from $string...
How can we remove all <br><br/><br /> tags only if they are in the very beginning of $string? ($string in my case is html code with various tags...)
I need to determine if I'm on a particular view. My use case is that I'd like to decorate navigation elements with an "on" class for the current view. Is there a built in way of doing this?
Is there a way to print the layout of a C++ object using the g++ compiler or any other means.
A simplified example (assuming int takes 4 bytes)
class A{
int a;
};
class B:public A{
int b;
}
so the output would be
A -
0 4
+ a +
B-
0 4 8
+ A.a + b +
It would be useful to understand the layout of objects (in my case virtual machine code).
Thanks in advance.
Regards,
Zaheer
Does anybody know any module in Python that computes the best bi-partite matching?
I have tried the following two:
munkres
hungarian
However, in my case, I have to deal with non-complete graph (i.e., there might not be an edge between two nodes), and therefore, there might not be a match if the node has no edge. The above two packages seem not be able to deal with this.
Any advise?
What's the difference between local/html5 on this page:
http://code.google.com/p/jquery-jstore/wiki/DefaultEngines
I was under the impression that I could use localstorage on Chrome, but looks like that's not the case?
Some elucidation would be greatly appreciated.
Thanks.
I've always thought of the if not x is None version to be more clear, but Google's style guide implies (based on this excerpt) that they use if x is not None. Is there any minor performance difference (I'm assuming not), and is there any case where one really doesn't fit (making the other a clear winner for my convention)?*
*I'm referring to any singleton, rather than just None.
...to compare singletons like
None. Use is or is not.
My WebApp needs to authenticate user before allowing any sort of access. The scenario I'm trying to implement is a login page with username and password fields. Once user hits "send" button, a sign like "Verifing..." should be shown up while an RPC call verifies credentials. In case of success, load the main app screen.
What is the best way to implement that?
I have a dynamic sql query which contains more than one table joined. Normally I get this query to a datatable and use it. For now I want to get result of this query to a list object. Does anyone help me about this case?
Hello!
Is there a way to kill the unload function with javascript(jquery)?
I am looking for something like this:
window.onbeforeunload = function(){
confirm("Close?")
}
or in jquery:
$(window).unload(function() {
confirm("close?")
});
Now, on window unload I get my confirm alert but it will continue in any case. Clicking cancel it won't stay on my page.
Can U help me plz?
At far as I know, at the moment we can call other targets from within a target by using the attribute 'DependsOnTargets' or by using the task
My question is when should we use each case?