Monday, 2 September 2013

which is better?visibility property or display property of an element in html?

which is better?visibility property or display property of an element in
html?

I have a big data enclosed in div.using some priority of log in I will
make visible or invisible(using javascript). But my question is which
property, whether visibility or display none is better for fast loading of
page?

Can we extract keypoints from background subtracted video?

Can we extract keypoints from background subtracted video?

Can we extract keypoints from the background subtracted images ? i am
extracting keypoint from the video by first subtracting its background ,
but it show me runtime error
capture >> current_frame;
if (current_frame.empty())
break;
if (! previous_frame.empty()) {
subtract(current_frame, previous_frame, predict_img);
detector.detect(predict_img, keypoint2);
BestKeypoints(keypoint2, 20);
dextract.compute( predict_img, keypoint2, descriptors_2);
Mat my_img_3 = descriptors_2.reshape(1,1);
float response = svm.predict(my_img_3);
}
waitKey(10);
current_frame.copyTo(previous_frame);
}
This is error :
OpenCv Error : Image step is wrong ( The matrix is not contineous, thus
its number of rows can not be changes ) in unknown function
..\..\..\src\opencv\modules\core\src\matrix.cpp , line802
I did it without subtracting background subtraction , it works

How can I convert my tables to divs

How can I convert my tables to divs

Well, I hope that it is possible to convert the and related tags to . I am
using SimpleHTMLDomParser and it is not possible to go for another parser
in this stage. Here's what I have tried:
$html=preg_replace('/<table[^>]*>/ism', '',$html);
$html=preg_replace('/<\/table>/ism', '<br/>',$html);
$html=preg_replace('/<(tr|td|th)[^>]*>/ism', '',$html);
$html=preg_replace('/<\/(tr|td|th)[^>]*>/ism', '<br/>',$html);
To strip out the tables, but now I need to convert all the
"<table>","<tr>","<td>","<th>" to (nested) "<div>" tags (the table changes
to a div, its internal tags to nested divs).
How to do that? Thanks in advance.

Phonegap uploaded audio file not being played in browser

Phonegap uploaded audio file not being played in browser

pI am uploading a recorded mp3 file using phonegap and php/p pRecording -
Using Media object (media.startRecord/ media.stopRecord) - Successful/p
pUploading - ft.upload(fileURI, encodeURI(a
href=http://some.server.com/upload.php
rel=nofollowhttp://some.server.com/upload.php/a), win, fail, options); In
options, I am using options.mimeType = audio/mpeg;/p p-This is also
successful/p pPlaying - But when I try to play it in browser as a
href=http://some.server.com/media_uploaded.mp3
rel=nofollowhttp://some.server.com/media_uploaded.mp3/a - It tries to play
but fails after sometime. I tried playing the same file with a
href=http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_audio_all
rel=nofollowhttp://www.w3schools.com/html/tryit.asp?filename=tryhtml5_audio_all/a

as well, but couldn't succeed./p pWhen I download the same file - it gets
played without any error in any media player in my computer./p pWhen I
upload any mp3 song at same place - it gets played successfully with - a
href=http://some.server.com/song_uploaded.mp3
rel=nofollowhttp://some.server.com/song_uploaded.mp3/a/p pWhat can be
possible problem(s) with my recorded audio?/p

Sunday, 1 September 2013

Eclipse - How to add a non-Android library project to an Android app?

Eclipse - How to add a non-Android library project to an Android app?

Folks,
I have three projects in my Eclipse workspace:
A maven-based library project that generates a .jar file. This project
contains our core code.
A maven-based Java desktop application. This app is dependent upon the
library project.
An Android application that we just started to build. It is not yet
mavenized.
I would like the Android application to use the library project as the
dependency.
I have read a few responses to similar questions about adding library file
dependency to an Android application and I tried to follow them:
Method #1:
Project->Properties->Java Build Path->Projects-->Add and add the library
project.
Now, I can use the classes from the library project. Compiler does not
produce any warning. However, when I run the application on the emulator,
I get a class-not-defined error.
Method #2:
Copy the generated .jar file into "libs" directory of the Android app.
This works. There is no class-not-defined exception. However, I cannot
attach the source and therefore cannot step through the library code.
Plus, each time the source changes, I will have to manually copy the .jar
file over.
Method #3:
Go to Properties of the library project. You will see "Android" in the
left pane. Select it and mark "IsLibrary" field.
In my case, however, there is no "Android" property in the left pane. I
guess this property is shown only if it is a genuine Android library
project.
I am stuck. I would appreciate it if someone can tell me how to best deal
with this situation.
Here is a summary of what I wish to achieve: 1. The same library project
to be used in a desktop application as well as the Android application. 2.
On the Android application, source code debugging should work. 3. If there
is any source code change in the library application, the Android
application should automatically pick up the new changes (instead of me
trying to drag the new .jar file into the libs folder each time).
Thank you in advance for your help.
Regards,
Peter

TheBat archive file (tbk) format

TheBat archive file (tbk) format

I'd like to write a function to read archived emails from TheBat mail
client archive file (.tbk). However, I can't find any specification of the
format.
If anyone has this format description or digged it themselves, I'd be
grateful.

Invoke-WebRequest working after server is unreachable

Invoke-WebRequest working after server is unreachable

I am using Invoke-WebRequest in a SCOM PowerShell script to periodically
monitor the availability of a URI. My script is fairly simple (since I
have very little knowledge of PS :-) ):
$scomapi = new-object -comObject "MOM.ScriptAPI"
$scompb = $scomapi.CreatePropertyBag()
$fullHostName = "https://" + <full path to monitored web endpoint>
$result = Invoke-WebRequest $fullHostName
if($result.content) {
$scompb.AddValue("ConfigurationReachable",$true);
} else {
$scompb.AddValue("ConfigurationReachable",$false);
}
$scomapi.AddItem($scompb)
$scomapi.ReturnItems()
In order to test this script, I did manual changes in the hosts file on
the client running the SCOM agent where I want to do the monitoring.
Interestingly, the script succeeds in fetching the web endpoint even after
the host is unreachable (tested this by pinging from that machine).
I did some further tests directly from the command line, and nothing
changes. Even though I have no ping to the remote address,
Invoke-WebRequest still succeeds and fetches the web page. So what am I
doing wrong here?