mardi 31 mars 2015

Adview android not appearing in the Landscape mode


Vote count:

0




I have my main Activity in Portrait mode. I want to add a Banner Adview in landscape mode. How to achieve this?


Note: I tried using SetRotation(90) to Adview. But it rotates it from (0,0) and banner appears in the centre of the screen. I want some thing like this: http://ift.tt/1MxsD2q



asked 36 secs ago







Adview android not appearing in the Landscape mode

how to refresh form on closing jquery dialog box?


Vote count:

0




This is my code :



<script type="text/javascript">
$(function () {
$("#divTimezone").dialog({
autoOpen: false,
modal: true,
height: 270,
width: 550,
close: function () {

}
});
$("#linkCreate").click(function () {
$("#divTimezone").dialog("open");
});

});
</script>
<div id="divTimezone">
@Html.Partial("_Create", new Aegis.Lisa.Library.Time_Zone())
</div>


When i close the modal popup and reopen it then the textbox values, validators values etc are not reset. They remain in the same state as i entered values previously. How to reset the form on close?



asked 37 secs ago







how to refresh form on closing jquery dialog box?

Java MyBatis Configuration AddMappers(String packageName)


Vote count:

0




First of all, I have a java code like this :



Environment environment = new Environment("development",
transactionFactory, dataSource);

Configuration config = new Configuration(environment);


Then, I tried to add the mappers, using addMappers(String packageName). In that package, contains an interface of SQLMap



config.addMappers("com.test.mappers");


It works fine.


But when I have a reference to another project, and that project has a package named "com.testtwo.mappers", and contains an interface of SQLMap, and I tried to write this :



config.addMappers("com.testtwo.mappers");


My config does not load all of the interface SQLMap in the other project.


Do I miss something?


Thank you



asked 34 secs ago







Java MyBatis Configuration AddMappers(String packageName)

I am an intermediate Java programmer, What are the Java tools and resources do I have to know?


Vote count:

0




I am an intermediate Java programmer, wanna strengthen my Java knowledge, I found some useful resources here Top 20 Online Resources to Learn Java Programming Faster and Better


but I want to know is there any tools that I have to use ?



asked 19 secs ago







I am an intermediate Java programmer, What are the Java tools and resources do I have to know?

Storing the quantity of each product related to it ID in a SESSION


Vote count:

0




I am developing an online shopping system and everything is working as I want, only except for one thing. I am not able to get the quantity reported for certain product. I'm trying to include it in the SESSION of each product. I've tried using foreach but without success. I would like greatly that someone examine the logic of my code and help me to achieve my goal. I'll put the relevant parts of my code to be more objective.

First, I have the page products.php and in this page the user can select the products:



$sql = "SELECT id_product, name_product, price_product FROM products

ORDER BY id_product";
$stmt = $connection->prepare($sql);
$stmt->execute();

$num = $stmt->rowCount();

if($num>0)
{
echo "<table>";
echo " <tr>";
echo " <th>NAME</th>";
echo " <th>PRICE</th>";
echo " <th>QUANTITY</th>";
echo " </tr>";
while ($row = $stmt->fetch(PDO::FETCH_ASSOC))
{
extract($row);
echo " <tr>";
echo " <td><div class='id-product' style='display: none'>{$id_product}</div>";
echo " <div class='name-product'>{$name_product}</div></td>";
echo " <td>R&#36;{$price_product}</td>";
echo " <td>";
echo " <form class='add'>";
echo " <input type='number' name='quantity' value='1' min='1' max='20'/>";
echo " <button type='submit'>Add product</button>";
echo " </form>";
echo " </td>";
echo " </tr>";
}
echo "</table>";


And now, to proccess the data I use jQuery:



<script>
$(document).ready(function()
{
$('.add').on('submit', function()
{
var id_product = $(this).closest('tr').find('.id-product').text();
var name_product = $(this).closest('tr').find('.name-product').text();
var quantity = $(this).closest('tr').find('input').val();
window.location.href = "add.php?id_product=" + id_product + "&name_product=" + name_product + "&quantity=" + quantity;
return false;
});
});
</script>


As you can see, I set the variable quantity with the value present on the input.

In page add.php I create the SESSION using:



$_SESSION['cart'][$id_product] = $name_product;
header('Location: products.php?action=added&id_product=' . $id_product . '&name_product=' . $name_product);


Now, to show the products that exists in the SESSION, I have the page cart.php:



if(count($_SESSION['cart'])>0)
{

$ids = "";
foreach($_SESSION['cart'] as $id_product=>$value)
{
$ids = $ids . $id_product . ",";
}

$ids = rtrim($ids, ',');

echo "<table>";

echo "<tr>";
echo "<th>Product name</th>";
echo "<th>Price</th>";
echo "</tr>";

$sql = "SELECT id_product, name_product, price_product from products WHERE id_product IN ({$ids}) ORDER BY name_product";
$stmt = $connection->prepare($sql);
$stmt->execute();

while ($row = $stmt->fetch(PDO::FETCH_ASSOC))
{
extract($row);
echo "<tr>";
echo "<td>{$name_product}</td>";
echo "<td>R&#36;{$price_product}</td>";
echo "<td>THE QUANTITY NEEDS GOES HERE</td>";
echo "<td>";
echo "<a href='remove.php?id_product={$id_product}&name_product={$name_product}'>Remove</a>";
echo "</td>";
echo "</tr>";
}

echo "<tr>";
echo "<td><b>Total</b></td>";
echo "<td>&#36;</td>"; //Here I need the sum of all prices with the quantities
echo "<td>";
echo "<a href='checkout.php'>Submit</a>";
echo "</td>";
echo "</tr>";

echo "</table>";
}
else
{
echo "<p>Your cart is empty.</p>";
}


I do not know how to add the quantity of each product in the SESSION and then display it in the cart page. I would be grateful for any help.



asked 26 secs ago







Storing the quantity of each product related to it ID in a SESSION

Getting scrambled replies from DHT bootsraps for Bittorrent


Vote count:

0




I'm trying to implement a DHT node in the Bittorrent mainline. So far I got a connection in and out against a bootstrap node, the query seems to be fine according to some bencoded examples but part of the result I'm getting back is all scrambled (the parts containing the actual data):



d2:ip6:µ§ û©Å1:rd2:id20:ëÿ6isQÿJì)ͺ«òûãF|Âge1:t2:aa1:y1:re


This is my code so far:



private static String serverName = "router.utorrent.com";
private static int port = 6881;
private static String packet = "d1:ad2:id20:abcdefghij0123456789e1:q4:ping1:t2:aa1:y1:qe";
public static void main(String[] args) {

int port = Main.port;
InetAddress address = InetAddress.getByName(Main.serverName);
DatagramSocket socket = new DatagramSocket();

byte[] buf = Main.packet.getBytes();
DatagramPacket packet = new DatagramPacket(buf, buf.length, address, port);
socket.send(packet);
byte[] recBuf = new byte[2048];
DatagramPacket recPacket = new DatagramPacket(recBuf, recBuf.length);

socket.receive(recPacket);

System.out.println(new String(extract(recPacket)));
}

private static byte[] extract(DatagramPacket packet) {
byte[] data = packet.getData();
int offset = packet.getOffset();
int length = packet.getLength();

byte[] copy = new byte[length];
System.arraycopy(data, offset, copy, 0, copy.length);

return copy;
}


I'm not sure whether I have a chartset problem or there is some encoding I couldn't find specified anywhere.



asked 1 min ago

dElo

63






Getting scrambled replies from DHT bootsraps for Bittorrent

PHP Mysqli Prepared statement removes part of date


Vote count:

0




I'm currently writing an sql that has me confused. I've got two possible ways to accept data - insert or update, depending on how the check for present data goes. If I do insert, everything goes in smoothly. However, if I do update, it only takes the year from the data (aka 2015-03-31 becomes 2015).


Insert statement + bind:



$sql = "insert into track_ach_mini values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?)";


$stmt = $mysqli->prepare($sql); $stmt->bind_param("iiiiiiiiiiiiss", simple_decrypt($_POST['uid']), $_POST['data']['a'], $_POST['data']['b'], $_POST['data']['c'], $_POST['data']['d'], $_POST['data']['e'], $_POST['data']['f'], $_POST['data']['g'], $_POST['data']['h'], $_POST['data']['i'], $_POST['data']['j'], $_POST['data']['k'], $_POST['l'], $date);


Update sql + prepare + bind:



$sql = "update track_ach_mini set status = 0, a = ?, b = ?, c = ?, d = ?, e = ?, f = ?, g = ?, h = ?, i = ?, j = ?, k = ?, l = ?, m = ? where uid = ?";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param("siiiiiiiiiiiis", $_POST['a'], $_POST['data']['b'], $_POST['data']['c'], $_POST['data']['d'], $_POST['data']['e'], $_POST['data']['f'], $_POST['data']['g'], $_POST['data']['h'], $_POST['data']['i'], $_POST['data']['j'], $_POST['data']['k'], $_POST['data']['l'], $date, simple_decrypt($_POST['uid']));


(array keys & db cols altered, as you probably guessed).


By echoing out $date, I get 2015-03-31. On the insert, it sets it to 2015-03-31. On the update, it only submits 2015, causing the db to truncate it to 0000-00-00.



asked 37 secs ago







PHP Mysqli Prepared statement removes part of date

Kendo UI ComboBox 3 Way Cascade Parent Enables Grandchild


Vote count:

0




I have three Kendo ComboBoxes setup to load remote data (non-server filtering) in a pretty standard way. But for some reason, when I select the top parent, both child and grandchild are enabled. The child filters correctly, but the grandchild shows all records. When I select a child, the grandchild then filters correctly.


Then, if I clear the parent, the child and grandchild boxes disable as they should. However, when I select the top parent again everything acts as it should, i.e. only the child is enabled (not the grandchild).


Something strange is happening, but I can't figure out what it is. Any ideas?


Here's the markup:



<input id="replenishmentCustomerEditor" name="CustomerID" required data-kendo-combo-box data-k-options="customerOptions">
<input id="replenishmentLocationEditor" name="LocationID" required data-kendo-combo-box data-k-options="locationOptions">
<input id="replenishmentAssetEditor" name="AssetID" required data-kendo-combo-box data-k-options="assetOptions">


Here's the code:



$scope.customerOptions = {
optionLabel: " ",
dataTextField: "Name",
dataValueField: "CustomerID",
valuePrimitive: true,
suggest: true,
autoBind: false,
change: function (e) {
if (!this.value() || this.select() == -1) {
this.value(null);
setTimeout(function () { $("#replenishmentLocationEditor").attr('disabled', 'disabled'); }, 10);
setTimeout(function () { $("#replenishmentAssetEditor").attr('disabled', 'disabled'); }, 10);
}
},
dataSource: { transport: { read: { type: "GET", beforeSend: gridService.setAuthHeader, url: '/api/Customer/List', cache: false } } }
};

$scope.locationOptions = {
optionLabel: " ",
dataTextField: "NameAddress",
dataValueField: "LocationID",
cascadeFrom: "replenishmentCustomerEditor",
cascadeFromField: "CustomerID",
valuePrimitive: true,
suggest: true,
autoBind: false,
change: function (e) {
if (!this.value() || this.select() == -1) {
this.value(null);
setTimeout(function () { $("#replenishmentAssetEditor").attr('disabled', 'disabled'); }, 10);
}
},
dataSource: { transport: { read: { type: "GET", beforeSend: gridService.setAuthHeader, url: '/api/Location/List', cache: false } } }
};

$scope.assetOptions = {
optionLabel: " ",
dataTextField: "Number",
dataValueField: "AssetID",
cascadeFrom: "replenishmentLocationEditor",
cascadeFromField: "LocationID",
valuePrimitive: true,
suggest: true,
autoBind: false,
change: function (e) {
if (!this.value() || this.select() == -1) {
this.value(null);
}
},
dataSource: { transport: { read: { type: "GET", beforeSend: gridService.setAuthHeader, url: '/api/Asset/List', cache: false } } }
};


asked 45 secs ago







Kendo UI ComboBox 3 Way Cascade Parent Enables Grandchild

How to make a failed routing resolve promise load a different template URL?


Vote count:

0




Learning Angular and running into an issue I cant seem to find a "good" answer to. I've been following the official Tutorial and have a similar setup with a project Im working on.


The $routeProvider .when case for phone details GETS a specific .JSON file based on the name of the phone clicked on in the phone list page. The problem is, if you type in a phone name that doesn't have a .JSON file associated with it, the route still proceeds and shows a blank page. I'm trying to figure out how to prevent this.


I've gotten as far as to add a resolve to .when route. However, I can only prevent the view from changing or use a $location.path redirect. Neither of these seem ideal.


How do I go about showing a "404 page" view for phone that doesn't have a JSON file? In my head, I would show a different templateUrl if the GET request responds with a 404, but cant seem to get it working.


Any help would be great!


Here is the code I've got so far:


My route handling.



.when('/game/:Game', {
templateUrl: 'views/game-detail.html',
controller: 'GameDetailCtrl',
resolve: {
myData: ["Games", "$location", "$q", "$timeout",'$rootScope', function(Games, $location, $q, $timeout,$rootScope) {
var def = $q.defer();

var path = $location.path().toString().substring(6);

// Games service
Games.get({gameName: path}, function(game, s) {

}).$promise.then(
function(data) {
// found game data
def.resolve(data);
},
function(error) {
// couldn't find JSON file
def.reject(error);
}
);

return def.promise;
}]
}
}).when('/pageNotFound', {
templateUrl: 'views/error.html'
})


Root Scope route change error listener:



$rootScope.$on("$routeChangeError",
function(event, current, previous, rejection) {
console.log("failed to change routes");
//$location.path('/pageNotFound');
});


asked 22 secs ago

Taz

44






How to make a failed routing resolve promise load a different template URL?

Show 3 scrollable ListViews of equal height in Android Layout


Vote count:

0




I am trying to show three different sections in my Android layout on one screen, each taking up one third of the screen. Each section has a TextView and a ListView, and the ListViews can scroll so that you can see all items, but the overall page does not move. I have tried putting each TextView and ListView in a LinearLayout and setting the height of each LinearLayout to one third the total height of the screen, but the first ListView just shows all the items in it, taking up most of the screen, and the other sections are pushed down. How can I make this work, or is there a better way to go about this?



asked 1 min ago







Show 3 scrollable ListViews of equal height in Android Layout

Send file using TcpClient and NetworkStream


Vote count:

0




I have checked several examples and tutorials, but they are all different and confusing, and I couldn't figure them out completely... What I want is to send a given file from a client app to a server app, here is where I am so far


Client-side send file:



client = new TcpClient();
client.Connect(serverIP, serverPort);
byte[] file = File.ReadAllBytes(Constants.TARGET_PATH_LOGS + "squad.jpg");
byte[] fileBuffer = new byte[file.Length];
NetworkStream stream = client.GetStream();
stream.Write(file, 0, fileBuffer.GetLength(0));


Server-side receive file:



NetworkStream stream = client.GetStream();
stream.Read(???);
???


What do I need to do now in the server side to save the file properly?



asked 1 min ago







Send file using TcpClient and NetworkStream

dropdown-menu and drop-down list width is not perfectly align


Vote count:

0




I am not sure why my dropdown-menu, and my drop-down list width is not perfectly align. I set both of their width to be: width:300px;


It looks like this right now :


enter image description here


Here is what I have in JSFiddle



asked 55 secs ago







dropdown-menu and drop-down list width is not perfectly align

Single-page Browser Application


Vote count:

0




I'm working on a project that requires a web browsing application that has access to only my company's website and will deny a request to any other site. I have no background in any Android development (aside from MIT App Inventor, which doesn't really count). The app should also prevent closure from the home and back buttons. The app does need to be able to navigate, but it can't leave the site (on the page it's on, there are no external links, so that's not a problem). Is there any existing app that fits this criteria? If there is, I wasn't able to find any. Or do I need to figure out how to create my own app? I'm thinking that it might require a root to be able to block any exit commands.


Thanks in advance,

Kollin



asked 28 secs ago







Single-page Browser Application

Json gem install fail. Xcode already installed and up to date


Vote count:

0




I am getting the following errors when trying to run the bundler.



bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Using rake 10.0.4
Using i18n 0.6.1
Using multi_json 1.7.3
Using activesupport 3.2.13
Using builder 3.0.4
Using activemodel 3.2.13
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.5
Using rack-cache 1.2
Using rack-test 0.6.2
Using hike 1.2.2
Using tilt 1.4.1
Using sprockets 2.2.2
Using actionpack 3.2.13
Using mime-types 1.23
Using polyglot 0.3.3
Using treetop 1.4.12
Using mail 2.5.4
Using actionmailer 3.2.13
Using arel 3.0.2
Using tzinfo 0.3.37
Using activerecord 3.2.13
Using activeresource 3.2.13
Using coffee-script-source 1.6.2
Using execjs 1.4.0
Using coffee-script 2.2.0
Using rack-ssl 1.3.3

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/camerons/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150331-784-1yax4yj.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
/Users/camerons/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:793:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ ( \
^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^ ~~~~~~~~~~
1 warning and 1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/camerons/.rvm/gems/ruby-2.2.0/gems/json-1.8.0 for inspection.
Results logged to /Users/camerons/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/json-1.8.0/gem_make.out
An error occurred while installing json (1.8.0), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.0'` succeeds before bundling.


I try running the gem install json 1.8.0 and get this error.



gem install json -v '1.8.0'
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.

/Users/camerons/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150331-884-1wle120.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
/Users/camerons/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:793:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ ( \
^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^ ~~~~~~~~~~
1 warning and 1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/camerons/.rvm/gems/ruby-2.2.0/gems/json-1.8.0 for inspection.
Results logged to /Users/camerons/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0/json-1.8.0/gem_make.out


I know it isn't xcode because it says it is already installed and I just ran the latest software update on it.


Any advice would be greatly appreciated!



asked 29 secs ago







Json gem install fail. Xcode already installed and up to date

Issues mmaping the same file twice


Vote count:

0




I'm using a Raspberry Pi B+, and I'm trying to mmap two different sections of /dev/mem - the first to be able to set two pins' functions from location 0x2020 0004 (0x04 bytes long), the other to manipulate the BSC Slave functions on the BCM2835 chip on the Pi from location 0x2021 4000 (0x1C bytes long).



static uint32_t * initMapMem(int fd, uint32_t addr, uint32_t len)
{
return (uint32_t *) mmap((void*)0x0, len,
PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_SHARED|MAP_LOCKED,
fd, addr);
}

int initialise(void) {
int fd;

fd = open("/dev/mem", O_RDWR | O_SYNC) ;

if (fd < 0)
{
fprintf(stderr, "This program needs root privileges. Try using sudo.\n");
return 1;
}

pinReg = initMapMem(fd, 0x20200004, 0x4);
bscReg = initMapMem(fd, 0x20214000, 0x1C);

close(fd);

if (bscReg == MAP_FAILED)
{
fprintf(stderr, "Bad, mmap failed.\n");
return 1;
}
if (pinReg == MAP_FAILED)
{
fprintf(stderr, "Bad, mmap failed.\n");
return 1;
}
return 0;
}


initialise() is called out of main(). Stepping through the program with gdb I find that bscReg gets positioned right, but pinReg returns as MAP_FAILED (aka 0xFFFFFFFF) with errno set to EINVAL. Doesn't matter which way it's done, either - pinReg always finds itself as MAP_FAILED when mmaped first or second.


How do I get pinReg to a valid value?



asked 1 min ago







Issues mmaping the same file twice

Gitlab 500 Error after upgrade


Vote count:

0




I just upgraded my Gitlab Omnibus install from 7.3 to 7.9.1, and now rather than showing a login page, Gitlab just shows a 500 error page (see below)


I also noticed the following in /var/log/gitlab/gitlab-rails/production.log



Started GET "/" for 127.0.0.1 at 2015-03-31 13:36:56 -0400
Processing by DashboardController#show as HTML
PG::Error: ERROR: relation "identities" does not exist
LINE 5: WHERE a.attrelid = '"identities"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"identities"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

Completed 500 Internal Server Error in 135ms

ActiveRecord::StatementInvalid (PG::Error: ERROR: relation "identities" does not exist
LINE 5: WHERE a.attrelid = '"identities"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"identities"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
):
app/models/user.rb:425:in `ldap_user?'
app/models/user.rb:463:in `requires_ldap_check?'
app/controllers/application_controller.rb:208:in `ldap_security_check'


I should note that we use LDAP authentication with Gitlab.



asked 37 secs ago







Gitlab 500 Error after upgrade

Can't locate Email/Sender/Simple.pm on OS X Mavericks


Vote count:

0




I am running perl using CGI on OS X Mavericks.


When i run the perl script it throws following error Can't locate Email/Sender/Simple.pm When i try to install Email sender module using cpan


cpan> install Email::Sender::Simple


It says


Email::Sender::Simple is up to date (1.300016).


Any help will be really appreciated.



asked 2 mins ago







Can't locate Email/Sender/Simple.pm on OS X Mavericks

SELECT FOUND_ROWS() not working with PDO PHP?


Vote count:

0




I changed my code to finally using PDO instead of mysql_..


I changed the code of one of my query which is like



SELECT SQL_CALC_FOUND_ROWS * ....etc


but now my code



SELECT FOUND_ROWS()


and the array



echo $array[0]['FOUND_ROWS()']


return value = 0;


there is anything I should know about PDO and this type of queries?



asked 25 secs ago

Francesco

5,282






SELECT FOUND_ROWS() not working with PDO PHP?

Intellij hangs on generating a large number of graphs


Vote count:

0




I'm running a Java code on intellij which calls an R script which is supposed to generate abt 2000 graphs. But when I run the code it generates abt 200 and just hangs. It doesn't do anything.


I initially thought it had something to do with the memory allocated to for the application. So i increased the memory allocated using the following link.http://ift.tt/1NA9uIj But it still doesn't make any difference.


I also tried running the same code from the command line. But it generates the same number of graphs and hangs again.


What could be the issue??



asked 38 secs ago







Intellij hangs on generating a large number of graphs

django.db.utils.IntegrityError: UNIQUE constraint failed: rango_category__new.slug


Vote count:

0




I learning Django from Tango with Django and I keep getting this error when I type:



python manage.py makemigrations rango
python manage.py migrate


This is the output:



django.db.utils.IntegrityError: UNIQUE constraint failed: rango_category__new.slug


Models.py:



from django.db import models
from django.template.defaultfilters import slugify

class Category(models.Model):
name = models.CharField(max_length=128, unique=True)
views = models.IntegerField(default=0)
likes = models.IntegerField(default=0)
slug = models.SlugField(unique=True)

def save(self, *args, **kwargs):
self.slug = slugify(self.name)
super(Category, self).save(*args, **kwargs)

def __unicode__(self):
return self.name


class Page(models.Model):
category = models.ForeignKey(Category)
title = models.CharField(max_length=128)
url = models.URLField()
views = models.IntegerField(default=0)

def __unicode__(self):
return self.title


asked 1 min ago







django.db.utils.IntegrityError: UNIQUE constraint failed: rango_category__new.slug

ComboCox column inside a GridView causing ObjectDisposedException


Vote count:

0




I created a grid view with combobox column inside it. The entity bound to the grid view is Compagne and the entity bound to the combox box is Client (a nested child of Compagne).

Compagne entity (models):



private string nom;
public string Nom
{
get { return nom; }
set { SetPropertyValue<string>("Nom", ref nom, value); }
}

private int site;
public int Site
{
get { return site; }
set { SetPropertyValue<int>("Site", ref site, value); }
}

private int but;
public int But
{
get { return but; }
set { SetPropertyValue<int>("But", ref but, value); }
}

private int statut;
public int Statut
{
get { return statut; }
set { SetPropertyValue<int>("Statut", ref statut, value); }
}

private DateTime dateCreation;
public DateTime DateCreation
{
get { return dateCreation; }
set { SetPropertyValue<DateTime>("DateCreation", ref dateCreation, value); }
}

private DateTime? dateFin;
public DateTime? DateFin
{
get { return dateFin; }
set { SetPropertyValue<DateTime?>("DateFin", ref dateFin, value); }
}
private Client client;
[Association("Client-Compagnes")]
public Client Client
{
get { return client; }
set { SetPropertyValue("Client", ref client, value); }
}


Client entity (models):



private string nom;
public string Nom
{
get { return nom; }
set { SetPropertyValue<string>("Nom", ref nom, value); }
}
private string societe;
public string Societe
{
get { return societe; }
set { SetPropertyValue<string>("Societe", ref societe, value); }
}


GridView Partial:



settings.Columns.Add(c =>
{
c.FieldName = "Nom";
c.Caption = "Nom Compagne";
c.ColumnType = MVCxGridViewColumnType.TextBox;
});
settings.Columns.Add(c =>
{
c.FieldName = "Site";
c.Caption = "Site";
c.Width = Unit.Percentage(5);
c.ColumnType = MVCxGridViewColumnType.SpinEdit;
c.PropertiesEdit.DisplayFormatString = "d";
});
settings.Columns.Add(c =>
{
c.FieldName = "But";
c.Caption = "But";
c.Width = Unit.Percentage(8);
c.ColumnType = MVCxGridViewColumnType.SpinEdit;
c.PropertiesEdit.DisplayFormatString = "d";
});
settings.Columns.Add(c =>
{
c.FieldName = "StatutU";
c.Caption = "Statut";
c.UnboundType = DevExpress.Data.UnboundColumnType.Boolean;
c.Width = Unit.Percentage(5);
c.UnboundExpression = "[Statut] == 1";
c.ColumnType = MVCxGridViewColumnType.CheckBox;
});
settings.Columns.Add(c =>
{
c.FieldName = "DateCreation";
c.Caption = "Date de Création";
c.ColumnType = MVCxGridViewColumnType.DateEdit;
c.PropertiesEdit.DisplayFormatString = "g";
});
settings.Columns.Add(c =>
{
c.FieldName = "DateFin";
c.Caption = "Date de Fin";
c.ColumnType = MVCxGridViewColumnType.DateEdit;
c.PropertiesEdit.DisplayFormatString = "d";
});
settings.Columns.Add(c =>
{
c.FieldName = "Client.Societe";
c.Caption = "Client";
c.ColumnType = MVCxGridViewColumnType.ComboBox;
var comboBoxProperties = c.PropertiesEdit as ComboBoxProperties;
comboBoxProperties.DataSource = AppointmentTool.Models.DataHelper.GetClients();
comboBoxProperties.TextField = "Societe";
comboBoxProperties.ValueField = "Oid";
comboBoxProperties.ValueType = typeof(int);
});


I omitted some code from the gridview partial view that is no related to the problem.


Controller:



[ValidateInput(false)]
public ActionResult CompagneAdminGridViewPartial()
{
UnitOfWork uow = new UnitOfWork();
var model = new XPCollection<Compagne>(uow);
return PartialView("_CompagneAdminGridViewPartial", model);
}


All fiel


And The error is:



Exception Details: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'ASTDataLayer.DAO.Client(2)'.


asked 1 min ago

Fourat

130






ComboCox column inside a GridView causing ObjectDisposedException

Adding javascript to moodle assignment page


Vote count:

0




I am working on a page in moodle that allows you to edit submissions. There is a tinymce editor that saves changes to a submission using a save button. I am looking to automate the saving using javascript. I have my js code, but i am not sure of how to include the javascript on the page.


Url is like this: http://ift.tt/1xvOMXN


I am new to moodle and php so any help is appreciated



asked 34 secs ago







Adding javascript to moodle assignment page

How to programmatically marshall XML from Java - 0_o


Vote count:

0




I am trying to programmatically create XML elements using JAXB in Java. Is this possible? I am reading this page here for something I can use, but have so far found nothing.


Normally I have to hard-code the element value like so:



import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
class MyXML {

String name;

public String getName() {
return name;
}

@XmlElement
public void setName(String s) {
this.name = s;
}

}//end class


Below is the calling class to write this to XML (marshall it):



import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import java.io.File;

public class Foo {

static public void main(String[] args) {

MyXML m = new MyXML();
m.setName("Yo");

JAXBContext jaxbContext = JAXBContext.newInstance(MyXML.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();

jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);




jaxbMarshaller.marshal(m, new File("MyXML_"+ ".xml"));



}

} //end Foo class


This would produce an XML document like so:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<myXML>
<name>Yo</name>
</myXML>


How would I program my Java class to create the element tag name depending on what is entered in the program? For instance in my example the tag element is called 'name' how could I set this at runtime though? Is this possible with generics or some other way?


Respectfully,



asked 19 secs ago







How to programmatically marshall XML from Java - 0_o

converting vtk to dicom


Vote count:

0




I'm not expert at all with file conversion, so i'm asking for your help. I'm working on a medical database, from wich i pulled out a DCM file.


The images inside the dicom has then been converted in one .VTK file, on wich i have to work on.


Now i need to convert again the .vtk file in a dicom file (and load it in the database). Is there a way to do that?


(the first conversion is made by a c# script. the script read the database and convert the original dicom. i cannot write on the database, so i have to convert the .vtk file outside the medical platform)



asked 42 secs ago







converting vtk to dicom

str object not callable on a script


Vote count:

0




I'm running a script on a network switch:



import exsh

def main():

#result='0'
#print result
result=exsh.clicmd('show ver', capture=True)
print result
result=exsh.clicmd('sh switch', capture=True)
print result
result=exsh.clicmd('sh vlan', capture=True)
print result
exsh.clicmd('create vlan vlan10 tag 10')
result=exsh.clicmd('sh vlan10', capture=True)
print result
exsh.clicmd=('del vlan10')
result=exsh.clicmd('sh vlan', capture=True)
print result

if True: main()


When I run it, I get the expected output until it gets to line 18:



Traceback (most recent call last):
File "/config/test.py", line 23, in <module>
if True: main()
File "/config/test.py", line 18, in main
result=exsh.clicmd('sh vlan', capture=True)
TypeError: 'str' object is not callable


What becomes even more unexpected is if I run it again immediately afterwards the error now occurs at line 8:



* X460-24p.2 # run script test.py
Traceback (most recent call last):
File "/config/test.py", line 23, in <module>
if True: main()
File "/config/test.py", line 8, in main
result=exsh.clicmd('show ver', capture=True)
TypeError: 'str' object is not callable


Not sure how to trace the problem.



asked 2 mins ago


1 Answer



Vote count:

0




Yo set exsh.clicmd=('del vlan10') which makes exsh.clicmda string then you try to call it after with result=exsh.clicmd('sh vlan', capture=True)



answered 1 min ago






str object not callable on a script

reform JavaScript code into JQuery form


Vote count:

0




I'm new on javaScript ( also jquery ), I looking for "html 5 validation costume message " on web, finally I found this code snipped :



(function (exports) {
function valOrFunction(val, ctx, args) {
if (typeof val == "function") {
return val.apply(ctx, args);
} else {
return val;
}
}

function InvalidInputHelper(input, options) {
input.setCustomValidity(valOrFunction(options.defaultText, window, [input]));

function changeOrInput() {
if (input.value == "") {
input.setCustomValidity(valOrFunction(options.emptyText, window, [input]));
} else {
input.setCustomValidity("");
}
}

function invalid() {
if (input.value == "") {
input.setCustomValidity(valOrFunction(options.emptyText, window, [input]));
} else {
console.log("INVALID!"); input.setCustomValidity(valOrFunction(options.invalidText, window, [input]));
}
}

input.addEventListener("change", changeOrInput);
input.addEventListener("input", changeOrInput);
input.addEventListener("invalid", invalid);
}
exports.InvalidInputHelper = InvalidInputHelper;


})(window);


InvalidInputHelper(document.getElementById("email"), { defaultText: "Please enter an email address!", emptyText: "Please enter an email address!", invalidText: function (input) { return 'The email address "' + input.value + '" is invalid!'; } });


Visit Set custom HTML5 required field validation message


Now I wan't to rewrite it with jquery, can any buddy helped me ?


Thanks a lot,



asked 58 secs ago







reform JavaScript code into JQuery form

Ash shell - How to do while loop inside a function?


Vote count:

0




For a specific reason I have to do an infinite loop inside a function and then run the function as a daemon,



#!/bin/sh
lol(){
while true
do
echo "looping..."
sleep 2
done
}
lol() &


that script doesn't work, it gives me the following error:



/tmp/test: line 9: syntax error: unexpected "&"


How do I do an infinite loop inside a function in ash ?



asked 2 mins ago

Lin

67

1 Answer



Vote count:

0




You're just starting the function wrong -- it's nothing to do with the loop:



lol &


answered 21 secs ago






Ash shell - How to do while loop inside a function?

Java pdfBox: Fill out pdf form, append it to pddocument, and repeat


Vote count:

0




I have a pdf form made and I'm trying to use pdfBox to fill in the form and print the document. I got it working great for 1 page print jobs but i had to try and modify for multiple pages. Basically it's a form with basic info up top and a list of contents. Well if the contents are larger than what the form has room for I have to make it a multiple page document. I end up with a document with a nice page one and then all the remaining pages are the blank template. What am I doing wrong?



PDDocument finalDoc = new PDDocument();
File template = new File("path/to/template.pdf");

//Declare basic info to be put on every page
String name = "John Smith";
String phoneNum = "555-555-5555";
//Get list of contents for each page
List<List<Map<String, String>>> pageContents = methodThatReturnsMyInfo();

for (List<Map<String, String>> content : pageContents) {
PDDocument doc = new PDDocument().load(template);
PDDocumentCatlog docCatalog = doc.getDocumentCatalog();
PDAcroForm acroForm = docCatalog.getAcroForm();

acroForm.getField("name").setValue(name);
acroForm.getField("phoneNum").setValue(phoneNum);

for (int i=0; i<content.size(); i++) {
acroForm.getField("qty"+i).setValue(content.get(i).get("qty"));
acroForm.getField("desc"+i).setValue(content.get(i).get("desc"));
}

List<PDPage> pages = docCatalog.getAllPages();
finalDoc.addPage(pages.get(0));
}

//Then prints/saves finalDoc


asked 1 min ago







Java pdfBox: Fill out pdf form, append it to pddocument, and repeat

Vim: Using custom highlight groups in statusline


Vote count:

0




When customising my vim statusline, I'm able to use the following syntax to make use of the highlight group User1:



set statusline+=%1*


Let's say I have some custom highlights like:



highlight StatusLineStyle ctermbg=34 ctermfg=15 guibg=#00af00 guifg=#ffffff


How can I make use of those custom syntax colourings in my statusline?



asked 1 min ago

jviotti

2,228






Vim: Using custom highlight groups in statusline

AcessDenied Trying to acess s3 bucket from url


Vote count:

0




Im using a link that I concatenate with datetime variable:



t = time.localtime(time.time())
datetime = str(t.tm_year) + str(t.tm_mon) + str(t.tm_mday) + str(t.tm_hour) + str(t.tm_min) + str(t.tm_sec)

link = 'http://ift.tt/19wWrtU' +datetime + '/test'


When I try to acess the link, in aws console it appears like this: http://ift.tt/1xT03C5


And it works, I can acess the above link.


But if I try to acess the link in the way Im saving it, like this:


http://ift.tt/19wWrtW


Im getting a xml with an Error "<code>AcessDenied</code>"


Do you see why Im getting this error?



asked 1 min ago

UserX

172






AcessDenied Trying to acess s3 bucket from url
[unable to retrieve full-text content]


OLAP Cube percentages of count


Vote count:

0




I am really new to SSAS, OLAP and Data Warehousing in general so if I don't make myself clear please let me know.


I have a table in my database (300,000 rows) with multiple columns that are properties of registrations and a datetime column. What I want to do is display those registrations by Time(column area) and Brand(row area) and have a percentage (market share) in the data area of a pivot grid.


So far I've created a simple cube with two dimensions: Properties and Time(I created a calendar dimension) and a Count measure. I've also added a simple calculated measure (Share) which calculates a percentage of the row count based on the total:



Case
// Test to avoid division by zero.
When IsEmpty
(
[Measures].[Count]
)
Then Null

Else ( [Registrations].[Id].CurrentMember,
[Measures].[Count] )
/
(
// The Root function returns the (All) value for the target dimension.
Root
(
[Registrations]
),
[Measures].[Count]
)

End


This works fine so far.


My problem is that I want to create some presets in my application (where I will be displaying the Pivot) that the end user will be able to select and have the Share measure be calculated on the total of that filtered data and since the Share measure is calculated on the Analysis Server I suppose this is where the filtering and recalculation should happen as well.


For example, I have an attribute in my Properties Dimension that is called Registration Type and contains 2 members (NEW and USED). The same thing for a different column etc.


How can I filter the cube based on those attribute filters (e.g. select only rows where Registration Type = USED) and have the share measure be calculated by the new total rows?


I've already tried by using Custom MDX queries and while it filters the data correctly the Share Measure remains the same.



asked 1 min ago







OLAP Cube percentages of count

Proper way of receiving and updating data from server in JPanel


Vote count:

0




I have my java serverthread which retrieves data from a database and sends them to my client. The main client GUI is represented by a JTabbedPane and I want every tab (which is a JPanel) to receive it's own data and show them (for example home panel, purchasespanel, profilepanel etc). What i did is to pass the ObjectInput/Output stream to every panel and let him receive data and update them itself by calling the getAndSet method on the panel object from the main class(you can see below). Is that the correct way of doing that?


Here's an example of one of my panels



public class PurchasesPanel extends JPanel {

private JTable table;
private JScrollPane scrollPane;
private ObjectInputStream input;
private ObjectOutputStream output;
private static final String PANEL_ID = "purchases";


public PurchasesPanel(ObjectInputStream input, ObjectOutputStream output) {

this.output = output;
this.input = input;
createGUI();

}


public void createGUI() {

//Impostazione del layout e creazione della tabella
setLayout(new BorderLayout());
table = new JTable();
scrollPane = new JScrollPane(table);
add(scrollPane);

}

public void getAndSetTableModel() {

try {

output.writeUTF(PANEL_ID);
output.flush();

DefaultTableModel model = (DefaultTableModel) input.readObject();

table.setModel(model);

} catch (Exception e) {

JOptionPane.showMessageDialog(this, "Si è verificato un errore con il pannello riepilogo acquisti. ");

}


}


}



asked 1 min ago







Proper way of receiving and updating data from server in JPanel

R time series plot - add dates on x axis


Vote count:

0




I created a time series with:



ts_0615391206 <- ts(demand_rev_0615391206$estimated_demand,
start=as.Date(min(demand_rev_0615391206$date),format = "d%/m%/Y%"),
end=as.Date(max(demand_rev_0615391206$date),format = "d%/m%/Y%"))
ts_0615391206
Time Series:
Start = 16125
End = 16318
Frequency = 1
[1] 2.71 2.47 3.86 3.61 5.78 5.59 3.28 3.40 3.34 3.68 3.40 3.41 2.69 2.60 2.88 2.76 3.01 3.19 3.51 3.49 2.88 3.06 3.83 3.62
[25] 2.88 2.55 2.52 2.22 3.44 3.02 3.45 3.12 3.65 3.57 2.91 2.90 3.94 4.12 3.01 3.10 3.96 4.30 3.02 2.87 3.06 3.10 2.18 2.08
[49] 3.02 3.29 3.67 3.87 4.20 4.12 2.76 2.91 2.74 2.97 3.34 3.19 4.62 4.67 4.62 4.95 3.88 3.86 5.01 4.97 5.32 6.02 3.84 3.50
[73] 3.86 3.45 3.71 3.54 2.81 2.84 4.64 4.47 5.40 5.10 6.17 6.24 5.80 5.72 6.88 6.92 6.68 6.17 5.94 5.92 4.01 4.42 5.28 4.91
[97] 5.27 5.46 6.11 6.57 4.90 5.17 4.21 4.04 3.98 4.13 3.89 3.91 4.11 4.22 3.93 3.84 3.43 3.70 4.31 4.44 4.98 4.68 5.20 5.04
[121] 4.89 5.04 3.97 3.86 2.58 2.51 3.64 3.42 3.93 3.78 4.15 3.72 6.14 6.17 6.93 6.98 7.50 7.29 8.10 8.26 7.31 7.14 6.67 6.71
[145] 6.72 6.31 6.10 5.81 6.53 7.09 6.39 6.83 8.69 9.46 8.52 7.44 8.43 8.17 8.39 8.64 6.14 7.05 7.91 7.56 8.46 8.81 6.30 6.49
[169] 6.33 7.45 7.39 7.41 8.08 8.51 8.14 8.55 9.42 10.17 10.15 9.54 7.23 7.41 6.47 6.06 7.96 7.79 8.95 8.63 9.49 9.21 8.66 8.19
[193] 7.24 6.46


When I plot the ts



plot.ts(ts_0615391206)


on x axis I see numbers (count of days since 1/1/1970 to date) instead of dates. Any idea how to fix that ?



asked 59 secs ago







R time series plot - add dates on x axis

How to create a product feature using query in cscart


Vote count:

0




I need to create a product feature via query. I created a product feature via admin panel, Its working fine. But I need to create a product feature via query.


My query for create product feature :-



$data = array(
array(
'feature_code' => 'Make1',
'company_id' => '0',
'feature_type' => 'M',
'categories_path' => '',
'parent_id' => '',
'display_on_product' => 'N',
'display_on_catalog' => 'N',
'display_on_header' => 'N',
'status' => 'A',
'position' => '0',
'comparison' => 'N')
);

db_query('INSERT INTO ?:product_features ?m', $data);


$object_id = db_get_field('SELECT LAST_INSERT_ID()');



$data = array(
array(
'feature_id' => $object_id,
'description' => 'Make1',
'full_description' => 'Make1',
'prefix' => '',
'suffix' => '',
'lang_code' => 'en'
)
);

db_query('INSERT INTO ?:product_features_descriptions ?m', $data);


But the fields are insert into table. But I not able to edit the product feature details in cscart. How Can I do. Please help me.



asked 1 min ago







How to create a product feature using query in cscart

pandas - how to filter "most frequent" Datetime objects


Vote count:

0




I'm working with a DataFrame like the following:



User_ID Datetime
01 2014-01-01 08:00:00
01 2014-01-02 09:00:00
02 2014-01-02 10:00:00
02 2014-01-03 11:00:00
03 2014-01-04 12:00:00
04 2014-01-04 13:00:00
05 2014-01-02 14:00:00


I would like to filter Users under certain conditions based on the Datetime columns, e.g. filter only Users with one occurrence / month, or only Users with occurrences only in summer etc.


So far I've group the df with:



g = df.groupby(['User_ID','Datetime']).size()


obtaining the "traces" in time of each User:



User_ID Datetime
01 2014-01-01 08:00:00
2014-01-02 09:00:00
02 2014-01-02 10:00:00
2014-01-03 11:00:00
03 2014-01-04 12:00:00
04 2014-01-04 13:00:00
05 2014-01-02 14:00:00


Then I applied a mask to filter, for instance, the Users with more than one trace:



mask = df.groupby('User_ID')['Datetime'].apply(lambda g: len(g)>1)
df = df[df['User_ID'].isin(mask[mask].index)]


So this is fine. I'm looking for a function instead of the lambda g: len(g)>1 able to filter Users under different conditions, as I said before. In particular filter Users with with one occurrence / month.



asked 1 min ago







pandas - how to filter "most frequent" Datetime objects

weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds


Vote count:

0




I have following configuration


OS Sparc 11 OCSG 5.1 Environment : Cluster (Admin+MS), (MS) Weblogic : 11g


Problem


I have deployed existing running ear from old environment (ocsg 5.1 windows) to my new environment sparc 11 ocsg 5.1. I am facing the following issue:



javax.ejb.EJBException: Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds
BEA1-0009181AB1D7057B1ADE
at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1788)
at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1676)
at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1988)
at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:1586)
at weblogic.transaction.internal.WLSTimer.timerExpired(WLSTimer.java:35)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
; nested exception is: weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds
BEA1-0009181AB1D7057B1ADE
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:156)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:595)
at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:455)
at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:52)
at com.warid.es.vasactivation.VasManagerServer_82gq0g_VasManagerServerLocalImpl.getBalanceDate(Unknown Source)
Truncated. see log file for complete stacktrace
Caused By: weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds
BEA1-0009181AB1D7057B1ADE
at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1788)
at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1676)
at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1988)
at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:1586)
at weblogic.transaction.internal.WLSTimer.timerExpired(WLSTimer.java:35)
Truncated. see log file for complete stacktrace


I have seen on my console every thing is processed fine, but no response is sent back to client which result in connection timeout issue.




nikis

6,332

asked 2 mins ago







weblogic.transaction.internal.TimedOutException: Transaction timed out after 32 seconds

Search algorithm with tag


Vote count:

0




I have three tables in sql server-



Photos table:

----------------------
| PhotoId | PhotoName|
----------------------
| | |
----------------------

Tags table:

----------------------
| TagId | TagName|
----------------------
| | |
----------------------

Junction table:

----------------------
| PhotoId | TagId |
----------------------
| | |
----------------------


A photo can have multiple tags, and a tag can belong to multiple photos.


Now, for example Eagle has tags Bird, Animal, Wild. I would like to search with tags Domestic, Bird, Animal. I'm using sql statement where TagName='Domestic' OR TagName='Bird' OR TagName='Animal'. The problem is, it produces query result where Eagle comes two times.


But I would like to have Eagle only once. Any idea?



asked 23 secs ago







Search algorithm with tag

Count the number of members of [X] mailing list in outlook and log result to excel?


Vote count:

0




I was hoping that someone here would have a simple way to do this, essentially I have a number of mailing lists that I would like to monitor the number of members of. The results would be returned to an excel sheet that simply has the total number of subscribers in each one that I want to check.


Thanks



asked 36 secs ago







Count the number of members of [X] mailing list in outlook and log result to excel?

how to use llvm intrinsics @llvm.read_register?


Vote count:

0




I noticed that llvm.read_register() could read the value of stack pointer, as well as llvm.write_register() could set the value of stack pointer. I add main function to the stackpointer.ll which could be found in the llvm src:



;stackpointer.ll
define i32 @get_stack() nounwind {
 %sp = call i32 @llvm.read_register.i32(metadata !0)
 ret i32 %sp
}

declare i32 @llvm.read_register.i32(metadata) nounwind
!0 = metadata !{metadata !"sp\00"}

define i32 @main() {
 %1 = call i32 @get_stack()
 ret i32 %1
}


I tested on an armv7 board running ubuntu 11.04:



lli stackpointer.ll


then, I get a stack dump:



ARMCodeEmitter::emitPseudoInstruction
UNREACHABLE executed at ARMCodeEmitter.cpp:847!
Stack dump:
0.  Program arguments: lli stackpointer.ll
1.  Running pass 'ARM Machine Code Emitter' on function '@main'
Aborted


I also tried llc:



llc stackpointer.ll -o stackpointer.s


The error messege:



Can't get register for value!
UNREACHABLE executed at ARMCodeEmitter.cpp:1183!
Stack dump:
0.  Program arguments: llc stackpointer.ll -o stackpointer.s
1.  Running pass 'Function Pass Manager' on moulude 'stackpointer.ll'
2.  Running pass 'ARM Instruction Selection' on function '@get_stack'
Aborted


I also tried on x86-64 platform, it didn't work. What is the correct way to use these intrinsics?



asked 1 min ago







how to use llvm intrinsics @llvm.read_register?

Empty box created when inserting a table using XMLCursor to XWPFDocument


Vote count:

0




When I inset a table into a XWPFDocument using an XMLCursor it is inserting the table into the correct position but it is adding an extra box under the first column. The box is joined onto the table so it looks like it is an additional table cell but when I insert the table without using and XMLCursor the table is correct and the box is at the position of the XMLCursor. Is there any way to delete the box as it looks like its an additional table cell.



XWPFDocument part1Document = new XWPFDocument(part1Package);
XmlCursor xmlCursor = part1Document.getDocument().getBody().getPArray(26).newCursor();

//create first row
XWPFTable tableOne = part1Document.createTable();

XWPFTableRow tableOneRowOne = tableOne.getRow(0);
tableOneRowOne.getCell(0).setText("Hello");
tableOneRowOne.addNewTableCell().setText("World");

XWPFTableRow tableOneRowTwo = tableOne.createRow();
tableOneRowTwo.getCell(0).setText("This is");
tableOneRowTwo.getCell(1).setText("a table");

tableOne.getRow(1).getCell(0).setText("only text");


XmlCursor c2 = tableOne.getCTTbl().newCursor();

c2.moveXml(xmlCursor);

c2.dispose();
XWPFTable tables = part1Document.insertNewTbl(xmlCursor);
xmlCursor.dispose();


The empty box is appearing at the position of the 26th paragraph. Any help would be great. Thanks.



asked 2 mins ago







Empty box created when inserting a table using XMLCursor to XWPFDocument

Elastic Search inconsistent index count


Vote count:

0




I am indexing a large dataset 30 million rows and following each re-index (using a JDBC river) I am seeing inconsistencies in the total size of the index.


I am using: curl -XGET 'http://localhost:9200/index_name/_count'


and the results vary by as much as 100,000 results after each re-index.


I can't see any index errors in the log.



asked 37 secs ago







Elastic Search inconsistent index count

GUI don't show the command at the frame


Vote count:

0




I programmed a little game in Java for school. We have library with given functions. I write a code that repeats a command (while), i checked with the println that the command is running correctly, but in the GUI you can't see the result, only the last result.


Code:



public void spielen () {
if (guthaben > 0) {
if (endlosspielAktiv) {
while (guthaben > 0) {
kasten.Ringe.faerbeUm(); //Here the GUI doesn't show the results
ZEICHENFENSTER.gibFenster().warte(500);
guthabenRunter();
}
setEndlosspielAktiv(false);
} else {
kasten.Ringe.faerbeUm();
}
} else if (guthaben == 0) {
setEndlosspielAktiv(false);
}
guthabenRunter();
}


asked 56 secs ago







GUI don't show the command at the frame

How to display two digit number instead of one Twig


Vote count:

0




Hi I want to display all one digit numbers (from 0 to 9) in two digits in twig ( like 00 01 02 .... 09 ) the rest will remain in two digits (from 10 to 99) is it possible to do that ?



asked 1 min ago







How to display two digit number instead of one Twig

Uncaught TypeError: undefined is not a function Chrome not working


Vote count:

0




I have an application launching an applet. When I try to click on the login button in Chrome I get the following error



applet.htm:54 Uncaught TypeError: undefined is not a function
engine.js:1262 console.trace()
engine.js:1262 dwr.engine._debug
engine.js:1263 Error: TypeError, undefined is not a function


Code applet.htm line 54(Uncaught TypeError: undefined is not a function) :



function initApplet() {
while(ctiApplet.isActive()==false) {

}


lines 1257 - 1281 of engine.js



/** @private Used internally when some message needs to get to the programmer */
dwr.engine._debug = function(message, stacktrace) {
var written = false;
try {
if (window.console) {
if (stacktrace && window.console.trace) window.console.trace();
window.console.log(message);
written = true;
}
else if (window.opera && window.opera.postError) {
window.opera.postError(message);
written = true;
}
}
catch (ex) { /* ignore */ }

if (!written) {
var debug = document.getElementById("dwr-debug");
if (debug) {
var contents = message + "<br/>" + debug.innerHTML;
if (contents.length > 2048) contents = contents.substring(0, 2048);
debug.innerHTML = contents;
}
}
};


Really can't understand why it is undefined. Its like it can't get a hold on the applet so doesn't realise its loaded. works on IE8. If anyone can shed any light on it.



asked 14 secs ago







Uncaught TypeError: undefined is not a function Chrome not working

WifiManager: Channel connection lost in Android 5.0.2 and reboot


Vote count:

0




I'm trying to create a WiFip2p GroupOwner. In a non-specific moment in the logcat the phrase "WifiManager: Channel connection lost" appears and the device reboots. I'm working with a Nexus7 2013 with Android 5.0.2. What can I do?



asked 1 min ago







WifiManager: Channel connection lost in Android 5.0.2 and reboot

Why no Infinite loop in didSet?


Vote count:

0




In my FirstViewController I have a button directing to my SecondViewController, passing data to a property in the SecondViewController. This property has a property observer, creating a new instance of the SecondViewController when set.


While it's working as I want, I wonder why it's not getting stuck in an infinite loop, creating an instance of the SecondViewController forever. And is it good practice to do it this way?


FirstViewController:



class FirstViewController: UIViewController {
@IBAction func something(sender: UIButton) {
let destination = storyboard?.instantiateViewControllerWithIdentifier("secondViewController") as SecondViewController
destination.selected = 1
showViewController(destination, sender: self)
}
}


SecondViewController:



class SecondViewController: UIViewController {
var selected: Int = 0 {
didSet {
let destination = storyboard?.instantiateViewControllerWithIdentifier("secondViewController") as SecondViewController
destination.selected = selected
showViewController(destination, sender: self)
}
}

@IBAction func something(sender: UIButton) {
selected = 2
}
}


asked 40 secs ago







Why no Infinite loop in didSet?