Saturday, 31 August 2013

passing bool array to a function

passing bool array to a function

I am passing a bool array to function and doing some modifications in the
passed array inside the function, the changes that I do in the function
are reflected in the original array that I passed to the function.For
example ,in the code below the output is 1 .Why am I getting this output ?
When we pass an integer variable for example ,the local variable maintains
its local value .How can I retain local copy of the original bool array
locally in the code below.
#include<iostream>
using namespace std;
void fun(bool A[30])
{
A[0]=true;
}
int main()
{
bool used[3];
used[0]=used[1]=used[2]=0;
fun(used);
cout<<used[0];
}

Testing abstract classes in Python

Testing abstract classes in Python

Consider the following scenario.
from abc import ABCMeta, abstractmethod
class ThisIsAnAbstractClass(ABCMeta):
@abstractmethod
def __init__(self,parameter):
self.parameter = parameter
def do_something():
"""do something"""
There is a class extended form ABCMeta (an abstract class) with an
abstract method in it. This class cannot be initialized because of that
abstract init() method. Is there a way to test this class? (at least using
any testing framework)

How to use unit8array in javascript?

How to use unit8array in javascript?

Accorting to this answer's comment, I would like to use Unit8Array to
achieve the same thing:
var bin = parseInt('1000', 2); //=8
I mean:
inputs are:
length = 4
digits = 1000
and after some TypedArray magic the output will be:
8

could not be found for the trigger in UpdatePanel

could not be found for the trigger in UpdatePanel

I need to keep the button in usercontrol (.ascx) file. and i have given
the AsyncPostBackTrigger controlid for the same button. but its showing
"ERROR" like could not be found for the trigger in UpdatePanel. could any
one help me? this i have give controlid `
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn1" EventName="Click" />
</Triggers>
`
this button i have kept in user control
<asp:Button ID="btn1" runat="server" Text="Click" />

Friday, 30 August 2013

Symbol not found when using template defined in a library

Symbol not found when using template defined in a library

I'm trying to use the adobe xmp library in an iOS application but I'm
getting link errors. I have the appropriate headers and libraries in my
path, but I'm getting link errors. I double-checked to make sure the
headers and library are on my path. I checked the mangled names of the
methods, but they aren't in the library (I checked using the nm command).
What am I doing wrong?
Library Header:
#if defined ( TXMP_STRING_TYPE )
#include "TXMPMeta.hpp"
#include "TXMPIterator.hpp"
#include "TXMPUtils.hpp"
typedef class TXMPMeta <TXMP_STRING_TYPE> SXMPMeta; // For
client convenience.
typedef class TXMPIterator <TXMP_STRING_TYPE> SXMPIterator;
typedef class TXMPUtils <TXMP_STRING_TYPE> SXMPUtils;
.mm file:
#include <string>
using namespace std;
#define IOS_ENV
#define TXMP_STRING_TYPE string
#import "XMP.hpp"
void DoStuff()
{
SXMPMeta meta;
string returnValue;
meta.SetProperty ( kXMP_NS_PDF, "goformz", "{ formId: {guid} }" );
meta.DumpObject(DumpToString, &returnValue);
}
Link Errors:
(null): "TXMPMeta<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > >::DumpObject(int
(*)(void*, char const*, unsigned int), void*) const", referenced from:
(null): "TXMPMeta<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > >::TXMPMeta()",
referenced from:
(null): "TXMPMeta<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >
>::SetProperty(char const*, char const*, char const*, unsigned int)",
referenced from:
(null): "TXMPMeta<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > >::~TXMPMeta()",
referenced from:
(null): Linker command failed with exit code 1 (use -v to see invocation)

Thursday, 29 August 2013

How to download from ftp without form lag vb.net

How to download from ftp without form lag vb.net

I just made a ftp chat in vb.net and it update message from a file from a
ftp server so i add a timer with interval 1000 with this code
Try
Dim client As New Net.WebClient
client.Credentials = New
Net.NetworkCredential("fnet_1355****", "******")
RichTextBox1.Text =
client.DownloadString("ftp://185.**.***.**/htdocs/chat­.txt")
Catch ex As Exception
End Try
so .. the file is downloaded and it update the text successful but there
is a problem .. every time he download the form have a bit lag ... and i
dont like that :D what i can do ?

How ExtJs grid loads data remotely when clicking reload icon in pagging bar?

How ExtJs grid loads data remotely when clicking reload icon in pagging bar?

I need to add some filter string during reload Extjs grid, when i click
reload button which is provided by EXtjs, UI updated by one server call. I
need to edit that call url in order to add filter contents. Please help me
to fix this issue.