akp

1

votes
1

answer
52

views

Return combo box choices as a parameters in wxpython

i am working on following piece of code. i want to return combo box choices as parameters and use in another function. As combo box comes up with event handler i don't find an easy way to call it in another function. my code looks like following self.combo_box_product = wx.ComboBox(self.panel_1, wx....
akp
1

votes
1

answer
66

views

AirConsole CSS different from App and from Google Chrome

Hey guys! A quick question. if anybody can help me... I'm creating a game for AirConsole using HTML5/Javascript for my Controller. I'm currently testing it and I found out that the CSS is not the same: When I play using the AirConsole App for the Controller When I use the Google Chrome browser on my...
Akp
1

votes
1

answer
91

views

Wrong displayed of file name with underscore in RTL in WPF

I am trying to display a file name '123_xyz.wmv' in a TextBlock in WPF I have set the FlowDirection='RightToLeft' the file is displayed xyz.wmv_123 which is not correct. Please advice.
AKP
1

votes
1

answer
643

views

merge is used only for creating or updating?

If i use ex.merge(obj), now if in object obj i set the primary key to a value which is not present in database, will it create a new record or will it throw an exception? for example if obj with pk val = 19 doesnot exist in database,and i set obj.setPk(20); obj.setName('nm'); em.merge(obj) // will...
akp
1

votes
2

answer
42

views

How to get the assigned variable back out of an Array?

I created an array of objects: Object[] r = new Object[2]; I assigned a variable of a class to r: r[0] = Start; Start is of type SDTNode which is a class I created. Now I want to get the value back: SDTNode end = r[0]; It is giving me an error. Is there a way to do this?
AKP
2

votes
4

answer
6.2k

views

issue with updating record in database using JPA

I have object in database with values as follows: id =1 name = 'john' chargeid = 6 I am using merge statement to update the code em.merge(obj) When i see the query generated by JPA i found that in update query only fields which has new or not null values are updated. I checked the bean which is ass...
akp
2

votes
1

answer
408

views

UserTransaction issue in java

I have existing project which uses 2 database (DB2),and the records which are saved in the 2 databases are related.So the transactions need to be maintained.Eg whenever a new thing is to be added then entries must be done to x number of tables in Database1 and and y number of tables in database2. No...
akp
2

votes
3

answer
6.5k

views

unit testing code which uses JPA & JTA

I use 2 separate database, so i have to use JTA to handle distributed transactions.So either either both db have to commit or both rollback. I use open JPA and JTA.Now to unit test the code using junit ? I get the following error when i try to run my code which handles distributed transcations.I...
akp
5

votes
5

answer
12.9k

views

Getting linux kernel debug information after kernel crash

Is there any way to get kernel previous debug information after kernel chrash occurs. I am trying to develop a Kernel module which basically captures IP packets in ip layer inside kernel network stack & after some modification i have to send the same packet back to the NIC for transmission. During a...
akp
6

votes
1

answer
42.4k

views

Inserting a date into db2

How can I insert a date into db2 in this format: yyyy-mm-dd, using a sql query?
akp
2

votes
3

answer
1.1k

views

Preventing decompiling of applet [duplicate]

Possible Duplicate: Is it worth to obfuscate java web application? I have writen an applet. I don't want other people to decompile it using easily availabe decompilers. I have taken lots of pains to implemented the code. Can anyone suggest how I can protect my applet from geting decompiled?
akp
2

votes
4

answer
5.1k

views

using spinlocks in user-space application

I am trying to create a kernel-module which has an structure & i want to use the same structure in user-space application and this application works with the given module. the main problem is that this structure is containing a variable named spinlock_t type. which is used in kernel for locking but...
akp
1

votes
1

answer
156

views

Difference between using synchronized on “this” and a private “new Object”?

Will following 2 code block achieve the same result. What is the difference better then, if any? class test { Object obj = new Object(); void test(){ synchronized(obj){ } } void test1(){ synchronized(this){ } } }
akp
2

votes
2

answer
895

views

DDD: modelling aggregate entities' unique global/local id in PostgreSQL

I have read Eric Evans' Domain Driven Design book and I have been trying to apply some of the concepts. In his book, Eric talks about aggregates and how aggregate roots should have a unique global id whereas aggregate members should have a unique local id. I have been trying to apply that concept to...
akp
32

votes
4

answer
48.2k

views

How to convert from float to bigDecimal in java?

How to convert from float to bigDecimal in java?
akp
2

votes
1

answer
5.2k

views

sk_buff copy & sk_buff clone

i m writing a module for linux kernel & it try to steal the packet & its related sk_buff. to do so i want to use struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask) & then pass the return type to the kernel as packet is dropped. so when kernel gets the info about packet drop it try t...
akp
2

votes
2

answer
1.6k

views

getting RHEL6 kernel code

I want to change some kernel source files for network stack testing so is there any way to get kernel source code for RHEL6 Enterprise edition and how to apply the changes to get results?
akp
2

votes
0

answer
202

views

Transit Travel Mode in Google Maps Android API

I want to create a Map activity which would take source and destination locations in two edit text controls and would return a map in transit mode BUS only showing the route along with the distance.I am not an expert at programming so detailed explanations are welcome.
AKP
1

votes
1

answer
233

views

r - Replace values in a data.frame column with a different value in the same column based unique ID

I'm trying to loop through a column in a data.frame and replace 9's (invalid) with the next valid value not equal to 9 for each unique id in the data.frame. I've had no luck with dplyr, lapply, and I've been searching hard for similar problems to no avail. #dummy data set id
AKP
7

votes
1

answer
8k

views

setting values of some fields to null using JPA

In jpa merge, are all coumns updated or only the columns which have new values? While updating if i set value of some attribute to null, will null value will be stored in that cloumn in db, or will it retain previous value?
akp
43

votes
5

answer
36.2k

views

Whole one core dedicated to single process

Is there any way in Linux to assign one CPU core to a particular given process and there should not be any other processes or interrupt handlers to be scheduled on this core? I have read about process affinity in Linux Binding Processes to CPUs using the taskset utility but that's not solving my pro...
akp
3

votes
1

answer
5.1k

views

UDP packet send with linux-kernel module without using sockets

I am writing a kernel module which creates a IP packet. Now i want to send this packet but haven't created any socket for it's transmission. is there any way to send it directly with the help of kernel routines. as i have tracked the linux kernel code for packet transmission there is a function defi...
akp
1

votes
1

answer
83

views

ArrayList Size Zero In RecyclerView And No data Displaying

I am Trying to get response in recyclerview. I am getting response in log but when i adding it to recyclerView no data is displaying. I am unable to understand what i am missing. This irritate me so much, Please help public class RecyclerViewAdapter extends RecyclerView.Adapter { ArrayList arrayLis...
Akp
2

votes
4

answer
5.7k

views

REST and JAVA JPA

I am trying to understand the code of some project which is not properly documented.Am the only developer working on the task.I dont have much experience. There is a data model and there are some classes witten to access it.It was mentioned that the data model has some rest api on top of it.But wh...
akp
1

votes
3

answer
88

views

Mysql query to find only exact value?

I have value in my db like 1,12,13,25,44,414,2114 I have to find exact 14 from the db. but it also return the value 414 and 2114 but i want exact 14. How can i achieve this through sql query Please help i have tried this but didn't worked. Select * from tb_name where columnNAme like '%value%'
Akp
25

votes
6

answer
77.2k

views

Can we update primary key values of a table?

Can we update primary key values of a table?
akp
2

votes
0

answer
1.6k

views

Error from python worker: /usr/bin/python No module named pyspark

I am trying to run Pyspark on Yarn, but I receive the following error, when I type any command on the console. I am able run scala shell in Spark in both local and yarn mode. Pyspark runs fine in local mode, but does not work in yarn mode. OS : RHEL 6.x Hadoop Distribution : IBM BigInsights 4.0 Spar...
akp
3

votes
3

answer
2k

views

concurrency (stale data) problem in JPA

Let's say I have methods with following signature Object getData(int id) { //create a entity manager //get data frm db //return data } updateData() { Object obj = getData(id) //get entity manager //start transcation tx //update //commit tx } Now will it cause concurrency issue? Can data be stale...
akp
6

votes
5

answer
11k

views

Eclipse IDE search a function with given name

How to search a partifular function in a particular project in Eclipse e.g. if I want to search a function with name xyz how do I do it?
akp
4

votes
3

answer
11.1k

views

JPA 1.0 error: The name is not a recognized entity or identifier. Known entity names: []

I am getting following exception while I try to execute simple JPA 1.0 code. What may be the cause? 5453 DevPQRWDPBSSPersist WARN [P=351601:O=0:CT] openjpa.Enhance - This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load...
akp
4

votes
1

answer
7.2k

views

No metadata found for type using OpenJPA with RuntimeUnenhancedClasses

I am using JPA (OpenJPA). I have following entries in my persistence.xml: I also have Serviceoffering class listed in persistence.xml. I am getting following exception when I try to run my JPA-related code. What can be the problem? No metadata was found for type 'class com.XYZ.cloud.bss.client.db.da...
akp
3

votes
2

answer
2.3k

views

callback function in socket as sk_data_ready()

I was trying to calculate the CPU cycles consumed by various layers & functions defined in linux kernel for TCP/IP network stack for processing a packet. so i used TSC for CPU consumtion by various functions. which shows that single call to sk_data_ready() function takes a lot of CPU cycles. So i f...
akp
1

votes
3

answer
64

views

Java program output should be true , But its return false why?

I am checking if a String 'nitin' is a palindrome but it's returning false. Please anyone help me to shorout this. public static void main(String[] args) { StringBuffer sb = new StringBuffer('nitin'); sb.reverse(); String rev = sb.toString(); System.out.println(sb); System.out.println(rev); if (...
Akp
2

votes
3

answer
1k

views

How to find forward reference in eclipse?

Is there any way by which I can find out all classes which implement a particular interface? For example, if I have a interface as follows: public interface myIntFac{} I want to find all classes inside current project that implement this interface. How can I find it out in Eclipse?
akp
2

votes
2

answer
2.1k

views

finding a function with particular name

How can i search for a function with particular name in my entire project.I dont even know if the function by that name exists.So i cant find references to that function by right clicking and then selecting the required option. For example in eclipse we have one short curt ctr + shift +R to search...
akp
2

votes
2

answer
4.1k

views

problem with using JPA

I am getting following error while executing a unti test case(JUNIT).I am using it to understand the part of the project.Project is a web based project.Project is using OPENJPA org.apache.openjpa.persistence.RollbackException: Unable to obtain a TransactionManager using null. at org.apache.openjpa....
akp
2

votes
1

answer
483

views

r - Missing object when ggsave output as .svg

I'm attempting to step through a dataset and create a histogram and summary table for each factor and save the output as a .svg . The histogram is created using ggplot2 and the summary table using summary(). I have successfully used the code below to save the output to a single .pdf with each page...
AKP
10

votes
2

answer
24.8k

views

updating multiple rows using JPA

I want to update all fields of a table that has value of colum NAME as 'PCNAME'. The table name which i want to update is XYZ.I want to update only some fields and not keep some unchanged. This will affect many rows and not a single row as there will be many rows with NAME='PCNAME' How can i do it...
akp
2

votes
4

answer
5.6k

views

Time calculation with TSC (Time Stamp Counter)

I am trying to measure the time taken by some code inside Linux kernel at very high accuracy by a Linux kernel module. For this purpose, I have tried rdtscl() which gives the number of clock ticks used in the code as given below: unsigned long ini, end; rdtscl(ini); //some code... rdtscl(end); prin...
akp
2

votes
2

answer
3.2k

views

best approach for updation using JPA

Using JPA which method should I follow while updating? approach 1 obj o = new obj() o.setName('val') set other values entitymanger.merge(ibj) approach 2 obj o = getObjFromDb(obj) obj.setval(name) //not am not updating other attributes entitymanage.merge(obj)
akp

View additional