Reliable Country CIDR block source?
I'm looking for a resource (website, company, etc) that can provide the
most up to date IP CIDR blocks by country.
So far i've found https://www.countryipblocks.net/ (paid)
http://www.ip2location.com/free/visitor-blocker (free)
I'd rather not shell out money for this but I'm looking for at least daily
updates (and very accurate).
Friday, 13 September 2013
Applying partially applied template
Applying partially applied template
Having a class like the A, is there a way to apply it to a template like
this of B, with T2 set to some type C? But without creating another
template class inheriting from A.
template<typename T1, typename T2>
class A
{ };
template<template <typename T1> class T3>
class B
{ };
Having a class like the A, is there a way to apply it to a template like
this of B, with T2 set to some type C? But without creating another
template class inheriting from A.
template<typename T1, typename T2>
class A
{ };
template<template <typename T1> class T3>
class B
{ };
Should the Backbone.Fetch method be in the Collection or the View
Should the Backbone.Fetch method be in the Collection or the View
Simple question really, where is the best place to put the Backbone.Fetch
method when calling a RESTFul service URL in Backbone.js?
Should it be within the View or the collection initialisation?
Simple question really, where is the best place to put the Backbone.Fetch
method when calling a RESTFul service URL in Backbone.js?
Should it be within the View or the collection initialisation?
Thursday, 12 September 2013
Difference in output when f77 code compiled with ifort & gfortran
Difference in output when f77 code compiled with ifort & gfortran
I need some pointers to solve a problem that I can describe only in a
limited way. I got a code written in f77 from a senior scientist. I can't
give the code on a public forum for ownership issues. It's not big (750
lines) but given implicit declarations and gotos statements, it is very
unreadable. Hence I am having trouble finding out the source of error.
Here is the problem:
When I compile the code with ifort, it runs fine and gives me sensible
numbers but when I compile it with gfortran, it compiles fine but does not
give me the right answer. The code is a numerical root finder for a
complex plasma physics problem. The ifort compiled version finds the root
but the gfortran compiled version fails to find the root.
Any ideas on how to proceed looking for a solution? I will update the
question to reflect the actual problem when I find one.
I need some pointers to solve a problem that I can describe only in a
limited way. I got a code written in f77 from a senior scientist. I can't
give the code on a public forum for ownership issues. It's not big (750
lines) but given implicit declarations and gotos statements, it is very
unreadable. Hence I am having trouble finding out the source of error.
Here is the problem:
When I compile the code with ifort, it runs fine and gives me sensible
numbers but when I compile it with gfortran, it compiles fine but does not
give me the right answer. The code is a numerical root finder for a
complex plasma physics problem. The ifort compiled version finds the root
but the gfortran compiled version fails to find the root.
Any ideas on how to proceed looking for a solution? I will update the
question to reflect the actual problem when I find one.
For Loop Statement in DOS script is reading the input from file incorrectly - Loops failing
For Loop Statement in DOS script is reading the input from file
incorrectly - Loops failing
Hi I have this for loop reading lines from a file called "temp". It should
read each line and then proceed to create a directory for each name in the
file. However, It's reading the first line of the file twice before it
moves to the second line. So I get an error saying the folder already
exist.
the file "temp" contain for now 2 entry :
folder1
folder2
The code is simple
for /F "tokens=*" %%i in (temp) do (
set pstname=%%i
echo the folder name is set to %pstname%
mkdir C:\output\%pstname%
)
Ok - when I run this ..
it reads first line foldre1 from the "temp" file and creates the directory
c:\output\folder1 . So I expect the next time the variable pstname be set
to the second line in the "temp" file ( should be set to folder2)
but that is not what happens. The loop reads fodlerone twice and attempts
to create folder1 folder again. If I continue with the script it
eventually reads the second line from "temp" file ( folder two and creates
it. So the script almost works
Issue: What am I doing wrong? It reads the first line in the file "temp"
twice before it proceeds to the next line?
Is there a next command I have to use? what is wrong with my logic? Please
help
Can someone please help?
incorrectly - Loops failing
Hi I have this for loop reading lines from a file called "temp". It should
read each line and then proceed to create a directory for each name in the
file. However, It's reading the first line of the file twice before it
moves to the second line. So I get an error saying the folder already
exist.
the file "temp" contain for now 2 entry :
folder1
folder2
The code is simple
for /F "tokens=*" %%i in (temp) do (
set pstname=%%i
echo the folder name is set to %pstname%
mkdir C:\output\%pstname%
)
Ok - when I run this ..
it reads first line foldre1 from the "temp" file and creates the directory
c:\output\folder1 . So I expect the next time the variable pstname be set
to the second line in the "temp" file ( should be set to folder2)
but that is not what happens. The loop reads fodlerone twice and attempts
to create folder1 folder again. If I continue with the script it
eventually reads the second line from "temp" file ( folder two and creates
it. So the script almost works
Issue: What am I doing wrong? It reads the first line in the file "temp"
twice before it proceeds to the next line?
Is there a next command I have to use? what is wrong with my logic? Please
help
Can someone please help?
Function to refresh captcha, works on iPhone, not on desktop browsers
Function to refresh captcha, works on iPhone, not on desktop browsers
Here's my page where I have a function to refresh the captcha (if you
click on "clicca qui" it should change the image). I'm 100% sure it worked
some months ago and now it doesn't without me changing anything. The call
to the function was <a href="javascript: refreshCaptcha();">. I noticed
though that on iPhone it worked. So I thought it was a problem of some
browsers that didn't accept the "javascript:" syntax. Then I changed it to
<a href="#" onclick="refreshCaptcha();return false;"> (as it is now,
"live"). This changed nothing, still works (image changes) on iPhone,
doesn't change on desktop browsers (tried with IE and Firefox).
Firebug console doesn't say anything.
What's happening?
Here's my page where I have a function to refresh the captcha (if you
click on "clicca qui" it should change the image). I'm 100% sure it worked
some months ago and now it doesn't without me changing anything. The call
to the function was <a href="javascript: refreshCaptcha();">. I noticed
though that on iPhone it worked. So I thought it was a problem of some
browsers that didn't accept the "javascript:" syntax. Then I changed it to
<a href="#" onclick="refreshCaptcha();return false;"> (as it is now,
"live"). This changed nothing, still works (image changes) on iPhone,
doesn't change on desktop browsers (tried with IE and Firefox).
Firebug console doesn't say anything.
What's happening?
Make methods work independently without using a common method
Make methods work independently without using a common method
I am currently trying to separate out the method implementation so that
they can work independently. The methods that I am trying to separate are
store and checker. Both these methods require the traverse method. My
current implementation has two method store and checker methods which I
have separated them into different classes. They require to be called
within the traverse method to work. This is the my current implementation.
class Traverse
{
public void traversemethod()
{
Console.WriteLine("Traverse function");
Checker r = new Checker();
r.checkermethod();
Store s = new Store();
s.storemethod();
}
}
class Checker
{
public void checkermethod()
{
Console.WriteLine("Checker function");
}
}
class Store
{
public void storemethod()
{
Console.WriteLine("Store function");
}
}
class Compute
{
public static void Main()
{
Console.WriteLine("Main function");
Traverse v = new Traverse();
v.traversemethod();
Console.ReadLine();
}
Is there any way by which I can implement them separately without
declaring them together in traverse method and calling both store and
checker method separately in the main function. I can implement the
traverse method in both store and checker method, but i was wondering if
there is any way to do it rather than duplicating the same code again.
I am currently trying to separate out the method implementation so that
they can work independently. The methods that I am trying to separate are
store and checker. Both these methods require the traverse method. My
current implementation has two method store and checker methods which I
have separated them into different classes. They require to be called
within the traverse method to work. This is the my current implementation.
class Traverse
{
public void traversemethod()
{
Console.WriteLine("Traverse function");
Checker r = new Checker();
r.checkermethod();
Store s = new Store();
s.storemethod();
}
}
class Checker
{
public void checkermethod()
{
Console.WriteLine("Checker function");
}
}
class Store
{
public void storemethod()
{
Console.WriteLine("Store function");
}
}
class Compute
{
public static void Main()
{
Console.WriteLine("Main function");
Traverse v = new Traverse();
v.traversemethod();
Console.ReadLine();
}
Is there any way by which I can implement them separately without
declaring them together in traverse method and calling both store and
checker method separately in the main function. I can implement the
traverse method in both store and checker method, but i was wondering if
there is any way to do it rather than duplicating the same code again.
Subscribe to:
Posts (Atom)