Monday, 30 September 2013

DNS Server, DHCP Client and Server works fine, but request time out occurs when using MikroTik as an access point for a modem

DNS Server, DHCP Client and Server works fine, but request time out occurs
when using MikroTik as an access point for a modem

I use 2 Mikrotik wireless router, the first one is connected to modem and
it works perfectly (SSID: server-one (hidden)).
Second router ID:
ether1: 192.168.1.1
wlan1: dhcp-client
wlan2: 192.168.2.1
SSID: skywifi
Then, i tried to configure the second router. I set wlan1 to connect to
server-one, as a station and dhcp client and received 192.168.50.124 as
its IP, 192.168.50.254 as its gateway.
I set wlan2 as an ap-bridge, and set it as dhcp server. Then I create a
static route to 0.0.0.0/0 through 192.168.50.254.
Connection OK, DNS to device connecting skywifi works perfectly, i can
nslookup google.com. The problem is, when i tried to ping google.com, it
always give request time out reply. (Note that I also tried to ping
another host too (Wikipedia,Yahoo, etc). The result is also request time
out.
Any idea why this things happened? Thanks,

Intertext like command in enumerate environment=?iso-8859-1?Q?=3F_=96_tex.stackexchange.com?=

Intertext like command in enumerate environment? – tex.stackexchange.com

I would like to insert some explanatory text between two items of a
numbered list. Is there a command that can do this in the same way as the
\intertext command in an align environment?

Fire a javascript function after jquery autosuggest selection made

Fire a javascript function after jquery autosuggest selection made

I have the jQuery autosuggest working. What i'd like to do though is after
the data is selected from the autosuggest, to be able to fire off a
javascript function. So the user selects the name John Smith and some
other info gets populated with ajax. I have the ajax working, I have the
autosuggest working but can't figure out how to get the autosuggest to
fire off the ajax.
I've tried putting a call in the select portion of the autosuggest.. that
didn't work. was almost as if it was getting ignored. Anyway.. I've looked
around and can't find the answer.
thanks for any help shannon

How to log the CPU and network utilization for Android

How to log the CPU and network utilization for Android

I want to get the CPU utilization over time and turn the records into plot
diagrams. I have surveyed some method for instant utilization, like shell
command top, dumpsys, and APPs TaskSpy.
Usage: top [ -m max_procs ] [ -n iterations ] [ -d delay ] [ -s
sort_column ] [ -t ] [ -h ]
-m num Maximum number of processes to display.
-n num Updates to show before exiting.
-d num Seconds to wait between updates.
-s col Column to sort by (cpu,vss,rss,thr).
-t Show threads instead of processes.
-h Display this help screen.
dumpsys
I want to customize the chart like TaskSpy and add some details to
analysis. It will be better to analysis on PC/MAC. Can I do these by adb
shell command?

Sunday, 29 September 2013

How to check out code from local git directory

How to check out code from local git directory

I downloaded a source code package. It is nearly 3GB. But it is a empty
directory and just contains a .git directory. How can I check out code
from it?

A call to PInvoke function has unbalanced the stack

A call to PInvoke function has unbalanced the stack

Making a function call to .NET 4 to native code is resulting in the
following exception:
A call to PInvoke function has unbalanced the stack. This is likely
because the managed PInvoke signature does not match the unmanaged target
signature. Check that the calling convention and parameters of the PInvoke
signature match the target unmanaged signature.
Here is my definition in Native Code:
typedef void ( CALLBACK* CB_DOWNLOADING )
(
ULONG, // secs elapsed
LPARAM, // custom callback param
LPBOOL // abort?
);
FETCH_API HttpFetchW
(
LPCWSTR url,
IStream** retval,
LPCWSTR usrname = NULL,
LPCWSTR pwd = NULL,
BOOL unzip = TRUE,
CB_DOWNLOADING cb = NULL,
LPARAM cb_param = 0,
LPWSTR ctype = NULL,
ULONG ctypelen = 0
);
Here is the .NET counterpart:
[DllImport(dllPath, CharSet = CharSet.Unicode, SetLastError = true,
CallingConvention = CallingConvention.Cdecl)]
internal static extern FETCH HttpFetchW
(
[MarshalAs(UnmanagedType.LPWStr)]
string url,
out System.Runtime.InteropServices.ComTypes.IStream retval,
[MarshalAs(UnmanagedType.LPWStr)]
string usrname,
[MarshalAs(UnmanagedType.LPWStr)]
string pwd,
bool unzip,
dlgDownloadingCB cb,
IntPtr cb_param,
[MarshalAs(UnmanagedType.LPWStr)]
string ctype,
ulong ctypelen
);
Where FETCH is an enum.
[UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
internal delegate void dlgDownloadingCB(ulong elapsedSec, IntPtr
lParam, bool abort);
internal static void DownloadingCB(ulong elapsedSec, IntPtr lParam, bool
abort)
{
// Console.WriteLine("elapsedSec = " + elapsedSec.ToString());
}
Can anyone suggest an alternative within the .NET 4?
Thank you very much for your help.

How to implement double indexing in a 2D sparse scipy matrix?

How to implement double indexing in a 2D sparse scipy matrix?

Suppose I have a 2D sparse matrix M representing the results of 2-on-2
basketball matches. I want to use address the elements of the matrix using
double-indexing : Element M[i,j][k,l] will represent the score of the game
played by a team of players i and j against team k and l. Thus, each
column/row is specified by two numbers instead of one. Note that this is
not a 4D matrix. I'm looking for a way to do this with a sparse SciPy
matrix in order to be able to perform various matrix-related calculations
(eigenvalues/vectors, etc).