Thursday, 3 October 2013

java.lang.NoSuchMethodException: Unknown property

java.lang.NoSuchMethodException: Unknown property

following is my pojo :
package anto.com.poc;
public class VerifyPaymentRO {
private String mihpayid;
private String request_id;
private String bank_ref_num;
private String amt;
private String disc;
private String mode;
private String PG_TYPE;
private String card_no;
private String name_on_card;
private String udf2;
private String addedon;
private String status;
private String unmappedstatus;
private String Merchant_UTR;
private String Settled_At;
public String getMihpayid() {
return mihpayid;
}
public void setMihpayid(String mihpayid) {
this.mihpayid = mihpayid;
}
public String getRequest_id() {
return request_id;
}
public void setRequest_id(String request_id) {
this.request_id = request_id;
}
public String getBank_ref_num() {
return bank_ref_num;
}
public void setBank_ref_num(String bank_ref_num) {
this.bank_ref_num = bank_ref_num;
}
public String getAmt() {
return amt;
}
public void setAmt(String amt) {
this.amt = amt;
}
public String getDisc() {
return disc;
}
public void setDisc(String disc) {
this.disc = disc;
}
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public String getPG_TYPE() {
return PG_TYPE;
}
public void setPG_TYPE(String pG_TYPE) {
PG_TYPE = pG_TYPE;
}
public String getCard_no() {
return card_no;
}
public void setCard_no(String card_no) {
this.card_no = card_no;
}
public String getName_on_card() {
return name_on_card;
}
public void setName_on_card(String name_on_card) {
this.name_on_card = name_on_card;
}
public String getUdf2() {
return udf2;
}
public void setUdf2(String udf2) {
this.udf2 = udf2;
}
public String getAddedon() {
return addedon;
}
public void setAddedon(String addedon) {
this.addedon = addedon;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getUnmappedstatus() {
return unmappedstatus;
}
public void setUnmappedstatus(String unmappedstatus) {
this.unmappedstatus = unmappedstatus;
}
public String getMerchant_UTR() {
return Merchant_UTR;
}
public void setMerchant_UTR(String merchant_UTR) {
Merchant_UTR = merchant_UTR;
}
public String getSettled_At() {
return Settled_At;
}
public void setSettled_At(String settled_At) {
Settled_At = settled_At;
}
}
and I am trying to set values at run time like the following :
static public VerifyPaymentRO convertToVerifyPaymentPOJO(String
verifyPaymentInfo) {
VerifyPaymentRO verifyPaymentRO = new VerifyPaymentRO();
String[] verifyPaymentComma=null;
String[] verifyPayment=null;
String value="";
verifyPaymentComma = verifyPaymentInfo.trim().split(",");
for (String verifyPaymentCommaSeparated : verifyPaymentComma) {
verifyPayment = verifyPaymentCommaSeparated.trim().split("=");
if(verifyPayment.length==2){
value=verifyPayment[1];
}else{
value="";
}
try {
if(verifyPayment[0].trim().equals("mihpayid"))
PropertyUtils.setProperty(verifyPaymentRO,
"mihpayid", value.trim());
if(verifyPayment[0].trim().equals("request_id"))
PropertyUtils.setProperty(verifyPaymentRO,
"request_id", value.trim());
if(verifyPayment[0].trim().equals("bank_ref_num"))
PropertyUtils.setProperty(verifyPaymentRO,
"bank_ref_num", value.trim());
if(verifyPayment[0].trim().equals("amt"))
PropertyUtils.setProperty(verifyPaymentRO, "amt",
value.trim());
if(verifyPayment[0].trim().equals("disc"))
PropertyUtils.setProperty(verifyPaymentRO, "disc",
value.trim());
if(verifyPayment[0].trim().equals("mode"))
PropertyUtils.setProperty(verifyPaymentRO, "mode",
value.trim());
if(verifyPayment[0].trim().equals("PG_TYPE"))
PropertyUtils.setProperty(verifyPaymentRO, "PG_TYPE",
value.trim());
if(verifyPayment[0].trim().equals("card_no"))
PropertyUtils.setProperty(verifyPaymentRO, "card_no",
value.trim());
if(verifyPayment[0].trim().equals("name_on_card"))
PropertyUtils.setProperty(verifyPaymentRO,
"name_on_card", value.trim());
if(verifyPayment[0].trim().equals("udf2"))
PropertyUtils.setProperty(verifyPaymentRO, "udf2",
value.trim());
if(verifyPayment[0].trim().equals("addedon"))
PropertyUtils.setProperty(verifyPaymentRO, "addedon",
value.trim());
if(verifyPayment[0].trim().equals("status"))
PropertyUtils.setProperty(verifyPaymentRO, "status",
value.trim());
if(verifyPayment[0].trim().equals("unmappedstatus"))
PropertyUtils.setProperty(verifyPaymentRO,
"unmappedstatus", value.trim());
if(verifyPayment[0].trim().equals("unmappedstatus"))
PropertyUtils.setProperty(verifyPaymentRO,
"unmappedstatus", value.trim());
if(verifyPayment[0].trim().equals("Merchant_UTR"))
PropertyUtils.setProperty(verifyPaymentRO,
"Merchant_UTR", value.trim());
if(verifyPayment[0].trim().equals("Settled_At"))
PropertyUtils.setProperty(verifyPaymentRO,
"Settled_At", value.trim());
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
}
return verifyPaymentRO;
}
everything works fine but for the last two properties I get the following
exception :
1. java.lang.NoSuchMethodException: Unknown property 'Merchant_UTR' on
class 'class anto.com.poc.VerifyPaymentRO'
2. java.lang.NoSuchMethodException: Unknown property 'Settled_At' on class
'class anto.com.poc.VerifyPaymentRO'
but these two fields are available and I get the above exception only for
the above two fields and rest are working fine.
so what could cause the issue?
thanks

Wednesday, 2 October 2013

Difference between using .ipp extension and .cpp extension files

Difference between using .ipp extension and .cpp extension files

Suppose I have 2 header files, 1 .ipp extension file and a main.cpp file:
First header file(like interface in Java):
template<class T>
class myClass1{
public:
virtual int size() = 0;
};
second header file:
#include "myClass1.h"
template<class T>
class myClass2 : public myClass1<T>
public:
{
virtual int size();
private:
int numItems;
};
#include "myClass2.ipp"
And then is my myClass2.ipp file:
template <class T>
int myClass2<T>::size()
{
return numItems;
}
Last one is my main:
#include "myclass2.h"
void tester()
{
myClass2<int> ForTesting;
if(ForTesting.size() == 0)
{
//......
}
else
{
//.....
}
}
int main(){
tester();
return 0;
}
myClass1, myClass2 and myClass2.ipp belong to header file. main.cpp in
source file. What's the advantages by using this way to implement your
program instead of using just .h and .cpp files? And what is .ipp
extension file? The difference between .ipp and .cpp?

Disable rotation on a UISnapBehavior?

Disable rotation on a UISnapBehavior?

I like that UIKitDynamics snippet, but I really want to use it to slide in
one direction only with a slight oscillation.
Is there a way to turn off rotation for this behavior? As SpriteKit has
allowsRotation property which can be easily turned off.

Resquest MongoDB with scala

Resquest MongoDB with scala

I want to do an application in scala, with a MongoDB database. I found
some tutorials to use it with ReactiveMongo, I wrote my classes, but I
want to test it and I don't understand how to do a simple request ; to add
a user for example, or find him...
What is the right method to use ?

Tuesday, 1 October 2013

How to trigger an event before a cookie is read?

How to trigger an event before a cookie is read?

i'm currently developing a model firefox addon which can enable a user to
have separate cookies for every tab. Here is what i'm planning to do:
1)tag the tab using a unique number (say Xtab)
2)all the cookies created in a particular tab are prefixed with the tag
(i.e. Xtab)
3)when the site that the user is browser tries to read the cookie, my
firefox addon will deliver the tagged cookie.
The tab can be tagged using setTabValue. Cookie creation can be monitored
using a observer service as described here My question is, is there an
event/listener which trigger before a cookie is read?

ServiceStack creates WSDLs? I thought WSDL was for non REST

ServiceStack creates WSDLs? I thought WSDL was for non REST

I'm so confused here on having a RESTful API where you expose a list of
Uri Templates to a consumer and then why ServiceSTack would also create a
WSDL. Isn't WSDL for non RESTful APIs?

Are Spell-Like Abilities actually Spells=?iso-8859-1?Q?=3F_=96_rpg.stackexchange.com?=

Are Spell-Like Abilities actually Spells? – rpg.stackexchange.com

An interesting point of contention surrounding the definition of a
spell-like ability arose whilst answering this question. Are spell-like
abilities actually spells? The question mentioned a Flail …

A formula to compute the lovasz number

A formula to compute the lovasz number

As Wikipedia says:
The Lovász number $\vartheta$ of graph $G$ is defined as follows:
$$\vartheta(G) = \min\limits_{c, U} \max\limits_{i \in V}
\frac{1}{(c^\mathrm{T} u_i)^2},$$ where $c$ is a unit vector in $R^N$ and
$U$ is an orthonormal representation of $G$ in $R^N$. Here minimization
implicitly is performed also over the dimension $N$, however without loss
of generality it suffices to consider $N = n$.
Does it suffice to consider the minimal allowed $N$ in the above formula?

Monday, 30 September 2013

Evaluation of a series

Evaluation of a series

Some hints to start the evaluation of this series? $$\sum_{k=0}^\infty
\dfrac{2^{2k}(k
!)^2}{(2k)!(2k+1)^2}\left(\dfrac{1}3-\dfrac{1}{4^{k+1}}\right)$$

Removing a string of files with rename

Removing a string of files with rename

I have been trying to batch rename a bunch of files so that they are
consistent and fit within the name structure that I have come up with. For
instance,I am renaming comics, and so I have a directory that looks like
this:
$ls *.cbr
Injustice - Gods Among Us 001 (2013) (Digital) (K6 of Ultron-Empire).cbr
Injustice - Gods Among Us 002 (2013) (Digital) (K6 of Ultron-Empire).cbr
Injustice - Gods Among Us 003 (2013) (Digital) (K6 of Ultron-Empire).cbr
My goal is to use rename the files so they look like the following:
Injustice - Gods Among Us 001.cbr
Injustice - Gods Among Us 002.cbr
Injustice - Gods Among Us 003.cbr
So I tried the following:
rename -n 's/^\d{3}.\.cbr/^\ $1.cbr/' *.cbr
Was assuming that by delimiting to the first set up on the 3 digit issue,
I could then change to rename everything starting from the beginning line
(Injustice - God Among Us) and add in the 3 digit issue number (\d{3})
everything would pan out. Needless to say, it didn't.
Although I would like a little direction on how to get this solved, I
really want to better understand how to leverage using pregex for future
use.

regex to extract consecutive single-line comments when a specific string is contained within

regex to extract consecutive single-line comments when a specific string
is contained within

Consider an SQL file as follows that contains a number of single-line
comments:
-- I'm a little teapot
<<< not a comment >>>
-- some random junk
-- random Mary had a
-- little lamb random
-- more random junk
<<< not a comment >>>
Using regex, I was looking to match the string Mary.*?lamb and extract all
consecutive (above and below) single line comments.
The expected output would be:
-- some random junk
-- random Mary had a
-- little lamb random
-- more random junk
I was trying something along these lines but had no luck.
(--[\S\t\x20]*\n)*?(--[\S\t\x20]*?Mary[\S\t\x20]*?\n)(--[\S\t\x20]*\n)*

Removing duplicate elements in XML

Removing duplicate elements in XML

My project requires a functionality to convert the input XML file into
DataTable. I am using the following code to do that.
DataSet ds = new DataSet();
ds.Locale = CultureInfo.InvariantCulture;
dataSourceFileStream.Seek(0, SeekOrigin.Begin);
ds.ReadXml(dataSourceFileStream);
dt = ds.Tables[0];
This works quiet right unless the input XML has duplicate elements, for
eg, if the XML file is like below:
<?xml version="1.0" encoding="iso-8859-1"?>
<DocumentElement>
<data>
<DATE>27 September 2013</DATE>
<SCHEME>Test Scheme Name</SCHEME>
<NAME>Mr John</NAME>
<SCHEME>Test Scheme Name</SCHEME>
<TYPE>1</TYPE>
</data>
</DocumentElement>
As you can see above, the element SCHEME appears twice. when this kind of
XML file comes ds.ReadXml(dataSourceFileStream); fails to return right
data table.
Any better way to handle this?

Sunday, 29 September 2013

is it possible to add css link within html tags?

is it possible to add css link within html tags?

i have 2 css and i placed my 1st css on
<head>
<link type="text/css" href="<?php echo base_url();
?>css/dark-hive/jquery-ui-1.8.10.custom.css" rel="stylesheet">
</head>
i want to put my 2nd css on a specific html tag because it affects my 1st
css if i put it also in the HEAD tag. can i do that? like... this is what
I'm planning to do. is it correct?
<div link="type:text/css; href:???"> </div>

how the cache size and array size affect the performance of mathematical operations on an array?

how the cache size and array size affect the performance of mathematical
operations on an array?

I am trying to learn the usage of cache. From what I see by doing some
sample experiment program, the time taken for execution of a program
iterating through an array and doing some operations on the elements
suddenly increases very much if I increase the array size beyond a
particular value.Can anyone explain in simple terms how the cache size and
array size affect the performance of mathematical operations on an array?

Something Similar to RAPL for non Sandy Bridge/xeon processors

Something Similar to RAPL for non Sandy Bridge/xeon processors

First post ever here.
I wanted to know if there was something similar to the Running Average
Power Limit for other processors(Intel i7) that aren't Sandy Bridge or
Xeon Processors as the machine im working on in the lab.
For those who do not know. I pulled this description to bring you up to
speed.
"RAPL(Running Average Power Limit) interface provides platform software
with the ability to monitor, control, and get notifications on SOC power
consumptions."
What I am looking for in particular is to acquire energy consumption
measurements on a processor's individual cores after running some code
like Matrix Multiplication or Vector Addition. Temperature would be
excellent too but that's another question for another day(lm-sensors is a
bit puzzling to me)
Thanks and Take Care.

Saturday, 28 September 2013

Runtime error in seekbar android

Runtime error in seekbar android

I have created seek bar & I want to update the seek bar value in textview.
I have done following thing.
part of layout file is,
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.15" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="49dp"
android:background="@drawable/circle"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.90" >
<TextView
android:id="@+id/seekvalue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text=" " />
</RelativeLayout>
</LinearLayout>
<SeekBar
android:id="@+id/showvalue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/linearLayout1" />
the java code is,
text=(TextView)findViewById(R.id.seekvalue);
// slide_me.setRightBehindContentView(R.layout.right_menu);
slider=(SeekBar)findViewById(R.id.showvalue);
slider.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
// int progressChanged = 0;
public void onProgressChanged(SeekBar seekBar, int
progress, boolean fromUser){
// progressChanged = progress;
text.setText(progress);
}
public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
I have got following run time error
09-29 08:08:51.732: E/AndroidRuntime(428): FATAL EXCEPTION: main
09-29 08:08:51.732: E/AndroidRuntime(428):
android.content.res.Resources$NotFoundException: String resource ID #0x1
09-29 08:08:51.732: E/AndroidRuntime(428): at
android.content.res.Resources.getText(Resources.java:201)
09-29 08:08:51.732: E/AndroidRuntime(428): at
android.widget.TextView.setText(TextView.java:2817)
09-29 08:08:51.732: E/AndroidRuntime(428): at
com.android.waitress.Calculator$1.onProgressChanged(Calculator.java:39)
09-29 08:08:51.732: E/AndroidRuntime(428): at
android.widget.SeekBar.onProgressRefresh(SeekBar.java:89)
09-29 08:08:51.732: E/AndroidRuntime(428): at
android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:506)
so please help me... thanks

curl_exec output to file instead of browser

curl_exec output to file instead of browser

So this is working when I echo the lines out, but when I perform the
curl_exec's it will return the following in my browser.
registerDomain-myip-Domain unavailable for registration.
registerDomain-myip-Domain unavailable for registration.
registerDomain-myip-Domain unavailable for registration.
Can I put the above to a file instead by modifying the code below?
<?php
date_default_timezone_set('UTC');
$lines = file('tocatch.txt');
$OPERATION = 'registerDomain';
$VERSION = '1';
$TYPE = 'xml';
$YOURAPIKEY = 'removed';
//
https://www.namesilo.com/api/OPERATION?version=VERSION&type=TYPE&key=YOURAPIKEY
foreach($lines as $line){
$REQUEST = 'https://www.namesilo.com/api/' .$OPERATION. '?version='
.$VERSION. '&type=' .$TYPE. '&key=' .$YOURAPIKEY. '&domain=' .$line.
'&years=1&private=1&auto_renew=1<br />';
$REQUEST = preg_replace('/\s/', '', $REQUEST);
// echo $REQUEST;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $REQUEST);
curl_exec($curl);
curl_close($curl);
}
?>

Bitmaps and Rasterized images for a programmer?

Bitmaps and Rasterized images for a programmer?

Is there a defacto reading material for a programmer to get up to speed
with rasterized (bitmaps) graphics?

Allow selected Computers to access the application on Server

Allow selected Computers to access the application on Server

We have installed our WPF application on Windows Server 2003 (installed to
Everyone, not Just Me). Windows Server have many Domain Users and Computer
on LAN.
How can I allow selected PCs (not Domain Users) on Domain to access the
application using Remote Desktop ? I tried to make Computer Names as
Application Users, but problem arises when two computer have same names.
Initially I tried to restrict it with Domain Users, but problem was the
Domain Users can connect to Server via Remote Desktop from any PC.
Thanks in advance.

Friday, 27 September 2013

Android Studio: Cannot Get Preview Window Opened

Android Studio: Cannot Get Preview Window Opened

I have looked around and cannot find a solution to my answer.
I want the preview and design tab for my layouts, but they are not there.
I go into View > Windows and it is greyed out. It is a stock project and I
have not done any changes to it. Here is an image of my problem
http://s22.postimg.org/dk7mo1w6p/screenshot1.png

Not able to connect to HBase from Windows

Not able to connect to HBase from Windows

I am trying to run a HBase Java Client Program from Windows. All I have is
1) A Java Program without any compiler error 2) hbase-site.xml (No other
HDFS or HBase config files I have. Only the above one.) When I run the
program I get the following error-given in the last block. Do I miss
something? Both I am giving here.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.zookeeper.quorum</name>
<value>IP Address1,IPAddress2,IPAddress3</value>
</property>
</configuration>
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;
import java.io.IOException;
public class HConnect
{
public static void main(String[] args)
{
try
{
Configuration aConfig = HBaseConfiguration.create();
HTable aTable = new HTable(aConfig, "TestTable");
byte[] aRowKey = Bytes.toBytes("RowKey1");
Put aPut = new Put(aRowKey);
byte[] aColFamily = Bytes.toBytes("ColumnFamily1");
byte[] aColumn = Bytes.toBytes("Column1");
byte[] aColumnVal = Bytes.toBytes("ColumnValue1");
aPut.add(aColFamily, aColumn, aColumnVal);
aTable.put(aPut);
aTable.close();
}
catch(IOException aException_in)
{
System.out.println("");
}
}
}
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
further details.
Sep 27, 2013 3:16:13 PM
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper <init>
INFO: The identifier of this process is 7948@sisavip5-600b
Sep 27, 2013 3:16:15 PM
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper
retryOrThrow
WARNING: Possibly transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
Sep 27, 2013 3:16:15 PM org.apache.hadoop.hbase.util.RetryCounter
sleepUntilNextRetry
INFO: Sleeping 2000ms before retry #1...
Sep 27, 2013 3:16:18 PM
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
WARNING: Possibly transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
Sep 27, 2013 3:16:18 PM org.apache.hadoop.hbase.util.RetryCounter
sleepUntilNextRetry
INFO: Sleeping 4000ms before retry #2...
Sep 27, 2013 3:16:22 PM
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
WARNING: Possibly transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
Sep 27, 2013 3:16:22 PM org.apache.hadoop.hbase.util.RetryCounter
sleepUntilNextRetry
INFO: Sleeping 8000ms before retry #3...
Sep 27, 2013 3:16:31 PM
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
WARNING: Possibly transient ZooKeeper exception:
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
Sep 27, 2013 3:16:31 PM
org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
SEVERE: ZooKeeper exists failed after 3 retries
Sep 27, 2013 3:16:31 PM org.apache.hadoop.hbase.zookeeper.ZKUtil
checkExists
WARNING: hconnection Unable to set watcher on znode (/hbase/hbaseid)
org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase/hbaseid

database query retuyrns fields in one order, I want to display them in another

database query retuyrns fields in one order, I want to display them in
another

This probably has been answered (or should be basic knowledge), so please
forgive the noob question...
I'm using the WP user_meta database to store advanced properties of a user.
Data is stored in this order (this is all for userid=15):
city = Altoona
state = PA
phone = 9999999999
name = Fred
I want to generate the output as
Fred, Altoona, PA, 9999999999
Here's the relevant PHP code:
$my_exportlist = $wpdb->get_results("SELECT `user_id` FROM
`wp_m_membership_relationships` WHERE `level_id` = '2' ");
foreach ($my_exportlist as $duser) {
$my_stationinfo = $wpdb->get_results("SELECT * FROM `wp_usermeta` WHERE
`meta_key` IN ('name', 'city', 'state', 'office') AND user_id
='$duser->user_id'");
foreach ($my_stationinfo as $myinfo) {
$csv_output .= $myinfo->meta_value . ",";
}
$csv_output .= "\n";
}

I can't configure "auto-complete" to use GTAGS

I can't configure "auto-complete" to use GTAGS

I have a similar structure for a C project
./project
./project/inc
./project/out
./project/asm
./project/src
I run "gtags -v" from Makefile in ./project thus producing 3 files GTAGS,
GRTAGS, GPATH in the same directory.
Now editing a C-file in .project/src I can use "gtag-find-tag", it works
fine finding files also in other directories.
While "auto-complete" don't use GTAGS even if "ac-source-gtags" is in
"ac-sources" list. How can I make "auto-complete" to use GTAGS?
This in my .emacs
(add-to-list 'load-path "~/.emacs.d/addons")
(require 'gtags)
(autoload 'gtags-mode "gtags" "" t)
(add-hook 'c-mode-hook '(lambda () (gtags-mode 1)))
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/addons/ac-dict")
(ac-config-default)
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)
Thanks.

Javascript - Uncaught TypeError: Object has no method

Javascript - Uncaught TypeError: Object has no method

I have this method:
var stopwatch = function () {
this.start = function () {
(...)
};
this.stop = function() {
(...)
};
};
When I try to invoke it:
stopwatch.start();
I am getting Uncaught TypeError: Object (here is my function) has no
method 'start'. What am I doing wrong?

PHP non blocking soap request

PHP non blocking soap request

After a user signs up on my website i need to send a soap request in a
method that is not blocking to the user. If the soap server is running
slow I don't want the end user to have to wait on it. Is there a way I can
send the request and let my main PHP application continue to run without
waiting from a response from the soap server? If not, is there a way to
set a max timeout on the soap request, and handle functionality if the
request is greater than a max timeout?

CKEDITOR in chrome adding "?" mark at cursor position while apply any style(bold/italic) without selection

CKEDITOR in chrome adding "?" mark at cursor position while apply any
style(bold/italic) without selection

I have a page which has CKEDITOR.when i try to apply any style(no
selection made just i clicked inside the editor) within the editor, it is
working in all other browser except chrome.
Chrome adding "?" mark at the cursor position.
is this ckeditor bug?
i try to find addCommand("bold")/addCommand("strong") function but its not
found
can i solve that issue?
Please help me out this issue.

Thursday, 26 September 2013

Handler is not starting activity everytime

Handler is not starting activity everytime

I have made an handler in a service which calls an Activity to generate
popup. It works fine when any activity of my application is opened.But
when activity is not opened that time it starts my popup activity only
once . I have checked the code by debugging every time handler invokes the
code of starting that activity but activity is not generated. But if any
activity of my application is opened then it works fine.
I am using FLAG_ACTIVITY_NEW_TASK flag since i am starting the activity
from service. Is there a problem of context.
Thanks in advance

Wednesday, 25 September 2013

Embed Sound in CSS in flex

Embed Sound in CSS in flex

I am trying to use sound in flex. I got the output using urlrequest, as I
have less sound files to use, and need not to load everytime i call it. So
I tried to put that in css and use it, but I am getting an error :
TypeError: Error #1007: Instantiation attempted on a non-constructor.
Below is my code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Style>
draw
{
url:"Assets/Sound/Active.mp3";
}
</mx:Style>
<mx:Script>
<![CDATA[
import flash.media.Sound;
import flash.media.SoundTransform;
internal var sound:Sound;
internal var soundVolume:SoundTransform;
public function playSound():void
{
var SoundClass:Class;
try
{
SoundClass =
StyleManager.getStyleDeclaration("draw").getStyle("url") as
Class;
soundVolume = new SoundTransform(1, 0);
trace("sound : "+sound);
sound = new SoundClass() as Sound;
sound.play(0, 0, soundVolume);
}
catch(E:Error)
{
trace("E "+E);
}
}
]]>
</mx:Script>
<mx:Button click="playSound()" label="Discard"/>
</mx:Application>

Thursday, 19 September 2013

error with dynamic quantize choropleth with d3

error with dynamic quantize choropleth with d3

i have this code enter link description here
i'm a d3 newbie. could you help me to complete the onchange and the
quantize.domain fuction in a way that i can bind json propeties when
selection form change?
d3.selectAll(".demosearch").on("change", function (dd) {
d3.json("comuni_mn.json", function(json) {
quantize.domain([
d3.min(json.features, function(d) { return
d.properties.[dd.value]; }),
d3.max(json.features, function(d) { return
d.properties.[dd.value]; })
]);
console.log(dd.value);
svg.selectAll("path")
.attr("class", function(d) { return
quantize(d.properties.[dd.value]); });
});
});

How to parse a string containing RDF n-triples?

How to parse a string containing RDF n-triples?

I have a file which reads rdf n-triples format. But, I am not allowed to
use third party API's (like jena etc... It's a different debate).
But basically, I can get two kinds of string:
<foo 1> <bar 1> <foo bar> .
<foo 2> <bar 2> foobar .
So, I want to write a class:
void ParseTriples(String s){
setObject(<foo> part)
setPredicate(<bar part>)
setObject(<foobar> or foobar)
}
How do I resolve this?

scala Play Salat Aggregate example

scala Play Salat Aggregate example

I am using Scala Play 2.x with MongoDB in backend. I must confess that
Salat has wonderful support for mongo CRUD operations but so far I didn't
find any good example of how I can call mongo aggregate function using
SALAT like $unwind, $match, $group or aggregate pipeline. For example
db.posts.aggregate([
{
$unwind :"$tag"
},
{ $group :
{
_id :"$tags",
count : {$sum :1}
}
},
{
$sort : {$post :-1}
},
{
$limit :1
}
])
Thanks in advance

How to use .udl file in app.config file

How to use .udl file in app.config file

I had file as string.udl on my Desktop.which contain
[oledb] ; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=dbVisitorManagement;Data Source=SHREE-PC So I
have to use this file for establishing connection in App.config file of My
Project then what I have to do for this??

Show Login after User Logsout and Press Back button

Show Login after User Logsout and Press Back button

It's quite common that when User is logged out and pressing back button
may land into LoggedIn user pages [last page], though they will not be
able to do anything from there. But certainly it can be seen as Logged in
User page.
One way is to ensure that browsers don't cache the page, setting up header
parameters. But it can work or can't work depending on browser.
When I have seen Facebook, somehow they implemented this feature that once
user is logged out, back button will always asks for login.
How do we achieve this using Javascript/jQuery?

Classic ASP SOAP Server

Classic ASP SOAP Server

I have to create a Classic ASP soap server that will respond to soap
requests. What is the best way to do this?
I read that using the SOAP toolkit is discouraged. Are there other options
apart from manually creating the response?
Rgds,
Karel

Wednesday, 18 September 2013

Android Runable class - cannot access property from run() method

Android Runable class - cannot access property from run() method

class MyRunnable implements Runnable{
public StringBuffer line2;
public MyRunnable(StringBuffer _line){
this.line2 = _line;
Log.w("LINE", this.line2.toString());
}
public void run(){
SpannableString read = new SpannableString("READ:> " +
this.line2.toString() + "\n");
read.setSpan(new ForegroundColorSpan(Color.GREEN), 0, 6, 0);
console.append(this.line2.toString());
}
}
This is my code... I have the problem that when accessing line2 from run()
method it has 0 length.
Any idea where I'm wrong?

jQuery dialog not opening in jsFiddle

jQuery dialog not opening in jsFiddle

Why jQuery dialog is not opening in jsFiddle?
<div id="rolling" style="display: none;">
//data
</div>
<div style="padding-top:15px;">
<button type="submit" id="Send to device"
onclick="javascript:initializeDevice()"> Send to device</button>
</div>
function initializeDevice()
{
document.getElementById('rolling').style.display = 'block';
jQuery("#rolling").dialog({
//title etc.
});
jQuery("#rolling").dialog('open');
}
check this link: http://jsfiddle.net/sumanthreddy/bps6e/2/

Use JBoss JPA 2.1 on JBoss EAP 6.1

Use JBoss JPA 2.1 on JBoss EAP 6.1

I am using JBoss AS 7.1 and JBoss EAP 6.1. I packaged all libraries and
classes in one WAR file and deployed it in two application servers. When I
run the same codes inside WAR on AS 7.1, it is working fine, but not on
EAP 6.1. I use JBoss JPA for the persistence entity (many-to-one and
one-to-many). Is it because EAP uses different way to implement JPA? Any
hints or directions are appreciated. The method which creates the errors
is as follows:
/**
* Attempts to store the entity object into the database.
*
* @param entity BaseEntity object.
* @throws ValidationException Thrown if we encounter a persistence error
*/
public void persist( BaseEntity entity ) throws ValidationException {
boolean isCreate = false;
try {
final EntityManager em = entityManager;
if ( null == entity.getId() ) {
isCreate = true;
entity.setCreateDateTime( new java.util.Date() );
entity.setCreateUser( SecurityUtil.getCurrentUser() );
em.persist( entity );
List<DistinguishedName> list = createDNs( entity );
for (DistinguishedName dn : list) {
em.persist( dn );
}
} else {
entity.setLastUpdateDateTime( new java.util.Date() );
entity.setLastUpdateUser( SecurityUtil.getCurrentUser() );
em.merge( entity );
}
em.flush();
} catch ( Exception e ) {
rollback();
if ( null != e.getCause() && null != e.getCause().getCause() ) {
if ( e.getCause().getCause() instanceof
ConstraintViolationException ) {
throw new ConstraintValidationException(
MessageBundleEnum.BUSINESSLOGIC.getMessage(
"InvalidConstraint" ), e );
} else if ( e.getCause().getCause() instanceof
StaleObjectStateException ) {
throw new EntityOutOfDateException(
MessageBundleEnum.BUSINESSLOGIC.getMessage( "outOfDate" ),
e );
}
}
throw new ValidationException(
MessageBundleEnum.BUSINESSLOGIC.getMessage( "generalError",
e.getMessage() ), e );
}
if ( isCreate ) {
raiseEvent(new CreatedEvent(), entity);
} else {
raiseEvent(new UpdatedEvent(), entity);
}
}
Here is the error on EAP 6.1:
15:09:28,446 TRACE [org.hibernate.type.descriptor.sql.BasicBinder]
(http-localhost/127.0.0.1:8080-1) binding parameter [1] as [BIGINT] -
458878 15:09:35,355 SEVERE
[com.test.function.application.network.ManageNetwork]
(http-localhost/127.0.0.1:8080-1) An error has occurred: Unable to find
com.test.function.domain.PhysicalPhysicalXref with id 458878.:
com.test.function.exception.businesslogic.ValidationException: An error
has occurred: Unable to find com.test.function.domain.PhysicalPhysicalXref
with id 458878. at
com.test.function.persistence.PersistenceService.persist(PersistenceService.java:183)
[function-0.22.jar:] at
com.test.function.persistence.PersistenceService.persist(PersistenceService.java:201)
[function-0.22.jar:] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_13] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_13] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_13] at java.lang.reflect.Method.invoke(Method.java:601)
[rt.jar:1.7.0_13] at
org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:129)
[jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:137)
[jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
[jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:74)
[jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:226)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:317)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
com.test.function.persistence.PersistenceService$$$view20.persist(Unknown
Source) [function-0.22.jar:] at
com.test.function.service.lim.network.ManageNetworkService.save(ManageNetworkService.java:162)
[function-0.22.jar:] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_13] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_13] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_13] at java.lang.reflect.Method.invoke(Method.java:601)
[rt.jar:1.7.0_13] at
org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:129)
[jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:137)
[jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
[jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:74)
[jboss-as-weld-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:248)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
[jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
[jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2] at
org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72)
[jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
com.test.function.service.lim.network.ManageNetworkService$$$view9.save(Unknown
Source) [function-0.22.jar:] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_13] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_13] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_13] at java.lang.reflect.Method.invoke(Method.java:601)
[rt.jar:1.7.0_13] at
org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:115)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
com.test.function.service.lim.network.ManageNetworkService$Proxy$_$$Weld$Proxy$.save(ManageNetworkService$Proxy$$$Weld$Proxy$.java)
[function-0.22.jar:] at
com.test.function.application.BaseManageNetwork.save(BaseManageNetwork.java:289)
[function-0.22.jar:] at
com.test.function.application.network.ManageNetwork$Proxy$$$WeldClientProxy.save(ManageNetwork$Proxy$$$_WeldClientProxy.java)
[function-0.22.jar:] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[rt.jar:1.7.0_13] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[rt.jar:1.7.0_13] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.7.0_13] at java.lang.reflect.Method.invoke(Method.java:601)
[rt.jar:1.7.0_13] at
org.apache.el.parser.AstValue.invoke(AstValue.java:258)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50)
[weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1] at
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
[jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1] at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
[jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101)
[jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1] at
javax.faces.component.UICommand.broadcast(UICommand.java:315)
[jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786)
[jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251)
[jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
[jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1] at
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
[jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1] at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
[jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1] at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)
[prettyfaces-jsf2-3.3.0.jar:] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:620)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:553)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:482)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:110)
[prettyfaces-jsf2-3.3.0.jar:] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
[jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
[jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
[jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
[jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1] at
java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

How do count all unique values in a data.frame

How do count all unique values in a data.frame

I've got a data frame with diagnoses as variables and patients as
observations. It's 32 variables and 5000 observations.
Please look at this example.
It is my goal to count and sum up all the diagnoses in the data frame
set.seed(1)
Data <- data.frame(id = seq(1, 10),
Diag1 = sample(c("A123", "B123", "C123"), 10, replace = TRUE),
Diag2 = sample(c("D123", "E123", "F123"), 10, replace = TRUE),
Diag3 = sample(c("G123", "H123", "I123"), 10, replace = TRUE),
Diag4 = sample(c("A123", "B123", "C123"), 10, replace = TRUE),
Diag5 = sample(c("J123", "K123", "L123"), 10, replace = TRUE),
Diag6 = sample(c("M123", "N123", "O123"), 10, replace = TRUE),
Diag7 = sample(c("P123", "Q123", "R123"), 10, replace = TRUE))
Data
class(Data)
mode(Data)
I know how to do it for one column using the plyr package
NoDiag1 <- count(Data, "Diag1")
How can I do this for the whole data frame instead of one variable?
If this is not possible, how can I add up column 1-7 to one column so that
I can use the count function for this "merged" column?

How to strip whitespace from before but not after punctuation in python

How to strip whitespace from before but not after punctuation in python

relative python newbie here. I have a text string output from a program I
can't modify. For discussion lets say:
text = "This text . Is to test . How it works ! Will it! Or won't it ? Hmm ?"
I want to remove the space before the punctuation, but not remove the
second space. I've been trying to do it with regex, and I know that I can
match the instances I want using match='\s[\?.!\"]\s' as my search term.
x=re.search('\s[\?\.\!\"]\s',text)
Is there a way with a re.sub to replace the search term with the leading
whitespace removed? Any ideas on how to proceed?

The difference between Manifest.xml and config.xml for phonegap build apps

The difference between Manifest.xml and config.xml for phonegap build apps

I am working on an android app with Phonegap and Jquery Mobile which I
will compile with build.phonegap.com.
I first want to know the difference between Manifest.xml and config.xml
files, and also whether it is required to add androidManifest.xml when i
am uploading the files to build.phonegap.com.
Secondly i will like to know if there will a device problem assuming i add
three different Manifest.xml for three difference devices eg, android, ios
and blackberry when i upload the files to phonegap build.
Thank you

How to show pop up window in android?

How to show pop up window in android?

I am developing a sample app.I am able to show alert on button click
having some tittle and button .But now I want to show a pop up window
having username (Label) and text field (Edit field) and a button. on click
on button.can I make another popup xml file for that ?
public void selfDestruct(View view) {
// Kabloey
Log.d("Naveen", "Test====");
System.out.println("----------------------ghfgjhf-----------------");
AlertDialog alertDialog = new
AlertDialog.Builder(SecondActivity.this).create();
alertDialog.setTitle("Reset...");
alertDialog.setMessage("R u sure?");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//here you can add functions
} });
alertDialog.show();
}
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/self_destruct"
android:onClick="selfDestruct" />

Tuesday, 17 September 2013

Cannot insert to more than one table

Cannot insert to more than one table

I am trying to execute a stored procedure via excel VBA, however the
stored procedure only inserts a record into a single table and throws an
error message when the other 2 records are to be inserted to their
respective tables
The error message is thrown on the VBA side however in SQL management
studio there are no errors yet it still only inserts to the single table.
USE [MainRoads]
GO
/****** Object: StoredProcedure [mruser].[sp_InsertUpdateProject]
Script Date: 18/09/2013 3:04:49 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [mruser].[sp_InsertUpdateProject]
-- Add the parameters for the stored procedure here
--@ProjectRecord_ID numeric(18,0),
@lProjectNumber numeric(18,0),
@sProjectName nvarchar(300),
@sProjectType nvarchar(100),
@sDirectorate nvarchar(300),
@sProjectManager nvarchar(300),
@sContractType nchar(10),
@sProjectDescription nvarchar(max),
@sCurrentPhase nvarchar(50),
@sProjectStartDate date,
@sPlannedCompDate date,
@sReportingPeriod nchar(10),
@sProjectStatusAt date,
@sPSRApprovedBy nvarchar(100),
@sPSRApprovedDate date,
@sProjectOverallHlth text,
@sProjectWrkflwStatus nchar(10),
@sProjectRAGStatus nchar(10),
@sAssessRAG nchar(10),
@sSelectRAG nchar(10),
@sDevelopRAG nchar(10),
@sDeliverRAG nchar(10),
@sOperateRAG nchar(10),
@lTotalOrigBudget decimal(18,2),
@lTotalAppBudget decimal(18,2),
@lActualsLifeToDate decimal(18,2),
@lTotalForecastToComplete decimal(18,2),
@lTotalProjVar decimal(18,2),
@lCommFunding decimal(18,2),
@lStateFunding decimal(18,2),
@lOthFunding decimal(18,2),
@sCommFundType nvarchar(50),
@sStateFundType nvarchar(50),
@sOthFundType nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
Declare @v_recordexist int
Select @v_recordexist = count(*) From Project_Information Where
Project_Number = @lProjectNumber
--If record does not exists update record
IF @v_recordexist = 0
BEGIN
INSERT INTO [mruser].[Project_Information] ([Project_Number],
[Project_Name], [Project_Type], [Directorate],
[Project_Manager],[Contract_Type], [Project_Description],
[Current_RO&DS_Phase],
[Project_Start_Date],[Planned_Completion_Date],
[Reporting_Period], [Project_Status_At], [PSR_Approved_By],
[PSR_Approved_Date], [Project_Overall_Health],
[Project_Workflow_Status], [Project_RAG_Status], [Date_Inserted] )
values(@lProjectNumber, @sProjectName, @sProjectType,
@sDirectorate, @sProjectManager, @sContractType,
@sProjectDescription, @sCurrentPhase, @sProjectStartDate,
@sPlannedCompDate, @sReportingPeriod, @sProjectStatusAt,
@sPSRApprovedBy, @sPSRApprovedDate, @sProjectOverallHlth,
@sProjectWrkflwStatus, @sProjectRAGStatus, GETDATE())
--SELECT SCOPE_IDENTITY() as ProjectIDNumber
BEGIN
Insert into [mruser].[Project_Finance] ([Project_Number],
[Total_Original_Budget], [Total_Approved_Budget],
[Actuals_Life_To_Date], [Total_Forecast_Cost_To_Complete],
[Total_Project_Variance], [Commonwealth_Funding],
[State_Funding], [Other_Funding], [Commonwealth_Fund_Type],
[State_Fund_Type], [Other_Fund_Type]) values (@lProjectNumber,
@lTotalOrigBudget, @lTotalAppBudget, @lActualsLifeToDate,
@lTotalForecastToComplete ,@lTotalProjVar ,@lCommFunding
,@lStateFunding ,@lOthFunding ,@sCommFundType ,@sStateFundType
,@sOthFundType)
--(strClientID, timeReg, timeValid, bCurrent, durum)
VALUES (@strClientID,getdate(),getdate() + 30,'1','1')
Insert into [mruser].[Project_Milestones] ([Project_Number],
[Assess_RAG_Status], [Select_RAG_Status],
[Develop_RAG_Status], [Deliver_RAG_Status],
[Operate_RAG_Status]) values(@lProjectNumber, @sAssessRAG,
@sSelectRAG, @sDeliverRAG, @sDevelopRAG, @sOperateRAG)
--Insert into [mruser].[Project_Finance] ([Project_Number],
[Total_Original_Budget], [Total_Approved_Budget],
[Actuals_Life_To_Date], [Total_Forecast_Cost_To_Complete],
[Total_Project_Variance], [Commonwealth_Funding],
[State_Funding], [Other_Funding], [Commonwealth_Fund_Type],
[State_Fund_Type], [Other_Fund_Type]) values (@lProjectNumber,
@lTotalOrigBudget, @lTotalAppBudget, @lActualsLifeToDate,
@lTotalForecastToComplete ,@lTotalProjVar ,@lCommFunding
,@lStateFunding ,@lOthFunding ,@sCommFundType ,@sStateFundType
,@sOthFundType)
END
End
Else
BEGIN
update [mruser].[Project_Information] set
[Project_Number] = @lProjectNumber,
[Project_Name] = @sProjectName,
[Project_Type] = @sProjectType,
[Directorate] = @sDirectorate,
[Project_Manager] = @sProjectManager,
[Contract_Type] = @sContractType,
[Project_Description] = @sProjectDescription,
[Current_RO&DS_Phase] = @sCurrentPhase,
[Project_Start_Date] = @sProjectStartDate,
[Planned_Completion_Date] = @sPlannedCompDate,
[Reporting_Period] = @sReportingPeriod,
[Project_Status_At] = @sProjectStatusAt,
[PSR_Approved_By] = @sPSRApprovedBy,
[PSR_Approved_Date] = @sPSRApprovedDate,
[Project_Overall_Health] = @sProjectOverallHlth,
[Project_Workflow_Status] = @sProjectWrkflwStatus,
[Project_RAG_Status] = @sProjectRAGStatus
where [Project_Number] = @lProjectNumber
update [mruser].[Project_Milestones] set
[Project_Number] = @lProjectNumber,
[Assess_RAG_Status] = @sAssessRAG,
[Select_RAG_Status] = @sSelectRAG,
[Develop_RAG_Status] = @sDeliverRAG,
[Deliver_RAG_Status] = @sDevelopRAG,
[Operate_RAG_Status] = @sOperateRAG
where [Project_Number] = @lProjectNumber
UPDATE [mruser].[Project_Finance] set
[Project_Number] = @lProjectNumber,
[Total_Original_Budget] = @lTotalOrigBudget,
[Total_Approved_Budget] = @lTotalAppBudget,
[Actuals_Life_To_Date] = @lActualsLifeToDate,
[Total_Forecast_Cost_To_Complete] = @lTotalForecastToComplete,
[Total_Project_Variance] = @lTotalProjVar,
[Commonwealth_Funding] = @lCommFunding,
[State_Funding] = @lStateFunding,
[Other_Funding] = @lOthFunding,
[Commonwealth_Fund_Type] = @sCommFundType,
[State_Fund_Type] = @sStateFundType,
[Other_Fund_Type] = @sOthFundType
where [Project_Number] = @lProjectNumber
END
End

Any way not to confuse sbt-eclipse if I just want everything in the top-level folder? (2.2.0 with 0.12.4)

Any way not to confuse sbt-eclipse if I just want everything in the
top-level folder? (2.2.0 with 0.12.4)

I'm a high school teacher, and I'm using Scala to teach my Intro to
Programming class. It's a little scary, but I'm excited.
However, since these are beginners, I want to give them as simple a
project structure as possible. In the beginning, everything will just be
at the top level, and at the very beginning, everything will probably be
in one .scala file.
Unfortunately, I can't figure out how to convince Eclipse that I don't
want src/main/scala, src/test/scala, etc. and not get errors. Here's my
best crack at build.sbt so far:
scalaSource in Compile <<= baseDirectory
scalaSource in Test <<= baseDirectory
resourceDirectory <<= baseDirectory
unmanagedSourceDirectories in Compile <<= Seq(scalaSource in Compile).join
unmanagedSourceDirectories in Test <<= Seq(scalaSource in Test).join
Unfortunately, when I run eclipse and refresh, Eclipse complains that
there are duplicate entries in the build path and that it can't link to
the base directory--which it represents as the absolute path to the
project directory, but with hyphens substituted for slashes.
I can fix up the Eclipse project manually, but it'd be great if I could
figure out how not to have to do that.

handling time zone in a countdown plugin

handling time zone in a countdown plugin

i have countdown plugin which takes a timestamp(in seconds) as an argument
and returns a countdown to the given timestamp in form of
day/houers/minutes .
all timestamps are calculated/stored in UTC timezone ... plugin used to
work fine until i have changed my server and currently my server is in
Newyork time zone .
as you can guess my countdown plugin doens't work right anymore ...
here is the important part of the plugin
// Time left
time_left = Math.floor((options.timestamp - (new Date())) / 1000);
is there any way change time zone on fly like in php ? something like
time_left = Math.floor((options.timestamp - (new Date('UTC'))) / 1000);

org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user lacks privilege

org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user
lacks privilege

In my web application run on TomEE 1.5.2 server at @ManagedBean I get EJB
by @EJB annotation. In EJB I get EntityManager by
@PersistenceContext(unitName = "CollDocPU")
private EntityManager em;
After that i use EM to create Query:
Query q = em.createNamedQuery("User.findByLogin").setParameter("login",
login);
At this moment I get error:
javax.el.ELException: javax.ejb.EJBException: The bean encountered a
non-application exception; nested exception is:
<openjpa-2.2.0-r422266:1244990 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: type not found or
user lacks privilege: TEXT {stmnt 2102470495 CREATE TABLE COURSE
(id_course SMALLINT NOT NULL, code VARCHAR(255), description TEXT, name
VARCHAR(255), realization INTEGER, version SMALLINT, PRIMARY KEY
(id_course)) ENGINE = innodb} [code=-5509, state=42509]
viewId=/pages/register.xhtml
location=/home/jakub/Projekty/Collv2/build/web/pages/register.xhtml
phaseId=INVOKE_APPLICATION(5)
Caused by:
org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user
lacks privilege: TEXT {stmnt 2102470495 CREATE TABLE COURSE (id_course
SMALLINT NOT NULL, code VARCHAR(255), description TEXT, name VARCHAR(255),
realization INTEGER, version SMALLINT, PRIMARY KEY (id_course)) ENGINE =
innodb} [code=-5509, state=42509]
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:247)
/pages/register.xhtml at line 26 and column 104
action="#{registerController.register}"
<HtmlCommandButton action="#{registerController.register}"
actionExpression="#{registerController.register}" class="class
javax.faces.component.html.HtmlCommandButton" clientId="j_id_f:j_id_m"
disabled="false" id="j_id_m" immediate="false" inView="true"
readonly="false" rendered="true" transient="false" type="submit"
value="#{msg.login}" location="/pages/register.xhtml at line 26 and column
104"/> - State size:0 bytes

Convert Scanning For className JavaScript block to use jQuery

Convert Scanning For className JavaScript block to use jQuery

I have a small block I wanted to convert to using jQuery for a couple of
different purposes, but mainly to reverse engineer how it works to imporve
my jQuery skills. I tried taking a go at it, but could not figure out all
of the conversions.
The following Javascript block iterated through the checkboxes rendered in
an ASP.NET TreeView control client-side and scan for checkboxes with a
className=disabledTreeviewNode (this equivilent functionality cannot be
achieved purely server side).
function DisableCheckBoxes(treeviewClientID) {
var treeView = document.getElementById(treeviewClientID);
if (treeView) {
//Get all the checkboxes which are 'inputs' in the treeview
var childCheckBoxes = treeView.getElementsByTagName("input");
//Iterate through the checkboxes and disable any checkbox that has
a className="disabledTreeviewNode"
for (var i = 0; i < childCheckBoxes.length; i++) {
var textSpan =
childCheckBoxes[i].parentNode.getElementsByTagName("span")[0];
if (textSpan != null && textSpan.firstChild)
if (textSpan.className == "disabledTreeviewNode" ||
textSpan.firstChild.className == "disabledTreeviewNode")
childCheckBoxes[i].disabled = true;
}
}
}
I tried changing the following:
var treeView = document.getElementById(treeviewClientID);
to
var treeView = $('#' + treeviewClientID);
However then I could no longer call getElementsByTagName. I tried to use
the jQuery equivilent of .find but then the code started to behave
differently and I was a bit lost.
Can anyone assist on converting this small block to use jQuery? Comments
are welcome as to if this is worthwhile or even if there is a better way.

Sunday, 15 September 2013

CSS background syntax not working in Safari and IE8

CSS background syntax not working in Safari and IE8

This is my background image syntax:
background:url(images/img.jpg) repeat-x scroll left bottom / 100% 100%
transparent;
I copied this from the web and not sure what the forward slash is meant to
be doing there. I am using this to resize the background on responsive
layouts. This works perfectly for me in FF, Chrome, Opera, IE10 and IE9
but it does not work in Safari and IE8.
Is there a workaround for Safari and IE8?

Not getting any output on Running a X window program

Not getting any output on Running a X window program

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
Display *dis;
int screen;
Window win;
GC gc;
void init_x() {
/* get the colors black and white (see section for details) */
unsigned long black,white;
/* use the information from the environment variable DISPLAY
to create the X connection:
*/
dis=XOpenDisplay((char *)0);
screen=DefaultScreen(dis);
black=BlackPixel(dis,screen), /* get color black */
white=WhitePixel(dis, screen); /* get color white */
/* once the display is initialized, create the window.
This window will be have be 200 pixels across and 300 down.
It will have the foreground white and background black
*/
win=XCreateSimpleWindow(dis,DefaultRootWindow(dis),0,0,
200, 300, 5, white, black);
/* here is where some properties of the window can be set.
The third and fourth items indicate the name which appears
at the top of the window and the name of the minimized window
respectively.
*/
XSetStandardProperties(dis,win,"My Window","HI!",None,NULL,0,NULL);
/* this routine determines which types of input are allowed in
the input. see the appropriate section for details...
*/
XSelectInput(dis, win, ExposureMask|ButtonPressMask|KeyPressMask);
/* create the Graphics Context */
gc=XCreateGC(dis, win, 0,0);
/* here is another routine to set the foreground and background
colors _currently_ in use in the window.
*/
XSetBackground(dis,gc,white);
XSetForeground(dis,gc,black);
/* clear the window and bring it on top of the other windows */
XClearWindow(dis, win);
XMapRaised(dis, win);
}
int main()
{
init_x();
return 0;
}
This is my first program to get started with X programming. I got this
sample code from Internet, I compiled and ran the code but there is no
output window.Can anyone please guide me what modification is required
here to display a window.

Change touch radius of a toggle button

Change touch radius of a toggle button

I have a circular toggle button that has the touch radius of a square - as
shown by the blue box:

How do I make it so the touch radius is only on the image? Here's my XML
for the ToggleButton:
<ToggleButton
android:layout_width="380dp"
android:layout_height="340dp"
android:shape="oval"
android:background="@layout/powerbutton"
android:id="@+id/powerButton"
android:textOn=""
android:textOff=""
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"/>
I have tried to add android:radius="100dp", android:shape="oval", defined
the shape in another XML file, and scoured the internet to see if anything
would fix it, but haven't had any luck. Below is what I have attempted in
another XML file:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" android:padding="10dp">
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
Anybody know what could be going wrong?

how to post multiple values via ajax $.post method to php script?

how to post multiple values via ajax $.post method to php script?

i have an image button below each image gallery. I want post the values of
a,b,c,d,e,f,g to a php script once the image button clicked. if php script
successfully inserted the a,b,c,d,e,f,g in to mysql i want to changed the
image button so user knows data entered successfuly!
could any one show me how i can make such ajax post method with multiple
values and how to change the image button if ajax post request was
successfull? in my php script what should i add so ajax knows data was
inserted successfully to mysql db ?
<html>
<head>
<script>
function postLike(a,b,c,d,e,f,g) {
//after sussceffuly insert to mysql i want to change image button to this
$('#like12').html(" <img class='lb-liked' onclick='deleteLike(&quot;"
+ b + "&quot;)' src='/liked.png' title='like' border='0' />");
}
</script>
</head>
<body>
<div id="like12" style="float: left; padding: 10px 2px 2px;">
<img class="liker"
onclick='postLike("http://somesite.com/12345.jpg","stacy","http://somesite.com/season_456565656.jpg","123456789","http://somesite.com/abddef/","98765432","cool
season")' src="./like.png" border="0">
</div>
</html>

Time Duration between 2 DateTimes in PHP is not accurate when over a day has past

Time Duration between 2 DateTimes in PHP is not accurate when over a day
has past

I am working on a Timeclock application for my boss and I store a clock in
and clock out time as a DateTime and as a Timestamp.
Below is a simple function to calculate the duration between a user's
Clock in and Clock out DateTimes.
In the demo you can see the result is 15:11:18 even though there is like 5
days between the 2 dates. I know I could simply make the function show the
number of days but my boss does not want to show days, instead this should
should the Total Hour, minutes, seconds between the 2 DateTimes and not
show the Days.
Can anyone point me in the right direction or help to make it show the
proper amount of time?
public function dateTimeDifference($startDatetime, $endDatetime, $format =
'%H:%I:%S')
{
$startDatetime2 = new DateTime($startDatetime, $this->timeZone);
$endDatetime2 = new DateTime($endDatetime, $this->timeZone);
$interval = $startDatetime2->diff($endDatetime2);
return $interval->format($format);
}
$startDatetime = '2013-09-10 07:15:48 pm';
$endDatetime = '2013-09-15 10:27:06 am';
echo dateTimeDifference($startDatetime, $endDatetime)
// Result: 15:11:18

Angularjs filter always returns true

Angularjs filter always returns true

I've made filter for ng-repaet that looks like this:
$scope.filterRoutine = function(col) {
return _.isEqual(col.Routine.IsIndoor, true);
}
It works fine (isEqual returns true or false).
But this doesn't work, and I don't know why is that (when I say it doesn't
work, I don't get any errors, but view doesn't change)
$scope.filterRoutine = function(col) {
return _.forEach(tempData, function (temp) {
if (_.find(col.Exercises, { Exercise: temp })) {
return true;
} else {
return false;
}
});
}
What I do here (or rather what I want to do) is this: I have tempData
collection, if my col.Exercises has at least one item from tempData it
should be showed in the view. But for some reason all items are showed in
the view i.e. nothing has been filtered.
My guess is that this because this function always returns true (because
always at least one col.Exercises should contain item from tempData).
How can I fix this i.e. hide all cols which don't contain any items from
tempData ?

Delete SHell forlder contents using IFileOperation

Delete SHell forlder contents using IFileOperation

I am trying to get the contents of Recycle Bin and delete them manually,
but I have 2 problems: 1. It doesn't work, it cracks on
SHCreateShellItemArrayFromIDLists call, probably the second parameter that
I'm giving it isn't what he expects 2. Even if it would work this way..
I'm not ok with the fact that I have to declare a constant size vector of
type PIDLIST_ABSOLUTE .. the is no possible way I could know in advance
how many files there are in Recycle bin, so I 'm guessing that this
approach isn't the right one. The code follows, it's a quick wrap up of
what I've found on the web:
void WINAPI DeleteRBinData( )
{ LPITEMIDLIST pidlRecycleBin = NULL; LPITEMIDLIST pidlItems = NULL;
IShellFolder *psfFirstFolder = NULL; IShellFolder *psfDeskTop = NULL;
IShellFolder *psfRecycleBin = NULL; LPENUMIDLIST ppenum = NULL; ULONG
celtFetched; HRESULT hr;
ULONG uAttr;
uAttr = SFGAO_FOLDER;
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
hr = SHGetFolderLocation(NULL, CSIDL_BITBUCKET, NULL, NULL, &pidlRecycleBin);
hr = SHGetDesktopFolder(&psfDeskTop);
hr = psfDeskTop->BindToObject(pidlRecycleBin, NULL, IID_IShellFolder,
(LPVOID *) &psfRecycleBin);
psfDeskTop->Release();
hr = psfRecycleBin->EnumObjects(NULL,SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
&ppenum);
PIDLIST_ABSOLUTE pIdlArray[10] ;
UINT cidl = 0;
while( hr = ppenum->Next(1,&pidlItems, &celtFetched) == S_OK &&
(celtFetched) == 1)
{
pIdlArray[cidl++] = pidlItems;
CoTaskMemFree(pidlItems);
}
IShellItemArray *aItems;
hr = SHCreateShellItemArrayFromIDLists(cidl, (PCIDLIST_ABSOLUTE_ARRAY
)pIdlArray, &aItems);
DeleteMyItems((IUnknown*)aItems);
}
and :
HRESULT DeleteMyItems(__in IUnknown* files)
{
IFileOperation *pfo;
hr = CoCreateInstance(CLSID_FileOperation,
NULL,
CLSCTX_ALL,
IID_PPV_ARGS(&pfo));
if (SUCCEEDED(hr))
{
hr = pfo->SetOperationFlags(FOF_NO_UI);
if (SUCCEEDED(hr))
{
// IFileOperation::DeleteItems()
if (SUCCEEDED(hr))
{
hr = pfo->PerformOperations();
}
}
pfo->Release();
}
return hr;
}

Saturday, 14 September 2013

Change layout of google chrome alertbox

Change layout of google chrome alertbox

I want to change layout of google chrome alert box, My basic need to alert
value like "Item added sucessfully" but in google chrome alert box it is
good to see can it is posible google chrome alert box show like a model
window in the center of screen with some effective design?

Admob Ads Finally Show but now my APP is NOT

Admob Ads Finally Show but now my APP is NOT

How do I get this:
super.onCreate(savedInstanceState);
super.setIntegerProperty( "splashscreen", R.drawable.splash );
super.loadUrl("file:///android_asset/www/index.html", 3000);
Into this without errors:
package com.appsclamation.wowmedesigns;
import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
import com.google.ads.*;
public class DefaultActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Look up the AdView as a resource and load a request.
AdView adView = (AdView)this.findViewById(R.id.adView);
adView.loadAd(new AdRequest());
}
}
So my ads and my actual app show at the same time? I removed it to get the
view working and now the app does not show when I put it back I get
errors. This is the hurdle and everything should work great.
Thanks in advance

Using [NSString stringWithFormat] in UITAbleViewCell displaying as empty string

Using [NSString stringWithFormat] in UITAbleViewCell displaying as empty
string

I must be missing something basic here. When I use [NSString
stringWithFormat] to set a property of an object that displays in a
UITableViewCell, it displays as empty. If I just set the property
normally, i.e. property = @"Item One", it displays fine. The code, and
result below.
Using this:
Results in:

Yet the log shows:
Which would indicate the property is set. Will someone please take me to
school here.

simple TableView not displaying data

simple TableView not displaying data

I am a beginner, learning how to do tableViews. I followed everything in
my book, but my table View is not being populated. Shouldn't it display
the word "Testing" for three rows here? My tableview Outlet is connected,
and I enabled the delegate and datasource. What am I missing here? After
all, I am following a book.
#pragma mark UITableViewDataSource Methods
- (UITableViewCell *)tableView:(UITableView *)tv
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:@"cell"];
if( nil == cell)
{
cell = [[UITableViewCell alloc] initWithStyle:
UITableViewCellStyleDefault reuseIdentifier:@"cell"];
}
cell.textLabel.text = @"Testing";
return cell;
}
-(NSInteger)tableView: (UITableView *)tv
numberofRowsInSection:(NSInteger)section
{
return 3;
}
#pragma mark UITableViewDelegate Methods
-(void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath
*)indexPath
{
[tv deselectRowAtIndexPath:indexPath animated:YES];
}
here is my .h file
#import <UIKit/UIKit.h>
@interface CLViewController : UIViewController <UITableViewDelegate,
UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end