text
stringlengths 8
267k
| meta
dict |
|---|---|
Q: How to use master/slave mysql in play framework My application is getting a lot of database calls hence I need to start using a distributed master/slave mysql database but I'm having problems configuring play framework!
so my first question is that if it is actually possible to configure hibernate and jpa with play framework to take advantage of replication driver
if, it is not possible, is there any other technique to use a distributed mysql schema with play
this is my configuration:
db.url=jdbc:mysql:replication://[master ip]:3306,[slave ip]:3306/<dbname>autoReconnectForPools=true&roundRobinLoadBalance=true&loadBalanceBlacklistTimeout=5000&loadBalanceStrategy=random
db.driver=com.mysql.jdbc.ReplicationDriver
db.user=<dbusername>
db.pass=<dbpassword>
A: user724051's answer which was previously inserted into someone else's answer:
Multiple db is not the solution, since the app is not really using different databases. I found the problem with my configuration file, apparently you have to explicitly tell hibernate what dialect it needs to use so, this is the way to configure it (although, to this point i am suspicious if it really sends reads to slave and writes to master yet - my cpu and memory utilization on the master is still suspiciously high!)
db.url=jdbc:mysql://[master ip]:3306,[slave1 ip]:3306/<dbname>
db.driver=com.mysql.jdbc.ReplicationDriver
db.user=<db username>
db.pass=<db password>
jpa.dialect=org.hibernate.dialect.MySQL5Dialect
A: You may want to check out the MultiDB module. Its description sounds like what you are after.
Multiple Database module for the Play! framework. This module allows
you to scale your Play! apps to multiple databases with a common
schema.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560804",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: Insert blob into oracle DB using perl Is this possible at all? I've seen references on the 'net indicating that a stored procedure should be used, but I have a script which needs to insert gzipped data into the DB. How can I go about this, if at all?
Thx
A: You need to use DBD::Oracle module,
use DBD::Oracle qw(:ora_types);
and when you bind the params don't forget tho specify the ora_type
$sth = $dbh->prepare("insert ...");
$sth->bind_param($field_num, $lob_value, { ora_type => ORA_LOB });
$sth->execute
The $lob_value is a scalar variable with the contents of your file.
A: I couldn't get Miguel's example to work since my installation of Perl doesn't have an ORA_LOB oracle type. Here's an example that works for me.
For the sake of brevity I'm using hard coded values and internal db subroutines so you'll obviously need to integrate the code into your environment.
use strict;
use DBI;
use DBD::Oracle qw(:ora_types);
require "lib.pl"; #contains getDBConnection() and myExit()
our $dbh = getDBConnection();
my $lob_value;
open FILE, "D:/Inet/wwwroot/tmpcharts/data.xls" or myExit("Failed to open input file: $!\n");
binmode FILE;
$lob_value .= $_ while(<FILE>);
close FILE;
my $sth = $dbh->prepare("update x_trl_test_files set doc=? where file_id=6");
$sth->bind_param(1, $lob_value, { ora_type => ORA_BLOB });
$sth->execute;
$dbh->commit;
myExit();
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560809",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Form output using bean Getting my feet wet with JSP/bean action. I'm getting An exception occurred processing JSP page /foo/output.jsp at line 14 on my output page. The java file compiles ok.
input.jsp
<p>First Number: <input type="text" name="first" value="" /></p>
<p>Second Number: <input type="text" name="second" value="" /></p>
<p>Action: <select name="compu">
<option value="1">+</option>
<option value="2">-</option>
<option value="3">*</option>
<option value="4">/</option>
</select></p>
<input type="submit" />
</form>
output.jsp
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*" errorPage="" %>
<jsp:useBean id="foo" class="stuff.DerInput" scope="page" />
<jsp:setProperty name="foo" property="*" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<jsp:getProperty name="foo" property="calculation" />
<p>The result: <%= foo.getCalculation() %></p>
</body>
</html>
DerInput.Java
package stuff;
public class DerInput {
int first, second, compu, theresult;
String notation;
public void setFirst( int value )
{
first = value;
}
public void setSecond( int value )
{
second = value;
}
public void setCompu( int value )
{
compu = value;
}
public String getCalculation() {
switch (compu) {
case 1:
theresult = first + second;
notation = "+";
break;
case 2:
theresult = first - second;
notation = "-";
break;
case 3:
theresult = first * second;
notation = "*";
break;
case 4:
theresult = first / second;
notation = "/";
break;
}
return first + " " + notation + " " + second + " = " + theresult;
}
}
A: Look here,
<jsp:getProperty name="foo" property="calculation" />
<p>The result: <%= foo.getCalculation() %></p>
You're expecting that the page scoped bean ${foo} is available in scriptlet scope <% foo %> as well. This is not true. They do not share the same variable scope. This would only result in a NullPointerException on the getCalculation() call, because <% foo %> is null.
Use EL instead.
<p>The result: ${foo.calculation}</p>
(Note: that <jsp:getProperty> line is superfluous here, so I removed it)
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560812",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Why are dashes preferred for CSS selectors / HTML attributes? In the past I've always used underscores for defining class and id attributes in HTML. Over the last few years I changed over to dashes, mostly to align myself with the trend in the community, not necessarily because it made sense to me.
I've always thought dashes have more drawbacks, and I don't see the benefits:
Code completion & Editing
Most editors treat dashes as word separators, so I can't tab through to the symbol I want. Say the class is "featured-product", I have to auto-complete "featured", enter a hyphen, and complete "product".
With underscores "featured_product" is treated as one word, so it can be filled in one step.
The same applies to navigating through the document. Jumping by words or double-clicking on class names is broken by hyphens.
(More generally, I think of classes and ids as tokens, so it doesn't make sense to me that a token should be so easily splittable on hyphens.)
Ambiguity with arithmetic operator
Using dashes breaks object-property access to form elements in JavaScript. This is only possible with underscores:
form.first_name.value='Stormageddon';
(Admittedly I don't access form elements this way myself, but when deciding on dashes vs underscores as a universal rule, consider that someone might.)
Languages like Sass (especially throughout the Compass framework) have settled on dashes as a standard, even for variable names. They originally used underscores in the beginning too. The fact that this is parsed differently strikes me as odd:
$list-item-10
$list-item - 10
Inconsistency with variable naming across languages
Back in the day, I used to write underscored_names for variables in PHP, ruby, HTML/CSS, and JavaScript. This was convenient and consistent, but again in order to "fit in" I now use:
*
*dash-case in HTML/CSS
*camelCase in JavaScript
*underscore_case in PHP and ruby
This doesn't really bother me too much, but I wonder why these became so misaligned, seemingly on purpose. At least with underscores it was possible to maintain consistency:
var featured_product = $('#featured_product'); // instead of
var featuredProduct = $('#featured-product');
The differences create situations where we have to translate strings unnecessarily, along with the potential for bugs.
So I ask: Why did the community almost universally settle on dashes, and are there any reasons that outweigh underscores?
There is a related question from back around the time this started, but I'm of the opinion that it's not (or shouldn't have been) just a matter of taste. I'd like to understand why we all settled on this convention if it really was just a matter of taste.
A: Perhaps a key reason why the HTML/CSS community aligned itself with dashes instead of underscores is due to historical deficiencies in specs and browser implementations.
From a Mozilla doc published March 2001 @ https://developer.mozilla.org/en-US/docs/Underscores_in_class_and_ID_Names
The CSS1 specification, published in its final form in 1996, did not
allow for the use of underscores in class and ID names unless they
were "escaped." An escaped underscore would look something like this:
p.urgent\_note {color: maroon;}
This was not well supported by browsers at the time, however, and the
practice has never caught on. CSS2, published in 1998, also forbade
the use of underscores in class and ID names. However, errata to the
specification published in early 2001 made underscores legal for the
first time. This unfortunately complicated an already complex
landscape.
I generally like underscores but the backslash just makes it ugly beyond hope, not to mention the scarce support at the time. I can understand why developers avoided it like the plague. Of course, we don't need the backslash nowadays, but the dash-etiquette has already been firmly established.
A: I think it's a programmer dependent thing. Someones like to use dashes, others use underscores.
I personally use underscores (_) because I use it in other places too. Such as:
- JavaScript variables (var my_name);
- My controller actions (public function view_detail)
Another reason that I use underscores, is this that in most IDEs two words separated by underscores are considered as 1 word. (and are possible to select with double_click).
A: I don't think anyone can answer this definitively, but here are my educated guesses:
*
*Underscores require hitting the Shift key, and are therefore harder to type.
*CSS selectors which are part of the official CSS specifications use dashes (such as pseudo-classes like :first-child and pseudo-elements :first-line), not underscores. Same thing for properties, e.g. text-decoration, background-color, etc. Programmers are creatures of habit. It makes sense that they would follow the standard's style if there's no good reason not to.
*This one is further out on the ledge, but... Whether it's myth or fact, there is a longstanding idea that Google treats words separated by underscores as a single word, and words separated by dashes as separate words. (Matt Cutts on Underscores vs. Dashes.) For this reason, I know that my preference now for creating page URLs is to use-words-with-dashes, and for me at least, this has bled into my naming conventions for other things, like CSS selectors.
A: There are many reasons, but one of the most important thing is maintaining consistency.
I think this article explains it comprehensively.
CSS is a hyphen-delimited syntax. By this I mean we write things like font-size, line-height, border-bottom etc.
So:
You just shouldn’t mix syntaxes: it’s inconsistent.
A: Code completion
Whether dash is interpreted as punctuation or as an opaque identifier depends on the editor of choice, I guess. However, as a personal preference, I favor being able to tab between each word in a CSS file and would find it annoying if they were separated with underscore and there were no stops.
Also, using hyphens allows you to take advantage of the |= attribute selector, which selects any element containing the text, optionally followed by a dash:
span[class|="em"] { font-style: italic; }
This would make the following HTML elements have italic font-style:
<span class="em">I'm italic</span>
<span class="em-strong">I'm italic too</span>
Ambiguity with arithmetic operator
I'd say that access to HTML elements via dot notation in JavaScript is a bug rather than a feature. It's a terrible construct from the early days of terrible JavaScript implementations and isn't really a great practice. For most of the stuff you do with JavaScript these days, you'd want to use CSS Selectors for fetching elements from the DOM anyway, which makes the whole dot notation rather useless. Which one would you prefer?
var firstName = $('#first-name');
var firstName = document.querySelector('#first-name');
var firstName = document.forms[0].first_name;
I find the two first options much more preferable, especially since '#first-name' can be replaced with a JavaScript variable and built dynamically. I also find them more pleasant on the eyes.
The fact that Sass enables arithmetic in its extensions to CSS doesn't really apply to CSS itself, but I do understand (and embrace) the fact that Sass follows the language style of CSS (except for the $ prefix of variables, which of course should have been @). If Sass documents are to look and feel like CSS documents, they need to follow the same style as CSS, which uses dash as a delimiter. In CSS3, arithmetic is limited to the calc function, which goes to show that in CSS itself, this isn't an issue.
Inconsistency with variable naming across languages
All languages, being markup languages, programming languages, styling languages or scripting languages, have their own style. You will find this within sub-languages of language groups like XML, where e.g. XSLT uses lower-case with hyphen delimiters and XML Schema uses camel-casing.
In general, you will find that adopting the style that feels and looks most "native" to the language you're writing in is better than trying to shoe-horn your own style into every different language. Since you can't avoid having to use native libraries and language constructs, your style will be "polluted" by the native style whether you like it or not, so it's pretty much futile to even try.
My advice is to not find a favorite style across languages, but instead make yourself at home within each language and learn to love all of its quirks. One of CSS' quirks is that keywords and identifiers are written in lowercase and separated by hyphens. Personally, I find this very visually appealing and think it fits in with the all-lowercase (although no-hyphen) HTML.
A: There's been a clear uptick in hyphen-separated, whole-word segments of URLs over recent years. This is encouraged by SEO best practices. Google explicitly "recommend that you use hyphens (-) instead of underscores (_) in your URLs": http://www.google.com/support/webmasters/bin/answer.py?answer=76329.
As noted, different conventions have prevailed at different times in different contexts, but they typically are not a formal part of any protocol or framework.
My hypothesis, then, is that Google's position anchors this pattern within one key context (SEO), and the trend to use this pattern in class, id, and attribute names is simply the herd moving slowly in this general direction.
A: point of refactoring only btn to bt
case: btn_pink
search btn in word
result btn
case: btn-pink
search btn in word
result btn | btn-pink
case: btn-pink
search btn in regexp
\bbtn\b(?!-) type to hard
result btn
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560813",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "230"
}
|
Q: Issue moving input to the right on right arrow key with jquery I have this code :
jQuery.fn.enterText = function(e){
var $cursor = $("#cursor");
if (e.keyCode == 39){
e.preventDefault();
$cursor.val("");
var nextChar = $cursor.next();
$cursor.after(nextChar);
}
};
Im trying to move the #cursor to the right but it seems the browser does not allow it....the left arrow key works :
if (e.keyCode == 37){
$cursor.val("");
var previousChar = $cursor.prev();
$cursor.after(previousChar);
}
A: The left arrow key works because you're using after(), so you're actually moving the previous character after the cursor element.
I would recommend using insertBefore() and insertAfter() to move the cursor element instead, so your intent is clearer:
if (e.keyCode == 39) {
e.preventDefault();
$cursor.val("");
var nextChar = $cursor.next();
$cursor.insertAfter(nextChar);
}
if (e.keyCode == 37) {
e.preventDefault();
$cursor.val("");
var previousChar = $cursor.prev();
$cursor.insertBefore(previousChar);
}
A: You should be using before instead of after:
http://jsfiddle.net/Gq5HZ/1/
if (e.keyCode == 39) {
$cursor.val("");
var nextChar = $cursor.next();
$cursor.before(nextChar);
}
You are trying to add the element which is after the cursor, after the cursor... it's already there.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560815",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Can not removeClass in jQuery The loading class is added but it doesn't removed. How to fix this ?
$(".phones").addClass("loading");
that = this
setTimeout(function() {
$(that).removeClass('loading');
}, 3000);
A: Something like this would work:
var phones = $(".phones").addClass("loading");
setTimeout(function() {
phones.removeClass('loading');
}, 3000);
I'm not sure why you're worried about scope, though.
A: Are you trying to do:
$(".phones").addClass("loading");
setTimeout(function() {
$(".phones").removeClass('loading');
}, 3000);
that = this, which refers to the window object if there is no smaller enclosing scope.
A: that=this has nothing to do with $(".phones") as your indentation hints at.
var phones = $(".phones").addClass("loading");
setTimeout(function() {
phones.removeClass('loading');
}, 3000);
A: The problem here is that you are adding the class to a group of elements defined by the class selector .phones but your removing it from a single element defined by the saved item that. It seems like you want to add and remove from the same group. To do this just use the same queries
$(".phones").addClass("loading");
setTimeout(function() {
$(".phones").removeClass('loading');
}, 3000);
A: Change that = this to that = $(this);, Not tested but believe this would help
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560819",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
}
|
Q: Is clustered indexes implemented in mysql? Why is this code not working? Is it because clustered indexes is not implemented in MySQL?
CREATE INDEX niels1 ON `table` CLUSTER (attr1,attr2);
A: As far as I know only the InnoDB engine offers clustered indices.
Also, there's no dedicated "CLUSTER" keyword; all PRIMARY KEY indices are CLUSTERed.
See http://dev.mysql.com/doc/refman/5.5/en/innodb-index-types.html
A: Because this is not a valid syntax for MySQL. See Alex's answer. InnoDB clusters the primary key, other engines do their own thing.
A: None of the MySQL's storage engines let you choose which index to cluster on as of this day. 01/2013.
http://dev.mysql.com/doc/refman/5.5/en/innodb-index-types.html
A: It doesn't seem like your trying to create a clustered index on table called "CLUSTER". Maybe you need to do something like:
CREATE INDEX niels1 ON CLUSTER (attr1,attr2) USING BTREE;
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560820",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Need help with trigger php/mySQL I need to make this trigger work using three tables. Does anyone see a problem?
The 'qty' needs to always show the latest quantity from the adds and pulls.
CREATE TRIGGER Upd_Cartons_Qty
AFTER INSERT ON cartons_added FOR EACH ROW
BEGIN
UPDATE cartons_current SET qty = qty + NEW.add_qty WHERE part_no = NEW.part_no;
END;
TABLE NAME: cartons_current
+--------------+--------------+-------+-------+
| Column | Type | Null | Key |
+--------------+--------------+-------+-------+
| part_no | varchar(20) | No | Prim |
| qty | int(8) | No | |
+--------------+--------------+-------+-------+
TABLE NAME: cartons-added
+--------------+--------------+-------+-------+
| Column | Type | Null | Key |
+--------------+--------------+-------+-------+
| part_no | varchar(20) | No | Prim |
| add_qty | int(8) | No | |
+--------------+--------------+-------+-------+
TABLE NAME: cartons_pulled
+--------------+--------------+-------+-------+
| Column | Type | Null | Key |
+--------------+--------------+-------+-------+
| part_no | varchar(20) | No | Prim |
| pull_qty | int(8) | No | |
+--------------+--------------+-------+-------+
A: 1- You cannot use ; as a final delimiter for the end. You need to set a delimiter before the trigger.
2- A after insert trigger should logically have a prefix ai, not upd.
3- You cannot change values in a after trigger in the same table the trigger is for. So if you (might) need to change values in cartons_added you need to do that in the before trigger.
4- On the other hand, you cannot change values in other tables in a before trigger, because these changes might rollback and then you have inconstancy i your tables, so that need to happen in the after trigger.
5- You can effect multiple tables in a trigger, just do it like the example.
DELIMITER $$
CREATE TRIGGER ai_Cartons_Qty AFTER INSERT ON cartons_added FOR EACH ROW
BEGIN
UPDATE cartons_current SET qty = qty + NEW.add_qty WHERE part_no = NEW.part_no;
UPDATE cartons_pulled SET x1 = x1 + NEW.add_qty WHERE part_no = NEW.part_no;
END$$
DELIMITER ;
If you want to alter some value in the triggers own table, don't use update, use code like below instead:
DELIMITER $$
CREATE TRIGGER ai_Cartons_Qty BEFORE INSERT ON cartons_added FOR EACH ROW
BEGIN
-- Update cartons_added .... will not work.
-- Use SET NEW.fieldname instead.
IF NEW.qty_added = 0 THEN
SET NEW.qty_added = 1;
END IF;
END$$
DELIMITER ;
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560821",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Opening and Closing Multiple Database Connections with PDO in PHP I'm working on simple database connection class. I'm using PHP and PDO.
As I would need to connect to multiple databases, I want to pool all the database connections in a class variable, and then access each as my scripts require.
Here is some pseudo code:
class Database_Driver
{
private static $db_connect_pool;
public static function openConnect($params_arr)
{
try
{
$db_driver_str = $params_arr['driver'];
$db_host_str = $params_arr['host'];
$db_name_str = $params_arr['db_name'];
$db_username_str = $params_arr['db_username'];
$db_password_str = $params_arr['db_password'];
$connect_options_arr = array(PDO::ATTR_PERSISTENT => true);
self::$db_connect_pool[''.$db_driver_str.'_'.$db_name_str.''] = new PDO("".$db_driver_str.":host=".$db_host_str.";db_name=".$db_name_str."", $db_username_str, $db_password_str, $connect_options_arr);
}
catch (Exception $e)
{
print_r($e);
}
}
public static getConnection($db_driver, $db_name)
{
return self::$db_connect_pool[''.$db_driver.''.$db_name.''];
}
}
Database_Driver::openConnect($params_str);
$db_handle = Database_Driver::getConnection($db_driver, $db_name);
$st_handle = $db_handle->prepare('SQL Statement');
$st_handle->execute();
So at the end of my script I want to close all the open database connections. How can I do this? Do I just nullify the array i.e. self::$db_connect_pool = NULL; or is there some other way to do this effectively.
Thanks in advance.
A: As per the manual:
To close the connection, you need to destroy the object by ensuring
that all remaining references to it are deleted--you do this by
assigning NULL to the variable that holds the object. If you don't do
this explicitly, PHP will automatically close the connection when your
script ends.
So, unless want/need to clean up along the way to free up resources, you can leave the connections to close themselves.
Persistent connections are not closed at the end of the script, but are cached for future use. Setting such connections to NULL should close them.
A: PHP closes all open connections at the end of a script automatically, so what you're wanting to do should already be done.
If you need the connections closed prior to the end of script execution, however, you'll need to loop your connection pool array and close the connections individually.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560823",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Why am I getting an "invalid link" error when trying to do a PayPal subscription? I'm getting an error when I'm trying to setup payment through this paypal subscriptions form. I'm testing it using the PayPal sandbox.
I'm getting the following error:
The link you have used to enter the PayPal system is invalid. Please
review the link and try again.
My code looks like this:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="payments@foo.com" id="id_business" />
<input type="hidden" name="item_name" value="Standard" id="id_item_name" />
<input type="hidden" name="a3" value="29.00" id="id_a3" />
<input type="hidden" name="p3" value="1" id="id_p3" />
<input type="hidden" name="t3" value="M" id="id_t3" />
<input type="hidden" name="src" value="1" id="id_src" />
<input type="hidden" name="sra" value="1" id="id_sra" />
<input type="hidden" name="no_note" value="1" id="id_no_note" />
<input type="hidden" name="notify_url" value="http://example.org/dashboard/payments/paypal/notify" id="id_notify_url" />
<input type="hidden" name="cancel_return" value="http://example.org/dashboard/payments/paypal/cancel" id="id_cancel_return" />
<input type="hidden" name="return" value="http://example.org/dashboard/payments/paypal/return" id="id_return_url" />
<input type="hidden" name="cmd" value="_xclick-subscriptions" id="id_cmd" />
<input type="hidden" name="charset" value="utf-8" id="id_charset" />
<input type="hidden" name="currency_code" value="SGD" id="id_currency_code" />
<input type="hidden" name="no_shipping" value="1" id="id_no_shipping" />
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="Buy it Now" />
</form>
A: The code is working fine. The issue was that I needed to create a business sandbox account, rather than using the regular PayPal email. I wish their error messages were a bit more descriptive.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560824",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Automatically convert percentage input values Several of the form fields in an application I am building using CakePHP collect percentages for their values. I would like the users to be to see and edit percentages in the familiar percentage (24.5%) format, but I want to store it in decimal (.245) format in order to ease calculation logic. Since there's several of these fields, I'd rather not have to write the conversion logic into the controllers for every single percentage field.
Is anyone aware of a simple solution to automatically performing this conversion, or am I stuck writing a custom helper/behavior to solve this problem?
Solution
I ended up writing a jQuery plugin that handles this. Here it is, for anyone who might need it in the future:
/**
* Input Percent
*
* Percentages are tricky to input because users like seeing them as 24.5%, but
* when using them in calculation their value is actually .245. This plugin
* takes a supplied field and automatically creates a percentage input.
*
* It works by taking an input element and creating a hidden input with the same
* name immediately following it in the DOM. This has the effect of submitting
* the proper value instead of the human only one. An onchange method is then
* bound to the original input in order to keep the two synced.
*
* Potential Caveats:
* * There will be two inputs with the same name. Make sure anything you
* script against this field is prepared to handle that.
*
* @author Brad Koch <kochb@aedisit.com>
*/
(function($) {
$.fn.inputPercent = function() {
return this.each(function() {
var display_field = this;
var value_field = $('<input type="hidden" />').get(0);
// Initialize and attach the hidden input.
$(value_field).attr('name', $(this).attr('name'));
$(value_field).val($(display_field).val());
$(display_field).after(value_field);
$(display_field).after('%');
// Convert the display field's proper percent value into the display format.
if (isFinite($(display_field).val())) {
$(display_field).val($(display_field).val() * 100);
}
// Enable synchronization between the two.
$(this).bind('change', function () {
var value = $(display_field).val();
// Handle non-numeric values.
if (isFinite(value)) {
$(value_field).val(value / 100);
} else {
$(value_field).val(value);
}
});
});
};
})(jQuery);
Usage:
$('input.percent').inputPercent();
A: There is already a helper for this - the NumberHelper
http://book.cakephp.org/view/1455/toPercentage
The only drawback that I have found is that if you store your data as a decimal representation of a percentage (ie .045 = 4.5%) instead of as the actual percentage (ie .045 = .045%) then you will have to multiply by 100 before converting.
ie:
<?php echo $this->Number->toPercentage( 51.5 ); // 51.5% ?>
<?php echo $this->Number->toPercentage( .245 * 100 ); // 24.5% ?>
A: You could write some simple javascript (use whatever your favourite framework is, or plain js) to convert fields with a class of #percentage just before submit.
Alternatively, and also dealing with users without javascript; in the model, add the beforeSave() method, check if the number is < 1 or not and if not, divide by 100.
You could also add a simple component or helper to convert the internal number back to a percentage for display, if NumberHelper can't help.
A: I recently wrote a plugin to convert from and to json to store in the DB.
https://github.com/dereuromark/tools/blob/master/models/behaviors/jsonable.php
you could easily modify it to convert from and to percentage.
you need some custom
afterFind
and
beforeSave
to do so.
then attach it to your model like so:
$actsAs = array('Percentage');
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560825",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: Python Script to List Local Users using Win32net I'm using this script on a LAN to get each of the machines to list out their local administrators and users. There has been a security breach in our network where a couple students have created local admins off directory, and we need to find out where. The list it imports just has the IP addresses of the entire network listed in it like
192.168.1.1
192.168.1.2
192.168.1.3
When only one IP is in the list, the script works and reports back with all local admins/users on the machine, but when there is two or more, the script errors out with the error: (1722, 'NetGroupGetUsers', 'The RPC server is unavailable.') When either of them is put in by themselves, they list fine so its not a matter of the IP's not working.
import win32net
def GetUsers( IP ):
print IP,
print win32net.NetGroupGetUsers(IP,'none',0),
return
F = open("C:\Users\JOHNDOE\Desktop\IP_List.txt")
for CurrentIP in F:
GetUsers(CurrentIP),
F.close()
I am pretty new to python programming so I admit that I may have made a stupid mistake in writing this. From what I have seen, this can be done somewhat easier in VBscript, but our supervisor told us that it had to be done in python. Any help would be much appreciated.
A: As you have it here, the file is closed after the first call to GetUsers() - you should dedent the F.close().
My guess is that the real problem is extraneous newline characters on the line, so try:
for CurrentIP in F.readlines():
GetUsers( CurrentIP.strip() );
F.close()
As a matter of Python style, four-space indentation is far, far preferable to one-space, and function definitions and local variable names should start with lowercase characters (e.g. currentIp, getUsers()).
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560827",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Zend_Config_ini add a section and(or) key on fly? I have an ini file for each client on my system, and add a new section and key to be created on the fly.
I need some think like this:
Current ini file:
[section_a]
key_a=1
key_b-2
And need to change this (with a php/zend) code, to that:
[section_a]
key_a =1
key_b = 2
[section_b]
key_a = 1
Need to add a new section named section_b whith a new key named key_a , but i don't find any mthod on Zend_Ini_Config like "$ini->add('section_b','key_a')".
Obs:
Php "magic" like $ini->$new_prop->$new_prop = "1" , dont work to!
Any Help!!
Update
<?php
class SystemConfigHelper
{
public static $data;
public static function load()
{
if(!defined("ACCOUNT_ID"))
return true;
try
{
$url = explode('.', $_SERVER['HTTP_HOST']);
self::$data = new Zend_Config_Ini(ACCOUNTS_PATH . "/" . ACCOUNT_ID . "/system-config.ini",null,array("allowModifications" => true));
return true;
}
catch(Exception $e)
{
die($e->getMessage());
return false;
}
}
public static function save()
{
try
{
$url = explode('.', $_SERVER['HTTP_HOST']);
$writer = new Zend_Config_Writer_Ini(array('config' => self::$data,
'filename' => ACCOUNTS_PATH . "/" . ACCOUNT_ID . "/system-config.ini"));
$writer->write();
}
catch(Exception $e)
{
die($e->getMessage());
return false;
}
}
public static function getParam($section,$key)
{
return self::$data->$section->$key;
}
public static function sync($data)
{
//self::$data = $data;
//return;
foreach(self::$data as $section => $param)
{
foreach($param as $key => $value)
{
self::$data->$section->$key = $data[$section][$key];
}
}
}
public static function getParamAs($section,$key,$as)
{
return self::$data->$section->$key==1?$as:"";
}
}
?>
A: Have you read the docs on Zend_Config_Writer? Assuming you've loaded the entire config file (and not just a section) you should be able to do this (pulled right from the docs):
$writer = new Zend_Config_Writer_Ini(array('config' => $config,
'filename' => 'config.ini'));
$writer->write();
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560829",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Convert Byte Array to image and display in Razor View I am using EF 4.1 Code First and for the sake of simplicity, let's say I have the following Entity class:
public class Person
{
public int Id { get; set; }
public string Name { get; set; }
public Byte[] Image { get; set; }
}
I have managed to create a working Create View that allows the Addition of a Person object into the Database.
But when I come to display the details for a Person, I get stuck on displaying the image. After doing some research, I have the following:
// To convert the Byte Array to the author Image
public FileContentResult getImg(int id)
{
byte[] byteArray = DbContext.Persons.Find(id).Image;
return byteArray != null
? new FileContentResult(byteArray, "image/jpeg")
: null;
}
And in the View where I am attempting to list the Person details, I have the following to get the Image to display:
<img src="@Html.Action("getImg", "Person", new { id = item.Id })" alt="Person Image" />
However the above is not working, my image source [src] attribute returns empty.
A: There's an even easier way of doing this if you already happen to have the image loaded in your model:
<img src="data:image;base64,@System.Convert.ToBase64String(Model.Image)" />
Doing this way you do not need to go to the server again just to fetch the image byte[] from the database as you're doing.
A: Like this:
<img src="@Url.Action("getImg", "Person", new { id = item.Id })" alt="Person Image" />
You need Url.Action and not Html.Action because you just want to generate an url to the GetImg action. Html.Action does something entirely different.
A: I found that the best way to display a dynamically loaded SVG image from a Model property in a Razor MVC page is to use Html.DisplayFor(..) in combination with .ToHTMLString(). For my case, have a base 64 SVG Image+XML data string stored in the model property named Image. Here is my code:
<img src='@Html.DisplayFor(model => model.Image).ToHtmlString()' />
This seemed be the only way I was able to get the SVG image to display properly in Chrome, FireFox and IE.
Cheers
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560830",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "42"
}
|
Q: How to center a button within a div? I have a div that's width is 100%.
I'd like to center a button within it, how might I do this?
<div style="width:100%; height:100%; border: 1px solid">
<button type="button">hello</button>
</div>
A: With the limited detail provided, I will assume the most simple situation and say you can use text-align: center:
http://jsfiddle.net/pMxty/
A: Margin: 0 auto; is the correct answer for horizontal centering only.
For centering both ways something like this will work, using jquery:
var cenBtn = function() {
var W = $(window).width();
var H = $(window).height();
var BtnW = insert button width;
var BtnH = insert button height;
var LeftOff = (W / 2) - (BtnW / 2);
var TopOff = (H / 2) - (BtnH /2);
$("#buttonID").css({left: LeftOff, top: TopOff});
};
$(window).bind("load, resize", cenBtn);
Update ... five years later, one could use flexbox on the parent DIV element to easily center the button both horizontally and vertically.
Including all browser prefixes, for best support
div {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align : center;
-moz-box-align : center;
-ms-flex-align : center;
-webkit-align-items : center;
align-items : center ;
justify-content : center;
-webkit-justify-content : center;
-webkit-box-pack : center;
-moz-box-pack : center;
-ms-flex-pack : center;
}
#container {
position: relative;
margin: 20px;
background: red;
height: 300px;
width: 400px;
}
#container div {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
justify-content: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
<!-- using a container to make the 100% width and height mean something -->
<div id="container">
<div style="width:100%; height:100%">
<button type="button">hello</button>
</div>
</div>
A: Using flexbox
.Center {
display: flex;
align-items: center;
justify-content: center;
}
And then adding the class to your button.
<button class="Center">Demo</button>
A: You should take it simple here you go :
first you have the initial position of your text or button :
<div style="background-color:green; height:200px; width:400px; margin:0 0 0 35%;">
<h2> Simple Text </h2>
<div>
<button> Simple Button </button>
</div>
</div>
By adding this css code line to the h2 tag or to the div tag that holds the button tag
style:" text-align:center; "
Finaly The result code will be :
<div style="background-color:green; height:200px; width:400px; margin:0 0 0 35%;">
<h2 style="text-align:center;"> Simple Text </h2> <!-- <<--- here the changes -->
<div style="text-align:center"> <!-- <<--- here the changes -->
<button> Simple Button </button>
</div>
</div>
A: Updated Answer
Updating because I noticed it's an active answer, however Flexbox would be the correct approach now.
Live Demo
Vertical and horizontal alignment.
#wrapper {
display: flex;
align-items: center;
justify-content: center;
}
Just horizontal (as long as the main flex axis is horizontal which is default)
#wrapper {
display: flex;
justify-content: center;
}
Original Answer using a fixed width and no flexbox
If the original poster wants vertical and center alignment its quite easy for fixed width and height of the button, try the following
Live Demo
CSS
button{
height:20px;
width:100px;
margin: -20px -50px;
position:relative;
top:50%;
left:50%;
}
for just horizontal alignment use either
button{
margin: 0 auto;
}
or
div{
text-align:center;
}
A: et voila:
button {
width: 100px; // whatever your button's width
margin: 0 auto; // auto left/right margins
display: block;
}
Update: If OP is looking for horizontal and vertical centre, this answer will do it for a fixed width/height element.
A: To center a <button type = "button"> both vertically and horizontally within a <div> which width is computed dynamically like in your case, this is what to do:
*
*Set text-align: center; to the wrapping <div>: this will center the button whenever you resize the <div> (or rather the window)
*For the vertical alignment, you will need to set margin: valuepx; for the button. This is the rule on how to calculate valuepx:
valuepx = (wrappingDIVheight - buttonHeight)/2
Here is a JS Bin demo.
A: Supposing div is #div and button is #button:
#div {
display: table-cell;
width: 100%;
height: 100%;
text-align: center;
vertical-align: center;
}
#button {}
Then nest the button into div as usual.
A: Came across this and thought I'd leave the solution I used as well, which utilizes line-height and text-align: center to do both vertical and horizontal centering:
Click here for working JSFiddle
A: Super simple answer that will apply to most cases is to just make set the margin to 0 auto and set the display to block. You can see how I centered my button in my demo on CodePen
A: You could just make:
<div style="text-align: center; border: 1px solid">
<input type="button" value="button">
</div>
Or you could do it like this instead:
<div style="border: 1px solid">
<input type="button" value="button" style="display: block; margin: 0 auto;">
</div>
The first one will center align everything inside the div. The other one will center align just the button.
A: Easiest thing is input it as a "div" give it a "margin:0 auto " but if you want it to be centered u need to give it a width
Div{
Margin: 0 auto ;
Width: 100px ;
}
A: Responsive CSS option to center a button vertically and horizontally without being concerned with parent element size (using data attribute hooks for clarity and separation concerns):
HTML
<div data-element="card">
<div data-container="button"><button>CTA...</button></div>
</div>
CSS
[data-container="button"] {
position: absolute;
top: 50%;
text-align: center;
width: 100%;
}
Fiddle: https://jsfiddle.net/crrollyson/zebo1z8f/
A: Responsive way to center your button in a div:
<div
style="display: flex;
align-items: center;
justify-content: center;
margin-bottom: 2rem;">
<button type="button" style="height: 10%; width: 20%;">hello</button>
</div>
A:
div {
text-align : center;
}
button {
width: 50%;
margin: 1rem auto;
}
<div style="width:100%; height:100%; border: 1px solid">
<button type="button">hello</button>
</div>
This is what I mostly do.
I think bootstrap also uses this in "mx-auto".
A:
var element = document.getElementById('btn1');
var elementwidth = element.clientWidth;
var elementheight = element.clientHeight;
element.style.left = 'calc(50% - ('+elementwidth+'px / 2) )';
element.style.top = 'calc(50% - ('+elementheight+'px / 2) )';
#btn1{
position: relative;
}
div{
height:200px;
width:200px;
border: 1px solid black;
}
<html>
<body>
<div>
<input type = 'button' id = 'btn1'>
</div>
</body>
</html>
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560832",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "282"
}
|
Q: mvvm light Messenger.Default.Register in View codebehind? The BookShelf solution John Papa presented at Mix11 has something that sounds a bit odd to me...
It uses an MVVM pattern and MVVM Light toolkit... Everything is great.
The only thing I can't understand is this:
In codebehind of Views it register for a couple of messages, here it is the code:
public partial class BookView : Page
{
public BookView()
{
InitializeComponent();
//btnEdit.SetBinding(Button.IsEnabledProperty, new Binding("User.IsAuthenticated") { Source = Application.Current.Resources["WebContext"] });
Title = ApplicationStrings.HomePageTitle;
RegisterMessages();
}
private void RegisterMessages()
{
Messenger.Default.Register<LaunchEditBookMessage>(this, OnLaunchEditBook);
Messenger.Default.Register<SavedBookDialogMessage>(this, OnSaveBookDialogMessageReceived);
}
private void OnLaunchEditBook(LaunchEditBookMessage msg)
{
var editBook = new EditBookWindow();
editBook.Show();
}
private void OnSaveBookDialogMessageReceived(SavedBookDialogMessage msg)
{
MessageBox.Show(msg.Content, msg.Caption, msg.Button);
}
//...
It is a business application, if you switch from that Page to another and then come back there, the page gets instanciated again and keeps registering for those messages causing those to fire multiple times...
How comes it subscribe for those messages in codebehind instead of in ViewModels? has this something to do with UI thread? **Is this a correct implementation?
How would you unregister those messages if user navigates to another page?
EDIT: REFACTORED CODE
XAML
<sdk:Page Loaded="Page_Loaded" Unloaded="Page_Unloaded">
CODE BEHIND
private void Page_Loaded(object sender, RoutedEventArgs e)
{
RegisterMessages();
}
private void Page_Unloaded(object sender, RoutedEventArgs e)
{
Messenger.Default.Unregister(this);
}
A: Yes, this looks like a bug in his example. He probably isn't expected the page to get instantiated more than once in an application. There is a method for Messenger.Default.Unregister you could hook into on an Unloaded event to fix this issue (you might consider moving the register to Loaded as well.
I understand why he put the events in the View, however. He is opening a new window and calling MessageBox.Show(), since these are very tightly coupled to the View, he kept them in the View. I still don't like the solution personally...
Other MVVM frameworks fight this problem a little better, such as Caliburn. It has lots of helper classes to do View-like things from your ViewModel. Caliburn can 100% eliminate anything in code-behind, but it has a pretty big learning curve.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560834",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
}
|
Q: Proper way to send an Authenticity Token with AJAX to Rails This works but gets stopped because it lacks an authenticity token:
$(".ajax-referral").click(function(){
$.ajax({type: "POST", url: $(this).parent("form").attr("action"), dataType: "script"});
return false;
});
So I tried adding it like so:
$(".ajax-referral").click(function(){
$.ajax({type: "POST", url: $(this).parent("form").attr("action") + "?&authenticity_token=" + AUTH_TOKEN, dataType: "script"});
return false;
});
And it passes the auth_token correctly as a param, but seems to lose the rest of my form.
Anyways to accomplish both sending the form data that works, and the authenticity token as well?
This is a rails environment. And I have this in my head.
= javascript_tag "var AUTH_TOKEN = '#{form_authenticity_token}';" if protect_against_forgery?
Things I've tried
1.
= hidden_field :authenticity_token, :value => form_authenticity_token
2.
$.ajax({type: "POST", url: $(this).parent("form").attr("action"), dataType: "script", authenticity_token: AUTH_TOKEN});
3.
// Always send the authenticity_token with ajax
$(document).ajaxSend(function(event, request, settings) {
if ( settings.type != 'GET' ) {
settings.data = (settings.data ? settings.data + "&" : "")
+ "authenticity_token=" + encodeURIComponent( AUTH_TOKEN );
}
});
A: In Rails 5.1+ a CSRF token is automatically appended if you use a built-in Rails JS helper for AJAX requests(from rails-ujs), example:
Rails.ajax({
url: "/your/url",
type: "POST",
data: "a=1&b=2",
success: function(data) {
console.log(data);
}
});
This library also provides you a helper to get CSRF token manually if you need it with:
Rails.csrfToken();
A: Actually, you are reading the action attribute of form and sending a post ajax request to it. to send form data you have to submit the form or you can serialize the form data and send it in ajax request like
$(".ajax-referral").click(function(){
$.ajax({
type: "POST",
url: $(this).parent("form").attr("action") + "?&authenticity_token=" + AUTH_TOKEN,
data:$(this).parent("form").serialize(),
dataType: "script"
});
return false;
});
Doing this will serialize your form data and send it along with ajax request and authenticity token is already being sent via query string
A: This token also already appears in one of the "meta" tags in the head of the application.html.erb layout file by default if you have the following ERB at the top:
<%= csrf_meta_tag %>
That ERB roughly renders to:
<meta content="abc123blahblahauthenticitytoken" name="csrf-token">
You can then grab it using jQuery with the following code:
var AUTH_TOKEN = $('meta[name=csrf-token]').attr('content');
A: None of these worked for me until I set the X-CSRF-Token value on the request header via JS like this:
request.setRequestHeader('X-CSRF-Token', token)
token of course, being the CSRF token. I got this from the <meta name="csrf-token"> tag and did not use encodeURIComponent()
Update since this is proving useful to some
So all in all:
var token = document.querySelector('meta[name="csrf-token"]').content
request.setRequestHeader('X-CSRF-Token', token)
A: You could include the AUTH_TOKEN in the form itself, as a hidden input.
<input type="hidden" name="AUTH_TOKEN">1234abcd</input>
A: I just ran into this issue but I tried this approach in my application.js file:
$(document).ajaxSend(function(e, xhr, options) {
if (options.data == null) {
options.data = {};
}
options.data['authenticity_token'] = token;
});
This is the original question where I got the idea: ajaxSend Question
A: Thanks!
Just to clarify for the more common use.
You need the js tag with var AUTH_TOKEN in your head. Should be something like this.
<%= csrf_meta_tag %>
<%= javascript_tag "var AUTH_TOKEN = '#{form_authenticity_token}';" if protect_against_forgery? %>
And then simply put your authenticity_token=AUTH_TOKEN in the ajax data if you don't need to use parent(form) or something like this.
$.ajax({
type: 'post',
dataType:'text',
data: "user_id="+user_id+"&authenticity_token="+AUTH_TOKEN,
url:'/follow/unfollow'
})
Thanks to the guys above for sharing this knowledge!
A: Here is a solution that applies to all AJAX requests.
You add the following to your all.js (or whatever your sitewide javascript file is)
$.ajaxSetup({
headers: {
'X-CSRF-Token': document.querySelector('meta[name="csrftoken"]').content
}
});
This will automatically add the token as a header on all AJAX requests. Works for me in Rails 7.
A: Simply using form_tag automatically includes CSRF token parameter. Rails supports "Unobtrusive Javascript" meaning that the form will still be submitted via AJAX. Controller actions support "respond_to" block, and you can use .js.erb extension to make changes on the web page in response to form submit.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560837",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "44"
}
|
Q: To Go or Not To Go with Liferay? What's the good, bad, and ugly? We are evaluating several solutions for a new web thing we're looking to build. There are several aspects to it, including user management, content management, campaigns, community, and financial transactions.
We are looking to roll the framework ourselves, using Joomla + Vaadin + CAS (to name a few) to DIY, but I am wondering if we should simply adopt the Liferay portal for one-stop shopping?
I have looked for testimonials and have not come up with much. I appreciate anyone who has used Liferay (or chosen not to) who would share what technical hurdles it solves (or doesn't) and potentially what others it may create.
Thank you!
A: Disclaimer: I work for Liferay now; however, I answered this question long before I started to work here. Also, Liferay has pivoted a bit in these years. Nonetheless, I believe the core of the answer still applies.
My companyThe company I worked for is a Liferay Inc. partner, so I have a lot of experience in it. Also, maybe you want to take my opinions with a grain of salt :)
We have used various Java portal tools, and the truth is: as a corporate portal, Liferay is the best one in the market, AFAIK. It is rich in functionality, has few bugs, its code is well written, the community is very helpful, and it is flexible and customizable, useful for a wide range of necessities.
Nonetheless, Liferay is a portal tool, so it excels as a content-centric platform. If you manage a lot of content (such as news, articles, blogs, wikis and forums), then I would happily recommend Liferay as your platform. In other cases, I would suggest a better consideration. You can use something like an ERP, for example.
Anyway, I have seen Liferay used as a general development platform in various places, and the result is reasonable. One gets a significant productivity boost when using Liferay. You do not need to think about users, permissions, content management... Liferay handles even complex, low-level issues such as clustering and sharding. And the Liferay Service Builder is one of the best scaffolding tools for Java I've seen. When I think about it, I feel that Liferay, with its various out-of-the-box applications and its Service Builder, is like a Ruby on Rails/Django for Java.
OTOH, Liferay is enormous, and it can be a problem. You may get a lot of unused stuff cluttering your platform. You will have to study a vast application, and it will demand much time and effort from you. Unfortunately, Liferay's documentation is poor, to make things worse.(I'd say Liferay's documentation improved a lot since I originally posted this answer.) Since Liferay does solve a wide range of problems, its codebase is big. This complexity can be dispensable in many, if not most, applications.
Also, if your application does not use a lot of content, Liferay can provide various helpful tools, but it will not be the natural environment for using Liferay. You will be locked in the Liferay platform, too, which can restrict your choices. You may want to analyze Liferay tools, but I do not know if it would be a good platform.
To summarize, I would say:
*
*If you want to use a Java-based portal, or to build a broad, complex portal, I recommend Liferay without restrictions;
*If you want to create an application that manages a lot of content, Liferay is an excellent platform to do it, and I think it may be the best choice;
*If your application is big but not content-centric, I would not recommend Liferay, but it can be useful;
*If your application does not manage a lot of content and is potentially small, Liferay probably will add more complexity than it is worth.
A: We decided not to go with Liferay primarily because we did not need a portal server and would only have been using it for security things. Since we were running against an Active Directory server for maintaining user info and permissions, we decided to just build out a Spring MVC application and use Spring Security to tie into Active Directory.
In the end, the decision was made to not use Liferay because we didn't want all of the extra overhead of a portlet container when we didn't need all of the extra stuff, and also wanted to maintain full control / flexibility over exactly how everything was strung together.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560838",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "41"
}
|
Q: MySQL merge multiple date columns into one Ok so I have multiple datetime columns for things such as date_created, last_login, last_updated, etc... I would like to merge them into one column with the most recent datetime showing, so that I can track active_users more easily.
I've found some suggestions to use the CONCAT command, but that looks to be just stringing all the results together.
A: Try this:
SELECT username,
GREATEST(date_created, last_login, last_updated) last_activity
FROM your_table
ORDER BY last_activity DESC
EDITED:
SELECT username,
GREATEST(
IFNULL(date_created, 0),
IFNULL(last_login, 0),
IFNULL(last_updated, 0)
last_activity
FROM your_table
ORDER BY last_activity DESC
EDITED AGAIN:
On your db copy (having 27.451 records) I used:
SELECT id,
GREATEST(
IFNULL(current_login_datetime, 0),
IFNULL(created_datetime, 0),
IFNULL(updated_datetime, 0))
last_activity
FROM users
ORDER BY last_activity DESC
obtaining exaclty 27.451 records!!
To prove, run this query:
SELECT COUNT(*) FROM
(SELECT id,
GREATEST(
IFNULL(current_login_datetime, 0),
IFNULL(created_datetime, 0),
IFNULL(updated_datetime, 0))
last_activity
FROM users
ORDER BY last_activity DESC) der
and check that number returned is the same as the query
SELECT COUNT(*) FROM users
Your problem could be derived from a limit in total returned or showed records.
For example using Navicat light you can have 1000 records (but you can read 27.451 as total).
A: If the values can be null and you want to select the first non null value use COALESCE. GREATEST and LEAST are also options
SELECT
username
,COALESCE(last_updated,last_login,date_created) AS not_null
,GREATEST(date_created, last_login, last_updated) AS latest
,LEAST(date_created, last_login, last_updated) AS first
FROM table1
ORDER BY last_activity DESC
If you want more control, you can use a CASE WHEN statement:
SELECT
username
, CASE WHEN date_created > '2011-01-31' THEN date_created
WHEN last_login > '2011-01-31' THEN last_login
ELSE last_updated END as its_complicated
.....
If you want the lastest AND you have null values floating around, use this query:
SELECT
username
,GREATEST(IFNULL(date_created,0), IFNULL(last_login,0), IFNULL(last_updated,0)) AS latest
FROM table1
ORDER BY last_activity DESC
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560840",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Select all between date and date (other format) in sql / php This is the format in the column "date":
2011-08-03 13:36:19
What i wish to do is make a sql query where it selects all entrys between two dates.
My two dates comes from a datepicker:
from 2011-09-20 to 2011-09-25
Now I cant do WHERE date BETWEEN '2011-09-20' AND '2011-09-25'
Because there is also time in the column date, as you can see above.
So how can i do this? Can i do BETWEEN 2011-09-20 00:00:00 AND 2011-09-25 00:00:00 ?
A: If you want to include the 25th, you'd have to go
BETWEEN '2011-09-20 00:00:00' AND '2011-09-25 23:59:59'
A: You answered your own question: zero fill the time. It makes sense, since 00:00:00 is midnight, and indicates the moment one day switches to the next.
A: Those two conditions are logically equivalent (although your second one has a syntax error as you are missing the single quotes).
You probably mean to add the time to the end date. You'll want to add 23:59:59 to denote the end of the day so it includes all times during that day.
You can do so by appending your end date string (assuming it is POST data from a form with an input name of end_date).
$end_date = $_POST['end_date'] . ' 23:59:59';
Note: Don't forget about SQL Injection.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560841",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: What's the fastest implementation for bignum? (Java's bigInteger / Cython's int / gmpy / etc...) Are there any benchmark on this???
(I tried googling for some results but found none...
and I couldn't test gmpy because gmplib wouldn't be installed on my laptop)
thank you!
A: First of all, I'm probably biased since I'm the maintainer of gmpy.
gmpy uses the GMP multiple-precision library and GMP is usually considered the fastest general purpose multiple-precision library. But when it's "fastest" depends on on the operation and the size of the values. When I compare the performance between Python longs and gmpy's mpz type, the crossover point is roughly between 20 and 50 digits. You'll probably get different results on your machine.
What exactly are you trying to do?
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560850",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: char* to double and back to char* again ( 64 bit application) I am trying to convert a char* to double and back to char* again. the following code works fine if the application you created is 32-bit but doesn't work for 64-bit application. The problem occurs when you try to convert back to char* from int. for example if the hello = 0x000000013fcf7888 then converted is 0x000000003fcf7888 only the last 32 bits are right.
#include <iostream>
#include <stdlib.h>
#include <tchar.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[]){
char* hello = "hello";
unsigned int hello_to_int = (unsigned int)hello;
double hello_to_double = (double)hello_to_int;
cout<<hello<<endl;
cout<<hello_to_int<<"\n"<<hello_to_double<<endl;
unsigned int converted_int = (unsigned int)hello_to_double;
char* converted = reinterpret_cast<char*>(converted_int);
cout<<converted_int<<"\n"<<converted<<endl;
getchar();
return 0;
}
A: On 64-bit Windows pointers are 64-bit while int is 32-bit. This is why you're losing data in the upper 32-bits while casting. Instead of int use long long to hold the intermediate result.
char* hello = "hello";
unsigned long long hello_to_int = (unsigned long long)hello;
Make similar changes for the reverse conversion. But this is not guaranteed to make the conversions function correctly because a double can easily represent the entire 32-bit integer range without loss of precision but the same is not true for a 64-bit integer.
Also, this isn't going to work
unsigned int converted_int = (unsigned int)hello_to_double;
That conversion will simply truncate anything digits after the decimal point in the floating point representation. The problem exists even if you change the data type to unsigned long long. You'll need to reinterpret_cast<unsigned long long> to make it work.
Even after all that you may still run into trouble depending on the value of the pointer. The conversion to double may cause the value to be a signalling NaN for instance, in which cause your code might throw an exception.
Simple answer is, unless you're trying this out for fun, don't do conversions like these.
A: You can't cast a char* to int on 64-bit Windows because an int is 32 bits, while a char* is 64 bits because it's a pointer. Since a double is always 64 bits, you might be able to get away with casting between a double and char*.
A: A couple of issues with encoding any integer (specifically, a collection of bits) into a floating point value:
*
*Conversions from 64-bit integers to doubles can be lossy. A double has 53-bits of actual precision, so integers above 2^52 (give or take an extra 2) will not necessarily be represented precisely.
*If you decide to reinterpret the bits of a pointer as a double instead (via union or reinterpret_cast) you will still have issues if you happen to encode a pointer as set of bits that are not a valid double representation. Unless you can guarantee that the double value never gets written back by the FPU, the FPU can silently transform an invalid double into another invalid double (see NaN), i.e., a double value that represents the same value but has different bits. (See this for issues related to using floating point formats as bits.)
You can probably safely get away with encoding a 32-bit pointer in a double, as that will definitely fit within the 53-bit precision range.
A:
only the last 32 bits are right.
That's because an int in your platform is only 32 bits long. Note that reinterpret_cast only guarantees that you can convert a pointer to an int of sufficient size (not your case), and back.
A: If it works in any system, anywhere, just all yourself lucky and move on. Converting a pointer to an integer is one thing (as long as the integer is large enough, you can get away with it), but a double is a floating point number - what you are doing simply doesn't make any sense, because a double is NOT necessarily capable of representing any random number. A double has range and precision limitations, and limits on how it represents things. It can represent numbers across a wide range of values, but it can't represent EVERY number in that range.
Remember that a double has two components: the mantissa and the exponent. Together, these allow you to represent either very big or very small numbers, but the mantissa has limited number of bits. If you run out of bits in the mantissa, you're going to lose some bits in the number you are trying to represent.
Apparently you got away with it under certain circumstances, but you're asking it to do something it wasn't made for, and for which it is manifestly inappropriate.
Just don't do that - it's not supposed to work.
A: This is as expected.
Typically a char* is going to be 32 bits on a 32-bit system, 64 bits on a 64-bit system; double is typically 64 bits on both systems. (These sizes are typical, and probably correct for Windows; the language permits a lot more variations.)
Conversion from a pointer to a floating-point type is, as far as I know, undefined. That doesn't just mean that the result of the conversion is undefined; the behavior of a program that attempts to perform such a conversion is undefined. If you're lucky, the program will crash or fail to compile.
But you're converting from a pointer to an integer (which is permitted, but implementation-defined) and then from an integer to a double (which is permitted and meaningful for meaningful numeric values -- but converted pointer values are not numerically meaningful). You're losing information because not all of the 64 bits of a double are used to represent the magnitude of the number; typically 11 or so bits are used to represent the exponent.
What you're doing quite simply makes no sense.
What exactly are you trying to accomplish? Whatever it is, there's surely a better way to do it.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560852",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Ef Code first One to one relationship with id as foreign I'm traying to do a mapping with One to One relationship with id as "foreign", I can't change the database
Those are the tables
Cutomer
*
*int CustomerId
*string Name
CustomerDetail
*
*int CustomerId
*string Details
Entity Splittitng does not works for me since i need a left outter join.
Any Ideas?
Thanks in advance,
and sorry about my english.
A: You can use the Shared Primary Key mapping here.
public class Customer
{
public int CustomerId { get; set; }
public string Name { get; set; }
public virtual CustomerDetail CustomerDetail { get; set; }
}
public class CustomerDetail
{
public int CustomerId { get; set; }
public string Details { get; set; }
public virtual Customer Customer { get; set; }
}
public class MyContext : DbContext
{
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<CustomerDetail>().HasKey(d => d.CustomerId);
modelBuilder.Entity<Customer>().HasOptional(c => c.CustomerDetail)
.WithRequired(d => d.Customer);
}
}
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560853",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: problem displaying webpage on different computers I have a very weird problem.
I have a webpage that displays some graphs using Jquery. This page works fine on my laptop & my other colleagues laptop.
But there is one particular PC that does not display the webpage properly. I thought that it might be a browser issue but when I connected remotely to that PC from my laptop, the webpage displayed the graphs perfectly.
I am not sure if this is an hardware related problem, my laptop's screen size is 15" while the PC that gives problem has a screen size of 40"
Please help.
Regards,
Krum
A: I once had to check the DPI settings on a particular machine because of weird rendering issues, and that fixed it.
Windows 7:
Control Panel > Appearance and Personalization > Display > Set custom text size (DPI)
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560858",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Are tables created with "CREATE TEMPORARY TABLE" in memory or on disk? In MySQL, when you create a temporary table, for example, CREATE TEMPORARY TABLE ..., is that table created and held in memory or on the disk?
I have read through the docs and Google'd it and have not come up with an answer.
A: Like Mark said, it depends on what ENGINE you tell it to use. If you don't give an ENGINE, it will do "something", but not necessarily keep it just in memory. If you want to force the table to be in memory, you have to define it explicitly:
CREATE TEMPORARY TABLE foobar (id int) ENGINE=MEMORY;
However, the use of MEMORY-engine is restricted. For more information have a look at Internal Temporary Table Use in MySQL.
A: It depends on what engine you specify. By default the table data will be stored on disk. If you specify the MEMORY engine, the data will only be stored in memory.
It should be possible to actually find the files that are created in the filesystem when the temporary tables are created. After running the following commands:
CREATE TABLE test.table_myisam (x int) ENGINE=MyISAM;
CREATE TABLE test.table_memory (x int) ENGINE=MEMORY;
CREATE TEMPORARY TABLE test.temp_table_myisam (x int) ENGINE=MyISAM;
CREATE TEMPORARY TABLE test.temp_table_memory (x int) ENGINE=MEMORY;
I then checked the directory: C:\ProgramData\MySQL\MySQL Server 5.5\data\test (on Windows) and the files present were:
table_innodb.frm # Table definition.
table_innodb.MYD # MyISAM table data file.
table_innodb.MYI # MyISAM table index file.
table_memory.frm # No MYD or MYI file for the MEMORY engine.
The temporary tables are stored in C:\Windows\Temp and have unusual names, but internally the data is stored in the same way.
#sql9a0_7_d.frm # This is the MyISAM temporary table.
#sql9a0_7_d.MYD # MyISAM data file for temporary table.
#sql9a0_7_d.MYI # MyISAM index file for temporary table.
#sql9a0_7_c.frm # This is the MEMORY engine file. No MYD or MYI.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560860",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "26"
}
|
Q: C# odd object behavior I noticed something in C# when dealing with custom objects that I found to be a little odd. I am certain it is just a lack of understanding on my part so maybe someone can enlighten me.
If I create a custom object and then I assign that object to the property of another object and the second object modifies the object assigned to it, those changes are reflected in the same class that did the assigning even though nothing is returned.
You want that in English? Here is an example:
class MyProgram
{
static void Main()
{
var myList = new List<string>();
myList.Add("I was added from MyProgram.Main().");
var myObject = new SomeObject();
myObject.MyList = myList;
myObject.DoSomething();
foreach (string s in myList)
Console.WriteLine(s); // This displays both strings.
}
}
public class SomeObject
{
public List<string> MyList { get; set; }
public void DoSomething()
{
this.MyList.Add("I was added from SomeObject.DoSomething()");
}
}
In the above sample I would have thought that, because SomeObject.DoSomething() returns void, this program would only display "I was added from MyProgram.Main().". However, the List<string> in fact contains both that line and "I was added from SomeObject.DoSomething()".
Here is another example. In this example the string remains unchanged. What is the difference and what am I missing?
class MyProgram
{
static void Main()
{
var myString = "I was set in MyProgram.Main()";
var myObject = new SomeObject();
myObject.MyString = myString;
myObject.DoSomething();
Console.WriteLine(myString); // Displays original string.
}
}
public class SomeObject
{
public string MyString { get; set; }
public void DoSomething()
{
this.MyString = "I was set in SomeObject.DoSomething().";
}
}
This program sample ends up displaying "I was set in MyProgram.Main()". After seeing the results of the first sample I would have assumed that the second program would have overwritten the string with "I was set in SomeObject.DoSomething().". I think I must be misunderstanding something.
A: It's absolutely correct:
myObject.MyList = myList;
This line assign a reference of myList to the myObject's property.
To prove this this, call GetHashCode() on myList and on myObject.MyList.
we are talking about different pointers to same memory location, if you wish.
A: This isn't odd, or strange. When you create a class, you create reference type. When you pass references to objects around, modifications to the objects they refer to are visible to anyone that holds a reference to that object.
var myList = new List<string>();
myList.Add("I was added from MyProgram.Main().");
var myObject = new SomeObject();
myObject.MyList = myList;
myObject.DoSomething();
So in this block of code, you instantiate a new instance of List<string> and assign a reference to that instance to the variable myList. Then you add "I was added from MyProgram.Main()." to the list referred to by myList. Then you assign a refernce to that same list to myObject.MyList (to be explicit, both myList and myObject.MyList are referring to the same List<string>! Then you invoke myObject.DoSomething() which adds "I was added from SomeObject.DoSomething()" to myObject.MyList. Since both myList and myObject.MyList are referring to the same List<string>, they will both see this modification.
Let's go by way of analogy. I have a piece of paper with a telephone number on it. I photocopy that piece of paper and give it to you. We both have a piece of paper with the same telephone number on it. Now I call up that number and tell the person on the other end of the line to put a banner up on their house that says "I was added from MyProgram.Main()." You call up the person on the other end of the line to put a banner up on their house that says "I was added from SomeObject.DoSomething()". Well, the person who lives at the house that has that telephone number is now going to have two banners outside their house. One that says
I was added from MyProgram.Main().
and another that says
I was added from SomeObject.DoSomething()
Make sense?
Now, in your second example, it's a little trickier.
var myString = "I was set in MyProgram.Main()";
var myObject = new SomeObject();
myObject.MyString = myString;
myObject.DoSomething();
You start by creating a new string whose value is "I was set in MyProgram.Main()" and assign a reference to that string to myString. Then you assign a reference to that same string to myObject.MyString. Again, both myString and myObject.MyString are referring to that same string whose value is "I was set in MyProgram.Main()". But then you invoke myObject.DoSomething which has this interesting line
this.MyString = "I was set in SomeObject.DoSomething().";
Well, now you've created a new string whose value is "I was set in SomeObject.DoSomething()." and assign a reference to that string to myObject.MyString. Note that you never changed the reference that myString holds. So now, myString and myObject.MyString are referring to different strings!
Let's go by analogy again. I have a piece of paper with a web address on it. I photocopy that piece of paper and give it to you. We both have a piece of paper with the same web address on it. You cross out that web address and write down a different address. It doesn't affect what I see on my piece of paper!
Finally, a lot of people in this thread are yammering about the immutability of string. What is going on here has nothing to do with the immutability of string.
A: Whether or not a method returns something, has nothing to do with what happens inside it.
You seem to be confused regarding what assignment actually means.
Let's start from the beginning.
var myList = new List<string>();
allocates a new List<string> object in memory and puts a reference to it into myList variable.
There is currently just one instance of List<string> created by your code but you can store references to it in different places.
var theSameList = myList;
var sameOldList = myList;
someObject.MyList = myList;
Right now myList, theSameList, sameOldList and someObject.MyList (which is in turn stored in a private field of SomeObject automagically generated by compiler) all refer to the same object.
Have a look at these:
var bob = new Person();
var guyIMetInTheBar = bob;
alice.Daddy = bob;
harry.Uncle = bob;
itDepartment.Head = bob;
There is just one instance of Person, and many references to it.
It's only natural that if our Bob grew a year older, each instance's Age would have increased.
It's the same object.
If a city was renamed, you'd expect all maps to be re-printed with its new name.
You find it strange that
those changes are reflected in the same class that did the assigning
—but wait, changes are not reflected. There's no copying under the hood. They're just there, because it's the same object, and if you change it, wherever you access it from, you access its current state.
So it matters not where you add an item to the list: as long as you're referring to the same list, you'll see the item being added.
As for your second example, I see Jason has already provided you with a much better explanation than I could possibly deliver so I won't go into that.
It will suffice if I say:
*
*Strings are immutable in .NET, you can't modify an instance of string for a variety of reasons.
*Even if they were mutable (like List<T> that has its internal state modifiable via methods), in your second example, you're not changing the object, you're changing the reference.
var goodGuy = jack;
alice.Lover = jack;
alice.Lover = mike;
Would alice's change of mood make jack a bad guy? Certainly not.
Similarly, changing myObject.MyString doesn't affect local variable myString. You don't do anything to the string itself (and in fact, you can't).
A: You are confusing both type of objects.
A List is a List of type string .. which means it can take strings :)
When you call the Add method it adds the string literal to its collection of strings.
At the time you call your DoSomething() method, the same list reference is available to it as the one you had in Main. Hence you could see both strings when you printed in the console.
A: Don't forget, that your variables are objects too. In the first example, you create a List<> object and assign it to your new object. You only hold a reference to a list, in this case, you now hold two references to the same list.
In the second example you assign a specific string object to your instance.
A: This is how reference types behave and is expected. myList and myObject.MyList are references to the same List object in heap memory.
In the second example strings are immutable and are passed by value, so on the line
myObject.MyString = myString;
The contents of myString are copied to myObject.MyString (i.e. passed by value not by reference)
String is a bit special because it is a reference type and a value type with the special property of immutability (once you have created a string you can't change it only make a new one, but this is somewhat hidden from you by the implementation)
A: Alex - you wrote -
In the above sample I would have thought that, because SomeObject.DoSomething() returns void, this program would only display "I was added from MyProgram.Main().". However, the List in fact contains both that line and "I was added from SomeObject.DoSomething()".
This is not the case. The VOID of the function just means the function does not return a value. This has nothing to do with the this.MyList.Add method you are invoking in the DoSomething() method. You do have to references to the same object - myList and the MyList in the SomeObject.
A: In the first example ... you are working with an mutable objects, and it is always accessed by reerence. All references to MyList in different objects refer to the same thing.
In the other case, strings behave a bit differently. Declaring a string literal (i.e. text between quotes) creates a new instance of a String, completely separated from the original version. You CAN NOT modify a string, just create a new one.
UPDATE
Jason is right, it has nothing to do with String immutability ... but ....
I can't help but think that string immutabiity has its word in here. Not in THIS concrete example, but if SomeObject.DoSomething's code was this : this.MyString += "I was updated in SomeObject.DoSomething()."; , then you would have to explain that new String is created by the "concatenation", and the first string is not updated
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560861",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
}
|
Q: merge array quantity php this is my working code:
while ($list = mysql_fetch_assoc($result)) {
$sql2 = "SELECT * FROM stock WHERE gID=".$list['gID'];
$result2 = mysql_query($sql2, $conn) or trigger_error("SQL", E_USER_ERROR);
$totalgid = mysql_num_rows($result2);
$sql3 = "SELECT * FROM stockcount WHERE gID=".$list['gID']." AND date='".$list['date']."' AND affectstock=1";
$result3 = mysql_query($sql3, $conn) or trigger_error("SQL", E_USER_ERROR);
$dategid = mysql_num_rows($result3);
$calculategid = $totalgid - $dategid;
if ($calculategid < 0) {
if(isset($arr[$list['date']][$list['gID']])){
//increment
} else {
//set to initial value of 1
$arr[$list['date']][$list['gID']]=$calculategid;
}
}
}
print_r($arr);
A: do you have a loop outside this that is something like foreach($someList as $list){ ...do this code... }? I only ask because you should never have duplicate values because if you try to set a value into the same exact key, will overwrite the previous value. I can only assume based on the code you posted that you are appending this array to another array inside a loop. If that is the case, something like this might help:
//initialize the output array
$arr = array();
//loop through somelist
foreach($someList as $list){
//check if the key exists, if so increment.
if(isset($arr[$list['date']][$list['gID']])){
//increment
$arr[$list['date']][$list['gID']]++;
} else {
//set to initial value of 1
$arr[$list['date']][$list['gID']]=1;
}
}
print_r($arr);
essentially, just check if the key isset() and if so, increment, if not set to 1.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560865",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Very strange redirecting stdout and stderr issues can someone explain them? I have two calls that produce very different output:
Call one:
dmake -m _makefile_.m 1>> _results.out 2>> _results.out
Call two:
dmake -m _makefile_.m >2&1 >_results.out
dmake does a compile of sorts and the first call correctly inlines compile errors whereas the second one puts all the compile errors at the top. I was always of the opinion that both of these were equivalent. What exactly are the differences between these two calls? Is this because of buffering?
A: >2&1 is not the right syntax; it will redirect the output of the dmake command to a file called 2 (running it in background), then attempt to run a command called 1 with its output redirected to _results.out.
You want:
dmake -m _makefile_.m >_results.out 2>&1
Change > to >> if you want to append to the file.
I'm not 100% sure whether this will intersperse stdout and stderr the way you want.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560868",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: mouseover streetview flash not showing text of street names or landmarks I have a hybrid application that is using both v2 and v3 google maps. I am using the v2 in the bottom portion of the page because my boss likes to use the flash version of streetview.
Everything works fine except that when a user places his/her mouse over the streetview flash in the bottom half of the page -- the flash version of streetview is not showing street names or landmarks tags.
Here's a link to the app:
enter link description here
The bottom half is created via sending a string to an iframe's source which is created each time you select a school from the drop down menus, such as, enter link description here
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560871",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: How to assign a value to a casted column in Oracle I am wondering whether is possible to assign a value to a casted column in SQL depending on real table values.
For Example:
select *, cast(null as number) as value from table1
where if(table1.id > 10 then value = 1) else value = 0
NOTE: I understand the above example is not completely Oracle, but, it is just a demonstration on what I want to accomplish in Oracle. Also, the above example can be done multiple ways due to its simplicity. My goal here is to verify if it is possible to accomplish the example using casted columns (columns not part of table1) and some sort of if/else.
Thanks,
Y_Y
A: select table1.*, (case when table1.id > 10 then 1 else 0 end) as value
from table1
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560883",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: preparing lapack dll with mingw I downloaded lapack 3.3.0 version and mingw (with all libraries) after that I succeded to make blas.dll by gfortran --shared -o blas.dll blas\src\*.f -O
I could not succeeded to make lapack.dll by gfortran --shared -o lapack.dll src\*.f blas.dll -O
I got the following error
gfortran: error: CreateProccess: No such file or directory
Note: I set path to mingw/bin and also copied dlamch.f and slamch.f from install directory to src directory.
:: instructions got from this site
http://www.codingday.com/compile-lapack-and-blas-as-dll-on-windows/
What should I do
A: I donwloaded lapack and can reproduce the error.
As is indicated in the comments on the page you referred to, you might be running into a problem with the command line being too long for the shell to handle. Try first compiling all source files, and then linking them, in two separate steps.
gfortran -c src/*.f -O
gfortran -shared -o lapack.dll *.o blas.dll
When I did this the CreateProcess error went away, but unfortunately some undefined reference errors popped up next. It appears there are references to a couple of blas functions which aren't included in the blas sources accompanying lapack (I think they might be C functions).
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560885",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Pastebin.com Post I'm trying to post a new Pastebin through a popup window in Javascript. The issues I'm getting is it is saying "Bad API request, invalid api_option"
Link that I'm using:
http://pastebin.com/api/api_post.php?api_dev_key=<KEY>&api_paste_name=TITLE&api_option=paste&api_paste_code=SOMETEXT
It says to put api_option as paste. I've tried looking up other examples, but no luck yet. Has everyone ran into this problem?
A: Are you, by any chance, required to POST the data rather than GETting it?
Also, it might not be the best idea ever to put your API key on the internet like this.
A: How are you submitting this request to Pastebin? Is it via POST or GET? My best guess is that you're sending a GET request and the API requires a POST.
A: Try this:
let api = {
option: "paste",
user_key: "XXXXXXXXXXXX",
dev_key: 'XXXXXXXXXXXX',
paste_name: "MyTitle",
paste_format: "JSON",
paste_private: 0,
paste_code: ""
};
let request = new XMLHttpRequest();
request.open('POST', 'http://pastebin.com/api/api_post.php', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
data['test'] = 'Yeah PasteBin!';
dataString = 'api_option='+api.option+'&api_user_key='+api.user_key+'&api_dev_key='+api.dev_key+
'&api_paste_name='+api.paste_name+'&api_paste_format='+api.paste_format+
'&api_paste_private='+api.paste_private+'&api_paste_code='+data;
request.onreadystatechange = function() {
if (request.status == 200 && request.readyState == 4) {
alert("URL to new pastebin file: " + request.responseText);
}
}
request.send(dataString);
The main issue with your code is put everything in your request URL, what is fine if it is a GET request. The URL of PasteBin: api/api_post.php demands a POST request (notice the name?), so you have to send it in the body like I've shown you above.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560889",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: MS Deploy package to IIS site with custom path I have a package I created from an IIS 6 site and I want to deploy it to IIS7 but I dont want to use the path specified in the package (it doesn't exist on target). How do I deploy the package with a new path?
*
*Is there a switch I can specify, such as an additional -dest?
*Is there something I have to do when creating the pacakge to set the path?
A: I found the answer here http://raquila.com/software/ms-deploy-basics/ at the very bottom. You have to use a replace switch
msdeploy -verb:sync -source:package=c:\pkg.zip -dest:metakey=lm/w3svc/2 -replace:objectName=metaProperty,match="c:\\path1",replace="c:\\path2"
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560894",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Why is my AJAX-call failing in Google Chrome? I am curious as to why my AJAX-call is failing in Google Chrome, it works perfectly fine in Firefox. Before anyone asks, no I'm not using JQuery because I need to have access to readyState == 3 which JQuery doesn't seem to have.
My script currently looks like this(with large unneccessary parts stripped out):
function fetch()
{
main = new XMLHttpRequest();
main.open("GET", "<?php echo anchor("thescript"); ?>", true);
var lastResponse = '';
var statusString = 'Step 1(of 3), please wait... ';
main.onreadystatechange = function()
{
if( main.readyState == 1 )
{
alert('Fetch!');
$("#ajax-status").html( statusString );
}
// If there's been an update
if( main.readyState == 3 )
{
}
if( main.readyState == 4 )
{
}
};
main.send(null);
}
It works perfectly in Firefox but in Chrome it doesn't even alert anything so it doesn't even get into readyState 1(which is when you send it) -- that seems rather odd..
Any ideas??
A: As noted above:
does it any difference to put the .open() after you set .onreadystatechange
And yes Ein~, it actually does a difference! The readystate's are now working properly, I think! I recieve the alert when it sends the request and I also tried an alert in readyState == 3 and it alerts that too. However, the response seems to be empty for some reason
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560907",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: How to do something in a function based on the character under the cursor in Vim? I’m writing a function that edits a certain environment in LaTeX.
The environment basically looks like this:
\begin{quicktikz}
...some stuff...
\end{quicktikz}
or like this:
\begin*{quicktikz}
...some stuff...
\end{quicktikz}
I want to write a function that toggles between the two, when called from within the environment. Since my Vim knowledge ain’t all that, I’m coming up with a simple solution:
*
*Get cursor position with let save_cursor=getpos(".").
*Backward search for \begin{quicktikz} using: ?\\begin{quicktikz}\|\\begin\*{quicktikz}.
*Search for the { and move left using: normal 0f{h.
*Check if the item under cursor equals *:
*
*if it does, do normal x;
*if it doesn’t, do normal a*<esc>.
*Restore cursor position using call setpos('.',save_cursor).
I know how to do all of this except for step 3. How can I check if the char under the cursor equals to * or not?
If you know a better way of doing this, sharing this would be welcome.
A: I think the easiest way to retrieve the char under cursor is:
getline(".")[col(".")-1]
Alternatively, you can do it with strpart()
strpart(getline("."), col(".")-1, 1)
The first expression first calls the function getline() passing "." as
argument which means the line where the cursor is positioned will be returned.
Then we use the so called expr8 or expr-[] (see the help) to retrieve a
single character. The number passed comes from another function, col()
which returns the current cursor column. As indexes start in 0, one is subtracted.
You can use it like
if getline(".")[col(".")-1] == '*'
...
A: Let me propose an alternative implementation of the technique you describe.
:?\\begin\>\zs\*\=?s//\='*'[submatch(0)!='']/|norm!``
The above command consists of two separate commands chained with | (see
:help :bar) in one line. The first one is a substitution (see :help :s)
performed for each line in the specified range,
?\\begin\>\zs\*\=?
According to the range syntax (see :help :range), this range specifies the
only line, that is the previous line where the \\begin\>\zs\*\= pattern
matches the word begin preceded with a backslash and followed by by optional
star character.1 The \zs atom between parts of the pattern
matching \begin and *, sets the start of the match there. So, the match
of the whole pattern is either empty or contains single star character. This
is not necessary for specifying a line in the range, it is useful for reusing
the same pattern later in the :substitute command, where only that star
character or its empty place should be replaced. For details about the
pattern's syntax see :help /\>, :help /\=, :help /\zs.
The substitution itself,
s//\='*'[submatch(0)!='']/
replaces the first occurrence of the last search pattern (which is set by the
backward search in the range) with a string to which the expression
'*'[submatch(0)!=''] evaluates (see :help sub-replace-\=). As the pattern
matches only an empty string or a star character, the subexpression
submatch(0)!='' evaluates to zero if there is no star after \begin, or to
one otherwise. Zero subscript from the string '*' results in a substring
containing the first character of that one-character string. Index one is
equal to the length of the string, therefore subscript results in an empty
string. Thus, when there is a star after \begin, it gets replaced with an
empty string, when a star is not present, zero-width interval just after
\begin is substituted with *.
The second command,
:norm!``
takes advantage of the fact that :substitute command stores the current
cursor position before it actually starts replacement. The `` movement
command jumps back to the position before the latest jump (which occurs in the
aforementioned substitution command) restoring position of the
cursor.2
1 Be careful with search, since in ranges, as usual, it wraps
around the end of file, when the wrapscan option is enabled (it is turned on
by default).
2 Do not confuse `` with the '' command which moves the
cursor to the first non-blank character in the line of the location before the
latest jump.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560911",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
}
|
Q: GSWin: How to convert XPS to PDF? I have XPS file that is needed to be converted to PDF. I'm trying to use GSWin tool. But I cannot, I don't know why.
The command line is:
C:\Windows\system32>"C:\Program Files
(x86)\gs\gs9.04\bin\gswin32c.exe" sOutputFile="c:\temp\test2.pdf"
-sDEVICE=pdfwrite -dNOPAUSE "C:\TEMP\test2.xps"
The output is:
Error: /undefined in PK♥
Operand stack:
Execution stack: %interp_exit .runexec2 --nostringval--
--nostringval-- --nostringval-
- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- fa lse 1 %stopped_push 1926 1 3 %oparray_pop 1925 1 3 %oparray_ pop 1909 1 3
%oparray_pop 1803 1 3 %oparray_pop --nostringval-
- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringv al-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:1165/1684(ro)(G)-- --dict:0/20(G)--
--dict:77/200(L)-- Current allocation mode is local Current file position is 3 GPL Ghostscript 9.04: Unrecoverable error, exit code 1
I don't understand it and don't know how to make it work. I suppose I use it improper but I'm not sure how to fix it.
Thanks!
A: Ghostscript (gswin32.exe) only accepts PostScript or PDF as an input, so you can't use it to deal with XPS. You need another member of the family, GhostXPS (gxps.exe), which accepts XPS as an input. There is also GhostPCL (pxl6.exe) which accepts PCL as an input.
All the family members are available under GPL and can be downloaded from the Ghostscript downloads site:
http://www.ghostscript.com/download/
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560912",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Can an IME (soft keyboard) get the name of the app using it? Can an IME get the name of the app using it? (assuming it has the right permissions)
Thanks in advance,
Barry
A: Answering my own question again! :)
The EditorInfo passed to InputMethodService.onStartInput() and onStartInputView() contains the member EditorInfo.packageName which contains the name of the calling app's package.
A: Try getCurrentInputEditorInfo().packageName
In add to your question and answer can you know how get current name Activity and name of field?
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560914",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
}
|
Q: "There is an error" when clicking on some Silverstripe admin pages I'm trying to fix a problem with some Silverstripe admin pages. Everytime when I click on Cart or Example product page, the message - "There is an error" pops up, and the page wouldn't show. Please see the attached image.
As you can see page Cart and example product's icons are different from the rest. I didn't write the code myself and I've never experienced this before, so any suggestion on where I should start to tackle the problem would be appreciated.
I can copy some code here if you can tell me which part. Thank you very much for your time.
Regards
Sam
Firefox console message when click on the Cart page.
Additional error message under console response tab:
ERROR [User Error]: Bad class to singleton() - ProductImageObject
IN POST /admin/getitem?ID=17&ajax=1
Line 334 in /home/xxx/subdomains/xxx/sapphire/core/Core.php
Source
======
325: *
326: * @param string $className
327: * @return Object
328: */
329: function singleton($className) {
330: global $_SINGLETONS;
331: if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR);
332: if(!is_string($className)) user_error("singleton() passed bad class_name: " .
var_export($className,true), E_USER_ERROR);
333: if(!isset($_SINGLETONS[$className])) {
* 334: if(!class_exists($className)) user_error("Bad class to singleton() - $className",
E_USER_ERROR);
335: $_SINGLETONS[$className] = Object::strong_create($className,null, true);
336: if(!$_SINGLETONS[$className]) user_error("singleton() Unknown class '$className'", E_USER_ERROR);
337: }
338: return $_SINGLETONS[$className];
339: }
340:
Trace
=====
<ul>user_error(Bad class to singleton() - ProductImageObject,256)
line 334 of Core.php
singleton(ProductImageObject)
line 96 of DataObjectManager.php
DataObjectManager->__construct(Product,ProductImages,ProductImageObject,Array,getCMSFields_forPopup,,Created DESC,)
line 48 of FileDataObjectManager.php
FileDataObjectManager->__construct(Product,ProductImages,ProductImageObject,ProductImage,Array,getCMSFields_forPopup)
line 125 of Product.php
Product->getCMSFields(CMSMain)
line 444 of CMSMain.php
CMSMain->getEditForm(17)
line 1021 of LeftAndMain.php
LeftAndMain->EditForm()
line 382 of LeftAndMain.php
LeftAndMain->getitem(SS_HTTPRequest)
line 193 of Controller.php
Controller->handleAction(SS_HTTPRequest)
line 137 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
line 281 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
line 124 of Director.php
Director::direct(/admin/getitem)
line 127 of main.php
</ul>
A: This can have many reasons, try 2 things to get started:
1) Put your site into development mode (if it isn't already): http://doc.silverstripe.org/sapphire/en/topics/debugging#dev-mode
2) Log errors (server-side): http://doc.silverstripe.org/sapphire/en/topics/error-handling#filesystem-logs
This will help you with server-side errors (and "there has been an error/500" sounds a lot like it) - you should find an entry related to it in the log file. If it's just a client-side / JS thing, you'll need to dive deeper into firebug...
And don't worry about the icons in the page tree, this is a feature (see http://www.ssbits.com/snippets/2009/spice-up-your-cms-sitetree/ for a brief description).
A: From what I see, you have to check the PHP class that defines your Cart Page. Most probably, you have misspelled or mistyped something.
Bad class to singleton() - ProductImageObject
This is our clue. Try checking line 125 of Product.php.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560916",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Fluent NHibernate one-to-many with intervening join table? I'm having trouble getting the Fluent Nhibernate Automapper to create what I want. I have two entities, with a one-to-many relationship between them.
class Person
{
public string name;
IList<departments> worksIn;
}
class Department
{
public string name;
}
The above is obviously bare bones, but I would be expecting to generate the fleshed out schema of:
Person{id, name}
Department{id, name}
PersonDepartment{id(FK person), id(Fk Department)}
Unfortunately, I am instead getting:
Person{id, name}
Department{id, name, personid(FK)}
I don't want the FK for Person included on the department table, I want a separate join/lookup table (PersonDepartment above) which contains the primarykeys of both tables as a composite PK and also Fks.
I'm not sure if I am drawing up my initial classes wrong (perhaps should just be LIst workIn - representing ids, rather than List worksIn), or if I need to manually map this?
Can this be done?
A: The way the classes have been structured suggests a one-to-many relationship (and indeed that's how you describe it in your question), so it should not be a surprise that FNH opts to model the database relationship in that way.
It would be possible, as you suggest, to manually create a many-to-many table mapping. But, is this definitely what you want?
I tend to find that pure many-to-many relationships are quite rare, and there is usually a good case for introducing an intermediate entity and using two one-to-many relationships. This leaves open the possibility of adding extra information to the link (e.g. a person's "primary" department, or perhaps details of their office within each of their departments).
Some example "bare-bones" classes illustrating this kind of structure:
public class Person
{
public int Id { get; set;}
public string Name { get; set;}
public IList<PersonDepartment> Departments { get; set; }
}
public class PersonDepartment
{
public int Id { get; set; }
public Person Person { get; set; }
public Department Department { get; set; }
public bool IsPrimary { get; set; }
public string Office { get; set; }
}
public class Department
{
public int Id { get; set; }
public IList<PersonDepartment> Personnel { get; set; }
public string Name { get; set; }
}
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560917",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
}
|
Q: Improving WPF Canvas performance I am developing a Maps like application using WPF. I have ~10,000 PathGeometry, Shapes added to the canvas. I have added ScaleTransform and TranslateTransform for zooming and panning controls.
The problem I'm facing is, when I zoom or pan, there is slight lag. Is there a way to organize the data so that I handle only the Shapes that are visible?
Any hints on making it more efficient will be helpful and appreciated.
A: What kind f stuff are you putting on the canvas? If using pathGeometry, are you enclosing them in Path class? If so, Path has FrameworkElement in its superclass hierarchy, which is responsible for massive performance loss.
Take a look at my question here. Although it is about Shape class, but the reason of performance degradation is the same, FrameworkElement.
If you are doing so, the solution is to use PathGeometry instead, and enclose it in DrawingContext of a DrawingVisual using DrawingContext.DrawGeometry() method.
Here are some links that should help.
Path Geometry
DrawingContext.DrawGeometry()
Optimizing Performance: 2D Graphics and Imaging
And draw the shapes yourself, using combination of lines, and other things provided by classes derived from Geometry class (ArcGeometry, PathGeometry etc).
This should help.
A: If you want the ultimate in performance for immediate drawing in WPF, then check out WriteableBitmapEx. This is an excellent open source library, which I recently contributed to. it provides GDI-like drawing capabilities on WriteableBitmap and is compatible with Windows Phone, WPF and Silverlight. The API is simple, you get blitting, polygons, lines and simple shapes etc... You won't get datatemplates and gradient brushes however.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560922",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
}
|
Q: Bind Session field to System.Data.Linq.Binary It's a picture, an array of bytes which is in the Session. I can't seem to bind it to the automatically created model for my table, inside my DataContext. I'm trying to do so using a FormView and an ObjectDataSource, with a specified type.
Some example code:
<ObjectDataSource [...] DataObjectTypeName="MyTypeName" >
<UpdateParameters>
<asp:SessionParameter Name="MyClassPropName" SessionField="MySessionFieldName" />
</UpdateParameters>
<InsertParameters>
<asp:SessionParameter Name="MyClassPropName" SessionField="MySessionFieldName" />
</InsertParameters>
</ObjectDataSource>
I've tried specifying some types to the TypeName property directy on the parameter and it didn't work as well.
The problem is that my property specified to be bound to a Session field is always null, with both operations (Insert and Update). And I'm sure my Session field has some value, which in this case, is an array of bytes. Do I have to name the Session Field to the name of my class' Property?
Is this a problem with the Linq.Binary data type or with binding a Session Field to a specified DataObjectTypeName?
Help?
A: Since I could not bind my business class to the Session Field with Binary nor with byte[], I just changed the property type from Binary to byte[] and did so manually on the Updating and Inserting event of the ObjectDataSource, using the same handler method, like so:
MyBusinessClass foo = (MyBusinessClass)e.InputParameters["BusinessClass"];
foo.Photo = (byte[])Session["MyImage"];
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560925",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: What does the [REFERENCE] tag do in an argument declaration? I am writing an custom callback function in Fortran for a piece of software (example here) that includes the following argument declaration
SUBROUTINE CONTACT_FORCE(TIME,UPAR,NPAR,PEN,RVEL,JFLAG,IFLAG,RESULT)
!DEC$ ATTRIBUTES DLLEXPORT,C::CONTACT_FORCE
...
DOUBLE PRECISION RESULT[REFERENCE](6) !Compiles ok
Which compiles fine with Compaq Visual Fortran 6. So my question is what does the [REFERENCE] tag do? I thought that Fortran passes everything by reference (and not by value). Of course there nothing in the compiler help about this, and searching online is difficult because the word reference is used so much with respect to Fortran that I don't know how to narrow it down.
Edit the above must be identical to
SUBROUTINE CONTACT_FORCE(TIME,UPAR,NPAR,PEN,RVEL,JFLAG,IFLAG,RESULT)
!DEC$ ATTRIBUTES DLLEXPORT,C::CONTACT_FORCE
!DEC$ ATTRIBUTES REFERENCE::RESULT
...
DOUBLE PRECISION RESULT(6) !Compiles ok
A: I'm assuming MS products here. Fortran can be made to pass by value or by reference if the C or STDCALL attribute is used. See here:
http://msdn.microsoft.com/en-us/library/aa294334(v=vs.60).aspx
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560927",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: HTML elements not properly stacking in Twitter's 'Bootstrap' framework I'm curious why the following won't display properly:
<div class="topbar">...</div>
<div class="container">...</div>
I'm using Twitter's Bootstrap (http://twitter.github.com/bootstrap/) for the layout and the contents within topbar are on top of the contents within container. Why aren't these divs properly stacking on top of each other?
A: After reading the documentation regarding the use of the <topbar> element, it reads:
Note: When using the topbar on any page, be sure to account for the overlap it causes by adding padding-top: 40px; to your body.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560936",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: Intercept and send keystrokes with Python on Linux I'm looking for a way to intercept all keyboard signals before they reach the active application. I then want to interpret and map the keystrokes before sending them on to the currently active application.
A Python library would be great, but C/C++ would also suffice.
A: I'm assuming you are using a system with X(org). If not some stuff can be done as well as the evdev level, but that's a another story.
Two parts in your question:
*
*intercepting all key events -> XGrabKeyboard()
*sending key events to the active application: I'd use libfakekey, it's a bit hacky hacky (it dynamically remaps part of the current keymap to send the KeySym you want to send) but it worked for me (small tip, don't forget to gerenate both the key presses and key release events :p).
Of course in your application grabbing the keyboard, you will have to listen to the KeyEvents from X and send keys from there.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560939",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
}
|
Q: Nested Iteratees I am working with a particular database where, upon a successful
query, you are able to access a group of chunks of the resulting data using a
specific command:
getResultData :: IO (ResponseCode, ByteString)
Now getResultData will return a response code and some data where
the response codes look like this:
response = GET_DATA_FAILED | OPERATION_SUCCEEDED | NO_MORE_DATA
The ByteString is one, some, or all of the chunks:
Data http://desmond.imageshack.us/Himg189/scaled.php?server=189&filename=chunksjpeg.png&res=medium
The story does not end here. There exists a stream of groups:
Stream http://desmond.imageshack.us/Himg695/scaled.php?server=695&filename=chunkgroupsjpeg.png&res=medium
Once receiving a NO_MORE_DATA response from getResultData, a call to
getNextItem will iterate the stream allowing me to start calls to
getResultData again. Once getNextItem returns STREAM_FINISHED, that's
all she wrote; I have my data.
Now, I wish to remodel this phenomenon with either Date.Iteratee or Data.Enumerator. Inasmuch as my
existing Data.Iteratee solution works, it yet seems very naive and I feel as if I should be modeling this
with nested iteratees as opposed to one big iteratee blob which is how
my solution is currently implemented.
I have been looking at the code of Data.Iteratee 0.8.6.2 and I am a bit confused
when it comes to the nested stuff.
Are nested iteratees the proper course of action? If so, how would one model this with nested iteratees?
Regards
A: I think nested iteratees are the correct approach, but this case has some unique problems which make it slightly different from most common examples.
Chunks and groups
The first problem is to get the data source right. Basically the logical divisions you've described would give you a stream equivalent to [[ByteString]]. If you create an enumerator to produce this directly, each element within the stream would be a full group of chunks, which presumably you wish to avoid (for memory reasons). You could flatten everything into a single [ByteString], but then you'd need to re-introduce boundaries, which would be pretty wasteful since the db is doing it for you.
Ignoring the stream of groups for now, it appears that you need to divide the data into chunks yourself. I would model this as:
enumGroup :: Enumerator ByteString IO a
enumGroup = enumFromCallback cb ()
where
cb () = do
(code, data) <- getResultData
case code of
OPERATION_SUCCEEDED -> return $ Right ((True, ()), data)
NO_MORE_DATA -> return $ Right ((False, ()), data)
GET_DATA_FAILED -> return $ Left MyException
Since chunks are of a fixed size, you can easily chunk this with Data.Iteratee.group.
enumGroupChunked :: Iteratee [ByteString] IO a -> IO (Iteratee ByteString IO a)
enumGroupChunked = enumGroup . joinI . group groupSize
Compare the type of this to Enumerator
type Enumerator s m a = Iteratee s m a -> m (Iteratee s m a)
So enumGroupChunked is basically a fancy enumerator which changes the stream type. This means that it takes a [ByteString] iteratee consumer, and returns an iteratee which consumes plain bytestrings. Often the return type of an enumerator doesn't matter; it's simply an iteratee which you evaluate with run (or tryRun) to get at the output, so you could do the same here:
evalGroupChunked :: Iteratee [ByteString] IO a -> IO a
evalGroupChunked i = enumGroupChunked i >>= run
If you have more complicated processing to do on each group, the easiest place to do so would be in the enumGroupChunked function.
Stream of groups
Now this is out of the way, what to do about the stream of groups? The answer depends on how you want to consume them. If you want to essentially treat each group in the stream independently, I would do something similar to this:
foldStream :: Iteratee [ByteString] IO a -> (b -> a -> b) -> b -> IO b
foldStream iter f acc0 = do
val <- evalGroupChunked iter
res <- getNextItem
case res of
OPERATION_SUCCEEDED -> foldStream iter f $! f acc0 val
NO_MORE_DATA -> return $ f acc0 val
GET_DATA_FAILED -> error "had a problem"
However, let's say you want to do some sort of stream processing of the entire dataset, not just individual groups. That is, you have a
bigProc :: Iteratee [ByteString] IO a
that you want to run over the entire dataset. This is where the return iteratee of an enumerator is useful. Some earlier code will be slightly different now:
enumGroupChunked' :: Iteratee [ByteString] IO a
-> IO (Iteratee ByteString IO (Iteratee [ByteString] IO a))
enumGroupChunked' = enumGroup . group groupSize
procStream :: Iteratee [ByteString] IO a -> a
procStream iter = do
i' <- enumGroupChunked' iter >>= run
res <- getNextItem
case res of
OPERATION_SUCCEEDED -> procStream i'
NO_MORE_DATA -> run i'
GET_DATA_FAILED -> error "had a problem"
This usage of nested iteratees (i.e. Iteratee s1 m (Iteratee s2 m a)) is slightly uncommon, but it's particularly helpful when you want to sequentially process data from multiple Enumerators. The key is to recognize that runing the outer iteratee will give you an iteratee which is ready to receive more data. It's a model that works well in this case, because you can enumerate each group independently but process them as a single stream.
One caution: the inner iteratee will be in whatever state it was left in. Suppose that the last chunk of a group may be smaller than a full chunk, e.g.
Group A Group B Group C
1024, 1024, 512 1024, 1024, 1024 1024, 1024, 1024
What will happen in this case is that, because group is combining data into chunks of size 1024, it will combine the last chunk of Group A with the first 512 bytes of Group B. This isn't a problem with the foldStream example because that code terminates the inner iteratee (with joinI). That means the groups are truly independent, so you have to treat them as such. If you want to combine the groups as in procStream, you have to think of the entire stream. If this is your case, then you'll need to use something more sophisticated than just group.
Data.Iteratee vs Data.Enumerator
Without getting into a debate of the merits of either package, not to mention IterIO (I'm admittedly biased), I would like to point out what I consider the most significant difference between the two: the abstraction of the stream.
In Data.Iteratee, a consumer Iteratee ByteString m a operates on a notional ByteString of some length, with access to a single chunk of ByteString at one time.
In Data.Enumerator, a consumer Iteratee ByteString m a operates on a notional [ByteString], with access to one or more elements (bytestrings) at one time.
This means that most Data.Iteratee operations are element-focused, that is with an Iteratee ByteString they'll operate on a single Word8, whereas Data.Enumerator operations are chunk-focused, operating on a ByteString.
You can think of Data.Iteratee.Iteratee [s] m a === Data.Enumerator.Iteratee s m a.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560944",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
}
|
Q: vim + minibufexplorer causing my screens to split unevenly Before I installed minibufexplorer, my vim screens would split evenly.
2 open = 50/50 (% width)
3 open = 33/33/33 (% width)
4 open = 25/25/25/25 (% width)
After I installed minibufexplorer, when I split a window it halves the current window so I get
2 open = 50/50 (% width)
3 open = 50/25/25 (% width)
etc
I have scoured the net for information with no luck.
Anybody help?
A: I took a look at the plugin's code, and found this:
" !!! We may want to make the following optional -- Bindu
" New windows don't cause all windows to be resized to equal sizes
set noequalalways
This setting controls the behaviour you specify. The only way I can see for you to solve your problem is to ask the plugin maintainers for a fix. The plugin seems not to be maintained by its original author, but there's a github project that continues it, I think: https://github.com/fholgado/minibufexpl.vim. You can file an issue on the bug tracker here: https://github.com/fholgado/minibufexpl.vim/issues.
As for why it's setting that option, I assume it's necessary, because minibufexpl opens up a new, small buffer with a list of the open buffers. If the setting was on, that buffer would be resized as well, which would be undesirable. I think it's avoidable by using winfixheight (the github version seems to use that), but I can't really tell, I don't use the plugin. One thing I can suggest is to find the plugin in your vimfiles and comment out the set noequalalways line, see if everything still works. If it does, you could ask the plugin authors to remove it entirely.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560948",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: How does Facebook Music Object works? i'v built a music canvas application and i'm trying to figure out how the Facebook Music and Audio Objects work.
i did everything the Open Graph Music Documentation Page said
here is my open graph meta tags for a song page.
<meta property="og:title" content="artist name - song name" />
<meta property="og:type" content="music.song" />
<meta property="og:image" content="artist image url" />
<meta property="og:url" content="song page url" />
<meta property="og:site_name" content="site name" />
<meta property="og:audio" content="song mp3 url" />
<meta property="og:audio:type" content="audio/vnd.facebook.bridge" />
<meta property="music:musician" content="artist page url" />
<meta property="music:album" content="song album url" />
<meta property="fb:app_id" content="my app id" />
i'm not getting any erros but..
i debugged the url and this is what i'm getting
*
*no artist name.
*incorrect song title.
*no album name.
*when i publish the song url on my facebook status i'm not getting any audio player.
note: im getting the correct src i just deleted it from the image.
i'm trying to figure out how to deal with Open Graph beta Music Object for 2 days now.
can someone please help..
thanks in advance.
edit:
if you look at the image i attached there is no artist name, album name and the title of the song is incorrect (facebook took that title from the mp3 filename) when i try adding go:audio:title, 'go:audio:artist, 'go:audio:album it works well but the facebook debugger returns error.
here is the debug information.
A: Facebook states: "Facebook Open Graph Music is only available to whitelisted partners at this time." Are you whitelisted partner?
A: og:audio:type should be application/mp3 to play, everything else seems fine to me
A: Everything looks good. Just make sure that whatever you put in og:url is the actual page with the <meta> tags.
All og:url means is "Completely ignore this page and go over here to find the tags".
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560958",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Segmentation Fault when trying to index an array of arrays of objects via a pointer Can someone please tell me why I get a segmentation fault running this? I try and a pointer to an array of an array of objects, how I can fix this problem? The declaration of the sf::Vector2 class can be found here: http://www.sfml-dev.org/documentation/1.6/classsf_1_1Vector2.php
Many thanks.
#include <SFML/System/Vector2.hpp>
#include <iostream>
class Tet
{
public:
Tet();
private:
static sf::Vector2 <int> I[4];
static sf::Vector2 <int> J[4];
static sf::Vector2 <int> *types[2];
};
sf::Vector2 <int> Tet::I[4] = {sf::Vector2 <int>(0,1),
sf::Vector2 <int>(1,1),
sf::Vector2 <int>(2,1),
sf::Vector2 <int>(3,1)};
sf::Vector2 <int> Tet::J[4] = {sf::Vector2 <int>(1,1),
sf::Vector2 <int>(2,1),
sf::Vector2 <int>(3,1),
sf::Vector2 <int>(3,2)};
sf::Vector2 <int>* Tet::types[2] = { I,J };
Tet::Tet()
{
//trying to print out x member of first vector of I
std::cout << (*(*(types))).x << std::endl;
}
main()
{
Tet t = Tet();
}
EDIT: g++ compiler
A: You never allocate or instantiate the types array you are referencing. types is a pointer you can't assign concrete values to a nullptr which is how you left it at the moment.
Just declare it as an array instead of a pointer
sf::Vector2<int> types[2][4];
You may want to consider a simpler more effective design perhaps by having a Vector2 object, a Matrix object, and then the Tet object which has a collection of matrices using STL containers and algorithms preferably.
A: maybe allocate types first and initialize with { &I, &J }
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560964",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: In Rails 3.1, how can I create an HTML table generator that uses block style formatting I'm developing an application that displays tabular data in many different areas and I find myself constantly using the same HTML table structure over and over. For example a particular table looks like this:
%table.zebra-striped#user-table{ :cellspacing => "0" }
%colgroup
%col{:id => "email"}
%col{:id => "username"}
%col{:id => "sign-in-count"}
%col{:id => "last-sign-in-at"}
%thead
%tr
%th{:id => "email-head", :scope => "col"} E-mail
%th{:id => "username-head", :scope => "col"} Username
%th{:id => "sign-in-count-head", :scope => "col"} Sign Ins
%th{:id => "last-sign-in-at-head", :scope => "col"} Last Sign In
%tbody
- @users.each do |user|
%tr{ :class => zebra }
%td
=h user.email
%td
=h user.username
%td
=h user.sign_in_count
%td
=h user.last_sign_in_at
Ideally, I would like to create some kind of helper method where I could do something like:
= custom_table_for @users do
= column :email
= column :username do |user|
= link_to user.username, user_path(user)
= column "Sign Ins", :sign_in_count
= column :last_sign_in_at
This way I can change the formatting of the data in the columns and the column header names if I'm not happy with default values, but have the table generated for me.
I suppose I could create a normal helper, but I'd have to use arrays and I have no idea how I could include custom data formatting per column.
active_admin has something similar to this which you can see here: http://activeadmin.info/docs/3-index-pages/index-as-table.html
Any leads or ideas would be greatly appreciated.
A: I just came up with this:
A few points:
*
*The line @columns = [] is a reset so you can call it more than once.
*The yield in the custom_table_for calls the block that you pass it.
*The block in the column method is stored and called in custom_table_for if it is set.
I included a sample class to show the usage too.
please note I did this outside of a rails app and you almost certainly want to use http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag instead of the p "<table>" this is merely for sample purposes when you run it in the console.
module TableHelper
def custom_table_for(items)
@columns = []
yield
p "<table>"
@columns.each do |c|
p "<th>#{c[:value]}</th>"
end
items.each do |e|
p "<tr>"
@columns.each do |c|
e[c[:name]] = c[:block].call(e[c[:name]]) if c[:block]
p "<td>#{e[c[:name]]}</td>"
end
p "</tr>"
end
p "</table>"
end
def column(name, value = nil, &block)
value = name unless value
@columns << {:name => name, :value => value, :block => block}
end
end
class ExampleTable
include TableHelper
def test
@users = [{:email => "Email 1", :username => "Test User"}, {:email => "Email 2", :username => "Test User 2"}]
custom_table_for @users do
column :email, "Email"
column :username do |user|
user.upcase
end
end
end
end
et = ExampleTable.new
et.test
UPDATE
I migrated this to rails to use content_tags
module TableHelper
def custom_table_for(items)
@columns = []
yield
content_tag :table do
thead + tbody(items)
end
end
def thead
content_tag :thead do
content_tag :tr do
@columns.each do |c|
concat(content_tag(:th, c[:value]))
end
end
end
end
def tbody(items)
content_tag :tbody do
items.each { |e|
concat(content_tag(:tr){
@columns.each { |c|
e[c[:name]] = c[:block].call(e[c[:name]]) if c[:block]
concat(content_tag(:td, e[c[:name]]))
}
})
}
end
end
def column(name, value = nil, &block)
value = name unless value
@columns << {:name => name, :value => value, :block => block}
end
end
A: To compliment @gazler's response, here's a way to make a table of a single resource-- column one for attribute names, column two for their values:
module TableHelper
@resource = nil
def simple_table_for(resource)
@resource = resource
content_tag :table do
content_tag :tbody do
yield
end
end
end
def row(key, label = nil, &block)
if key.is_a? String
label = key
end
content_tag(:tr) {
concat content_tag :td, label || key.capitalize
concat content_tag(:td ){
if block_given?
yield
else
@resource.send(key)
end
}
}
end
end
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560965",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
}
|
Q: Possible to scope a javascript variable to a function and that function's recursive calls to itself? I am in a situation where I have a loop that is calling a function. The function will make recursive calls to itself once called.
Is there a way that I can scope a variable to the function and the chain of recursive calls generated from the first call?
Something like this:
for(var i=0;i<100;i++)
{
myFunction();
}
function myFunction()
{
var someNumber = 200;
someNumber -= 10;
if( someNumber > 0)
{
myFunction();
}
}
where at the second iteration of the first call to someNumber would be 190 and not 200. Is this possible to accomplish?
If there is anything confusing here, please let me know.
A: while(var i=0;i<100;i++)
{
myFunction(200);
}
function myFunction(someNumber)
{
someNumber -= 10;
if( someNumber > 0)
{
myFunction(someNumber);
}
}
A: Yes, use an inner function to do the recursion:
for (var i = 0; i < 100; i++)
{
myFunction();
}
function myFunction()
{
var someNumber = 200;
(function innerFunction()
{
someNumber -= 10;
if( someNumber > 0)
{
innerFunction();
}
})();
};
Note, you have a syntax error. Your while needs to be for.
Edit: Perhaps your real code is different and calls for a recursive function, but your example would be much simpler by just using a loop:
function myFunction()
{
for (var someNumber = 200; someNumber > 0; someNumber -= 10)
{
}
};
A: Yes and no--you should be able to accomplish the task by passing the value of the variable in as a parameter of myFunction. The first call will need to set the starting value, then pass it along for future invocations to modify.
while(var i=0;i<100;i++)
{
myFunction();
}
function myFunction(seed) {
if (seed == undefined)
{
seed = 200;
}
alert(seed);
var newSeed = seed - 50;
if (seed > 0)
{
myFunction(newSeed);
}
};
A: I think using objects would be the way to go if you want to do something where you are actually scoping variables.
function myObject(_someNumber) {
var someNumber = _someNumber;
this.myFunction = function() {
this.someNumber -= 10;
if(this.someNumber > 0)
{
this.myFunction(this.someNumber);
}
}
}
for(var i=0;i<100;i++)
{
new myObject().myFunction(someNumber);
}
A: You want a closure. Well, you might not want it, but it will do what you are asking.
(function() {
var someNumber=200;
myFunction=function() {
someNumber-=10;
if (someNumber > 0) {
myFunction();
}
}
})();
But properly passing parameters is probably a better idea.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560973",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: What crypto algorithms does Android support? I have been googling for hours and cannot find any solid answers but lots of hearsay.
Does anyone know where the documentation is that defines which encryption/signature/hash algorithms the Android OS supports.
I have heard from forums that not all phones support the same algorithms so I am looking for what common algorithms every Android phone supports.
A: The official cipher list can be found here. alot are supported from SDK 1 but even more from SDK 10: https://developer.android.com/reference/javax/crypto/Cipher.html
A: The same list updated with android 4.2.2
I/CRYPTO (32293): provider: AndroidOpenSSL
I/CRYPTO (32293): algorithm: MD5WithRSA
I/CRYPTO (32293): algorithm: SHA1WithRSA
I/CRYPTO (32293): algorithm: SHA512WithRSA
I/CRYPTO (32293): algorithm: MD5
I/CRYPTO (32293): algorithm: SHA-512
I/CRYPTO (32293): algorithm: DSA
I/CRYPTO (32293): algorithm: RSA
I/CRYPTO (32293): algorithm: SHA384WithRSA
I/CRYPTO (32293): algorithm: NONEwithRSA
I/CRYPTO (32293): algorithm: SHA-256
I/CRYPTO (32293): algorithm: SHA256WithRSA
I/CRYPTO (32293): algorithm: SSL
I/CRYPTO (32293): algorithm: SHA1PRNG
I/CRYPTO (32293): algorithm: SHA-1
I/CRYPTO (32293): algorithm: SHA1withDSA
I/CRYPTO (32293): algorithm: TLSv1.1
I/CRYPTO (32293): algorithm: TLSv1.2
I/CRYPTO (32293): algorithm: SSLv3
I/CRYPTO (32293): algorithm: TLSv1
I/CRYPTO (32293): algorithm: RSA/ECB/PKCS1Padding
I/CRYPTO (32293): algorithm: TLS
I/CRYPTO (32293): algorithm: Default
I/CRYPTO (32293): algorithm: RSA
I/CRYPTO (32293): algorithm: SHA-384
I/CRYPTO (32293): algorithm: RSA/ECB/NoPadding
I/CRYPTO (32293): provider: DRLCertFactory
I/CRYPTO (32293): algorithm: X509
I/CRYPTO (32293): provider: BC
I/CRYPTO (32293): algorithm: SHA384WITHRSA
I/CRYPTO (32293): algorithm: MD5WITHRSA
I/CRYPTO (32293): algorithm: PKCS12PBE
I/CRYPTO (32293): algorithm: PBEWITHSHAAND40BITRC4
I/CRYPTO (32293): algorithm: SHA512WITHRSA
I/CRYPTO (32293): algorithm: DH
I/CRYPTO (32293): algorithm: AES
I/CRYPTO (32293): algorithm: PBEWITHSHAAND40BITRC4
I/CRYPTO (32293): algorithm: SHA-256
I/CRYPTO (32293): algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
I/CRYPTO (32293): algorithm: PBEWITHSHAAND128BITRC4
I/CRYPTO (32293): algorithm: PBEWITHSHAAND40BITRC2-CBC
I/CRYPTO (32293): algorithm: HMACSHA1
I/CRYPTO (32293): algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
I/CRYPTO (32293): algorithm: SHA-1
I/CRYPTO (32293): algorithm: PBEWITHSHAAND128BITRC2-CBC
I/CRYPTO (32293): algorithm: EC
I/CRYPTO (32293): algorithm: PBEWITHSHAAND256BITAES-CBC-BC
I/CRYPTO (32293): algorithm: SHA256WITHRSA
I/CRYPTO (32293): algorithm: AES
I/CRYPTO (32293): algorithm: ECDSA
I/CRYPTO (32293): algorithm: SHA256WITHECDSA
I/CRYPTO (32293): algorithm: DH
I/CRYPTO (32293): algorithm: SHA384WITHECDSA
I/CRYPTO (32293): algorithm: SHA1withDSA
I/CRYPTO (32293): algorithm: DES
I/CRYPTO (32293): algorithm: SHA512WITHECDSA
I/CRYPTO (32293): algorithm: SHA1WITHRSA
I/CRYPTO (32293): algorithm: HMACMD5
I/CRYPTO (32293): algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
I/CRYPTO (32293): algorithm: PBEWITHHMACSHA1
I/CRYPTO (32293): algorithm: SHA-384
I/CRYPTO (32293): algorithm: PBEWITHSHAAND128BITRC2-CBC
I/CRYPTO (32293): algorithm: HMACSHA256
I/CRYPTO (32293): algorithm: BouncyCastle
I/CRYPTO (32293): algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
I/CRYPTO (32293): algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
I/CRYPTO (32293): algorithm: PBEWITHSHAANDTWOFISH-CBC
I/CRYPTO (32293): algorithm: HMACSHA1
I/CRYPTO (32293): algorithm: DSA
I/CRYPTO (32293): algorithm: PBEWITHSHAAND128BITAES-CBC-BC
I/CRYPTO (32293): algorithm: BLOWFISH
I/CRYPTO (32293): algorithm: AESWRAP
I/CRYPTO (32293): algorithm: DH
I/CRYPTO (32293): algorithm: PKIX
I/CRYPTO (32293): algorithm: HMACSHA384
I/CRYPTO (32293): algorithm: PBEWITHSHA1ANDRC2
I/CRYPTO (32293): algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
I/CRYPTO (32293): algorithm: RSA
I/CRYPTO (32293): algorithm: PBKDF2WithHmacSHA1
I/CRYPTO (32293): algorithm: EC
I/CRYPTO (32293): algorithm: HMACSHA512
I/CRYPTO (32293): algorithm: DSA
I/CRYPTO (32293): algorithm: BLOWFISH
I/CRYPTO (32293): algorithm: BLOWFISH
I/CRYPTO (32293): algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
I/CRYPTO (32293): algorithm: DH
I/CRYPTO (32293): algorithm: PBEWITHSHAAND192BITAES-CBC-BC
I/CRYPTO (32293): algorithm: MD5
I/CRYPTO (32293): algorithm: PBEWITHMD5ANDDES
I/CRYPTO (32293): algorithm: DESEDEWRAP
I/CRYPTO (32293): algorithm: DSA
I/CRYPTO (32293): algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
I/CRYPTO (32293): algorithm: BKS
I/CRYPTO (32293): algorithm: X.509
I/CRYPTO (32293): algorithm: HMACSHA512
I/CRYPTO (32293): algorithm: HMACSHA384
I/CRYPTO (32293): algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
I/CRYPTO (32293): algorithm: PBEWITHSHA1ANDRC2
I/CRYPTO (32293): algorithm: PBEWITHSHA1ANDDES
I/CRYPTO (32293): algorithm: PBEWITHHMACSHA
I/CRYPTO (32293): algorithm: PBEWITHSHAAND192BITAES-CBC-BC
I/CRYPTO (32293): algorithm: DESEDE
I/CRYPTO (32293): algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
I/CRYPTO (32293): algorithm: PBEWITHMD5ANDRC2
I/CRYPTO (32293): algorithm: DES
I/CRYPTO (32293): algorithm: ARC4
I/CRYPTO (32293): algorithm: DESEDE
I/CRYPTO (32293): algorithm: RSA
I/CRYPTO (32293): algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
I/CRYPTO (32293): algorithm: DESEDE
I/CRYPTO (32293): algorithm: PBEWITHMD5ANDDES
I/CRYPTO (32293): algorithm: PKCS12
I/CRYPTO (32293): algorithm: ARC4
I/CRYPTO (32293): algorithm: HMACSHA256
I/CRYPTO (32293): algorithm: PKIX
I/CRYPTO (32293): algorithm: SHA-512
I/CRYPTO (32293): algorithm: PBEWITHSHAAND40BITRC2-CBC
I/CRYPTO (32293): algorithm: PBEWITHSHAAND128BITRC4
I/CRYPTO (32293): algorithm: Collection
I/CRYPTO (32293): algorithm: HMACMD5
I/CRYPTO (32293): algorithm: DSA
I/CRYPTO (32293): algorithm: PBEWITHSHAAND256BITAES-CBC-BC
I/CRYPTO (32293): algorithm: PBEWITHSHAAND128BITAES-CBC-BC
I/CRYPTO (32293): algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
I/CRYPTO (32293): algorithm: RSA
I/CRYPTO (32293): algorithm: PBEWITHSHA1ANDDES
I/CRYPTO (32293): algorithm: ECDH
I/CRYPTO (32293): algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
I/CRYPTO (32293): algorithm: PBEWITHHMACSHA1
I/CRYPTO (32293): algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
I/CRYPTO (32293): algorithm: NONEWITHDSA
I/CRYPTO (32293): algorithm: DESEDE
I/CRYPTO (32293): algorithm: PBEWITHSHAANDTWOFISH-CBC
I/CRYPTO (32293): algorithm: DES
I/CRYPTO (32293): algorithm: DH
I/CRYPTO (32293): algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
I/CRYPTO (32293): algorithm: AES
I/CRYPTO (32293): algorithm: PBEWITHMD5ANDRC2
I/CRYPTO (32293): algorithm: DES
I/CRYPTO (32293): algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
I/CRYPTO (32293): algorithm: OAEP
I/CRYPTO (32293): algorithm: NONEwithECDSA
I/CRYPTO (32293): provider: Crypto
I/CRYPTO (32293): algorithm: SHA1withDSA
I/CRYPTO (32293): algorithm: SHA-1
I/CRYPTO (32293): algorithm: SHA1PRNG
I/CRYPTO (32293): algorithm: DSA
I/CRYPTO (32293): provider: HarmonyJSSE
I/CRYPTO (32293): algorithm: SSLv3
I/CRYPTO (32293): algorithm: AndroidCAStore
I/CRYPTO (32293): algorithm: X509
I/CRYPTO (32293): algorithm: X509
I/CRYPTO (32293): algorithm: TLS
I/CRYPTO (32293): algorithm: SSL
I/CRYPTO (32293): algorithm: TLSv1
A: The list for ICS 4.0.3:
02-10 10:50:04.192: I/CRYPTO(1701): provider: AndroidOpenSSL
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: SHA-512
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: SSL
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: TLSv1
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: SHA-256
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: MD5
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: SSLv3
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: TLS
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: SHA-384
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: SHA-1
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: Default
02-10 10:50:04.192: I/CRYPTO(1701): provider: DRLCertFactory
02-10 10:50:04.192: I/CRYPTO(1701): algorithm: X509
02-10 10:50:04.192: I/CRYPTO(1701): provider: BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND128BITRC4
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA384
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND40BITRC4
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA1
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA256WithRSAEncryption
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: AES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA512
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: NONEwithECDSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND40BITRC2-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: AESWRAP
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5ANDRC2
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: EC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA-256
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACMD5
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA384WithRSAEncryption
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHHMACSHA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA1ANDDES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA-1
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA384WITHECDSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: ECDH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAANDTWOFISH-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA1
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA256WITHECDSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA1withDSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA384
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: BouncyCastle
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: BKS
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND128BITRC2-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: MD5WithRSAEncryption
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: MD5
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: ARC4
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA256
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAANDTWOFISH-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: RSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND40BITRC2-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DESEDEWRAP
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DESEDE
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA1WithRSAEncryption
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND256BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: RSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PKCS12PBE
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: AES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA256
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: X.509
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: BLOWFISH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND256BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: BLOWFISH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PKCS12
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA512WithRSAEncryption
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHHMACSHA1
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: NONEWITHDSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHHMACSHA1
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PKIX
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND128BITRC4
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: AES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA-512
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA1ANDRC2
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND192BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: RSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA1ANDDES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBKDF2WithHmacSHA1
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5ANDDES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA512WITHECDSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND128BITRC2-CBC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: OAEP
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DESEDE
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACSHA512
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: ECDSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND128BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DSA
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DESEDE
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: HMACMD5
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: SHA-384
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND128BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: BLOWFISH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHAAND192BITAES-CBC-BC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: EC
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5ANDDES
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHMD5ANDRC2
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: DH
02-10 10:50:04.200: I/CRYPTO(1701): algorithm: PBEWITHSHA1ANDRC2
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: PKIX
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: DSA
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: ARC4
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: DESEDE
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: DES
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: PBEWITHSHAAND40BITRC4
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: Collection
02-10 10:50:04.208: I/CRYPTO(1701): provider: Crypto
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: DSA
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: SHA1withDSA
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: SHA-1
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: SHA1PRNG
02-10 10:50:04.208: I/CRYPTO(1701): provider: HarmonyJSSE
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: TLSv1
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: SSLv3
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: TLS
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: X509
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: AndroidCAStore
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: SSL
02-10 10:50:04.208: I/CRYPTO(1701): algorithm: X509
A: Try this to list all security providers:
Provider[] providers = Security.getProviders();
for (Provider provider : providers) {
Log.i("CRYPTO","provider: "+provider.getName());
Set<Provider.Service> services = provider.getServices();
for (Provider.Service service : services) {
Log.i("CRYPTO"," algorithm: "+service.getAlgorithm());
}
}
Update
Here is a list for my Nexus S (OS 2.3.4):
provider: AndroidOpenSSL
algorithm: SHA-384
algorithm: SHA-1
algorithm: SSLv3
algorithm: MD5
algorithm: SSL
algorithm: SHA-256
algorithm: TLS
algorithm: SHA-512
algorithm: TLSv1
algorithm: Default
provider: DRLCertFactory
algorithm: X509
provider: BC
algorithm: PKCS12
algorithm: DESEDE
algorithm: DH
algorithm: RC4
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: DESEDE
algorithm: Collection
algorithm: SHA-1
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: DESEDEWRAP
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: AES
algorithm: HMACSHA256
algorithm: OAEP
algorithm: HMACSHA256
algorithm: HMACSHA384
algorithm: DSA
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: DES
algorithm: PBEWITHMD5ANDDES
algorithm: SHA1withDSA
algorithm: PBEWITHMD5ANDDES
algorithm: BouncyCastle
algorithm: PKIX
algorithm: PKCS12PBE
algorithm: DSA
algorithm: RSA
algorithm: PBEWITHSHA1ANDDES
algorithm: DESEDE
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHAAND128BITRC4
algorithm: DH
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: HMACSHA384
algorithm: AESWRAP
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: SHA256WithRSAEncryption
algorithm: DES
algorithm: HMACSHA512
algorithm: HMACSHA1
algorithm: DH
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PKIX
algorithm: PBEWITHMD5ANDRC2
algorithm: SHA-256
algorithm: PBEWITHSHA1ANDDES
algorithm: HMACSHA512
algorithm: SHA384WithRSAEncryption
algorithm: DES
algorithm: BLOWFISH
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: DSA
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: BLOWFISH
algorithm: PBEWITHSHAAND40BITRC4
algorithm: PBKDF2WithHmacSHA1
algorithm: PBEWITHSHAAND40BITRC4
algorithm: HMACSHA1
algorithm: AES
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHHMACSHA
algorithm: DH
algorithm: BKS
algorithm: NONEWITHDSA
algorithm: DES
algorithm: PBEWITHMD5ANDRC2
algorithm: DSA
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: SHA512WithRSAEncryption
algorithm: HMACMD5
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHA1ANDRC2
algorithm: ARC4
algorithm: PBEWITHHMACSHA1
algorithm: AES
algorithm: PBEWITHHMACSHA1
algorithm: MD5
algorithm: RSA
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND128BITRC4
algorithm: SHA-384
algorithm: RSA
algorithm: DESEDE
algorithm: SHA-512
algorithm: X.509
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: MD5WithRSAEncryption
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: BLOWFISH
algorithm: DH
algorithm: SHA1WithRSAEncryption
algorithm: HMACMD5
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
provider: Crypto
algorithm: SHA1withDSA
algorithm: SHA-1
algorithm: DSA
algorithm: SHA1PRNG
provider: HarmonyJSSE
algorithm: X509
algorithm: SSLv3
algorithm: TLS
algorithm: TLSv1
algorithm: X509
algorithm: SSL
A: A list for Android 4.4.2 on Nexus 5
provider: AndroidOpenSSL
algorithm: SSL
algorithm: SSLv3
algorithm: TLS
algorithm: TLSv1
algorithm: TLSv1.1
algorithm: TLSv1.2
algorithm: Default
algorithm: SHA-1
algorithm: SHA-256
algorithm: SHA-384
algorithm: SHA-512
algorithm: MD5
algorithm: RSA
algorithm: DSA
algorithm: EC
algorithm: RSA
algorithm: DSA
algorithm: EC
algorithm: ECDH
algorithm: MD5WithRSA
algorithm: SHA1WithRSA
algorithm: SHA256WithRSA
algorithm: SHA384WithRSA
algorithm: SHA512WithRSA
algorithm: SHA1withDSA
algorithm: NONEwithRSA
algorithm: ECDSA
algorithm: SHA256withECDSA
algorithm: SHA384withECDSA
algorithm: SHA512withECDSA
algorithm: SHA1PRNG
algorithm: RSA/ECB/NoPadding
algorithm: RSA/ECB/PKCS1Padding
algorithm: AES/ECB/NoPadding
algorithm: AES/ECB/PKCS5Padding
algorithm: AES/CBC/NoPadding
algorithm: AES/CBC/PKCS5Padding
algorithm: AES/CFB/NoPadding
algorithm: AES/CFB/PKCS5Padding
algorithm: AES/CTR/NoPadding
algorithm: AES/CTR/PKCS5Padding
algorithm: AES/OFB/NoPadding
algorithm: AES/OFB/PKCS5Padding
algorithm: DESEDE/CBC/NoPadding
algorithm: DESEDE/CBC/PKCS5Padding
algorithm: DESEDE/CFB/NoPadding
algorithm: DESEDE/CFB/PKCS5Padding
algorithm: DESEDE/ECB/NoPadding
algorithm: DESEDE/ECB/PKCS5Padding
algorithm: DESEDE/OFB/NoPadding
algorithm: DESEDE/OFB/PKCS5Padding
algorithm: ARC4
algorithm: HmacMD5
algorithm: HmacSHA1
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: X509
provider: DRLCertFactory
algorithm: X509
provider: BC
algorithm: MD5
algorithm: HMACMD5
algorithm: HMACMD5
algorithm: SHA-1
algorithm: HMACSHA1
algorithm: HMACSHA1
algorithm: PBEWITHHMACSHA
algorithm: PBEWITHHMACSHA1
algorithm: PBEWITHHMACSHA1
algorithm: PBKDF2WithHmacSHA1
algorithm: PBKDF2WithHmacSHA1And8BIT
algorithm: SHA-256
algorithm: HMACSHA256
algorithm: HMACSHA256
algorithm: SHA-384
algorithm: HMACSHA384
algorithm: HMACSHA384
algorithm: SHA-512
algorithm: HMACSHA512
algorithm: HMACSHA512
algorithm: PKCS12PBE
algorithm: AES
algorithm: AES
algorithm: AESWRAP
algorithm: AES
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: ARC4
algorithm: ARC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: DESEDE
algorithm: DESEDEWRAP
algorithm: DESEDE
algorithm: DESEDE
algorithm: DESEDE
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: X.509
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: SHA1withDSA
algorithm: NONEWITHDSA
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: ECDH
algorithm: EC
algorithm: EC
algorithm: ECDSA
algorithm: NONEwithECDSA
algorithm: SHA256WITHECDSA
algorithm: SHA384WITHECDSA
algorithm: SHA512WITHECDSA
algorithm: OAEP
algorithm: RSA
algorithm: RSA
algorithm: RSA
algorithm: MD5WITHRSA
algorithm: SHA1WITHRSA
algorithm: SHA256WITHRSA
algorithm: SHA384WITHRSA
algorithm: SHA512WITHRSA
algorithm: BKS
algorithm: BouncyCastle
algorithm: PKCS12
algorithm: PKIX
algorithm: PKIX
algorithm: Collection
provider: Crypto
algorithm: SHA-1
algorithm: SHA1PRNG
algorithm: SHA1withDSA
algorithm: DSA
provider: HarmonyJSSE
algorithm: SSL
algorithm: SSLv3
algorithm: TLS
algorithm: TLSv1
algorithm: PKIX
algorithm: PKIX
algorithm: AndroidCAStore
provider: AndroidKeyStore
algorithm: AndroidKeyStore
algorithm: RSA
A: A list for Android 5.0 on Nexus 5
provider: AndroidOpenSSL
algorithm: SSL
algorithm: SSLv3
algorithm: TLS
algorithm: TLSv1
algorithm: TLSv1.1
algorithm: TLSv1.2
algorithm: Default
algorithm: SHA-1
algorithm: SHA-224
algorithm: SHA-256
algorithm: SHA-384
algorithm: SHA-512
algorithm: MD5
algorithm: RSA
algorithm: DH
algorithm: DSA
algorithm: EC
algorithm: RSA
algorithm: DH
algorithm: DSA
algorithm: EC
algorithm: ECDH
algorithm: MD5WithRSA
algorithm: SHA1WithRSA
algorithm: SHA224WithRSA
algorithm: SHA256WithRSA
algorithm: SHA384WithRSA
algorithm: SHA512WithRSA
algorithm: SHA1withDSA
algorithm: NONEwithRSA
algorithm: ECDSA
algorithm: SHA224withECDSA
algorithm: SHA256withECDSA
algorithm: SHA384withECDSA
algorithm: SHA512withECDSA
algorithm: SHA1PRNG
algorithm: RSA/ECB/NoPadding
algorithm: RSA/ECB/PKCS1Padding
algorithm: AES/ECB/NoPadding
algorithm: AES/ECB/PKCS5Padding
algorithm: AES/CBC/NoPadding
algorithm: AES/CBC/PKCS5Padding
algorithm: AES/CFB/NoPadding
algorithm: AES/CTR/NoPadding
algorithm: AES/OFB/NoPadding
algorithm: DESEDE/ECB/NoPadding
algorithm: DESEDE/ECB/PKCS5Padding
algorithm: DESEDE/CBC/NoPadding
algorithm: DESEDE/CBC/PKCS5Padding
algorithm: DESEDE/CFB/NoPadding
algorithm: DESEDE/OFB/NoPadding
algorithm: ARC4
algorithm: HmacMD5
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: X509
provider: BC
algorithm: MD5
algorithm: HMACMD5
algorithm: HMACMD5
algorithm: SHA-1
algorithm: HMACSHA1
algorithm: HMACSHA1
algorithm: PBEWITHHMACSHA
algorithm: PBEWITHHMACSHA1
algorithm: PBEWITHHMACSHA1
algorithm: PBKDF2WithHmacSHA1
algorithm: PBKDF2WithHmacSHA1And8BIT
algorithm: SHA-224
algorithm: HMACSHA224
algorithm: HMACSHA224
algorithm: SHA-256
algorithm: HMACSHA256
algorithm: HMACSHA256
algorithm: SHA-384
algorithm: HMACSHA384
algorithm: HMACSHA384
algorithm: SHA-512
algorithm: HMACSHA512
algorithm: HMACSHA512
algorithm: PKCS12PBE
algorithm: AES
algorithm: GCM
algorithm: AES
algorithm: AESWRAP
algorithm: GCM
algorithm: AES
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: ARC4
algorithm: ARC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: DESEDE
algorithm: DESEDEWRAP
algorithm: DESEDE
algorithm: DESEDE
algorithm: DESEDE
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: X.509
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: SHA1withDSA
algorithm: NONEWITHDSA
algorithm: SHA224WITHDSA
algorithm: SHA256WITHDSA
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: ECDH
algorithm: EC
algorithm: EC
algorithm: ECDSA
algorithm: NONEwithECDSA
algorithm: SHA224WITHECDSA
algorithm: SHA256WITHECDSA
algorithm: SHA384WITHECDSA
algorithm: SHA512WITHECDSA
algorithm: OAEP
algorithm: RSA
algorithm: RSA
algorithm: RSA
algorithm: MD5WITHRSA
algorithm: SHA1WITHRSA
algorithm: SHA224WITHRSA
algorithm: SHA256WITHRSA
algorithm: SHA384WITHRSA
algorithm: SHA512WITHRSA
algorithm: BKS
algorithm: BouncyCastle
algorithm: PKCS12
algorithm: PKIX
algorithm: PKIX
algorithm: Collection
provider: Crypto
algorithm: SHA1PRNG
provider: HarmonyJSSE
algorithm: PKIX
algorithm: PKIX
algorithm: AndroidCAStore
provider: AndroidKeyStore
algorithm: AndroidKeyStore
algorithm: RSA
A: A list for 6.0.0 (M) Emulator
provider: AndroidKeyStoreBCWorkaround
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: AES/ECB/NoPadding
algorithm: AES/ECB/PKCS7Padding
algorithm: AES/CBC/NoPadding
algorithm: AES/CBC/PKCS7Padding
algorithm: AES/CTR/NoPadding
algorithm: AES/GCM/NoPadding
algorithm: RSA/ECB/NoPadding
algorithm: RSA/ECB/PKCS1Padding
algorithm: RSA/ECB/OAEPPadding
algorithm: RSA/ECB/OAEPWithSHA-1AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-224AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-256AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-384AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-512AndMGF1Padding
algorithm: NONEwithRSA
algorithm: MD5withRSA
algorithm: SHA1withRSA
algorithm: SHA224withRSA
algorithm: SHA256withRSA
algorithm: SHA384withRSA
algorithm: SHA512withRSA
algorithm: SHA1withRSA/PSS
algorithm: SHA224withRSA/PSS
algorithm: SHA256withRSA/PSS
algorithm: SHA384withRSA/PSS
algorithm: SHA512withRSA/PSS
algorithm: NONEwithECDSA
algorithm: ECDSA
algorithm: SHA224withECDSA
algorithm: SHA256withECDSA
algorithm: SHA384withECDSA
algorithm: SHA512withECDSA
provider: AndroidOpenSSL
algorithm: SSL
algorithm: SSLv3
algorithm: TLS
algorithm: TLSv1
algorithm: TLSv1.1
algorithm: TLSv1.2
algorithm: Default
algorithm: SHA-1
algorithm: SHA-224
algorithm: SHA-256
algorithm: SHA-384
algorithm: SHA-512
algorithm: MD5
algorithm: RSA
algorithm: EC
algorithm: RSA
algorithm: EC
algorithm: ECDH
algorithm: MD5WithRSA
algorithm: SHA1WithRSA
algorithm: SHA224WithRSA
algorithm: SHA256WithRSA
algorithm: SHA384WithRSA
algorithm: SHA512WithRSA
algorithm: NONEwithRSA
algorithm: ECDSA
algorithm: SHA224withECDSA
algorithm: SHA256withECDSA
algorithm: SHA384withECDSA
algorithm: SHA512withECDSA
algorithm: SHA1PRNG
algorithm: RSA/ECB/NoPadding
algorithm: RSA/ECB/PKCS1Padding
algorithm: AES/ECB/NoPadding
algorithm: AES/ECB/PKCS5Padding
algorithm: AES/CBC/NoPadding
algorithm: AES/CBC/PKCS5Padding
algorithm: AES/CTR/NoPadding
algorithm: DESEDE/CBC/NoPadding
algorithm: DESEDE/CBC/PKCS5Padding
algorithm: ARC4
algorithm: AES/GCM/NoPadding
algorithm: HmacMD5
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: X509
provider: BC
algorithm: MD5
algorithm: HMACMD5
algorithm: HMACMD5
algorithm: SHA-1
algorithm: HMACSHA1
algorithm: HMACSHA1
algorithm: PBEWITHHMACSHA
algorithm: PBEWITHHMACSHA1
algorithm: PBEWITHHMACSHA1
algorithm: PBKDF2WithHmacSHA1
algorithm: PBKDF2WithHmacSHA1And8BIT
algorithm: SHA-224
algorithm: HMACSHA224
algorithm: HMACSHA224
algorithm: SHA-256
algorithm: HMACSHA256
algorithm: HMACSHA256
algorithm: SHA-384
algorithm: HMACSHA384
algorithm: HMACSHA384
algorithm: SHA-512
algorithm: HMACSHA512
algorithm: HMACSHA512
algorithm: PKCS12PBE
algorithm: AES
algorithm: GCM
algorithm: AES
algorithm: AESWRAP
algorithm: AES/GCM/NOPADDING
algorithm: AES
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: ARC4
algorithm: ARC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: DESEDE
algorithm: DESEDEWRAP
algorithm: DESEDE
algorithm: DESEDE
algorithm: DESEDE
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: X.509
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: SHA1withDSA
algorithm: NONEWITHDSA
algorithm: SHA224WITHDSA
algorithm: SHA256WITHDSA
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: ECDH
algorithm: EC
algorithm: EC
algorithm: ECDSA
algorithm: NONEwithECDSA
algorithm: SHA224WITHECDSA
algorithm: SHA256WITHECDSA
algorithm: SHA384WITHECDSA
algorithm: SHA512WITHECDSA
algorithm: OAEP
algorithm: RSA
algorithm: RSA
algorithm: RSA
algorithm: MD5WITHRSA
algorithm: SHA1WITHRSA
algorithm: SHA224WITHRSA
algorithm: SHA256WITHRSA
algorithm: SHA384WITHRSA
algorithm: SHA512WITHRSA
algorithm: BKS
algorithm: BouncyCastle
algorithm: PKCS12
algorithm: PKIX
algorithm: PKIX
algorithm: Collection
provider: Crypto
algorithm: SHA1PRNG
provider: HarmonyJSSE
algorithm: PKIX
algorithm: PKIX
algorithm: AndroidCAStore
provider: AndroidKeyStore
algorithm: AndroidKeyStore
algorithm: EC
algorithm: RSA
algorithm: EC
algorithm: RSA
algorithm: AES
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: AES
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
A: Android 4.3.1, API 18
04-03 19:29:58.544 CRYPTO: provider: AndroidOpenSSL
04-03 19:29:58.544 CRYPTO: algorithm: SSL
04-03 19:29:58.544 CRYPTO: algorithm: SSLv3
04-03 19:29:58.544 CRYPTO: algorithm: TLS
04-03 19:29:58.544 CRYPTO: algorithm: TLSv1
04-03 19:29:58.544 CRYPTO: algorithm: TLSv1.1
04-03 19:29:58.544 CRYPTO: algorithm: TLSv1.2
04-03 19:29:58.554 CRYPTO: algorithm: Default
04-03 19:29:58.554 CRYPTO: algorithm: SHA-1
04-03 19:29:58.554 CRYPTO: algorithm: SHA-256
04-03 19:29:58.554 CRYPTO: algorithm: SHA-384
04-03 19:29:58.554 CRYPTO: algorithm: SHA-512
04-03 19:29:58.554 CRYPTO: algorithm: MD5
04-03 19:29:58.554 CRYPTO: algorithm: RSA
04-03 19:29:58.554 CRYPTO: algorithm: DSA
04-03 19:29:58.554 CRYPTO: algorithm: EC
04-03 19:29:58.554 CRYPTO: algorithm: RSA
04-03 19:29:58.554 CRYPTO: algorithm: DSA
04-03 19:29:58.554 CRYPTO: algorithm: EC
04-03 19:29:58.554 CRYPTO: algorithm: ECDH
04-03 19:29:58.554 CRYPTO: algorithm: MD5WithRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA1WithRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA256WithRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA384WithRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA512WithRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA1withDSA
04-03 19:29:58.554 CRYPTO: algorithm: NONEwithRSA
04-03 19:29:58.554 CRYPTO: algorithm: ECDSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA256withECDSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA384withECDSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA512withECDSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA1PRNG
04-03 19:29:58.554 CRYPTO: algorithm: RSA/ECB/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: RSA/ECB/PKCS1Padding
04-03 19:29:58.554 CRYPTO: algorithm: AES/ECB/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: AES/ECB/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: AES/CBC/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: AES/CBC/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: AES/CFB/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: AES/CFB/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: AES/CTR/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: AES/CTR/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: AES/OFB/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: AES/OFB/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/CBC/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/CBC/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/CFB/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/CFB/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/ECB/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/ECB/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/OFB/NoPadding
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE/OFB/PKCS5Padding
04-03 19:29:58.554 CRYPTO: algorithm: ARC4
04-03 19:29:58.554 CRYPTO: algorithm: HmacMD5
04-03 19:29:58.554 CRYPTO: algorithm: HmacSHA1
04-03 19:29:58.554 CRYPTO: algorithm: HmacSHA256
04-03 19:29:58.554 CRYPTO: algorithm: HmacSHA384
04-03 19:29:58.554 CRYPTO: algorithm: HmacSHA512
04-03 19:29:58.554 CRYPTO: algorithm: X509
04-03 19:29:58.554 CRYPTO: provider: DRLCertFactory
04-03 19:29:58.554 CRYPTO: algorithm: X509
04-03 19:29:58.554 CRYPTO: provider: BC
04-03 19:29:58.554 CRYPTO: algorithm: MD5
04-03 19:29:58.554 CRYPTO: algorithm: HMACMD5
04-03 19:29:58.554 CRYPTO: algorithm: HMACMD5
04-03 19:29:58.554 CRYPTO: algorithm: SHA-1
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA1
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA1
04-03 19:29:58.554 CRYPTO: algorithm: SHA-256
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA256
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA256
04-03 19:29:58.554 CRYPTO: algorithm: SHA-384
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA384
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA384
04-03 19:29:58.554 CRYPTO: algorithm: SHA-512
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA512
04-03 19:29:58.554 CRYPTO: algorithm: HMACSHA512
04-03 19:29:58.554 CRYPTO: algorithm: AES
04-03 19:29:58.554 CRYPTO: algorithm: AES
04-03 19:29:58.554 CRYPTO: algorithm: AESWRAP
04-03 19:29:58.554 CRYPTO: algorithm: AES
04-03 19:29:58.554 CRYPTO: algorithm: ARC4
04-03 19:29:58.554 CRYPTO: algorithm: ARC4
04-03 19:29:58.554 CRYPTO: algorithm: BLOWFISH
04-03 19:29:58.554 CRYPTO: algorithm: BLOWFISH
04-03 19:29:58.554 CRYPTO: algorithm: BLOWFISH
04-03 19:29:58.554 CRYPTO: algorithm: DES
04-03 19:29:58.554 CRYPTO: algorithm: DES
04-03 19:29:58.554 CRYPTO: algorithm: DES
04-03 19:29:58.554 CRYPTO: algorithm: DES
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE
04-03 19:29:58.554 CRYPTO: algorithm: DESEDEWRAP
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE
04-03 19:29:58.554 CRYPTO: algorithm: DESEDE
04-03 19:29:58.554 CRYPTO: algorithm: X.509
04-03 19:29:58.554 CRYPTO: algorithm: DSA
04-03 19:29:58.554 CRYPTO: algorithm: DSA
04-03 19:29:58.554 CRYPTO: algorithm: DSA
04-03 19:29:58.554 CRYPTO: algorithm: DSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA1withDSA
04-03 19:29:58.554 CRYPTO: algorithm: NONEWITHDSA
04-03 19:29:58.554 CRYPTO: algorithm: DH
04-03 19:29:58.554 CRYPTO: algorithm: DH
04-03 19:29:58.554 CRYPTO: algorithm: DH
04-03 19:29:58.554 CRYPTO: algorithm: DH
04-03 19:29:58.554 CRYPTO: algorithm: DH
04-03 19:29:58.554 CRYPTO: algorithm: ECDH
04-03 19:29:58.554 CRYPTO: algorithm: EC
04-03 19:29:58.554 CRYPTO: algorithm: EC
04-03 19:29:58.554 CRYPTO: algorithm: ECDSA
04-03 19:29:58.554 CRYPTO: algorithm: NONEwithECDSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA256WITHECDSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA384WITHECDSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA512WITHECDSA
04-03 19:29:58.554 CRYPTO: algorithm: OAEP
04-03 19:29:58.554 CRYPTO: algorithm: RSA
04-03 19:29:58.554 CRYPTO: algorithm: RSA
04-03 19:29:58.554 CRYPTO: algorithm: RSA
04-03 19:29:58.554 CRYPTO: algorithm: MD5WITHRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA1WITHRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA256WITHRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA384WITHRSA
04-03 19:29:58.554 CRYPTO: algorithm: SHA512WITHRSA
04-03 19:29:58.554 CRYPTO: algorithm: BKS
04-03 19:29:58.554 CRYPTO: algorithm: BouncyCastle
04-03 19:29:58.554 CRYPTO: algorithm: PKCS12
04-03 19:29:58.554 CRYPTO: algorithm: PKCS12PBE
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5ANDDES
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5ANDRC2
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA1ANDDES
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA1ANDRC2
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND128BITRC2-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND40BITRC2-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND128BITRC4
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND40BITRC4
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND128BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND192BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND256BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAANDTWOFISH-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5ANDDES
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5ANDRC2
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA1ANDDES
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA1ANDRC2
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND128BITRC4
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND40BITRC4
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND128BITRC2-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND40BITRC2-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAANDTWOFISH-CBC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHHMACSHA1
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND128BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND192BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHAAND256BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
04-03 19:29:58.554 CRYPTO: algorithm: PBKDF2WithHmacSHA1
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHHMACSHA
04-03 19:29:58.554 CRYPTO: algorithm: PBEWITHHMACSHA1
04-03 19:29:58.554 CRYPTO: algorithm: PKIX
04-03 19:29:58.554 CRYPTO: algorithm: PKIX
04-03 19:29:58.554 CRYPTO: algorithm: Collection
04-03 19:29:58.554 CRYPTO: provider: Crypto
04-03 19:29:58.554 CRYPTO: algorithm: SHA-1
04-03 19:29:58.554 CRYPTO: algorithm: SHA1PRNG
04-03 19:29:58.554 CRYPTO: algorithm: SHA1withDSA
04-03 19:29:58.554 CRYPTO: algorithm: DSA
04-03 19:29:58.554 CRYPTO: provider: HarmonyJSSE
04-03 19:29:58.554 CRYPTO: algorithm: SSL
04-03 19:29:58.554 CRYPTO: algorithm: SSLv3
04-03 19:29:58.554 CRYPTO: algorithm: TLS
04-03 19:29:58.554 CRYPTO: algorithm: TLSv1
04-03 19:29:58.554 CRYPTO: algorithm: PKIX
04-03 19:29:58.554 CRYPTO: algorithm: PKIX
04-03 19:29:58.554 CRYPTO: algorithm: AndroidCAStore
04-03 19:29:58.554 CRYPTO: provider: AndroidKeyStore
04-03 19:29:58.554 CRYPTO: algorithm: AndroidKeyStore
04-03 19:29:58.554 CRYPTO: algorithm: RSA
A: Here is an update for Android 5.1.1 (Nexus 5 Stock).
I/CRYPTO ( 1949): provider: AndroidOpenSSL
I/CRYPTO ( 1949): algorithm: SSL
I/CRYPTO ( 1949): algorithm: SSLv3
I/CRYPTO ( 1949): algorithm: TLS
I/CRYPTO ( 1949): algorithm: TLSv1
I/CRYPTO ( 1949): algorithm: TLSv1.1
I/CRYPTO ( 1949): algorithm: TLSv1.2
I/CRYPTO ( 1949): algorithm: Default
I/CRYPTO ( 1949): algorithm: SHA-1
I/CRYPTO ( 1949): algorithm: SHA-224
I/CRYPTO ( 1949): algorithm: SHA-256
I/CRYPTO ( 1949): algorithm: SHA-384
I/CRYPTO ( 1949): algorithm: SHA-512
I/CRYPTO ( 1949): algorithm: MD5
I/CRYPTO ( 1949): algorithm: RSA
I/CRYPTO ( 1949): algorithm: DH
I/CRYPTO ( 1949): algorithm: DSA
I/CRYPTO ( 1949): algorithm: EC
I/CRYPTO ( 1949): algorithm: RSA
I/CRYPTO ( 1949): algorithm: DH
I/CRYPTO ( 1949): algorithm: DSA
I/CRYPTO ( 1949): algorithm: EC
I/CRYPTO ( 1949): algorithm: ECDH
I/CRYPTO ( 1949): algorithm: MD5WithRSA
I/CRYPTO ( 1949): algorithm: SHA1WithRSA
I/CRYPTO ( 1949): algorithm: SHA224WithRSA
I/CRYPTO ( 1949): algorithm: SHA256WithRSA
I/CRYPTO ( 1949): algorithm: SHA384WithRSA
I/CRYPTO ( 1949): algorithm: SHA512WithRSA
I/CRYPTO ( 1949): algorithm: SHA1withDSA
I/CRYPTO ( 1949): algorithm: NONEwithRSA
I/CRYPTO ( 1949): algorithm: ECDSA
I/CRYPTO ( 1949): algorithm: SHA224withECDSA
I/CRYPTO ( 1949): algorithm: SHA256withECDSA
I/CRYPTO ( 1949): algorithm: SHA384withECDSA
I/CRYPTO ( 1949): algorithm: SHA512withECDSA
I/CRYPTO ( 1949): algorithm: SHA1PRNG
I/CRYPTO ( 1949): algorithm: RSA/ECB/NoPadding
I/CRYPTO ( 1949): algorithm: RSA/ECB/PKCS1Padding
I/CRYPTO ( 1949): algorithm: AES/ECB/NoPadding
I/CRYPTO ( 1949): algorithm: AES/ECB/PKCS5Padding
I/CRYPTO ( 1949): algorithm: AES/CBC/NoPadding
I/CRYPTO ( 1949): algorithm: AES/CBC/PKCS5Padding
I/CRYPTO ( 1949): algorithm: AES/CFB/NoPadding
I/CRYPTO ( 1949): algorithm: AES/CTR/NoPadding
I/CRYPTO ( 1949): algorithm: AES/OFB/NoPadding
I/CRYPTO ( 1949): algorithm: DESEDE/ECB/NoPadding
I/CRYPTO ( 1949): algorithm: DESEDE/ECB/PKCS5Padding
I/CRYPTO ( 1949): algorithm: DESEDE/CBC/NoPadding
I/CRYPTO ( 1949): algorithm: DESEDE/CBC/PKCS5Padding
I/CRYPTO ( 1949): algorithm: DESEDE/CFB/NoPadding
I/CRYPTO ( 1949): algorithm: DESEDE/OFB/NoPadding
I/CRYPTO ( 1949): algorithm: ARC4
I/CRYPTO ( 1949): algorithm: HmacMD5
I/CRYPTO ( 1949): algorithm: HmacSHA1
I/CRYPTO ( 1949): algorithm: HmacSHA224
I/CRYPTO ( 1949): algorithm: HmacSHA256
I/CRYPTO ( 1949): algorithm: HmacSHA384
I/CRYPTO ( 1949): algorithm: HmacSHA512
I/CRYPTO ( 1949): algorithm: X509
I/CRYPTO ( 1949): provider: BC
I/CRYPTO ( 1949): algorithm: MD5
I/CRYPTO ( 1949): algorithm: HMACMD5
I/CRYPTO ( 1949): algorithm: HMACMD5
I/CRYPTO ( 1949): algorithm: SHA-1
I/CRYPTO ( 1949): algorithm: HMACSHA1
I/CRYPTO ( 1949): algorithm: HMACSHA1
I/CRYPTO ( 1949): algorithm: PBEWITHHMACSHA
I/CRYPTO ( 1949): algorithm: PBEWITHHMACSHA1
I/CRYPTO ( 1949): algorithm: PBEWITHHMACSHA1
I/CRYPTO ( 1949): algorithm: PBKDF2WithHmacSHA1
I/CRYPTO ( 1949): algorithm: PBKDF2WithHmacSHA1And8BIT
I/CRYPTO ( 1949): algorithm: SHA-224
I/CRYPTO ( 1949): algorithm: HMACSHA224
I/CRYPTO ( 1949): algorithm: HMACSHA224
I/CRYPTO ( 1949): algorithm: SHA-256
I/CRYPTO ( 1949): algorithm: HMACSHA256
I/CRYPTO ( 1949): algorithm: HMACSHA256
I/CRYPTO ( 1949): algorithm: SHA-384
I/CRYPTO ( 1949): algorithm: HMACSHA384
I/CRYPTO ( 1949): algorithm: HMACSHA384
I/CRYPTO ( 1949): algorithm: SHA-512
I/CRYPTO ( 1949): algorithm: HMACSHA512
I/CRYPTO ( 1949): algorithm: HMACSHA512
I/CRYPTO ( 1949): algorithm: PKCS12PBE
I/CRYPTO ( 1949): algorithm: AES
I/CRYPTO ( 1949): algorithm: GCM
I/CRYPTO ( 1949): algorithm: AES
I/CRYPTO ( 1949): algorithm: AESWRAP
I/CRYPTO ( 1949): algorithm: GCM
I/CRYPTO ( 1949): algorithm: AES
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND128BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND192BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND256BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
I/CRYPTO ( 1949): algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
I/CRYPTO ( 1949): algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
I/CRYPTO ( 1949): algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
I/CRYPTO ( 1949): algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
I/CRYPTO ( 1949): algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND128BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND192BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND256BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
I/CRYPTO ( 1949): algorithm: ARC4
I/CRYPTO ( 1949): algorithm: ARC4
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND128BITRC4
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND40BITRC4
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND128BITRC4
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND40BITRC4
I/CRYPTO ( 1949): algorithm: BLOWFISH
I/CRYPTO ( 1949): algorithm: BLOWFISH
I/CRYPTO ( 1949): algorithm: BLOWFISH
I/CRYPTO ( 1949): algorithm: DES
I/CRYPTO ( 1949): algorithm: DES
I/CRYPTO ( 1949): algorithm: DES
I/CRYPTO ( 1949): algorithm: DES
I/CRYPTO ( 1949): algorithm: PBEWITHMD5ANDDES
I/CRYPTO ( 1949): algorithm: PBEWITHSHA1ANDDES
I/CRYPTO ( 1949): algorithm: PBEWITHMD5ANDDES
I/CRYPTO ( 1949): algorithm: PBEWITHSHA1ANDDES
I/CRYPTO ( 1949): algorithm: DESEDE
I/CRYPTO ( 1949): algorithm: DESEDEWRAP
I/CRYPTO ( 1949): algorithm: DESEDE
I/CRYPTO ( 1949): algorithm: DESEDE
I/CRYPTO ( 1949): algorithm: DESEDE
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHMD5ANDRC2
I/CRYPTO ( 1949): algorithm: PBEWITHSHA1ANDRC2
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND128BITRC2-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND40BITRC2-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHMD5ANDRC2
I/CRYPTO ( 1949): algorithm: PBEWITHSHA1ANDRC2
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND128BITRC2-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAAND40BITRC2-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAANDTWOFISH-CBC
I/CRYPTO ( 1949): algorithm: PBEWITHSHAANDTWOFISH-CBC
I/CRYPTO ( 1949): algorithm: X.509
I/CRYPTO ( 1949): algorithm: DSA
I/CRYPTO ( 1949): algorithm: DSA
I/CRYPTO ( 1949): algorithm: DSA
I/CRYPTO ( 1949): algorithm: DSA
I/CRYPTO ( 1949): algorithm: SHA1withDSA
I/CRYPTO ( 1949): algorithm: NONEWITHDSA
I/CRYPTO ( 1949): algorithm: SHA224WITHDSA
I/CRYPTO ( 1949): algorithm: SHA256WITHDSA
I/CRYPTO ( 1949): algorithm: DH
I/CRYPTO ( 1949): algorithm: DH
I/CRYPTO ( 1949): algorithm: DH
I/CRYPTO ( 1949): algorithm: DH
I/CRYPTO ( 1949): algorithm: DH
I/CRYPTO ( 1949): algorithm: ECDH
I/CRYPTO ( 1949): algorithm: EC
I/CRYPTO ( 1949): algorithm: EC
I/CRYPTO ( 1949): algorithm: ECDSA
I/CRYPTO ( 1949): algorithm: NONEwithECDSA
I/CRYPTO ( 1949): algorithm: SHA224WITHECDSA
I/CRYPTO ( 1949): algorithm: SHA256WITHECDSA
I/CRYPTO ( 1949): algorithm: SHA384WITHECDSA
I/CRYPTO ( 1949): algorithm: SHA512WITHECDSA
I/CRYPTO ( 1949): algorithm: OAEP
I/CRYPTO ( 1949): algorithm: RSA
I/CRYPTO ( 1949): algorithm: RSA
I/CRYPTO ( 1949): algorithm: RSA
I/CRYPTO ( 1949): algorithm: MD5WITHRSA
I/CRYPTO ( 1949): algorithm: SHA1WITHRSA
I/CRYPTO ( 1949): algorithm: SHA224WITHRSA
I/CRYPTO ( 1949): algorithm: SHA256WITHRSA
I/CRYPTO ( 1949): algorithm: SHA384WITHRSA
I/CRYPTO ( 1949): algorithm: SHA512WITHRSA
I/CRYPTO ( 1949): algorithm: BKS
I/CRYPTO ( 1949): algorithm: BouncyCastle
I/CRYPTO ( 1949): algorithm: PKCS12
I/CRYPTO ( 1949): algorithm: PKIX
I/CRYPTO ( 1949): algorithm: PKIX
I/CRYPTO ( 1949): algorithm: Collection
I/CRYPTO ( 1949): provider: Crypto
I/CRYPTO ( 1949): algorithm: SHA1PRNG
I/CRYPTO ( 1949): provider: HarmonyJSSE
I/CRYPTO ( 1949): algorithm: PKIX
I/CRYPTO ( 1949): algorithm: PKIX
I/CRYPTO ( 1949): algorithm: AndroidCAStore
I/CRYPTO ( 1949): provider: AndroidKeyStore
I/CRYPTO ( 1949): algorithm: AndroidKeyStore
I/CRYPTO ( 1949): algorithm: RSA
A: A list for 7.0.0 (N) Emulator
provider: AndroidNSSP
algorithm: PKIX
provider: AndroidOpenSSL
algorithm: SSL
algorithm: SSLv3
algorithm: TLS
algorithm: TLSv1
algorithm: TLSv1.1
algorithm: TLSv1.2
algorithm: Default
algorithm: SHA-1
algorithm: SHA-224
algorithm: SHA-256
algorithm: SHA-384
algorithm: SHA-512
algorithm: MD5
algorithm: RSA
algorithm: EC
algorithm: RSA
algorithm: EC
algorithm: ECDH
algorithm: MD5WithRSA
algorithm: SHA1WithRSA
algorithm: SHA224WithRSA
algorithm: SHA256WithRSA
algorithm: SHA384WithRSA
algorithm: SHA512WithRSA
algorithm: NONEwithRSA
algorithm: SHA1withECDSA
algorithm: SHA224withECDSA
algorithm: SHA256withECDSA
algorithm: SHA384withECDSA
algorithm: SHA512withECDSA
algorithm: SHA1withRSA/PSS
algorithm: SHA224withRSA/PSS
algorithm: SHA256withRSA/PSS
algorithm: SHA384withRSA/PSS
algorithm: SHA512withRSA/PSS
algorithm: SHA1PRNG
algorithm: RSA/ECB/NoPadding
algorithm: RSA/ECB/PKCS1Padding
algorithm: AES/ECB/NoPadding
algorithm: AES/ECB/PKCS5Padding
algorithm: AES/CBC/NoPadding
algorithm: AES/CBC/PKCS5Padding
algorithm: AES/CTR/NoPadding
algorithm: DESEDE/CBC/NoPadding
algorithm: DESEDE/CBC/PKCS5Padding
algorithm: ARC4
algorithm: AES/GCM/NoPadding
algorithm: HmacMD5
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: X509
provider: CertPathProvider
algorithm: PKIX
algorithm: PKIX
provider: AndroidKeyStoreBCWorkaround
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: AES/ECB/NoPadding
algorithm: AES/ECB/PKCS7Padding
algorithm: AES/CBC/NoPadding
algorithm: AES/CBC/PKCS7Padding
algorithm: AES/CTR/NoPadding
algorithm: AES/GCM/NoPadding
algorithm: RSA/ECB/NoPadding
algorithm: RSA/ECB/PKCS1Padding
algorithm: RSA/ECB/OAEPPadding
algorithm: RSA/ECB/OAEPWithSHA-1AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-224AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-256AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-384AndMGF1Padding
algorithm: RSA/ECB/OAEPWithSHA-512AndMGF1Padding
algorithm: NONEwithRSA
algorithm: MD5withRSA
algorithm: SHA1withRSA
algorithm: SHA224withRSA
algorithm: SHA256withRSA
algorithm: SHA384withRSA
algorithm: SHA512withRSA
algorithm: SHA1withRSA/PSS
algorithm: SHA224withRSA/PSS
algorithm: SHA256withRSA/PSS
algorithm: SHA384withRSA/PSS
algorithm: SHA512withRSA/PSS
algorithm: NONEwithECDSA
algorithm: SHA1withECDSA
algorithm: SHA224withECDSA
algorithm: SHA256withECDSA
algorithm: SHA384withECDSA
algorithm: SHA512withECDSA
provider: BC
algorithm: MD5
algorithm: HMACMD5
algorithm: HMACMD5
algorithm: SHA-1
algorithm: HMACSHA1
algorithm: HMACSHA1
algorithm: PBEWITHHMACSHA
algorithm: PBEWITHHMACSHA1
algorithm: PBEWITHHMACSHA1
algorithm: PBKDF2WithHmacSHA1
algorithm: PBKDF2WithHmacSHA1And8BIT
algorithm: SHA-224
algorithm: HMACSHA224
algorithm: HMACSHA224
algorithm: SHA-256
algorithm: HMACSHA256
algorithm: HMACSHA256
algorithm: SHA-384
algorithm: HMACSHA384
algorithm: HMACSHA384
algorithm: SHA-512
algorithm: HMACSHA512
algorithm: HMACSHA512
algorithm: PKCS12PBE
algorithm: AES
algorithm: GCM
algorithm: AES
algorithm: AESWRAP
algorithm: AES/GCM/NOPADDING
algorithm: AES
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
algorithm: PBEWITHSHAAND128BITAES-CBC-BC
algorithm: PBEWITHSHAAND192BITAES-CBC-BC
algorithm: PBEWITHSHAAND256BITAES-CBC-BC
algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
algorithm: ARC4
algorithm: ARC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: PBEWITHSHAAND128BITRC4
algorithm: PBEWITHSHAAND40BITRC4
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: BLOWFISH
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: DES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: PBEWITHMD5ANDDES
algorithm: PBEWITHSHA1ANDDES
algorithm: DESEDE
algorithm: DESEDEWRAP
algorithm: DESEDE
algorithm: DESEDE
algorithm: DESEDE
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHMD5ANDRC2
algorithm: PBEWITHSHA1ANDRC2
algorithm: PBEWITHSHAAND128BITRC2-CBC
algorithm: PBEWITHSHAAND40BITRC2-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: PBEWITHSHAANDTWOFISH-CBC
algorithm: X.509
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: DSA
algorithm: SHA1withDSA
algorithm: NONEWITHDSA
algorithm: SHA224WITHDSA
algorithm: SHA256WITHDSA
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: DH
algorithm: ECDH
algorithm: EC
algorithm: EC
algorithm: SHA1withECDSA
algorithm: NONEwithECDSA
algorithm: SHA224WITHECDSA
algorithm: SHA256WITHECDSA
algorithm: SHA384WITHECDSA
algorithm: SHA512WITHECDSA
algorithm: OAEP
algorithm: PSS
algorithm: RSA
algorithm: RSA
algorithm: RSA
algorithm: MD5WITHRSA
algorithm: SHA1WITHRSA
algorithm: SHA224WITHRSA
algorithm: SHA256WITHRSA
algorithm: SHA384WITHRSA
algorithm: SHA512WITHRSA
algorithm: BKS
algorithm: BouncyCastle
algorithm: PKCS12
algorithm: PKIX
algorithm: PKIX
algorithm: Collection
provider: HarmonyJSSE
algorithm: PKIX
algorithm: PKIX
algorithm: AndroidCAStore
provider: AndroidKeyStore
algorithm: AndroidKeyStore
algorithm: EC
algorithm: RSA
algorithm: EC
algorithm: RSA
algorithm: AES
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
algorithm: AES
algorithm: HmacSHA1
algorithm: HmacSHA224
algorithm: HmacSHA256
algorithm: HmacSHA384
algorithm: HmacSHA512
A: Android 7.1.1
I/CRYPTO: provider: AndroidNSSP
E/CRYPTO: algorithm: PKIX
I/CRYPTO: provider: AndroidOpenSSL
E/CRYPTO: algorithm: SSL
E/CRYPTO: algorithm: SSLv3
E/CRYPTO: algorithm: TLS
E/CRYPTO: algorithm: TLSv1
E/CRYPTO: algorithm: TLSv1.1
E/CRYPTO: algorithm: TLSv1.2
E/CRYPTO: algorithm: Default
E/CRYPTO: algorithm: SHA-1
E/CRYPTO: algorithm: SHA-224
E/CRYPTO: algorithm: SHA-256
E/CRYPTO: algorithm: SHA-384
E/CRYPTO: algorithm: SHA-512
E/CRYPTO: algorithm: MD5
E/CRYPTO: algorithm: RSA
E/CRYPTO: algorithm: EC
E/CRYPTO: algorithm: RSA
E/CRYPTO: algorithm: EC
E/CRYPTO: algorithm: ECDH
E/CRYPTO: algorithm: MD5WithRSA
E/CRYPTO: algorithm: SHA1WithRSA
E/CRYPTO: algorithm: SHA224WithRSA
E/CRYPTO: algorithm: SHA256WithRSA
E/CRYPTO: algorithm: SHA384WithRSA
E/CRYPTO: algorithm: SHA512WithRSA
E/CRYPTO: algorithm: NONEwithRSA
E/CRYPTO: algorithm: SHA1withECDSA
E/CRYPTO: algorithm: SHA224withECDSA
E/CRYPTO: algorithm: SHA256withECDSA
E/CRYPTO: algorithm: SHA384withECDSA
E/CRYPTO: algorithm: SHA512withECDSA
E/CRYPTO: algorithm: SHA1withRSA/PSS
E/CRYPTO: algorithm: SHA224withRSA/PSS
E/CRYPTO: algorithm: SHA256withRSA/PSS
E/CRYPTO: algorithm: SHA384withRSA/PSS
E/CRYPTO: algorithm: SHA512withRSA/PSS
E/CRYPTO: algorithm: SHA1PRNG
E/CRYPTO: algorithm: RSA/ECB/NoPadding
E/CRYPTO: algorithm: RSA/ECB/PKCS1Padding
E/CRYPTO: algorithm: AES/ECB/NoPadding
E/CRYPTO: algorithm: AES/ECB/PKCS5Padding
E/CRYPTO: algorithm: AES/CBC/NoPadding
E/CRYPTO: algorithm: AES/CBC/PKCS5Padding
E/CRYPTO: algorithm: AES/CTR/NoPadding
E/CRYPTO: algorithm: DESEDE/CBC/NoPadding
E/CRYPTO: algorithm: DESEDE/CBC/PKCS5Padding
E/CRYPTO: algorithm: ARC4
E/CRYPTO: algorithm: AES/GCM/NoPadding
E/CRYPTO: algorithm: HmacMD5
E/CRYPTO: algorithm: HmacSHA1
E/CRYPTO: algorithm: HmacSHA224
E/CRYPTO: algorithm: HmacSHA256
E/CRYPTO: algorithm: HmacSHA384
E/CRYPTO: algorithm: HmacSHA512
E/CRYPTO: algorithm: X509
I/CRYPTO: provider: CertPathProvider
E/CRYPTO: algorithm: PKIX
E/CRYPTO: algorithm: PKIX
I/CRYPTO: provider: AndroidKeyStoreBCWorkaround
E/CRYPTO: algorithm: HmacSHA1
E/CRYPTO: algorithm: HmacSHA224
E/CRYPTO: algorithm: HmacSHA256
E/CRYPTO: algorithm: HmacSHA384
E/CRYPTO: algorithm: HmacSHA512
E/CRYPTO: algorithm: AES/ECB/NoPadding
E/CRYPTO: algorithm: AES/ECB/PKCS7Padding
E/CRYPTO: algorithm: AES/CBC/NoPadding
E/CRYPTO: algorithm: AES/CBC/PKCS7Padding
E/CRYPTO: algorithm: AES/CTR/NoPadding
E/CRYPTO: algorithm: AES/GCM/NoPadding
E/CRYPTO: algorithm: RSA/ECB/NoPadding
E/CRYPTO: algorithm: RSA/ECB/PKCS1Padding
E/CRYPTO: algorithm: RSA/ECB/OAEPPadding
E/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-1AndMGF1Padding
E/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-224AndMGF1Padding
E/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-256AndMGF1Padding
E/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-384AndMGF1Padding
E/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-512AndMGF1Padding
E/CRYPTO: algorithm: NONEwithRSA
E/CRYPTO: algorithm: MD5withRSA
E/CRYPTO: algorithm: SHA1withRSA
E/CRYPTO: algorithm: SHA224withRSA
E/CRYPTO: algorithm: SHA256withRSA
E/CRYPTO: algorithm: SHA384withRSA
E/CRYPTO: algorithm: SHA512withRSA
E/CRYPTO: algorithm: SHA1withRSA/PSS
E/CRYPTO: algorithm: SHA224withRSA/PSS
E/CRYPTO: algorithm: SHA256withRSA/PSS
E/CRYPTO: algorithm: SHA384withRSA/PSS
E/CRYPTO: algorithm: SHA512withRSA/PSS
E/CRYPTO: algorithm: NONEwithECDSA
E/CRYPTO: algorithm: SHA1withECDSA
E/CRYPTO: algorithm: SHA224withECDSA
E/CRYPTO: algorithm: SHA256withECDSA
E/CRYPTO: algorithm: SHA384withECDSA
E/CRYPTO: algorithm: SHA512withECDSA
I/CRYPTO: provider: BC
E/CRYPTO: algorithm: MD5
E/CRYPTO: algorithm: HMACMD5
E/CRYPTO: algorithm: HMACMD5
E/CRYPTO: algorithm: SHA-1
E/CRYPTO: algorithm: HMACSHA1
E/CRYPTO: algorithm: HMACSHA1
E/CRYPTO: algorithm: PBEWITHHMACSHA
E/CRYPTO: algorithm: PBEWITHHMACSHA1
E/CRYPTO: algorithm: PBEWITHHMACSHA1
E/CRYPTO: algorithm: PBKDF2WithHmacSHA1
E/CRYPTO: algorithm: PBKDF2WithHmacSHA1And8BIT
E/CRYPTO: algorithm: SHA-224
E/CRYPTO: algorithm: HMACSHA224
E/CRYPTO: algorithm: HMACSHA224
E/CRYPTO: algorithm: SHA-256
E/CRYPTO: algorithm: HMACSHA256
E/CRYPTO: algorithm: HMACSHA256
E/CRYPTO: algorithm: SHA-384
E/CRYPTO: algorithm: HMACSHA384
E/CRYPTO: algorithm: HMACSHA384
E/CRYPTO: algorithm: SHA-512
E/CRYPTO: algorithm: HMACSHA512
E/CRYPTO: algorithm: HMACSHA512
E/CRYPTO: algorithm: PKCS12PBE
E/CRYPTO: algorithm: AES
E/CRYPTO: algorithm: GCM
E/CRYPTO: algorithm: AES
E/CRYPTO: algorithm: AESWRAP
E/CRYPTO: algorithm: AES/GCM/NOPADDING
E/CRYPTO: algorithm: AES
E/CRYPTO: algorithm: PBEWITHSHAAND128BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHAAND192BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHAAND256BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
E/CRYPTO: algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
E/CRYPTO: algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
E/CRYPTO: algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
0 E/CRYPTO: algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
E/CRYPTO: algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
E/CRYPTO: algorithm: PBEWITHSHAAND128BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHAAND192BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHAAND256BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
E/CRYPTO: algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
E/CRYPTO: algorithm: ARC4
E/CRYPTO: algorithm: ARC4
E/CRYPTO: algorithm: PBEWITHSHAAND128BITRC4
E/CRYPTO: algorithm: PBEWITHSHAAND40BITRC4
E/CRYPTO: algorithm: PBEWITHSHAAND128BITRC4
E/CRYPTO: algorithm: PBEWITHSHAAND40BITRC4
E/CRYPTO: algorithm: BLOWFISH
E/CRYPTO: algorithm: BLOWFISH
E/CRYPTO: algorithm: BLOWFISH
E/CRYPTO: algorithm: DES
E/CRYPTO: algorithm: DES
E/CRYPTO: algorithm: DES
E/CRYPTO: algorithm: DES
E/CRYPTO: algorithm: PBEWITHMD5ANDDES
E/CRYPTO: algorithm: PBEWITHSHA1ANDDES
E/CRYPTO: algorithm: PBEWITHMD5ANDDES
E/CRYPTO: algorithm: PBEWITHSHA1ANDDES
E/CRYPTO: algorithm: DESEDE
E/CRYPTO: algorithm: DESEDEWRAP
E/CRYPTO: algorithm: DESEDE
E/CRYPTO: algorithm: DESEDE
E/CRYPTO: algorithm: DESEDE
E/CRYPTO: algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
E/CRYPTO: algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
E/CRYPTO: algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
E/CRYPTO: algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
E/CRYPTO: algorithm: PBEWITHMD5ANDRC2
E/CRYPTO: algorithm: PBEWITHSHA1ANDRC2
E/CRYPTO: algorithm: PBEWITHSHAAND128BITRC2-CBC
E/CRYPTO: algorithm: PBEWITHSHAAND40BITRC2-CBC
E/CRYPTO: algorithm: PBEWITHMD5ANDRC2
E/CRYPTO: algorithm: PBEWITHSHA1ANDRC2
E/CRYPTO: algorithm: PBEWITHSHAAND128BITRC2-CBC
E/CRYPTO: algorithm: PBEWITHSHAAND40BITRC2-CBC
E/CRYPTO: algorithm: PBEWITHSHAANDTWOFISH-CBC
E/CRYPTO: algorithm: PBEWITHSHAANDTWOFISH-CBC
E/CRYPTO: algorithm: X.509
E/CRYPTO: algorithm: DSA
E/CRYPTO: algorithm: DSA
E/CRYPTO: algorithm: DSA
E/CRYPTO: algorithm: DSA
E/CRYPTO: algorithm: SHA1withDSA
E/CRYPTO: algorithm: NONEWITHDSA
E/CRYPTO: algorithm: SHA224WITHDSA
E/CRYPTO: algorithm: SHA256WITHDSA
E/CRYPTO: algorithm: DH
E/CRYPTO: algorithm: DH
E/CRYPTO: algorithm: DH
E/CRYPTO: algorithm: DH
E/CRYPTO: algorithm: DH
E/CRYPTO: algorithm: ECDH
E/CRYPTO: algorithm: EC
E/CRYPTO: algorithm: EC
E/CRYPTO: algorithm: SHA1withECDSA
E/CRYPTO: algorithm: NONEwithECDSA
E/CRYPTO: algorithm: SHA224WITHECDSA
E/CRYPTO: algorithm: SHA256WITHECDSA
E/CRYPTO: algorithm: SHA384WITHECDSA
E/CRYPTO: algorithm: SHA512WITHECDSA
E/CRYPTO: algorithm: OAEP
E/CRYPTO: algorithm: PSS
E/CRYPTO: algorithm: RSA
E/CRYPTO: algorithm: RSA
E/CRYPTO: algorithm: RSA
E/CRYPTO: algorithm: MD5WITHRSA
E/CRYPTO: algorithm: SHA1WITHRSA
E/CRYPTO: algorithm: SHA224WITHRSA
E/CRYPTO: algorithm: SHA256WITHRSA
E/CRYPTO: algorithm: SHA384WITHRSA
E/CRYPTO: algorithm: SHA512WITHRSA
E/CRYPTO: algorithm: BKS
E/CRYPTO: algorithm: BouncyCastle
E/CRYPTO: algorithm: PKCS12
E/CRYPTO: algorithm: PKIX
E/CRYPTO: algorithm: PKIX
E/CRYPTO: algorithm: Collection
I/CRYPTO: provider: HarmonyJSSE
E/CRYPTO: algorithm: PKIX
E/CRYPTO: algorithm: PKIX
E/CRYPTO: algorithm: AndroidCAStore
I/CRYPTO: provider: AndroidKeyStore
E/CRYPTO: algorithm: AndroidKeyStore
E/CRYPTO: algorithm: EC
E/CRYPTO: algorithm: RSA
E/CRYPTO: algorithm: EC
E/CRYPTO: algorithm: RSA
E/CRYPTO: algorithm: AES
E/CRYPTO: algorithm: HmacSHA1
E/CRYPTO: algorithm: HmacSHA224
E/CRYPTO: algorithm: HmacSHA256
E/CRYPTO: algorithm: HmacSHA384
E/CRYPTO: algorithm: HmacSHA512
E/CRYPTO: algorithm: AES
E/CRYPTO: algorithm: HmacSHA1
E/CRYPTO: algorithm: HmacSHA224
E/CRYPTO: algorithm: HmacSHA256
E/CRYPTO: algorithm: HmacSHA384
E/CRYPTO: algorithm: HmacSHA512
A: Android 8.0.0
I/CRYPTO: provider: AndroidNSSP
I/CRYPTO: algorithm: PKIX
I/CRYPTO: provider: AndroidOpenSSL
I/CRYPTO: algorithm: SSL
I/CRYPTO: algorithm: TLS
I/CRYPTO: algorithm: TLSv1
I/CRYPTO: algorithm: TLSv1.1
I/CRYPTO: algorithm: TLSv1.2
I/CRYPTO: algorithm: Default
I/CRYPTO: algorithm: SHA-1
I/CRYPTO: algorithm: SHA-224
I/CRYPTO: algorithm: SHA-256
I/CRYPTO: algorithm: SHA-384
I/CRYPTO: algorithm: SHA-512
I/CRYPTO: algorithm: MD5
I/CRYPTO: algorithm: RSA
I/CRYPTO: algorithm: EC
I/CRYPTO: algorithm: RSA
I/CRYPTO: algorithm: EC
I/CRYPTO: algorithm: ECDH
I/CRYPTO: algorithm: MD5WithRSA
I/CRYPTO: algorithm: SHA1WithRSA
I/CRYPTO: algorithm: SHA224WithRSA
I/CRYPTO: algorithm: SHA256WithRSA
I/CRYPTO: algorithm: SHA384WithRSA
I/CRYPTO: algorithm: SHA512WithRSA
I/CRYPTO: algorithm: NONEwithRSA
I/CRYPTO: algorithm: SHA1withECDSA
I/CRYPTO: algorithm: SHA224withECDSA
I/CRYPTO: algorithm: SHA256withECDSA
I/CRYPTO: algorithm: SHA384withECDSA
I/CRYPTO: algorithm: SHA512withECDSA
I/CRYPTO: algorithm: SHA1withRSA/PSS
I/CRYPTO: algorithm: SHA224withRSA/PSS
I/CRYPTO: algorithm: SHA256withRSA/PSS
I/CRYPTO: algorithm: SHA384withRSA/PSS
I/CRYPTO: algorithm: SHA512withRSA/PSS
I/CRYPTO: algorithm: SHA1PRNG
I/CRYPTO: algorithm: RSA/ECB/NoPadding
I/CRYPTO: algorithm: RSA/ECB/PKCS1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPPadding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-1AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-224AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-256AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-384AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-512AndMGF1Padding
I/CRYPTO: algorithm: AES/ECB/NoPadding
I/CRYPTO: algorithm: AES/ECB/PKCS5Padding
I/CRYPTO: algorithm: AES/CBC/NoPadding
I/CRYPTO: algorithm: AES/CBC/PKCS5Padding
I/CRYPTO: algorithm: AES/CTR/NoPadding
I/CRYPTO: algorithm: AES_128/ECB/NoPadding
I/CRYPTO: algorithm: AES_128/ECB/PKCS5Padding
I/CRYPTO: algorithm: AES_128/CBC/NoPadding
I/CRYPTO: algorithm: AES_128/CBC/PKCS5Padding
I/CRYPTO: algorithm: AES_256/ECB/NoPadding
I/CRYPTO: algorithm: AES_256/ECB/PKCS5Padding
I/CRYPTO: algorithm: AES_256/CBC/NoPadding
I/CRYPTO: algorithm: AES_256/CBC/PKCS5Padding
I/CRYPTO: algorithm: DESEDE/CBC/NoPadding
I/CRYPTO: algorithm: DESEDE/CBC/PKCS5Padding
I/CRYPTO: algorithm: ARC4
I/CRYPTO: algorithm: AES/GCM/NoPadding
I/CRYPTO: algorithm: AES_128/GCM/NoPadding
I/CRYPTO: algorithm: AES_256/GCM/NoPadding
I/CRYPTO: algorithm: HmacMD5
I/CRYPTO: algorithm: HmacSHA1
I/CRYPTO: algorithm: HmacSHA224
I/CRYPTO: algorithm: HmacSHA256
I/CRYPTO: algorithm: HmacSHA384
I/CRYPTO: algorithm: HmacSHA512
I/CRYPTO: algorithm: X509
I/CRYPTO: provider: CertPathProvider
I/CRYPTO: algorithm: PKIX
I/CRYPTO: algorithm: PKIX
I/CRYPTO: provider: AndroidKeyStoreBCWorkaround
I/CRYPTO: algorithm: HmacSHA1
I/CRYPTO: algorithm: HmacSHA224
I/CRYPTO: algorithm: HmacSHA256
I/CRYPTO: algorithm: HmacSHA384
I/CRYPTO: algorithm: HmacSHA512
I/CRYPTO: algorithm: AES/ECB/NoPadding
I/CRYPTO: algorithm: AES/ECB/PKCS7Padding
I/CRYPTO: algorithm: AES/CBC/NoPadding
I/CRYPTO: algorithm: AES/CBC/PKCS7Padding
I/CRYPTO: algorithm: AES/CTR/NoPadding
I/CRYPTO: algorithm: AES/GCM/NoPadding
I/CRYPTO: algorithm: RSA/ECB/NoPadding
I/CRYPTO: algorithm: RSA/ECB/PKCS1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPPadding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-1AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-224AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-256AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-384AndMGF1Padding
I/CRYPTO: algorithm: RSA/ECB/OAEPWithSHA-512AndMGF1Padding
I/CRYPTO: algorithm: NONEwithRSA
I/CRYPTO: algorithm: MD5withRSA
I/CRYPTO: algorithm: SHA1withRSA
I/CRYPTO: algorithm: SHA224withRSA
I/CRYPTO: algorithm: SHA256withRSA
I/CRYPTO: algorithm: SHA384withRSA
I/CRYPTO: algorithm: SHA512withRSA
I/CRYPTO: algorithm: SHA1withRSA/PSS
I/CRYPTO: algorithm: SHA224withRSA/PSS
I/CRYPTO: algorithm: SHA256withRSA/PSS
I/CRYPTO: algorithm: SHA384withRSA/PSS
I/CRYPTO: algorithm: SHA512withRSA/PSS
I/CRYPTO: algorithm: NONEwithECDSA
I/CRYPTO: algorithm: SHA1withECDSA
I/CRYPTO: algorithm: SHA224withECDSA
I/CRYPTO: algorithm: SHA256withECDSA
I/CRYPTO: algorithm: SHA384withECDSA
I/CRYPTO: algorithm: SHA512withECDSA
I/CRYPTO: provider: BC
I/CRYPTO: algorithm: MD5
I/CRYPTO: algorithm: HMACMD5
I/CRYPTO: algorithm: HMACMD5
I/CRYPTO: algorithm: SHA-1
I/CRYPTO: algorithm: HMACSHA1
I/CRYPTO: algorithm: HMACSHA1
I/CRYPTO: algorithm: PBEWITHHMACSHA
I/CRYPTO: algorithm: PBEWITHHMACSHA1
I/CRYPTO: algorithm: PBEWITHHMACSHA1
I/CRYPTO: algorithm: SHA-224
I/CRYPTO: algorithm: PBEWITHHMACSHA224
I/CRYPTO: algorithm: HMACSHA224
I/CRYPTO: algorithm: HMACSHA224
I/CRYPTO: algorithm: SHA-256
I/CRYPTO: algorithm: PBEWITHHMACSHA256
I/CRYPTO: algorithm: HMACSHA256
I/CRYPTO: algorithm: HMACSHA256
I/CRYPTO: algorithm: SHA-384
I/CRYPTO: algorithm: PBEWITHHMACSHA384
I/CRYPTO: algorithm: HMACSHA384
I/CRYPTO: algorithm: HMACSHA384
I/CRYPTO: algorithm: SHA-512
I/CRYPTO: algorithm: PBEWITHHMACSHA512
I/CRYPTO: algorithm: HMACSHA512
I/CRYPTO: algorithm: HMACSHA512
I/CRYPTO: algorithm: PBKDF2WithHmacSHA1
I/CRYPTO: algorithm: PBKDF2WithHmacSHA1And8BIT
I/CRYPTO: algorithm: PBKDF2WithHmacSHA224
I/CRYPTO: algorithm: PBKDF2WithHmacSHA256
I/CRYPTO: algorithm: PBKDF2WithHmacSHA384
I/CRYPTO: algorithm: PBKDF2WithHmacSHA512
I/CRYPTO: algorithm: PBEWithHmacSHA1AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA224AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA256AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA384AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA512AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA1AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA224AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA256AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA384AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA512AndAES_256
I/CRYPTO: algorithm: PKCS12PBE
I/CRYPTO: algorithm: PBEWithHmacSHA1AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA224AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA256AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA384AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA512AndAES_128
I/CRYPTO: algorithm: PBEWithHmacSHA1AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA224AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA256AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA384AndAES_256
I/CRYPTO: algorithm: PBEWithHmacSHA512AndAES_256
I/CRYPTO: algorithm: AES
I/CRYPTO: algorithm: GCM
I/CRYPTO: algorithm: AES
I/CRYPTO: algorithm: AESWRAP
I/CRYPTO: algorithm: AES/GCM/NOPADDING
I/CRYPTO: algorithm: AES
I/CRYPTO: algorithm: PBEWITHSHAAND128BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHAAND192BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHAAND256BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
I/CRYPTO: algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
I/CRYPTO: algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
I/CRYPTO: algorithm: PBEWITHMD5AND128BITAES-CBC-OPENSSL
I/CRYPTO: algorithm: PBEWITHMD5AND192BITAES-CBC-OPENSSL
I/CRYPTO: algorithm: PBEWITHMD5AND256BITAES-CBC-OPENSSL
I/CRYPTO: algorithm: PBEWITHSHAAND128BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHAAND192BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHAAND256BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHA256AND128BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHA256AND192BITAES-CBC-BC
I/CRYPTO: algorithm: PBEWITHSHA256AND256BITAES-CBC-BC
I/CRYPTO: algorithm: ARC4
I/CRYPTO: algorithm: ARC4
I/CRYPTO: algorithm: PBEWITHSHAAND128BITRC4
I/CRYPTO: algorithm: PBEWITHSHAAND40BITRC4
I/CRYPTO: algorithm: PBEWITHSHAAND128BITRC4
I/CRYPTO: algorithm: PBEWITHSHAAND40BITRC4
I/CRYPTO: algorithm: BLOWFISH
I/CRYPTO: algorithm: BLOWFISH
I/CRYPTO: algorithm: DES
I/CRYPTO: algorithm: DES
I/CRYPTO: algorithm: PBEWITHMD5ANDDES
I/CRYPTO: algorithm: PBEWITHSHA1ANDDES
I/CRYPTO: algorithm: PBEWITHMD5ANDDES
I/CRYPTO: algorithm: PBEWITHSHA1ANDDES
I/CRYPTO: algorithm: DESEDE
I/CRYPTO: algorithm: DESEDEWRAP
I/CRYPTO: algorithm: DESEDE
I/CRYPTO: algorithm: DESEDE
I/CRYPTO: algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
I/CRYPTO: algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
I/CRYPTO: algorithm: PBEWITHSHAAND3-KEYTRIPLEDES-CBC
I/CRYPTO: algorithm: PBEWITHSHAAND2-KEYTRIPLEDES-CBC
I/CRYPTO: algorithm: PBEWITHMD5ANDRC2
I/CRYPTO: algorithm: PBEWITHSHA1ANDRC2
I/CRYPTO: algorithm: PBEWITHSHAAND128BITRC2-CBC
I/CRYPTO: algorithm: PBEWITHSHAAND40BITRC2-CBC
I/CRYPTO: algorithm: PBEWITHMD5ANDRC2
I/CRYPTO: algorithm: PBEWITHSHA1ANDRC2
I/CRYPTO: algorithm: PBEWITHSHAAND128BITRC2-CBC
I/CRYPTO: algorithm: PBEWITHSHAAND40BITRC2-CBC
I/CRYPTO: algorithm: PBEWITHSHAANDTWOFISH-CBC
I/CRYPTO: algorithm: PBEWITHSHAANDTWOFISH-CBC
I/CRYPTO: algorithm: X.509
I/CRYPTO: algorithm: DSA
I/CRYPTO: algorithm: DSA
I/CRYPTO: algorithm: SHA1withDSA
I/CRYPTO: algorithm: NONEWITHDSA
I/CRYPTO: algorithm: SHA224WITHDSA
I/CRYPTO: algorithm: SHA256WITHDSA
I/CRYPTO: algorithm: DH
I/CRYPTO: algorithm: DH
I/CRYPTO: algorithm: EC
I/CRYPTO: algorithm: ECDH
I/CRYPTO: algorithm: EC
I/CRYPTO: algorithm: EC
I/CRYPTO: algorithm: SHA1withECDSA
I/CRYPTO: algorithm: NONEwithECDSA
I/CRYPTO: algorithm: SHA224WITHECDSA
I/CRYPTO: algorithm: SHA256WITHECDSA
I/CRYPTO: algorithm: SHA384WITHECDSA
I/CRYPTO: algorithm: SHA512WITHECDSA
I/CRYPTO: algorithm: OAEP
I/CRYPTO: algorithm: PSS
I/CRYPTO: algorithm: RSA
I/CRYPTO: algorithm: RSA
I/CRYPTO: algorithm: MD5WITHRSA
I/CRYPTO: algorithm: SHA1WITHRSA
I/CRYPTO: algorithm: SHA224WITHRSA
I/CRYPTO: algorithm: SHA256WITHRSA
I/CRYPTO: algorithm: SHA384WITHRSA
I/CRYPTO: algorithm: SHA512WITHRSA
I/CRYPTO: algorithm: BKS
I/CRYPTO: algorithm: BouncyCastle
I/CRYPTO: algorithm: PKCS12
I/CRYPTO: algorithm: PKIX
I/CRYPTO: algorithm: PKIX
I/CRYPTO: algorithm: Collection
I/CRYPTO: provider: HarmonyJSSE
I/CRYPTO: algorithm: PKIX
I/CRYPTO: algorithm: PKIX
I/CRYPTO: algorithm: AndroidCAStore
I/CRYPTO: provider: AndroidKeyStore
I/CRYPTO: algorithm: AndroidKeyStore
I/CRYPTO: algorithm: EC
I/CRYPTO: algorithm: RSA
I/CRYPTO: algorithm: EC
I/CRYPTO: algorithm: RSA
I/CRYPTO: algorithm: AES
I/CRYPTO: algorithm: HmacSHA1
I/CRYPTO: algorithm: HmacSHA224
I/CRYPTO: algorithm: HmacSHA256
I/CRYPTO: algorithm: HmacSHA384
I/CRYPTO: algorithm: HmacSHA512
I/CRYPTO: algorithm: AES
I/CRYPTO: algorithm: HmacSHA1
I/CRYPTO: algorithm: HmacSHA224
I/CRYPTO: algorithm: HmacSHA256
I/CRYPTO: algorithm: HmacSHA384
I/CRYPTO: algorithm: HmacSHA512
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560974",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "35"
}
|
Q: IE8 not POSTing data after 307 redirect from ASP.NET I'm (re)writing a RESTful resource scheduler app using ASP.NET 3.5/SQL Server as the backend, and jQuery/Backbone.js as the front. In ASP.NET, I'm using WCF services, with RouteTable routes to route requests to the appropriate WCF class. In my Global.asax file, I have:
System.Web.Routing.RouteTable.Routes.Add(
new System.ServiceModel.Activation.ServiceRoute(
"events", factory, typeof( Scheduler.Events ) ) );
In App_Code, my IEvents.cs has this:
[WebInvoke( Method = "POST", ResponseFormat = WebMessageFormat.Json,
UriTemplate = "",
BodyStyle = WebMessageBodyStyle.WrappedRequest )]
SchedulerEvent SaveNewEvent ( SchedulerEvent schedulerEvent );
And Events.cs has the SaveNewEvent function does all the magic.
Because of the routing, the server returns a 307 response for POSTs to /events. Chrome, Safari, and Firefox all do what's expected, which is rePOST the request to the new location and then process the response. IE8 (which is all I've tested, but it's all we run here) gets the 307, but issues a GET to the new URL which doesn't do me any good because no data is POSTed and saved. I know this because I used Fiddler to track the requests from IE, and when I debug the server-side code, SaveNewEvent is never called.
Interestingly, PUT and DELETE requests from IE work fine.
I find it hard to believe that PUT and DELETE would work, but POSTs wouldn't. Am I missing something? I can't find any info on IE8 that suggests this is broken. Is there a way to have ASP.NET route by issuing a 302 redirect? And would that work?
Any experiences, insights, suggestions, or ideas are appreciated.
A: While the RFC states that 302 should always ask the user, most browsers implement it as 303 See Other and accordingly GET on the LOCATION. While this isn't strictly HTTP 1.1, you can't do anything about it and need to work with the behaviour of the browsers. I encountered the same problem and needed to work around it as well.
A: After giving the problem some space, I came back to it and found out that the 307 Temporary Redirect wasn't being caused by the ServiceRoutes, but by how my services were being accessed in the Javascript. I was missing the trailing slash in my service URLs. D'oh:
EVENTS_URL: "/events"
should have been
EVENTS_URL: "/events/"
No more redirect, POSTs work great.
Unrelated to my problem, but related to WCF services, while getting to the bottom of this, I came across these two pages which helped me clean up my WCF code. FYI:
http://geekswithblogs.net/michelotti/archive/2010/08/21/restful-wcf-services-with-no-svc-file-and-no-config.aspx
404 when running .net 4 WCF service on IIS (no svc file)
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560975",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Converting date format sql I am taking information from one database with the datetime string formatted like this
2011-08-25 13:53:22.607
and would like to format it to look like
8/25/2011 01:53:22 PM
Please suggest a way for me to do this.
A: in Sql Server try:
DECLARE @YourDatetime datetime
SELECT @YourDateTime='2011-08-25 13:53:22.607'
SELECT
CONVERT(varchar(2),month(@YourDateTime))+'/'+CONVERT(varchar(2),day(@YourDateTime))+'/'+CONVERT(varchar(4),year(@YourDateTime)) --date remove leading zeros
+' '+RIGHT('0'+LTRIM(LEFT(RIGHT(convert(varchar(50),@YourDateTime,109),14),8)),8) --amp/pm time format keep leading zeros
+' '+RIGHT(convert(varchar(50),@YourDateTime,109),2) --am or pm
output:
----------------------
8/25/2011 01:53:22 PM
(1 row(s) affected)
A: There is a good article on date formatting in SQL Server here: http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/
It was written with SQL Server 2005 in mind but the information is still relevant.
A: There is no native m/d/yyyy style. You can get close (leading 0s on month and day, no leading 0 on hour) with this:
DECLARE @d DATETIME = '2011-08-25 13:53:22.607';
SELECT CONVERT(CHAR(10), @d, 101) + ' '
+ LTRIM(RIGHT(CONVERT(VARCHAR(25), @d, 22), 12));
You can do a lot more work to manipulate the strings to get exactly the format you're after, but for now I'd suggest doing that formatting in the application/presentation tier instead of arm-wrestling SQL Server into doing it.
In Denali you will be able to use FORMAT() with much more control and less ugly string manipulation (a.k.a. manual labor), e.g.
SELECT FORMAT(@d, 'M/d/yyyy hh:mm:ss tt');
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560976",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
}
|
Q: CGContextDrawImage is EXTREMELY slow after large UIImage drawn into it It seems that CGContextDrawImage(CGContextRef, CGRect, CGImageRef) performs MUCH WORSE when drawing a CGImage that was created by CoreGraphics (i.e. with CGBitmapContextCreateImage) than it does when drawing the CGImage which backs a UIImage. See this testing method:
-(void)showStrangePerformanceOfCGContextDrawImage
{
///Setup : Load an image and start a context:
UIImage *theImage = [UIImage imageNamed:@"reallyBigImage.png"];
UIGraphicsBeginImageContext(theImage.size);
CGContextRef ctxt = UIGraphicsGetCurrentContext();
CGRect imgRec = CGRectMake(0, 0, theImage.size.width, theImage.size.height);
///Why is this SO MUCH faster...
NSDate * startingTimeForUIImageDrawing = [NSDate date];
CGContextDrawImage(ctxt, imgRec, theImage.CGImage); //Draw existing image into context Using the UIImage backing
NSLog(@"Time was %f", [[NSDate date] timeIntervalSinceDate:startingTimeForUIImageDrawing]);
/// Create a new image from the context to use this time in CGContextDrawImage:
CGImageRef theImageConverted = CGBitmapContextCreateImage(ctxt);
///This is WAY slower but why?? Using a pure CGImageRef (ass opposed to one behind a UIImage) seems like it should be faster but AT LEAST it should be the same speed!?
NSDate * startingTimeForNakedGImageDrawing = [NSDate date];
CGContextDrawImage(ctxt, imgRec, theImageConverted);
NSLog(@"Time was %f", [[NSDate date] timeIntervalSinceDate:startingTimeForNakedGImageDrawing]);
}
So I guess the question is, #1 what may be causing this and #2 is there a way around it, i.e. other ways to create a CGImageRef which may be faster? I realize I could convert everything to UIImages first but that is such an ugly solution. I already have the CGContextRef sitting there.
UPDATE : This seems to not necessarily be true when drawing small images? That may be a clue- that this problem is amplified when large images (i.e. fullsize camera pics) are used. 640x480 seems to be pretty similar in terms of execution time with either method
UPDATE 2 : Ok, so I've discovered something new.. Its actually NOT the backing of the CGImage that is changing the performance. I can flip-flop the order of the 2 steps and make the UIImage method behave slowly, whereas the "naked" CGImage will be super fast. It seems whichever you perform second will suffer from terrible performance. This seems to be the case UNLESS I free memory by calling CGImageRelease on the image I created with CGBitmapContextCreateImage. Then the UIImage backed method will be fast subsequently. The inverse it not true. What gives? "Crowded" memory shouldn't affect performance like this, should it?
UPDATE 3 : Spoke too soon. The previous update holds true for images at size 2048x2048 but stepping up to 1936x2592 (camera size) the naked CGImage method is still way slower, regardless of order of operations or memory situation. Maybe there are some CG internal limits that make a 16MB image efficient whereas the 21MB image can't be handled efficiently. Its literally 20 times slower to draw the camera size than a 2048x2048. Somehow UIImage provides its CGImage data much faster than a pure CGImage object does. o.O
UPDATE 4 : I thought this might have to do with some memory caching thing, but the results are the same whether the UIImage is loaded with the non-caching [UIImage imageWithContentsOfFile] as if [UIImage imageNamed] is used.
UPDATE 5 (Day 2) : After creating mroe questions than were answered yesterday I have something solid today. What I can say for sure is the following:
*
*The CGImages behind a UIImage don't use alpha. (kCGImageAlphaNoneSkipLast). I thought that maybe they were faster to be drawn because my context WAS using alpha. So I changed the context to use kCGImageAlphaNoneSkipLast. This makes the drawing MUCH faster, UNLESS:
*Drawing into a CGContextRef with a UIImage FIRST, makes ALL subsequent image drawing slow
I proved this by 1)first creating a non-alpha context (1936x2592). 2) Filled it with randomly colored 2x2 squares. 3) Full frame drawing a CGImage into that context was FAST (.17 seconds) 4) Repeated experiment but filled context with a drawn CGImage backing a UIImage. Subsequent full frame image drawing was 6+ seconds. SLOWWWWW.
Somehow drawing into a context with a (Large) UIImage drastically slows all subsequent drawing into that context.
A: Well after a TON of experimentation I think I have found the fastest way to handle situations like this. The drawing operation above which was taking 6+ seconds now .1 seconds. YES. Here's what I discovered:
*
*Homogenize your contexts & images with a pixel format! The root of the question I asked boiled down to the fact that the CGImages inside a UIImage were using THE SAME PIXEL FORMAT as my context. Therefore fast. The CGImages were a different format and therefore slow. Inspect your images with CGImageGetAlphaInfo to see which pixel format they use. I'm using kCGImageAlphaNoneSkipLast EVERYWHERE now as I don't need to work with alpha. If you don't use the same pixel format everywhere, when drawing an image into a context Quartz will be forced to perform expensive pixel-conversions for EACH pixel. = SLOW
*USE CGLayers! These make offscreen-drawing performance much better. How this works is basically as follows. 1) create a CGLayer from the context using CGLayerCreateWithContext. 2) do any drawing/setting of drawing properties on THIS LAYER's CONTEXT which is gotten with CGLayerGetContext. READ any pixels or information from the ORIGINAL context. 3) When done, "stamp" this CGLayer back onto the original context using CGContextDrawLayerAtPoint.This is FAST as long as you keep in mind:
*1) Release any CGImages created from a context (i.e. those created with CGBitmapContextCreateImage) BEFORE "stamping" your layer back into the CGContextRef using CGContextDrawLayerAtPoint. This creates a 3-4x speed increase when drawing that layer. 2) Keep your pixel format the same everywhere!! 3) Clean up CG objects AS SOON as you can. Things hanging around in memory seem to create strange situations of slowdown, probably because there are callbacks or checks associated with these strong references. Just a guess, but I can say that CLEANING UP MEMORY ASAP helps performance immensely.
A: I had a similar problem. My application has to redraw a picture almost as large as the screen size. The problem came down to drawing as fast as possible two images of the same resolution, neither rotated nor flipped, but scaled and positioned in different places of the screen each time. After all, I was able to get ~15-20 FPS on iPad 1 and ~20-25 FPS on iPad4. So... hope this helps someone:
*
*Exactly as typewriter said, you have to use the same pixel format. Using one with AlphaNone gives a speed boost. But even more important, argb32_image call in my case did numerous calls converting pixels from ARGB to BGRA. So the best bitmapInfo value for me was (at the time; there is a probability that Apple can change something here in the future):
const CGBitmabInfo g_bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipLast;
*CGContextDrawImage may work faster if rectangle argument was made integral (by CGRectIntegral). Seems to have more effect when image is scaled by factor close to 1.
*Using layers actually slowed down things for me. Probably something was changed since 2011 in some internal calls.
*Setting interpolation quality for the context lower than default (by CGContextSetInterpolationQuality) is important. I would recommend using (IS_RETINA_DISPLAY ? kCGInterpolationNone : kCGInterpolationLow). Macros IS_RETINA_DISPLAY is taken from here.
*Make sure you get CGColorSpaceRef from CGColorSpaceCreateDeviceRGB() or the like when creating context. Some performance issues were reported for getting fixed color space instead of requesting that of the device.
*Inheriting view class from UIImageView and simply setting self.image to the image created from context proved useful to me. However, read about using UIImageView first if you want to do this, for it requires some changes in code logic (because drawRect: isn't called anymore).
*And if you can avoid scaling your image at the time of actual drawing, try to do so. Drawing non-scaled image is significantly faster - unfortunately, for me that was not an option.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560979",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "33"
}
|
Q: Type of objects inside non-parameterized arrays in JSON I am trying to write simple function that converts Json strings into Objects.
The language I am using is objective-c however this question discusses issues doesn't relate to this lang.
My question is, How to know the Type of Objects that laid inside a json array that is to be mapped into non-parameterized (a.k.a non-generic) lists??
I found two Json Java libraries unable to solve this issue, Jakson and Gson and here's the example:
import java.io.Serializable;
import java.util.List;
import com.google.gson.Gson;
public class Main
{
public static void main(String[] args) throws Exception
{
Gson g = new Gson();
Office o = g.fromJson(
"{\"empx\":\"1\",\"emps\":[{\"firstName\":\"Muhammad\",\"lastName\":\"Abdullah\"},{\"firstName\":\"XX\",\"lastName\":null}]}"
, Office.class);
System.out.println(((Employee)o.getEmps().get(0)).getFirstName());
}
}
class Office
{
private List emps;
private String empx;
public String getEmpx()
{
return empx;
}
public void setEmpx(String empx)
{
this.empx = empx;
}
public List getEmps()
{
return emps;
}
public void setEmps(List emps)
{
this.emps = emps;
}
}
class Employee implements Serializable
{
private static final long serialVersionUID = 1L;
String firstName;
String lastName;
public String getFirstName()
{
return firstName;
}
public String getLastName()
{
return lastName;
}
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
public void setLastName(String lastName)
{
this.lastName = lastName;
}
}
In Google Gson they considered this array's objects as objects of type java.lang.Object:
Exception in thread "main" java.lang.ClassCastException: java.lang.Object
But Jaskon was much smarter, it considered this unknown object to be a Map:
Exception in thread "main" java.lang.ClassCastException: java.util.LinkedHashMap
However, Both have been failed to detect the Object (which I think is impossible!)
So, In a language that doesn't support Parameterized types (Generics), Is n't any way to accomplish this?
A: I would suggest using dictionaries. The key keys could infer the types or there could be a type key.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560989",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
}
|
Q: JBOSS 7 - Spring ContextLoaderListener ClassNotFoundException im trying to migrate my JBOSS 5.1 application to JBOSS 7.0.2. In admin console i select deployments -> add content and my .war and try to enable it.
I already resolved some problems, but cant figure out this one: (in short, in long at the end)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.ZaprogsProject.war:main" from Servic
e Module Loader]
I copied to JBOSS7\standalone\lib\ the following files:
spring-aop-3.0.5.RELEASE.jar
spring-asm-3.0.5.RELEASE.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-context-support-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-expression-3.0.5.RELEASE.jar
spring-jdbc-3.0.5.RELEASE.jar
spring-orm-3.0.5.RELEASE.jar
spring-test-3.0.5.RELEASE.jar
spring-tx-3.0.5.RELEASE.jar
spring-web-3.0.5.RELEASE.jar
spring-webmvc-3.0.5.RELEASE.jar
I have read this: https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7 (Debug and resolve ClassNotFoundExceptions and NoClassDefFoundErrors) but cant find a solution for me and still getting the same error. Can anyone help?
22:19:12,091 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."ZaprogsProject.war".INSTALL: o
rg.jboss.msc.service.StartException in service jboss.deployment.unit."ZaprogsProject.war".INSTALL: Failed to process phase INSTALL of deployment "ZaprogsProject
.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0]
at java.lang.Thread.run(Thread.java:722) [:1.7.0]
Caused by: java.lang.RuntimeException: Failed to load class org.springframework.web.context.ContextLoaderListener
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:141)
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:122)
at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)
at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)
at org.jboss.as.ee.component.ComponentDescription.createConfiguration(ComponentDescription.java:153)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:70)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.ZaprogsProject.war:main" from Servic
e Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
at java.lang.Class.forName0(Native Method) [:1.7.0]
at java.lang.Class.forName(Class.java:264) [:1.7.0]
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:139)
... 11 more
A: JBoss AS 7 does class-loading in a diff way.
All classes in the WAR are loaded with the same class loader. This means classes packaged in the WEB-INF/lib are treated the same as classes in WEB-INF/classes.
Hence it works for you.
But as you have said correctly your WEB-INF/lib is bloated.This would not be the correct way.
You would need to make a module :
Goto modules folder, make folder structure with main folder and put your jar and modules.xml with entries in it.
Something like :
<main-class name="org.jboss.msc.Version"/>
<resources>
<resource-root path="jboss-msc-1.0.1.GA.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.modules"/>
<!-- Optional deps -->
<module name="javax.inject.api" optional="true"/>
<module name="org.jboss.threads" optional="true"/>
<module name="org.jboss.vfs" optional="true"/>
</dependencies>
You would also need to update MANIFEST as well.
Details are here :
https://docs.jboss.org/author/display/MODULES/Module+descriptors
A: I would not put those JARs in that directory. Try them in your WAR file's WEB-INF/lib. The class loader will find them there.
You need to understand that all Java EE app servers use a hierarchy of class loaders: bootstrap, server, application. JBoss wasn't finding that class when it needed to.
A: There is a major change Jboss 7 when compared to previous versions.If you want to access any libraries outside your war file, it should be installed as module.
Check https://docs.jboss.org/author/display/MODULES/Introduction
In this case you should install Spring as module and specify the name of the module as dependency in your application's manifest file(check Manifest module information)
A: In case the issue started occurring all of a sudden(just like in my case), deleting the application (MyApp) physically from #JBOSS_HOME#\standalone\deployments\ MyApp.war worked for me.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560990",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: Deadlock Prevention(Java+MySQL) i have an sql class that connects to the database and updates the information from my game server. I was wondering if anything here would cause a deadlock and what are good ways to prevent deadlocks. I am new to alot of things so any tips would be great :)
package server.util;
import java.sql.*;
import java.security.MessageDigest;
import server.model.players.Client;
public class SQL {
public static Connection con = null;
public static Statement stmt;
public static boolean connectionMade;
public static void createConnection() {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql://URL/DATABASE", "USERNAME", "PASS");
stmt = con.createStatement();
} catch (Exception e) {
e.printStackTrace();
}
}
public static ResultSet query(String s) throws SQLException {
try {
if (s.toLowerCase().startsWith("select")) {
ResultSet rs = stmt.executeQuery(s);
return rs;
} else {
stmt.executeUpdate(s);
}
return null;
} catch (Exception e) {
destroyConnection();
createConnection();
e.printStackTrace();
}
return null;
}
public static void destroyConnection() {
try {
stmt.close();
con.close();
connectionMade = false;
} catch (Exception e) {
e.printStackTrace();
}
}
public static boolean saveHighScore(Client clientToSave) {
try {
query("DELETE FROM `skills` WHERE playerName = '"+clientToSave.playerName+"';");
query("DELETE FROM `skillsoverall` WHERE playerName = '"+clientToSave.playerName+"';");
//query("DELETE FROM `scores` WHERE playerName = '"+clientToSave.playerName+"';");
query("INSERT INTO `skills` (`playerName`,`Attacklvl`,`Attackxp`,`Defencelvl`,`Defencexp`,`Strengthlvl`,`Strengthxp`,`Hitpointslvl`,`Hitpointsxp`,`Rangelvl`,`Rangexp`,`Prayerlvl`,`Prayerxp`,`Magiclvl`,`Magicxp`,`Cookinglvl`,`Cookingxp`,`Woodcuttinglvl`,`Woodcuttingxp`,`Fletchinglvl`,`Fletchingxp`,`Fishinglvl`,`Fishingxp`,`Firemakinglvl`,`Firemakingxp`,`Craftinglvl`,`Craftingxp`,`Smithinglvl`,`Smithingxp`,`Mininglvl`,`Miningxp`,`Herblorelvl`,`Herblorexp`,`Agilitylvl`,`Agilityxp`,`Thievinglvl`,`Thievingxp`,`Slayerlvl`,`Slayerxp`,`Farminglvl`,`Farmingxp`,`Runecraftlvl`,`Runecraftxp`,`Hunterlvl`,`Hunterxp`,`Summonlvl`,`Summonxp`) VALUES ('"+clientToSave.playerName+"',"+clientToSave.playerLevel[0]+","+clientToSave.playerXP[0]+","+clientToSave.playerLevel[1]+","+clientToSave.playerXP[1]+","+clientToSave.playerLevel[2]+","+clientToSave.playerXP[2]+","+clientToSave.playerLevel[3]+","+clientToSave.playerXP[3]+","+clientToSave.playerLevel[4]+","+clientToSave.playerXP[4]+","+clientToSave.playerLevel[5]+","+clientToSave.playerXP[5]+","+clientToSave.playerLevel[6]+","+clientToSave.playerXP[6]+","+clientToSave.playerLevel[7]+","+clientToSave.playerXP[7]+","+clientToSave.playerLevel[8]+","+clientToSave.playerXP[8]+","+clientToSave.playerLevel[9]+","+clientToSave.playerXP[9]+","+clientToSave.playerLevel[10]+","+clientToSave.playerXP[10]+","+clientToSave.playerLevel[11]+","+clientToSave.playerXP[11]+","+clientToSave.playerLevel[12]+","+clientToSave.playerXP[12]+","+clientToSave.playerLevel[13]+","+clientToSave.playerXP[13]+","+clientToSave.playerLevel[14]+","+clientToSave.playerXP[14]+","+clientToSave.playerLevel[15]+","+clientToSave.playerXP[15]+","+clientToSave.playerLevel[16]+","+clientToSave.playerXP[16]+","+clientToSave.playerLevel[17]+","+clientToSave.playerXP[17]+","+clientToSave.playerLevel[18]+","+clientToSave.playerXP[18]+","+clientToSave.playerLevel[19]+","+clientToSave.playerXP[19]+","+clientToSave.playerLevel[20]+","+clientToSave.playerXP[20]+","+clientToSave.playerLevel[21]+","+clientToSave.playerXP[21]+","+clientToSave.playerLevel[22]+","+clientToSave.playerXP[22]+");");
query("INSERT INTO `skillsoverall` (`playerName`,`lvl`,`xp`) VALUES ('"+clientToSave.playerName+"',"+(clientToSave.getLevelForXP(clientToSave.playerXP[0]) + clientToSave.getLevelForXP(clientToSave.playerXP[1]) + clientToSave.getLevelForXP(clientToSave.playerXP[2]) + clientToSave.getLevelForXP(clientToSave.playerXP[3]) + clientToSave.getLevelForXP(clientToSave.playerXP[4]) + clientToSave.getLevelForXP(clientToSave.playerXP[5]) + clientToSave.getLevelForXP(clientToSave.playerXP[6]) + clientToSave.getLevelForXP(clientToSave.playerXP[7]) + clientToSave.getLevelForXP(clientToSave.playerXP[8]) + clientToSave.getLevelForXP(clientToSave.playerXP[9]) + clientToSave.getLevelForXP(clientToSave.playerXP[10]) + clientToSave.getLevelForXP(clientToSave.playerXP[11]) + clientToSave.getLevelForXP(clientToSave.playerXP[12]) + clientToSave.getLevelForXP(clientToSave.playerXP[13]) + clientToSave.getLevelForXP(clientToSave.playerXP[14]) + clientToSave.getLevelForXP(clientToSave.playerXP[15]) + clientToSave.getLevelForXP(clientToSave.playerXP[16]) + clientToSave.getLevelForXP(clientToSave.playerXP[17]) + clientToSave.getLevelForXP(clientToSave.playerXP[18]) + clientToSave.getLevelForXP(clientToSave.playerXP[19]) + clientToSave.getLevelForXP(clientToSave.playerXP[20]) + clientToSave.getLevelForXP(clientToSave.playerXP[21]) + clientToSave.getLevelForXP(clientToSave.playerXP[22]))+","+((clientToSave.playerXP[0]) + (clientToSave.playerXP[1]) + (clientToSave.playerXP[2]) + (clientToSave.playerXP[3]) + (clientToSave.playerXP[4]) + (clientToSave.playerXP[5]) + (clientToSave.playerXP[6]) + (clientToSave.playerXP[7]) + (clientToSave.playerXP[8]) + (clientToSave.playerXP[9]) + (clientToSave.playerXP[10]) + (clientToSave.playerXP[11]) + (clientToSave.playerXP[12]) + (clientToSave.playerXP[13]) + (clientToSave.playerXP[14]) + (clientToSave.playerXP[15]) + (clientToSave.playerXP[16]) + (clientToSave.playerXP[17]) + (clientToSave.playerXP[18]) + (clientToSave.playerXP[19]) + (clientToSave.playerXP[20]) + (clientToSave.playerXP[21]) + (clientToSave.playerXP[22]))+");");
//query("INSERT INTO `scores` (`playerName`,`killcount`,`pkpoints`,`pcpoints`) VALUES ('"+clientToSave.playerName+"',"+clientToSave.KC+","+clientToSave.pkPoints+","+clientToSave.pcPoints+");");
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
}
A: You need to worry about synchronization on the Java side, because java.sql implementations are not thread safe. And you need to think about isolation on the database server, balancing responsiveness with ACID.
I'd recommend a few other things for your Java class:
*
*Use a connection pool. Destroying and creating connections is very expensive. Your SQL class should not be handling such chores.
*Use PreparedStatement and bind variables. Creating a query string that way is a bad idea.
*Close resources in a finally block.
All those static strings...I'm reading this on a mobile phone, but what I'm seeing is not good. You may have a serious violation of 1st normal form.
A: Deadlocks are generally cause by poorly synchronized code. The most typical case is that Thread A grabs a lock on resource X, Thread B grabs a lock on resource Y, and then both threads wait while they each try to grab the resource they don't yet have locked.
Since your code has no synchronization at all, it should be fine.
To avoid deadlock problems, try to do the minimum amount of work possible inside of synchronized blocks. Be very careful about calling code external to the class inside a synchronized block, as this external code may try to obtain a lock and produce a deadlock. Remember that doing a database query is a call to external code, and it is not unusual for a db query to lock on resources inside the database.
Are you actually seeing deadlocks, or are you just being cautious?
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560997",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Simultaneous status bar hiding and view transition I would like to transition from an "initialization screen" to a "presentation screen" in my application. The initialization screen has the status bar visible but I want the presentation screen to use the full screen. I would like the status bar to disappear when the initialization screen does, not before or after it.
In my callback from the initialization screen view controller that says "ready to run" I do this:
[UIView transitionFromView: setupViewController.view toView: runViewController.view
duration: 1.0 options: UIViewAnimationOptionTransitionCurlUp
completion: ^(BOOL finished) {
[[UIApplication sharedApplication] setStatusBarHidden: YES withAnimation: UIStatusBarAnimationSlide];
}];
but with this the status bar is there until the curl-up animation completes, then it slides up.
So I tried this:
[UIView transitionFromView: setupViewController.view toView: runViewController.view
duration: 1.0 options: UIViewAnimationOptionTransitionCurlUp
completion: nil];
[[UIApplication sharedApplication] setStatusBarHidden: YES withAnimation: UIStatusBarAnimationSlide];
but with this the status bar slides up before the curl-up animation starts.
So I tried this:
[UIView beginAnimations: @"whatever" context: nil];
[UIView setAnimationDuration: 1.0];
[UIApplication sharedApplication].statusBarHidden = YES;
[UIView transitionFromView: setupViewController.view toView: runViewController.view
duration: 1.0 options: UIViewAnimationOptionTransitionCurlUp completion: nil];
[UIView commitAnimations];
and I get the simultaneous action but the status bar just fades away instead of sliding up.
What I would really like is for the status bar to curl-up with the initialization screen (if I am using curl-up or flip if I am using flip) to reveal the full screen but I will settle for the status bar to slide up during the 1.0 second interval that the initialization screen is curling up.
Thanks for any suggestions...
A: It seems the third method is working as you wish except you've used the line:
[UIApplication sharedApplication].statusBarHidden = YES;
instead of:
[[UIApplication sharedApplication] setStatusBarHidden: YES withAnimation: UIStatusBarAnimationSlide];
which allows you to set the slide up animation.
However, I don't think it's possible to include the status bar in the curl up animation.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7560999",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: What's needed to support non-square matrices in GLSL shader? I'm trying to use non-square matrices in my GLSL shader but when I compile I get a syntax error.
My shader code using:
uniform mat4 my_mat;
compiles just fine.
But if I change it to:
uniform mat4x3 my_mat;
I get
ERROR: 0:5: 'mat4x3' : syntax error syntax error
I get a similar error for
uniform mat4x4 my_mat;
If I print my GL_VERSION and GL_SHADING_LANGUAGE_VERSION I get:
GL_VERSION: 2.1 NVIDIA-1.6.36
GL_SHADING_LANGUAGE_VERSION: 1.20
I'm compiling and running my OpenGL on a Mac OS X 10.6 MacBook Pro. According to this NVidia document and others, GLSL 1.20 and GL 2.1 should encompass support of non-square matrices and this syntax. Is there another catch? Or another way to troubleshoot why I get syntax errors?
A: If I place
#version 120
At the top of my shader code, the problem goes away. According to the same document listed in the question shader source without the version compiler option will compile "as before" which I guess means that they won't.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561003",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Avoiding errors on Access name-parsing query I'm trying to clean up data in an older database, and the FirstName field has been polluted with middle names & initials over the years. Using a simple Left-Mid query, I'm easily able to split the names on a space. But I'm running into problems when I try to avoid returning an #ERROR on the entries that actually have just a first name.
I tried using NULLIF. The idea was that if there were no spaces in the name, return NULL as the middle name and pass the entire string to FName.
SELECT MID([FirstName], NULLIF(INSTR([FirstName], " "), 0) AS [MName],
LEFT([FirstName], ISNULL(NULLIF(INSTR([FirstName], " "), 0),
LEN([FirstName])) AS [FName]
FROM Persons;
I also tried using an IIF statement - if there is a space in the name, then parse it, else return the MName as null.
In both instances, Access returns a Syntax error (missing operator). The basic Left-Mid query works on its own, and I can pass a WHERE to just grab the entries where there is a space. Am I just forgetting something obvious here?
A: This should do the trick:
SELECT
IIF(INSTR(FirstName," ")>0, MID(FirstName, INSTR(FirstName," ")), null) AS MName,
LEFT(FirstName, IIF(INSTR(FirstName," ")>0, INSTR(FirstName," "), LEN(FirstName))) AS FName
FROM
Persons;
Honestly, I never heard about NULLIF. I just googled it and I only found SQL Server references.
Are you sure that's available in MS Access?
(I have to admit - I can only try on A2000 now, because that's the only version I have installed on this machine)
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561004",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: IE7: javascript canvas code used to work in IE7, now it doesn't. What happened between these two revisions that caused that? Been working with the canvas element with a library called Raphael
Current revision: http://jsfiddle.net/G5mTx/27/
Working in IE7 revision: http://jsfiddle.net/G5mTx/10/
Note: These work in non-IE browsers.
So... I've added a bunch of jQuery handlers since revisions 10. Is there a javascript library I can use for just IE that will enable everything?
EDIT: Note that revisions 11-26 may not have to do with revisions 10 and 27 (jsfiddle is public)
A: Solution in comments of original post.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561009",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Injecting SecurityContext into a Listener prePersist or preUpdate in Symfony2 to get User in a createdBy or updatedBy Causes Circular Reference Error I setup a listener class where i'll set the ownerid column on any doctrine prePersist. My services.yml file looks like this ...
services:
my.listener:
class: App\SharedBundle\Listener\EntityListener
arguments: ["@security.context"]
tags:
- { name: doctrine.event_listener, event: prePersist }
and my class looks like this ...
use Doctrine\ORM\Event\LifecycleEventArgs;
use Symfony\Component\Security\Core\SecurityContextInterface;
class EntityListener
{
protected $securityContext;
public function __construct(SecurityContextInterface $securityContext)
{
$this->securityContext = $securityContext;
}
/**
*
* @param LifecycleEventArgs $args
*/
public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
$entityManager = $args->getEntityManager();
$entity->setCreatedby();
}
}
The result of this is the following error.
ServiceCircularReferenceException: Circular reference detected for service "doctrine.orm.default_entity_manager", path: "doctrine.orm.default_entity_manager -> doctrine.dbal.default_connection -> my.listener -> security.context -> security.authentication.manager -> fos_user.user_manager".
My assumption is that the security context has already been injected somewhere in the chain but I don't know how to access it. Any ideas?
A: I had similar problems and the only workaround was to pass the whole container in the constructor (arguments: ['@service_container']).
use Doctrine\ORM\Event\LifecycleEventArgs;
use Symfony\Component\DependencyInjection\ContainerInterface;
class MyListener
{
protected $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
// ...
public function prePersist(LifeCycleEventArgs $args)
{
$securityContext = $this->container->get('security.context');
// ...
}
}
A: As of Symfony 2.6 this issue should be fixed. A pull request has just been accepted into the master. Your problem is described in here.
https://github.com/symfony/symfony/pull/11690
As of Symfony 2.6, you can inject the security.token_storage into your listener. This service will contain the token as used by the SecurityContext in <=2.5. In 3.0 this service will replace the SecurityContext::getToken() altogether. You can see a basic change list here: http://symfony.com/blog/new-in-symfony-2-6-security-component-improvements#deprecated-the-security-context-service
Example usage in 2.6:
Your configuration:
services:
my.entityListener:
class: App\SharedBundle\Listener\EntityListener
arguments:
- "@security.token_storage"
tags:
- { name: doctrine.event_listener, event: prePersist }
Your Listener
namespace App\SharedBundle\Listener;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class EntityListener
{
private $token_storage;
public function __construct(TokenStorageInterface $token_storage)
{
$this->token_storage = $token_storage;
}
public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getEntity();
$entity->setCreatedBy($this->token_storage->getToken()->getUsername());
}
}
For a nice created_by example, you can use https://github.com/hostnet/entity-blamable-component/blob/master/src/Listener/BlamableListener.php for inspiration. It uses the hostnet/entity-tracker-component which provides a special event that is fired when an entity is changed during your request. There's also a bundle to configure this in Symfony2
*
*https://github.com/hostnet/entity-tracker-component
*https://github.com/hostnet/entity-tracker-bundle
A: There's a great answer already in this thread but everything changes. Now there're entity listeners classes in Doctrine:
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#entity-listeners-class
So you can add an annotation to your entity like:
/**
* @ORM\EntityListeners({"App\Entity\Listener\PhotoListener"})
* @ORM\Entity(repositoryClass="App\Repository\PhotoRepository")
*/
class Photo
{
// Entity code here...
}
And create a class like this:
class PhotoListener
{
private $container;
function __construct(ContainerInterface $container)
{
$this->container = $container;
}
/** @ORM\PreRemove() */
public function preRemoveHandler(Photo $photo, LifecycleEventArgs $event): void
{
// Some code here...
}
}
Also you should define this listener in services.yml like that:
photo_listener:
class: App\Entity\Listener\PhotoListener
public: false
autowire: true
tags:
- {name: doctrine.orm.entity_listener}
A: I use the doctrine config files to set preUpdate or prePersist methods:
Project\MainBundle\Entity\YourEntity:
type: entity
table: yourentities
repositoryClass: Project\MainBundle\Repository\YourEntitytRepository
fields:
id:
type: integer
id: true
generator:
strategy: AUTO
lifecycleCallbacks:
prePersist: [methodNameHere]
preUpdate: [anotherMethodHere]
And the methods are declared in the entity, this way you don't need a listener and if you need a more general method you can make a BaseEntity to keep that method and extend the other entites from that. Hope it helps!
A: Symfony 6.2.4
Add this in your Entity :
#[ORM\EntityListeners(["App\Doctrine\MyListener"])]
Add this in your services.yaml:
App\Doctrine\MyListener:
tags: [doctrine.orm.entity_listener]
Then you can do this :
<?php
namespace App\Doctrine;
use App\Entity\MyEntity;
use Symfony\Component\Security\Core\Security;
class MyListener
{
private $security;
public function __construct(Security $security)
{
$this->security = $security;
}
public function prePersist(MyEntity $myEntity)
{
//Your stuff
}
}
Hope it helps.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561013",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "44"
}
|
Q: In Vertica, should you factor out strings into their own logical tables? Suppose your logical table is:
CREATE TABLE employee(
name VARCHAR,
university VARCHAR
);
Now you have only a few universities. Therefore, you could factor out the university name:
CREATE TABLE employee(
name VARCHAR,
university integer references university(university)
);
CREATE TABLE university(
university identity,
name varchar
);
You have queries of the sort:
SELECT employee
FROM employee as e1
WHERE EXISTS
(SELECT employee
FROM employee as e2
WHERE e1.name = e2.name AND e1.university <> e2.university)
What I'm wondering about is: does the second logical schema, where the name is "factored out", speed up things? Perhaps because there, e1.university <> e2.university is a comparison of integers rather than of strings.
A: I know this is an old question -- but the answer is usually no. The encoding that the product does will generally shrink the column enough that it is faster than the join that would have to occur.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561014",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Search for tweets with t.co rewritten links Just noticed a spike of visitors following a t.co/LINKHERE a link re-written by twitter. Is there a way to track back to the twitter message that contained the link, if you know the link?
A: The standard twitter search will work for a few days.
For older t.co links, you could try searching with
find-tco.appspot.com.
A: You can do this using twitter API 1.1. The easiest way is to use the api is through the twitter API console. Here are the steps:
*
*Goto https://dev.twitter.com/rest/tools/console
*Select https://api.twitter.com/1.1 from the Service dropdown menu.
*Select OAuth 1 from the Authentication dropdown menu and authorize with your twitter account.
*Choose GET /search/tweets.json api.
*Type the t.co link (e.g. https://t.co/w6iqrcuZMA) in q query parameter (Try both http and https links. In my case the http link returned no record while https link returned some records). All the search results will be returned in json format.
*Now to open the actual tweet use this link (fill the placeholders of course): https://twitter.com/{user.screen_name}/status/{id_str}
A: Here’s the quick and easy way:
*
*Go to: http://dev.twitter.com/rest/tools/console
*Service: “api.twitter.com/1.1”
*Authentication: OAuth 1, then log in if you need to
*Make sure GET is selected and paste https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**SUFFIX**} into the Request URL box.
*Replace **SUFFIX** with the t.co URL suffix. So if the URL you’re searching for is t.co/**N2ul8FFCxu**, the link you pasted should look like this:
https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**N2ul8FFCxu**}
*Click Send
*Open a new tab and paste twitter.com/**SCREEN_NAME**/status/**ID_STR** into the address bar
*Replace **SCREEN_NAME** and **ID_STR** with info from Response. Like this:
twitter.com/**twitter**/status/**526534593826938881**
A: t.co links do show up in search, so if you're curious, you have about a week to find them before they get dropped from the search index.
For example:
http://search.twitter.com/search.json?q=https:%2F%2Ft.co%2FGJMsIcM6
Returns:
{
"completed_in": 0.019,
"max_id": 178215431251828740,
"max_id_str": "178215431251828736",
"page": 1,
"query": "https%3A%2F%2Ft.co%2FGJMsIcM6",
"refresh_url": "?since_id=178215431251828736&q=https%3A%2F%2Ft.co%2FGJMsIcM6",
"results": [
{
"created_at": "Fri, 09 Mar 2012 20:27:24 +0000",
"from_user": "kurrik",
"from_user_id": 7588892,
"from_user_id_str": "7588892",
"from_user_name": "Arne Roomann-Kurrik",
"geo": null,
"id": 178215431251828740,
"id_str": "178215431251828736",
"iso_language_code": "en",
"metadata": {
"result_type": "recent"
},
"profile_image_url": "http://a0.twimg.com/profile_images/24229162/arne001_normal.jpg",
"profile_image_url_https": "https://si0.twimg.com/profile_images/24229162/arne001_normal.jpg",
"source": "<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>",
"text": "RT @raffi: “Twitter Catches the 'SPDY' Train” from @wired → http://t.co/suCbWWEl (& they reference my tweet! → https://t.co/GJMsIcM6)",
"to_user": null,
"to_user_id": null,
"to_user_id_str": null,
"to_user_name": null
},
{
"created_at": "Fri, 09 Mar 2012 20:26:26 +0000",
"from_user": "raffi",
"from_user_id": 8285392,
"from_user_id_str": "8285392",
"from_user_name": "Raffi Krikorian",
"geo": null,
"id": 178215186921033730,
"id_str": "178215186921033730",
"iso_language_code": "en",
"metadata": {
"result_type": "recent"
},
"profile_image_url": "http://a0.twimg.com/profile_images/1270234259/raffi-headshot-casual_normal.png",
"profile_image_url_https": "https://si0.twimg.com/profile_images/1270234259/raffi-headshot-casual_normal.png",
"source": "<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>",
"text": "“Twitter Catches the 'SPDY' Train” from @wired → http://t.co/suCbWWEl (& they reference my tweet! → https://t.co/GJMsIcM6)",
"to_user": null,
"to_user_id": null,
"to_user_id_str": null,
"to_user_name": null
}
],
"results_per_page": 15,
"since_id": 0,
"since_id_str": "0"
}
You'll see that search returns retweets as well.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561016",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "22"
}
|
Q: Get the column names of a python numpy ndarray Let's say I have a data file called data.txt that looks like:
TIME FX FY FZ
0 10 5 6
1 2 4 7
2 5 2 6
...
In Python run:
import numpy as np
myData = np.genfromtxt("data.txt", names=True)
>>> print myData["TIME"]
[0, 1, 2]
The names at the top of my data file will vary, so what I would like to do is find out what the names of my arrays in the data file are. I would like something like:
>>> print myData.names
[TIME, F0, F1, F2]
I thought about just to read in the data file and get the first line and parse it as a separate operation, but that doesn't seem very efficient or elegant.
A: Try:
myData.dtype.names
This will return a tuple of the field names.
In [10]: myData.dtype.names
Out[10]: ('TIME', 'FX', 'FY', 'FZ')
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561017",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "64"
}
|
Q: python read files from hard disk and return result depending on the pattern found what i wanna do is this;
- read files from hard drive and find a pattern like the see if the file contains this string if it does return true or return false. In the function call it should print out nicely saying `the found in file.txt etc.
this is what i have came up with so far
import os
path = '../'
folder = os.listdir(path);
y = {}
n = {}
def bla(pattern):
for book in folder:
if book[-3:] == 'txt':
data = open(path+''+book).read()
if pattern in sanitize(data):
y[pattern] = book + " contains " + pattern
return True
else :
n[pattern] = book + " does not contain " + pattern
return False
if bla('jane'):
print(y['jane'])
print(n['jane'])
desired output is this;
1.txt contains 'the'
2.txt does not contain 'the'
3.txt contains 'the'
4.txt does not contain 'the'
this works but without the return true and return false thingy that i desired to have, ANY BETTER WAY THAN THIS?
import os
path = '../'
folder = os.listdir(path);
def bla(pattern):
for book in folder:
if book[-3:] == 'txt':
data = open(path+''+book).read()
if pattern in sanitize(data):
print(book + " contains " + pattern)
else :
print(book + " does not contain " + pattern)
bla('the')
A: import re
m1 = re.compile(r'.*?\.txt$')
pattern = 'yourpattern'
m2 = re.compile(r'%s' % (pattern))
for file in filter(m1.search, os.listdir(somedir)):
if m2.search(open(file,'r').read()):
print file, 'contains', pattern
else:
print file, 'does not contain', pattern
modify output per your tastes
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561019",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: jQuery tablesorter parser for datetime in MM.DD.YYYY HH:MI AM format I am having a 4 column table in which the 2nd column is a date column with the following format "mm.dd.yyyy hh:mi am". The default tablesorter doesn't sort by date column correctly. I had to write my own parser in tablesorter but it is still not working for me. I am not sure if the regex used is correct or not and if anyone can point me the mistake in the code below? I would appreciate your help.
ts.addParser(
{
id: "srsDate",
is: function (s) {
return /\d{1,2}\.\d{1,2}\.\d{1,4} \d{1,2}:\d{1,2}\s(am|pm)/.test(s);
},
format: function (s) {
s = s.replace(/\./g, " ");
s = s.replace(/\:/g, " ");
s = s.replace("am", "0");
s = s.replace("pm", "1");
s = s.split(" ");
return $.tablesorter.formatFloat(new Date(s[0], s[1], s[2], s[3], s[4], s[5]).getTime() + parseInt(s[6]));
},
type: "numeric"
});
And I call it like:
myapp.Sort = function () {
$(myapp.config.tblHistory).tablesorter({ headers: { 1: { sorter: 'srsDate'} }, sortList: [[0, 0]] });
}
I referenced: date Sorting Problem with Jquery Tablesorter to build the new parser. The results of the sort is not working. It doesn't sort the data at all.
A: I don't use tablesorter myself, however have you considered using Date.parse(datestring)?
Your function could then just be:
ts.addParser({
id: "srsDate",
is: function (s) {
return /\d{1,2}\.\d{1,2}\.\d{1,4} \d{1,2}:\d{1,2}\s(am|pm)/.test(s);
},
format: function (s) {
return Date.parse(s);
},
type: "numeric"
});
This will return that date as a Unix timestamp in milliseconds.
If you want to return it as the number of seconds, simple divide the result of Date.parse(s) by 1000:
function: function (s) {
return (Date.parse(s) / 1000);
}
Although either method is fine if you're simply sorting the data.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561026",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: ZipInputStream getNextEntry is null when extracting .zip files I'm trying to extract .zip files and I'm using this code:
String zipFile = Path + FileName;
FileInputStream fin = new FileInputStream(zipFile);
ZipInputStream zin = new ZipInputStream(fin);
ZipEntry ze = null;
while ((ze = zin.getNextEntry()) != null) {
UnzipCounter++;
if (ze.isDirectory()) {
dirChecker(ze.getName());
} else {
FileOutputStream fout = new FileOutputStream(Path
+ ze.getName());
while ((Unziplength = zin.read(Unzipbuffer)) > 0) {
fout.write(Unzipbuffer, 0, Unziplength);
}
zin.closeEntry();
fout.close();
}
}
zin.close();
but the problem is that, while debugging, when the code reaches the while(!=null) part, the zin.getNextEntry() is always null so it doesnt extract anything..
The .zip file is 150kb.. How can I fix this?
The .zip exists
Code I use to dl the .zip:
URL=intent.getStringExtra("DownloadService_URL");
FileName=intent.getStringExtra("DownloadService_FILENAME");
Path=intent.getStringExtra("DownloadService_PATH");
File PathChecker = new File(Path);
try{
if(!PathChecker.isDirectory())
PathChecker.mkdirs();
URL url = new URL(URL);
URLConnection conexion = url.openConnection();
conexion.connect();
int lenghtOfFile = conexion.getContentLength();
lenghtOfFile/=100;
InputStream input = new BufferedInputStream(url.openStream());
OutputStream output = new FileOutputStream(Path+FileName);
byte data[] = new byte[1024];
long total = 0;
int count = 0;
while ((count = input.read(data)) != -1) {
output.write(data, 0, count);
total += count;
notification.setLatestEventInfo(context, contentTitle, "جاري تحميل ملف " + FileName + " " + (total/lenghtOfFile), contentIntent);
mNotificationManager.notify(1, notification);
}
output.flush();
output.close();
input.close();
A: You might have run into the following problem, which occurs, when reading zip files using a ZipInputStream: Zip files contain entries and additional structure information in a sequence. Furthermore, they contain a registry of all entries at the very end (!) of the file. Only this registry does provide full information about the correct zip file structure. Therefore, reading a zip file in a sequence, by using a stream, sometimes results in a "guess", which can fail. This is a common problem of all zip implementations, not only for java.util.zip. Better approach is to use ZipFile, which determines the structure from the registry at the end of the file. You might want to read http://commons.apache.org/compress/zip.html, which tells a little more details.
A: If the Zip is placed in the same directory as this exact source, named "91.zip", it works just fine.
import java.io.*;
import java.util.zip.*;
class Unzip {
public static void main(String[] args) throws Exception {
String Path = ".";
String FileName = "91.zip";
File zipFile = new File(Path, FileName);
FileInputStream fin = new FileInputStream(zipFile);
ZipInputStream zin = new ZipInputStream(fin);
ZipEntry ze = null;
int UnzipCounter = 0;
while ((ze = zin.getNextEntry()) != null) {
UnzipCounter++;
//if (ze.isDirectory()) {
// dirChecker(ze.getName());
//} else {
byte[] Unzipbuffer = new byte[(int) pow(2, 16)];
FileOutputStream fout = new FileOutputStream(
new File(Path, ze.getName()));
int Unziplength = 0;
while ((Unziplength = zin.read(Unzipbuffer)) > 0) {
fout.write(Unzipbuffer, 0, Unziplength);
}
zin.closeEntry();
fout.close();
//}
}
zin.close();
}
}
BTW
*
*what is the language in that MP3, Arabic?
*I had to alter the source to get it to compile.
*I used the File constructor that takes two String arguments, to insert the correct separator automatically.
A: Try this code:-
private boolean extractZip(String pathOfZip,String pathToExtract)
{
int BUFFER_SIZE = 1024;
int size;
byte[] buffer = new byte[BUFFER_SIZE];
try {
File f = new File(pathToExtract);
if(!f.isDirectory()) {
f.mkdirs();
}
ZipInputStream zin = new ZipInputStream(new BufferedInputStream(new FileInputStream(pathOfZip), BUFFER_SIZE));
try {
ZipEntry ze = null;
while ((ze = zin.getNextEntry()) != null) {
String path = pathToExtract +"/"+ ze.getName();
if (ze.isDirectory()) {
File unzipFile = new File(path);
if(!unzipFile.isDirectory()) {
unzipFile.mkdirs();
}
}
else {
FileOutputStream out = new FileOutputStream(path, false);
BufferedOutputStream fout = new BufferedOutputStream(out, BUFFER_SIZE);
try {
while ( (size = zin.read(buffer, 0, BUFFER_SIZE)) != -1 ) {
fout.write(buffer, 0, size);
}
zin.closeEntry();
}catch (Exception e) {
Log.e("Exception", "Unzip exception 1:" + e.toString());
}
finally {
fout.flush();
fout.close();
}
}
}
}catch (Exception e) {
Log.e("Exception", "Unzip exception2 :" + e.toString());
}
finally {
zin.close();
}
return true;
}
catch (Exception e) {
Log.e("Exception", "Unzip exception :" + e.toString());
}
return false;
}
A: This code works fine for me. Perhaps you need to check that the zipFile String is valid?
String zipFile = "C:/my.zip";
FileInputStream fin = new FileInputStream(zipFile);
ZipInputStream zin = new ZipInputStream(fin);
ZipEntry ze = null;
while ((ze = zin.getNextEntry()) != null) {
System.out.println("got entry " + ze);
}
zin.close();
produced valid results on a 3.3Mb zip file.
A: This code seems to work correctly for me.
Are you sure that your zip file is a valid zip file? If the file does not exist or is not readable then you will get a FileNotFoundException, but if the file is empty or not a valid zip file, then you will get ze == null.
while ((ze = zin.getNextEntry()) != null) {
The zip that you specify isn't a valid zip file. The size of the entry is 4294967295
while ((ze = zin.getNextEntry()) != null) {
System.out.println("ze=" + ze.getName() + " " + ze.getSize());
UnzipCounter++;
This gives:
ze=595.mp3 4294967295
...
Exception in thread "main" java.util.zip.ZipException: invalid entry size (expected 4294967295 but got 341297 bytes)
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:386)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:156)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at uk.co.farwell.stackoverflow.ZipTest.main(ZipTest.java:29)
Try your code with a valid zip file.
A: I know it's late for answer but anyway ..
I think the problem is in
if(!PathChecker.isDirectory())
PathChecker.mkdirs();
it should be
if(!PathChecker.getParentFile().exists())
PathChecker.getParentFile().mkdirs();
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561031",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
}
|
Q: I'm lost in boost libraries (specifically boost_program_options) Hi all I've been banging my head against the wall all day now.
So I want to move my program onto the university supercomputer, but it doesn't have boost (and I used boost program_options in my code). On my pc, I just have -lboost_program_options and that works fine, but obviously won't work anymore.
So, I need to package the necessary stuff along with my code so that it will compile on the supercomputer (using intel icpc)
My first hurdle was compiling the line in my makefile that had the code that wanted to include the boost header, but I ran the following in my code folder:
bcp --scan --boost=/usr/include/ main.cpp destination_folder/
And put the resulting files in my include directory. which solved that.
Boost program options isn't a header only package unfortunately, so i need something else. I need to get a library or something. Because i get errors when the compiler gets to the last task on my makefile (doing all the object files)
In my travels I found this question:
extractin/building boost program_options
I tried what the answer suggests, but putting "build" in my command doesn't generate any extra files...
Now totally stuck, don't know how to get this library thing. I've read so much stuff on bjam my head is spinning, I just don't have the level of understanding to process it all in my head.
OS: Linux both systems
A: One option is to build boost on that machine. Install it in your home. Change your CXXFLAGS and LDDFLAGS to point to the proper header and library directories and build your code there.
The other option is to cross compile both on your PC (if you have such a cross toolchain). Link your code statically to boost and take the final binary to the super computer.
A: Since both systems are linux, you'll just want to use the binaries. If both systems run on the same CPU, just compile your program statically. If not, download the debian package for the architecture your supercomputer runs on and rip headers and binaries from that.
I've build boost from bjam for cross-compiling to windows, and if there ever was a reason to use the autotools in a project, it's the mess of boost and bjam. Avoid it if possible, and try to adapt the debian package source if you can't.
A: Instead of building Boost.ProgramOptions you could include and compile all its .cpp files within your project.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561033",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Reinstall Aptana Studio 3 bundles to get my custom snippets back? I'm using Aptana Studio 3 for JavaScript development.
Day 1, I tried importing some old favorite Textmate snippets etc. with limited success.
Some keys like dot, comma, "d + number" etc. takes precedence over my custom commands and the situation has become almost unbearable ...
(Hmm, no, unbearable situation should be reserved for this: http://www.usaid.gov/fwd/)
What should I do next?
I really just want to take back control :)
1) How do I make sure my own custom snippets always takes precedence in all scopes?
2) How do I delete all existing (conflicting?) bundles and get some decent ones back?
A: I believe the majority of those cases were issues with 3.0.4. Can you try updating to 3.0.5 beta to see if that helps?
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561036",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Regex regular expression coordinates trying to sort out a regular expression for the following string:
51.4920302, -0.0850667
So far I have:@"^[0-9]*,{-}[0-9]*$" but it doesn't seem to be working.
Any thought, greatly received.
The whole snippet is:
[RegularExpression(@"^[0-9]*,{-}[0-9]*$", ErrorMessage = "Must enter a valid coordinate")]
public string FaveRunLatLng2 { get; set; }
Thanks.
A: You're not allowing for the decimal point. You're also basically requiring the second part of the coordinates to be negative and not allowing the first. Try
@"^-?[0-9]+\.[0-9]+, -?[0-9]+\.[0-9]+$"
A: \b-?\d+\.\d+, -?\d+\.\d+\b
If you want the space to be optional, you can add \s?, like this:
\b-?\d+\.\d+,\s?-?\d+\.\d+\b
As long as you know your input is going to have a comma and space. If it is entered by a user, you may need to sanitize it first.
Here is a tester online you can use:
http://www.regular-expressions.info/javascriptexample.html
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561042",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Do you add public/assets in version control? In rails 3.1, when you precompile the assets, rails create public/assets directory and add files there.
Do you version-control public/assets/*?
A: I was looking for an answer to this too. I found the official Rails Guide has some thoughts on this:
http://guides.rubyonrails.org/asset_pipeline.html#local-precompilation
Here's a quote of the relevant section (emphasis added):
There are several reasons why you might want to precompile your assets locally. Among them are:
*
*You may not have write access to your production file system.
*You may be deploying to more than one server, and want to avoid duplication of work.
*You may be doing frequent deploys that do not include asset changes.
Local compilation allows you to commit the compiled files into source control, and deploy as normal.
There are three caveats:
*
*You must not run the Capistrano deployment task that precompiles assets.
*You must ensure any necessary compressors or minifiers are available on your development system.
*You must change the following application configuration setting:
In config/environments/development.rb, place the following line:
config.assets.prefix = "/dev-assets"
The prefix change makes Sprockets use a different URL for serving assets in development mode, and pass all requests to Sprockets. The prefix is still set to /assets in the production environment. Without this change, the application would serve the precompiled assets from /assets in development, and you would not see any local changes until you compile assets again.
In practice, this will allow you to precompile locally, have those files in your working tree, and commit those files to source control when needed. Development mode will work as expected.
So, it looks like it might be a good idea to put precompiled assets into VCS on occasion.
A: I use Capistrano to deploy. The last step is compiling the assets. Nothing like that gets checked into version control.
https://github.com/capistrano/capistrano/wiki/Documentation-v2.x
Checking in compiled assets, .gz files/etc, will just clutter up version control.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561043",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "17"
}
|
Q: What is the difference between GetClientRect and GetWindowRect in WinApi? What of these should I use in InvalidateRect to refresh my window? And why?
A: From MSDN:
GetWindowRect
Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
GetClientRect
Retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).
More: client rect does not include title bar, borders, scroll bars, status bar...
A: The window rect includes the non-client area, i.e. the window borders, caption bar etc. The client rect does not.
GetWindowRect returns a rect in screen coordinates whereas GetClientRect returns a rect in client coordinates.
InvalidateRect receives a rect in client coordinates. If you want to invalidate your entire client area, then pass NULL to InvalidateRect. You could pass in the rect returned by GetClientRect, but it is far simpler and clearer to pass NULL.
A: A very simple explanation is that GetWindowRect() gives you the rectangle that includes the borders of the window. GetClientRect() gives you the rectangle that excludes the borders - the area that is allocated to the window specific drawing.
Please note that GetWindowRect() returns a rectangle in screen coordinates - coordinates that are relative to the screen/monitor. GetClientRect() returns a rectangle that is relative to itself.
A: GetClientRect gets the coordinates of the window's client area. Specifically this is the area inside the window chrome and excludes the header etc. One of the comments on the MSDN page sums it up quite well:
I would say that this function return size of the area that I can render to.
GetWindowsRect gets the coordinates of the whole window. This includes the header, status bar etc. However according to a comment on the MSDN page
Apps under Vista that are not linked with WINVER=6 will receive a misleading set of values here, that do not account for the extra padding of "glass" pixels Vista Aero applies to the window.
So unless this have been fixed for Windows 7 double check the result you get and make sure you have the correct value of WINVER.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561049",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "34"
}
|
Q: What wiki engines have strong MVC separation? I would like use an existing wiki engine but replace the render and editing functions of the wiki with client-side javascript. Modifying HTML already rendered by the server application with Jquery or the likes in not a viable option because some critical features I intend to write don't seem like they would be straightforward to implement with that method but I could be wrong. Some features:
*
*lazy-load additional wiki pages
*switch on the fly between editing and viewing the wiki without reloading
*render wiki mark-up without reloading
*Possibly create new wiki pages and start editing without reloading
Maybe I am going at this the wrong way and if so feel free to comment on that too.
A: Whenever I wonder "What wiki engines has both and ",
I go to http://www.wikimatrix.org/ and hit the "Wiki Choice Wizard" and see what wiki engines it "recommends".
That narrows down the choices down to the best candidates much faster than manually going through the list of wiki engines at Wikipedia.
In particular, the wiki matrix makes it easy to narrow "the list of all wiki that it knows about" to just "the wiki written in languages you are comfortable using".
There has been some discussion of client-side rendering using Javascript; see
*
*http://en.wikipedia.org/wiki/TiddlyWiki
*http://c2.com/cgi/wiki?FilesystemBasedWiki
*http://features.sheep.art.pl/JavascriptParser
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561056",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: How do I use regex properly? Why isn't this working?
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
string regex = "<Name[.\\s]*>[.]*s[.]*</Name>";
string source = "<Name xmlns=\"http://xml.web.asdf.com\">Session</Name>";
bool hit = System.Text.RegularExpressions.Regex.IsMatch(
source,
regex,
System.Text.RegularExpressions.RegexOptions.IgnoreCase
);
Why is hit false? I'm trying to find any Name XML field that has an 's' in the name. I don't understand what could be wrong.
Thanks!
A: You are using . in a character class, where it means literally ., I think you mean to use in the sense of any character - so .* rather than [.]*
string regex = "<Name(.|\\s)*>.*s.*</Name>";
A: With XPath, this could be as easy as /Name[contains(.,'s')]
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561057",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: PHP Date() error after upgrading to 5.3.8 I'm getting the following error all over my websites after upgrading to PHP 5.3.8:
Warning: strtotime() [function.strtotime]: It is not safe to rely on
the system's timezone settings. You are required to use the
date.timezone setting or the date_default_timezone_set() function. In
case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We
selected 'America/Chicago' for 'CDT/-5.0/DST' instead in ....
My php.ini file has date.timezone = "America/Chicago" so I'm not sure why this warning is being thrown.
Note
Defining on a per page basis is not feasible at this point. This is impacting several websites and thousands of pages. I have checked phpinfo() for the site and see the following response:
http://screencast.com/t/EPOCW9VdR
A: You can declare the timezone within your php file using
date_default_timezone_set('America/Los_Angeles');
A: double check that the php.ini that has the timezone setting is the one php is loading. you can check phpinfo() for which one is being used. Also, maybe restart apache.
although, defining on a per page basis is not feasible as you stated, although not idea, if using apache, you can set the value in a .htaccess or the httpd.conf file. php_value date.timezone America/Chicago even if just a temp fix.
So you can accept and close the question. Thanks.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561058",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: Why this ActionScript program isn't working? It shows me an error of :
1120: Access of undefined property myArray. DataGrid.mxml /DataGrid/src line 10
Source Code :
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var myArray:Array = new Array();
myArray[0] = "Tom"; // string
[Bindable]
public var arrColl:ArrayCollection = new ArrayCollection(myArray);
]]>
</mx:Script>
<mx:AdvancedDataGrid id="ad"
columns="{myArray}"
dataProvider="{arrColl}"/>
</mx:Application>
What is the problem ?
A: You shouldn’t write arbitrary code directly in a script block like that unless you know exactly what you’re doing. Rather, you should do something like this:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="initialize()">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var myArray:Array = new Array();
[Bindable]
public var arrColl:ArrayCollection;
private function initialize() : void
{
myArray[0] = "Tom";
arrColl = new ArrayCollection(myArray)
}
]]>
</mx:Script>
<mx:AdvancedDataGrid columns="{myArray}" dataProvider="{arrColl}"/>
</mx:Application>
Another problem with this code is that myArray[0] = "Tom" will not cause the data grid to be updated. For that, you would have to assign to the variable myArray itself (e.g. myArray = ["Tom"]).
A: You can't start assigning values to the array in the class definition. You need move your myArray[0] = "Tom"; line inside of a method. If you want it to be happen at initialization, then specify an event handler in the Application tag creationComplete="yourEventHandler", and put the line in yourEventHandler(). Hope that helps, let me know if you need more code :)
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561062",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Can't view this site in Chrome (Getting Aw Snap! error) The site in question is http://traceyj.posterous.com/
Using Chrome, it shows the Aw Snap error almost instantaneously. I do not have much programming experience to troubleshoot this - I've tried viewing the site in a css validator but it looks like the solution isn't as easy as I thought it would be.
Any help would be greatly appreciated.
Thanks!
A: 'Aw Snap' is an error given by Chrome when a webpage 'crashes'.
https://www.google.com/support/chrome/bin/answer.py?answer=95669&hl=en-US
That's a pretty high level description however, so it's not much use for troubleshooting.
OK, in Chrome, using the DOM inspection and script debugging tools (bring these up before you load the page in question), I can see that there are some bad requests (HTTP status 400) to http://traceyj.posterous.com/posts/deferred_content.jsonp with an insanely long query string. By insanely long, I mean close to 1KB:
GET [http]://traceyj.posterous.com/posts/deferred_content.jsonp?authenticity_token= gmiqsYI36417dgFhq9VF%2BoiN05dYXzPToUXXc3UPqE0%3D&referrer=http%3A%2F%2Ftraceyj.poste rous.com%2F&posts=%255B%257B%2522post_id%2522%253A72384043%252C%2522post_is_private% 2522%253Afalse%252C%2522post_url_slug%2522%253A%25222673652011-satsep24%2522%252C%25 22user_id%2522%253A65911%257D%252C%257B%2522post_id%2522%253A72383955%252C%2522post_ is_private%2522%253Afalse%252C%2522post_url_slug%2522%253A%25222663652011-frisep23...
ad nauseum
These errors also show in the web console in Firefox.
Now as far as I can tell, posterous.com is a site that provides the tools to do what you're doing: presenting a whole bunch of photographs etc. Unless you are customizing something on the page, it seems likely that the dev team at posterous.com would be best suited to helping you.
Other things you might try would be to shorten the list of items that you're displaying on each page. In fact, going to http://traceyj.posterous.com/?page=6, works (at least for now) in Chrome - and I suspect it's simply because the query string isn't so insanely long, which is likely the cause of the 414 errors that Joseph mentioned.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561068",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: Jasminerice and stylesheets for fixtures I have found jasminerice very helpful for getting all my Jasmine tests to run via Rails 3.1's asset pipeline. The only thing I remain stuck with, is that I cannot get my setup to load any stylesheets (that go with my fixtures) and I need them for a couple of dom / element-style specific tests. Does anybody know how to get the stylesheets to be loaded in this setup?
A: Support for CSS files has been added recently, the README states:
For including stylesheets in your specs, jasminerice uses a spec.css file. Create such a file next to the spec.js.coffee file:
spec/javascripts/spec.css
and in that file, use sprockets directives to include the right css files, e.g.
/*
*= require application
*/
The change is fairly new so you may want to include the gem directly from the latest github version:
# Gemfile
gem 'jasminerice', git: 'git://github.com/bradphelan/jasminerice.git'
You may also want to be precise with your css markup, so as to not mess up Jasmine's spec runner page as the css files (as the js files) are included directly into it.
A: I have updated the Jasminerice gem and bradphelan (the Jasminerice author) has pulled that change into the source on Github. So in order to use use stylesheets in your Jasmine tests running through Jasminerice, simply refer to the gem on Github in your Gemfile like so: gem "jasminerice", :git => 'git://github.com/bradphelan/jasminerice.git'. The documentation has also been updated on Github.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561069",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Can You Have Your OpenGraph Object Link to a Different URL? So you need a public URL with meta tags to represent an object in the OpenGraph, and one of the required meta tags is a URL property. When the action gets published, it links to this URL property.
Let's say I'm on http://mysite.com/A. It seems like I can't then do this:
<meta property="og:url" content="http://mysite.com/B"></meta>
Because Facebook will try to look at the root url for the meta tags. Is there any way to link to a different URL (mysite.com/B) from a given OpenGraph object URL (mysite.com/A)?
A: You should be able to link to another URL. But all an og:url means is "go over to that URL and use the tags from there instead". You can either
1) put all your tags on A and then redirect users to B with JavaScript or User-Agent detection;
2) put your content on A and do an og:url to B.
A: @Paul, I didn't fully understand or appreciate your comment until now - apologies and thanks.
What I learned from a little more tinkering is that on the initial post to FB with the object item url in the post, is that FB then crawls that page, gets the META tags and if you've got og:url defined it will crawl it again. It crawls it twice.
In my case, I am passing a querystring that does get parsed, but I was not setting it again in the og:url, so when it crawled my page the second time, it was not picking up the querystring variable I needed it to.
That was a dumb thing on my part. Thanks for the great answer.
Jim
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561071",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
}
|
Q: How do I run twisted trial on all tests in a directory? How do I run trial so that it executes all tests within a directory? All my unit tests pass if I run trial on each file individually, but if I try something like...
trial test/
on the test directory, it gives me one "PASSED", and the following message...
UserWarning: (for module __init__) not in path importer cache (PEP 302 violation
- check your local configuration).
rather than actually running all the tests within the directory.
A: First of all: you can't call your top-level unit test package test. That's the name of Python's unit tests, so you will never be able to run your tests in an installed configuration, and depending on how your python is set up, you may end up importing python's own tests instead of your own.
Second: sys.path is a vast and subtle mystery.
trial supports running on files and directories as a quick getting-started hack, but it can never really be completely correct about using path names. The right thing to do is to pass trial a module (or package) name, that it can import as a python module and inspect.
So if your directory structure looks like:
~/Projects/MyProject/
~/Projects/MyProject/myproject/
~/Projects/MyProject/myproject/__init__.py
~/Projects/MyProject/myproject/stuff.py
~/Projects/MyProject/myproject/test/
~/Projects/MyProject/myproject/test/__init__.py
~/Projects/MyProject/myproject/test/test_stuff.py
then you should run your tests like this:
PYTHONPATH=$HOME/Projects/MyProject (cd /tmp; trial myproject.test)
in other words, don't run your tests from within your project's directory; this dumps _trial_temp directories all over your source code, confuses "the place I load my code from" and "the current directory" and generally makes a muddle of various things which can be difficult to untangle later.
So, set up your PYTHONPATH and PATH using the path-management tool of your choice: Combinator, setup.py develop, virtualenv – or just dumping junk into your ~/.bashrc – and then run trial from some temporary location, on a uniquely-named top-level Python package, and everything should work just fine.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561073",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
}
|
Q: List jUnit Tests That Were Run Is there a way to get a list of the jUnit tests that were run for the purpose of including that list in a report?
Rather than copying the 80 unit tests I ran, I was hoping to output it as html or a csv that I could then turn into a figure for my report.
Extra points if the pass/fail status of each test were included.
A: It depends how you run them, but if you're using maven, then the surefire plugin produces a report for you.
If you're using ant, see How do I use Ant to create HTML test reports?
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561075",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Problem retrieving results from an index in an embedded RavenDB I have an index that works great when I query it using the .Net client API with a server based RavenDb.
However, if I change the RavenDb to an embedded type then I cannot query the index directly unless I first query the document that the index uses.
For instance if I have the following document objects which reside as separate collections in the RavenDb:
private class TestParentDocument
{
public string Id { get { return GetType().Name + "/" + AggregateRootId; } }
public Guid AggregateRootId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
private class TestChildProductFlagDocument
{
public string TestParentDocumentId { get; set; }
public short ProductFlagTypeId { get; set; }
}
Then I have the following object which represents the output document that the index maps to:
private class TestJoinIndexOutput
{
public string TestParentDocumentId { get; set; }
public string Name { get; set; }
public short ProductFlagTypeId { get; set; }
}
Here is the index definition:
private class TestJoinIndex : AbstractIndexCreationTask<TestChildProductFlagDocument, TestJoinIndexOutput>
{
public TestJoinIndex()
{
Map = docs => from doc in docs
select new
{
TestParentDocumentId = doc.TestParentDocumentId,
ProductFlagTypeId = doc.ProductFlagTypeId
};
TransformResults = (database, results) =>
from result in results
let parentDoc = database.Load<TestParentDocument>(result.TestParentDocumentId)
select new
{
TestParentDocumentId = result.TestParentDocumentId,
ProductFlagTypeId = result.ProductFlagTypeId,
Name = parentDoc.Name
};
}
My code to call the index looks like so:
var theJoinIndexes = ravenSession.Query<TestJoinIndexOutput, TestJoinIndex>().ToList();
This returns almost immediately and fails unless I do the following:
var theParentDocuments = ravenSession.Query<TestParentDocument>().ToList();
var theJoinIndexes = ravenSession.Query<TestJoinIndexOutput, TestJoinIndex>().ToList();
My Ravendb embedded definition looks like so:
docStore = new EmbeddableDocumentStore
{
UseEmbeddedHttpServer = false,
RunInMemory = true
};
docStore.Configuration.Port = 7777;
docStore.Initialize();
IndexCreation.CreateIndexes(typeof(TestJoinIndex).Assembly, docstore);
A: You aren't waiting for indexing to complete, call WaitForNonStaleResultsAsOfNow
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561077",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
}
|
Q: jquery selector find element from other I have the follow html:
<div id="x">
<div id="x1">
</div>
....
</div>
....
<div id="x2">
<table id="y">
</table>
</div>
From "x" I need to reach "y", something like $("#x").find("#y")
Suppose that I do not know what has in the "...".
How to do this?
A: Try the following
$('#x').siblings().find('#y')
In truth though this makes little sense to do given that both elements in this case have id values. It's much faster to just search for #y directly. If you do actually have multiple ids with the same value that's a problem and you should move to an id generation scheme or classes
A: You can go up one level with parent() and use find() from there.
$('#x').parent().find('#y');
A: I think what you are looking for is...
$('#y', $('#x'))
The second parameter is the scope of the selector.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561081",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "-1"
}
|
Q: Conflict on generated R I has some Android projects that I'm integrating on one.
This is something like:
(Lib projects)
Android_Commons
RichReader
FacReader
WWReader
The main project is ReaderShelf, and add all those projects as library on it's path.
But the source linked presents compilation errors, the ids from the library cannot be found on the R class.
I opened all the R files, and they are a merge of all the original R files.
But when opening from the source that give error:
searchButton = (Button) findViewById(R.id.r_search);
sectionsButton = (Button) findViewById(R.id.r_sections);
navigateButton = (Button) findViewById(R.id.r_navigate);
They open the correct file but without the r_sections & r_navigate.
PS: r_search that don't give error is a common id that is presented on the Main project as well
Actually, I found another weird behavior, commenting the problematic lines, the code compiles, but when opening, the DPReaderActivity returns null on all findViewById.
Edit:
I saw the log building the project and I found this, I don't know if it helps
[2011-09-26 18:36:21 - ReaderShelf] trying overlaySet Key=r_favorites.png
[2011-09-26 18:36:21 - ReaderShelf] trying overlaySet Key=r_library.png
[2011-09-26 18:36:21 - ReaderShelf] trying overlaySet Key=r_navigate.png
[2011-09-26 18:36:21 - ReaderShelf] trying overlaySet Key=r_search.png
[2011-09-26 18:36:21 - ReaderShelf] trying overlaySet Key=r_sections.png
A: Check the import list, there might be an import with an outdated package name or with "R" in the name.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561082",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Embedded Linux - Booting phases I would like to systematize my U-Boot/linux knowledge. Is it true that minimum 2 bootloader phases are needed in each embedded platform? Or can following process vary?
*
*1st-stage bootloader (can be U-Boot) is stored in internal the processor's ROM and can't be updated. It will run from internal cache memory. This U-Boot needs to (at least): initialize RAM, initialize external flash, initialize serial console, read and run 2nd-stage bootloader.
*2nd-stage bootloader (can be U-Boot) is stored in RW flash memory. It will handle ethernet, flash RW functions, etc. This U-Boot can be customized and overwritten. Main task is to load linux kernel into RAM and run it.
*linux kernel startup.
Is 1st-stage bootloader always Read-Only?
A: The first-stage bootloader doesn't have to be read-only - but putting a read-only bootloader in ROM with some recovery mode is helpful in case you corrupt the read-write parts of flash; otherwise you'll need to physically attach a programmer to the flash chip in order to recover.
A: If you are using U-Boot, the 2nd stage bootloader can be skipped to speed up the boot time. In other words, the first stage bootloader (SPL) will load the Linux kernel directly, skipping the second stage bootloader (u-boot). In U-Boot, this is called the Falcon Mode.
A: Where, how that first bootloader is is heavily system dependent. You might have some sort of usb bootable device that enumerates and downloads firmware to ram all in hardware then the processor boots from that ram.
Normally yes the first boot is some sort of flash. It is a good idea to have that first bootloader uber simple, essentially 100% bug free and durable and reliable with perhaps a serial or other way to get in so that you can use it to replace the second/real bootloader.
Ideally the second bootloader wants to be flash as well, the second bootloader would want to do the bulk of the work, initializing ddr, setting up ethernet if it wants to have some sort of ethernet based debugging or transferring of files, bootp, etc. Being significantly larger and more complicated it is expected to both have bugs and need to be upgraded more often than the primary bootloader. The primary is hopefully protected from being overwritten, so that you can comfortably replace the second bootloader without bricking the system.
Do all systems use the above? No, some/many may only use a single bootloader, with there perhaps being a pause very early so that a keystroke on a serial port can interrupt the bootloader taking you to a place where you can re-load the bootloader. Allowing for bootloader development with fewer chances at bricking but still a chance if you mess up that first bit before and including the keystroke and serial flash loader thing. Here again that serial loader thing is not always present, just a convenience for the bootloader developers. Often the fallback will be jtag, or a removable prom or some other system way to get in and reprogram the prom when you brick it (also, sometimes the same way you program it the first time in system when the board is produced, some designs are brickable to save on cost and use pre-programmed flashes during manufacturing so the first boot works).
A linux bootloader does not require any/all of this, a very very minimal, setup ram, prep the command line or atags or whatever and branch to linux.
It is a loaded question as the answer is heavily dependent on your system, processor, design engineers (including you). Traditionally processors boot from flash and the bootloader gets memory and some other things up so the next bit of code can run. That next bit of code can come from many places, usb, disk, flash/rom, ethernet/bootp/tftp, pcie, mdio, spi, i2c, etc. And there can be as many layers between power on reset and linux starting as the design desires or requires.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561085",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "11"
}
|
Q: Advice Needed for Honeycomb App Upgrade. I have been doing some research on the upgrading my app (android:maxSdkVersion = “10”) to Honeycomb and would like some advice.
First, one of the activities in my application is a List Activity. Once the user selects an item from the listview, a new activity/layout starts that gives information about the item selected from the listview. The user must then back out of the info screen to get back to the listview. (Simple)
If I move this application to Honeycomb, then I can use Fragments. Using Fragments, I can use both of the above mentioned activities on the screen at once.
Now the dilemma. If I use Fragments to get the functionality I would like, but then I will have to use the Android Compatibility library in order for my FROYO users to use the application. And by using the Android Compatibility library I will bind my application to a lower level of honeycomb OS.
So, if I want to continue upgrading my application past ICE CREAM, then the best thing to do might be to create one application that remains maxSdkVersion = “10” and a second application using minSdkVersion=”11”.
So, for a paid app, users will have to buy two versions of the application?
What am I missing here?
Thanks in advance!
A:
So, for a paid app, users will have to buy two versions of the
application?
If you are using Google Market then, no, you can upload multiple apks and target different configurations using some constraints.
You can read this post from the official android dev blog
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561086",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: How to get the current inner window size in an Adobe AIR app? I need to know the available screen space in my current AIR app, but when I use stage.nativeWindow.width and stage.nativeWindow.height, I get the size of the window including the title bar. I'd like to know the "inner size", so excluding the title bar. How do I do this?
A: Maybe stage.stageWidth and stage.stageHeight are what you are looking for ?
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561087",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Delphi select a paragraph in richedit How to select a paragraph on several lines. Paragraphs are limited by number and not by #10 + *#13? Selection fear to be by clicking or by mouse flying over the paragraph.
A: Basically if you use SelStart and SelLength public properties of your TRichEdit, you can select whatever text you want in your richedit control.
So, you can break your text apart as you want, paragraphs or not, and then just select programmatically a slice of it.
A: {********************************************************************}
// Nombre de la funcion: TI2FStrings.GetCursorSQL
// Explicación: Obtiene el párrafo donde está situado el cursor.
//
// Usuario Fecha Modificación
// ------------ ---------- ------------------------------------------
// drodriguez 11/08/2005 Creación
{********************************************************************}
class function TI2FStrings.GetCursorSQL(Text: string; CursorPos: Integer): string;
var
LastPos, iPos: Integer;
IniPos, FinPos: Integer;
Begin
iPos:= 1;
Repeat
LastPos:= iPos;
iPos:= PosEx(#13#10#13#10, Text, iPos);
if (iPos <> 0) then Inc(iPos, 2);
until (iPos = 0) or (CursorPos < iPos - 1);
if (iPos = 0) then iPos:= Length(Text)
else Dec(iPos, 2);
FinPos:= iPos;
IniPos:= LastPos;
Result:= Trim(Copy(Text, IniPos, FinPos - IniPos + 1));
end;
This is to get an SQL from an TMemo where every SQL is separated by an empty line. Just replace #13#10#13#10 by #13#10.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561098",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Using the linq search option in enumerate files Quick one here. I am trying to EnumerateFiles in a C# application and I want to find all the files in a directory that do not match a given pattern. So I would have something like this:
var files = Directory.EnumerateFiles("MY_DIR_PATH", "NOT_MY_FILE_NAME");
Can someone help me out with the not part?
A: I don't think you can use that overload of EnumerateFiles for this, but you can use linq:
Directory.EnumerateFiles("MY_DIR_PATH").Where(s => s != "NOT_MY_FILE_NAME");
or in query syntax:
var files = from f in Directory.EnumerateFiles("MY_DIR_PATH")
where f != "NOT_MY_FILE_NAME"
select f;
A: You can do something like that:
var files = Directory.EnumerateFiles("MY_DIR_PATH")
.Where(fileName => fileName != "MY_FILE_NAME");
A: How about
var files = Directory.GetFiles("MY_DIR_PATH")
.Where(f => !f.Contains("NOT_MY_FILE_NAME"));
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561100",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Using JavaScript in Android - will it slowdown activity? Hello I what to make a small app for Android 2.2 that will display a chart with data that I'll get from an API. I didn't find a free library for Android that can draw the chart like I want and I was thinking to use a WebView to load a local HTML and then use a JavaScript library to draw my chart.
Is this a good solution or will this create other problems? In the same activity I will have a panel similar to the SlidingDrawer and I am concerned that the calls to my WebView to render the chart will slow down my app.
Thanks for suggestions/advice.
A: I am currently using WebView extensively in Android. While we have done a great deal with it and it generally works, I have noticed some problems with missing touch events when using Canvas inside of a WebView (see How can I prevent performance degradation for Canvas inside of WebView on an Android Xoom?).
My personal advice to you would be to implement the drawing that you want natively. Then if you want to add interactivity, you will benefit from better performance and reliability than through WebView. I'm not sure how the JavaScript library you want to use draws your chart or what your future plans are. For example, if you're going to need WebView and JavaScript for other features, you might as well try it out now and start learning all the details of WebViews. I would search SO for questions related to Android WebView before committing so you have an idea of how much work you are adding so you can "save time" by using a JavaScript library.
My opinion. Hope it's helpful.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561102",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
}
|
Q: asp.net html page I have a (say) start.html page that I want to wrap up in an ASP.NET app, and be the first page to launch once deployed. How do I accomplish this within VS; not within IIS, but within VS to have a deployable package that will contain the start page information.
A: It's really up to IIS to decide the order of priority. So you should define start.html as the first document in IIS. And if you cannot do this for various reasons and IIS decides to pick your default.aspx as default you will have to redirect to: Response.Redirect("~/start.html") but that would really be ugly stuff. Configure your web server appropriately.
A: Have you tried with index.html? I think it's the default.
A: Naming the page default.aspx should do the trick.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561106",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: Dispatcher Thread and UI Rendering Thread working when WPF Form is in Minimized Stat I have two question regarding WPF Dispatcher Thread.
*
*Does dispatcher thread keeps running when your WPF form is in minimized stat.
*I have so many dynamic updated so I flow my updated till winform and then user Timer in winform to update UI. In winform when you minimized winform your Timer will stop working as it is created in UI thread. So my CPU utilization is low. If I have to achieve same behavior in WPF MVVM then how can I achieve that?
A: Both your questions seem to assume that minimizing your app will somehow stop some of your threads. I don't know where you got that idea, but it's completely wrong. Your UI thread is still running even when you're minimized. How else would it ever process the "restore" command when you un-minimize it? How would Windows be able to get its title to show on the taskbar?
You also seem to think that WPF has a "dispatcher thread" that's somehow special. That's not the case. The Dispatcher takes the place of the Windows message queue, which means it's attached to the UI thread. The thing you call a "dispatcher thread" is the same thing as the UI thread. If you're doing WinForms and WPF in the same app, they both run on the same UI thread (unless you're manually starting new threads and starting your own dispatchers on them, but that's a pretty unusual scenario).
And no, your Timer does not stop running just because your app is minimized (unless you manually wrote code to stop it). Try it: add a call to Console.Beep() in your timer tick event, and then try minimizing your app and see for yourself whether it keeps making noise.
Here's my guess: in your timer's Tick event, your WinForms app calls Invalidate(). When the app is minimized, Invalidate does nothing -- the window isn't shown, so there's nothing to invalidate -- so you see low CPU usage because it's not doing anything.
If you want the same behavior in WPF, your best bet is to add this code to the beginning of your Tick event:
if (WindowState == WindowState.Minimized)
return;
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561107",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Q: CSS pseudo classes in Internet Explorer 8 This might apply to IE7 too, I'm not sure though. I have the following CSS:
div#sidebar-right a.menu-item img:nth-child(1),
div#sidebar-right a.menu-item > *:first-child {
position: relative;
left: 11px;
top: 37px;
z-index: 10;
opacity: 0;
-webkit-transform: rotate(6deg);
-moz-transform: rotate(6deg);
-webkit-transition-property: top, opacity, -webkit-transform;
-webkit-transition-duration: 0.2s, 0.3s, 0.5s;
-webkit-transition-timing-function: linear, linear, ease-in;
-moz-transition-property: top, opacity, -moz-transform;
-moz-transition-duration: 0.2s, 0.3s, 0.5s;
-moz-transition-timing-function: linear, linear, ease-in;
}
div#sidebar-right a.menu-item:hover img:nth-child(1),
div#sidebar-right a.menu-item:hover > *:first-child {
top: -6px;
opacity: 1;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
}
div#sidebar-right a.menu-item img:nth-child(2),
div#sidebar-right a.menu-item > *:first-child + * {
position: relative;
z-index: 11;
top: -63px;
}
div#sidebar-right a.menu-item.home-menu:hover img:nth-child(2),
div#sidebar-right a.menu-item.home-menu:hover > *:first-child + * {
top: -100px;
}
div#sidebar-right a.menu-item.code-menu:hover img:nth-child(2),
div#sidebar-right a.menu-item.code-menu:hover > *:first-child + * {
top: -97px;
}
div#sidebar-right a.menu-item.game-menu:hover img:nth-child(2),
div#sidebar-right a.menu-item.game-menu:hover > *:first-child + * {
top: -101px;
}
div#sidebar-right a.menu-item.sports-menu:hover img:nth-child(2),
div#sidebar-right a.menu-item.sports-menu:hover > *:first-child + * {
top: -98px;
}
div#sidebar-right a.menu-item.the-nation-menu:hover img:nth-child(2),
div#sidebar-right a.menu-item.the-nation-menu:hover > *:first-child + * {
top: -98px;
}
For some reason this CSS is not being picked up in IE8 at all. I understand that nth-child is not supported in IE8, but first-child is and that's also listed as a rule here. Any thoughts? What's really puzzling is that the rule isn't just not being applied, it's just not showing up. If you look at the Developer Tools view under the CSS tab, you can literally scroll through the entire thing and not see any of these rules in there. Very confusing.
A: It seems you misunderstood how selector parsing works. IE8 sees selector of the form something_invalid, something_valid which means it should ignore the entire selector and not apply the properties. I'll give you another example - imagine you specify selector like div, p:foo-bar { /* properties */ }. Even if the div selector is completely valid, the declaration is dropped because of the unrecognized pseudoclass foo-bar. Browsers always check if the entire selector is valid; there's nothing special when using comma in the selector.
The solution is simple - just remove the nth-child part of selectors; your notation with first-child will match the desired elements in all browsers.
A: try a.menu-item.home-menu:hover * instead of a.menu-item.home-menu:hover > *:first-child + *
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561108",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
}
|
Q: jquery - parse json - 2 arrays How to use each parse the json type -
retrieveMessage: function()
{
$.post('ActionScripts/RetrieveMessage.php',{
}, function(data) {
$.each(data, function(key, reader){
alert(reader.id + reader.count); //this line does not return anything
});
},"json");
}
data:
[{"id":"1","user_name":"Jenan","user_image":"ImageName","text_chat":"Hello","date":"2011-09-25 21:29:09","error":""}][{"count":"2"}]
I would get text -
id=1 count=2
PHP
$jsonresult = array();
$count = array();
$countresult = array();
$countresult["count"] = "2";
$count[] = $countresult;
while($row = mysql_fetch_array($result))
{
$thisResult = array();
$thisResult["user_auth"] = 1;
$thisResult["id"] = $row['id'];
$thisResult["user_name"] = $row['user_name'];
$thisResult["user_image"] = $row['user_image'];
$thisResult["text_chat"] = $row['text_chat'];
$thisResult["date"] = $row['date'];
$thisResult["error"] = "";
$jsonresult[] = $thisResult;
}
echo json_encode($jsonresult) . json_encode($count);
Here compose two collections together.
How to read the collection with id parameters and collection of the count? Is this the right solution? What solution do I choose for composing arrays?
Thanks for the advice.
A: Instead of gluing 2 arrays together:
echo json_encode($jsonresult) . json_encode($count);
you should make one array that contains them:
echo json_encode(array(
'result' => $jsonresult,
'count' => $count
));
Now in your JavaScript:
$.post('ActionScripts/RetrieveMessage.php', {}, function(data) {
var result = data.result;
var count = data.count;
$.each(result, function(k,v){
alert(v.id+' '+count[k].count); // 1 2
});
},"json");
A: try
}, function(data) {
data = eval(data);
$.each(data, function(key, reader){
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561110",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Is MSDTC a big resource drain? So, Is MSDTC a big resource drain on a system (server & application)?
In the past, I have written several large scale web applications that rely on MSDTC for database transactions. I have never investigated how much of a drain that would be on the server.
Currently, I am working with CSLA framework and CSLA doesn't rely on MSDTC for transactions. It basically reuses the same connection object and executes all database commands within a TransactionScope object.
I guess I am looking for some arguments either way as to using MSDTC or not.
A: MSTDC is used for distributed transaction. To simplify, using a TransactionScope can implicitely use MSDTC if the transaction needs to be distributed, ie: if the TransactionScope surrounds a piece of code that implies more than one resource. This is called escalation, and most of the time happens automatically.
So, yes it takes somes resources, but if you do need ACID transaction across multiple systems ("resource managers", like SQL Server, Oracle, or MSMQ for example) on a Windows OS, you don't have much choice but use MSDTC.
One thing about performance that can be done when configuration MSDTC, is ensure there is only one Coordinator for a pool of distributed resources, avoiding MSDTC to MSDTC communication. Configuration is usually the biggest problem you'll face with MSDTC. Example here: http://yrushka.com/index.php/security/configure-msdtc-for-distributed-transactions/
A: Compared to you application probably not. I use it on my current project and I have never noticed it affecting the CPU resources. What you do have to be careful about is latency, if there are multiple servers involved in your transaction that will be a much bigger problem than CPU.
Another way to look at is, its not going to be CPU bound, execution will be based on IO. Of course this assumes you don't do a lot of computation in your transaction, but that's not DTC's fault now is it?
A: I have used MSDTC for transactions enrolling multiple partners (one or more DB servers and one or more servers using MSMQ). The drain of using MSDTC in terms of performance vs. using transactions in general isn't a big deal. We were processing more than 40 million messages a data through MSMQ and every single one had a db action as well (though some were just cached reads, not many though).
The biggest problem is MSDTC is a huge pain in the but when you are crossing zones (e.g. DMZ to intranet). Getting stuff to enroll when they are in different zones is possible but takes tweaking. DTC also has a large number of configuration options if you are interested.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561111",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
}
|
Q: Filling in hidden inputs with Behat I am writing Behat tests and I need to change the value of a hidden input field
<input type="hidden" id="input_id" ..... />
I need to change the value of this input field, but I keep getting
Form field with id|name|label|value "input_id" not found
I have been using the step
$steps->And('I fill in "1" for "input_id"', $world);
Is there something special which needs to be done to modify hidden input fields?
A: Rev is right. If real user can can change input fields via javascript by clicking a button or link. try doing that. Fields that are not visible to user are also not visible to Mink also.
Or else what you can do is Call $session->executeScript($javascript) from your context with $javascript like
$javascript = "document.getElementById('input_id').value='abc'";
$this->getSession()->executeScript($javascript);
and check if that works
A: It's intended by design. Mink is user+browser emulator. It emulates everything, that real user can do in real browser. And user surely can't fill hidden fields on the page - he just don't see them.
Mink is not crawler, it's a browser emulator. The whole idea of Mink is to describe real user interactions through simple and clean API. If there's something, that user can't do through real browser - you can't do it with Mink.
(source: http://groups.google.com/group/behat/browse_thread/thread/f06d423c27754c4d)
A: Despite the fact that user can't fill hidden fields, there are some situations when this is desirable to be able to fill hidden field for testing (as usually rules have exceptions). You can use next step in your feature context class to fill hidden field by name:
/**
* @Given /^I fill hidden field "([^"]*)" with "([^"]*)"$/
*/
public function iFillHiddenFieldWith($field, $value)
{
$this->getSession()->getPage()->find('css',
'input[name="'.$field.'"]')->setValue($value);
}
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561114",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
}
|
Q: Web app in full screen mode on Ipod I have a web app I'm building a mobile site for. I'm trying to run it in full screen without a nav bar if the user has added the page to their home screen.
Right now, my javascript is very simple:
if (navigator.standalone) {
alert ('From Home Screen');
} else {
alert ('From Browser');
}
All I want to check to see is if I can detect whether or not the user has added the app to their home screen. With the code above, even after adding the app to the home screen, the app is only ever being caught by the else statement.
Looking through apple's documentation, I found this goody:
<meta name="apple-mobile-web-app-capable" content="yes" />
Adding that code to my didn't seem to do a thing. I still cannot get the site to go into fullscreen mode, or alert it as standalone.
A: That meta tag is (apparently) processed when the link is added to the home screen. So, if you added it to your home screen before adding the meta tag, it will have no effect.
Try removing the icon from your home screen and adding it again.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561116",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: How do I Connect to remote service from a different .apk First off I have seen this:
Remote Service as apk
And it does not help me at all. Here is the deal. I have one apk that creates a remote service (call it A). I then have another apk (call it B). How can I connect B to A without include the AIDL file or a jar file. I would think that this would be possible.
** UPDATE **
So I have copied the AIDL file into B and created an to the service in A for the AIDL file. I can conntect to the remote service, and bind to the service now. However when I try to call a method that exists in the service I get:
java.lang.SecurityException: Binder invocation to an incorrect interface
Having trouble finding any help on this. Any ideas?
** PROBLEM SOLVED **
The AIDL file had to be in a package with the same name in the project B. Thanks for your help Peter.
A: You have to know the format of the data that is sent between two separate processes. This is needed for serialization/deserialization of the data to Java objects.
AIDL is a description language to describe the structure of objects.
So, you have two options:
*
*Either you have an AIDL, or
*your code explicitly know the format to do the de-/serialization. This is the implementation of Parcelable. This implementation could be inside a jar that you include in your app.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561117",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
}
|
Q: Php array rebuild I got an array looking like this:
array("canv" => array(1 => "4", 2 => "6", 3 => "9", 4 => "7");
I need it to look like this:
array("canv" => array("4", "6", "9", "7");
so I can easly check if the value exist this way:
if(isset($result["canv"][$gid])) where $gid is a number from "4", "6", "9", "7".
How can it be done?
A: This will flip the values to become keys and vice versa:
$result["canv"] = array_flip($result["canv"]);
So instead of
array(1 => "4", 2 => "6", 3 => "9", 4 => "7")
you'll have
array("4" => 1, "6" => 2, "9" => 3, "7" => 4)
But then again think about building the original array in the desired way and only do this if you can't afford that.
A: Without any modification, with your existing array, you can check it as:
if (in_array($gid, $result["canv"])) {
// $gid is in the array
}
Logically, if canv is to be an array of those values, the values should be array members rather than the array keys which point to members. You are asking to use them as array keys. Unless you want them to behave as keys later on, whereby they will be used to point to array values, you should not change them now.
A: It won't work because you are looking for array keys, while 4, 6, 9 and 7 are the values, but if you use array_search($gid, $result['canv']) you'll find the index of $gid or false if $gid's value is not in the list.
So this will work:
if(array_search($gid, $result['canv']) !== false){
//Do Stuff
}
A: Then I don't think you want it to look like that.... You want it to look like this:
array(
"canv" => array(
4 => "value",
6 => "value",
9 => "value",
7 => "value"
)
)
You did not specify what values you want, but it may not matter. You can arrive at at that however you want, but if you wind up with an array with (4,6,9,7) in it, you can just do array_flip and it will exchange the keys with the values.
|
{
"language": "en",
"url": "https://stackoverflow.com/questions/7561119",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.