PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,297,790 | 07/02/2012 16:42:29 | 773,202 | 05/27/2011 13:47:17 | 170 | 8 | css four-column left floated layout with equal left and right margins | I have a four-column, left-floated layout. I want equal margins for left and right margins. I've floated the four columns to the left and assigned a right margin of 20px on each float. The full width column div looks correct, but the margins and columns are not displaying correctly on the columns with different widths. I've gone over the math several times and my eyes are burning trying to figure out what I'm doing wrong.
Any suggestions on the best way to do this or how to do this? Thanks.
[4 column margins not correct][1]
[1]: http://jsfiddle.net/Chris22/w3YRF/1/ | css-float | margins | multiple-columns | null | null | null | open | css four-column left floated layout with equal left and right margins
===
I have a four-column, left-floated layout. I want equal margins for left and right margins. I've floated the four columns to the left and assigned a right margin of 20px on each float. The full width column div looks correct, but the margins and columns are not displaying correctly on the columns with different widths. I've gone over the math several times and my eyes are burning trying to figure out what I'm doing wrong.
Any suggestions on the best way to do this or how to do this? Thanks.
[4 column margins not correct][1]
[1]: http://jsfiddle.net/Chris22/w3YRF/1/ | 0 |
11,297,754 | 07/02/2012 16:40:06 | 576,682 | 01/15/2011 11:48:12 | 1,700 | 21 | What Is The Best Keystore to use? | I want to use [Keystore][1] in my upcoming project. I saw that there is an [Keystore API][2] in Java. But that seems to be very complicated.
Are there any other good keystore available that work well with Java/Groovy?
[1]: http://en.wikipedia.org/wiki/Keystore
[2]: http://docs.oracle.com/javase/1.4.2/docs/api/java/security/KeyStore.html | java | groovy | null | null | null | null | open | What Is The Best Keystore to use?
===
I want to use [Keystore][1] in my upcoming project. I saw that there is an [Keystore API][2] in Java. But that seems to be very complicated.
Are there any other good keystore available that work well with Java/Groovy?
[1]: http://en.wikipedia.org/wiki/Keystore
[2]: http://docs.oracle.com/javase/1.4.2/docs/api/java/security/KeyStore.html | 0 |
11,297,757 | 07/02/2012 16:40:21 | 857,994 | 07/22/2011 13:21:38 | 6,780 | 230 | DataGridView Sort - Keep two in sync | If I have two DataGridView items in a C# Win Forms application, and they have the same column set at all times, how can I ensure they are always sorted the same way?
I can get a notification when one grid or the other sorts, but if I try to use that notification to sort the other grid in the same way I get a stack overflow (for obvious reasons).
I'm sure I can get around the stack overflow problem with some ugly hacks, but I figure there must be a normal way to do this. I can't be the first one with the need to keep two DataGridViews in sync when the user's sorting them. | c# | .net | winforms | .net-3.5 | datagridview | null | open | DataGridView Sort - Keep two in sync
===
If I have two DataGridView items in a C# Win Forms application, and they have the same column set at all times, how can I ensure they are always sorted the same way?
I can get a notification when one grid or the other sorts, but if I try to use that notification to sort the other grid in the same way I get a stack overflow (for obvious reasons).
I'm sure I can get around the stack overflow problem with some ugly hacks, but I figure there must be a normal way to do this. I can't be the first one with the need to keep two DataGridViews in sync when the user's sorting them. | 0 |
11,326,266 | 07/04/2012 09:30:09 | 1,479,556 | 06/25/2012 09:41:17 | 31 | 2 | How to use SQLite in Android? | Please help me for using SQLite in android.
How to add ,update and delete records from SQLite.
If possible, show me some sample code.
Please help me while i am new to android. | android | null | null | null | null | 07/04/2012 09:48:14 | not a real question | How to use SQLite in Android?
===
Please help me for using SQLite in android.
How to add ,update and delete records from SQLite.
If possible, show me some sample code.
Please help me while i am new to android. | 1 |
11,326,267 | 07/04/2012 09:30:09 | 1,107,377 | 12/20/2011 08:10:54 | 44 | 0 | How to zip an existing folder with files inside it? | I am using SharpZipLib and I need to zip an existing folder where there are files inside it.
**Example:**
I need to zip "Folder2"
C:\Folder1\Folder2
Folder2 has two files a.txt and b.txt
My current code uses "FastZip"
FastZip fastzip = new FastZip();
Boolean recurse = true;
String filter = null;
fastzip.CreateZip(folderName, @"\" + folderName, recurse, filter);
I get an error of:
*Access to path C:\Folder1\Folder2 is denied.*
Any experts out here on SharZipLib? :) | c# | icsharpziplib | null | null | null | null | open | How to zip an existing folder with files inside it?
===
I am using SharpZipLib and I need to zip an existing folder where there are files inside it.
**Example:**
I need to zip "Folder2"
C:\Folder1\Folder2
Folder2 has two files a.txt and b.txt
My current code uses "FastZip"
FastZip fastzip = new FastZip();
Boolean recurse = true;
String filter = null;
fastzip.CreateZip(folderName, @"\" + folderName, recurse, filter);
I get an error of:
*Access to path C:\Folder1\Folder2 is denied.*
Any experts out here on SharZipLib? :) | 0 |
11,372,239 | 07/07/2012 04:20:40 | 1,346,618 | 04/20/2012 13:03:47 | 23 | 1 | Using ajax for form submission with multiple forms generated by php on page | I have a page with multiple forms that do the same thing, acting as a `like` button for each post in the page, and right next to it the number of likes inside a div named "likes".$id, so I can identify where to write the likes count after the ajax call. I was trying to use jQuery ajax function, but I couldn't set what div to write the results of the function.
$.ajax({type:'POST', url: 'likepost.php', data:$('#like').serialize(), success: function(response) {
$('#like').find('#likediv').html(response);
}});
And how would I access the data on likepost.php? I am terrible with javascript, so I hope someone could help me and explain how the jQuery function really works, because I've been copying and pasting it without really knowing what I was doing. | php | jquery | ajax | facebook-like | null | null | open | Using ajax for form submission with multiple forms generated by php on page
===
I have a page with multiple forms that do the same thing, acting as a `like` button for each post in the page, and right next to it the number of likes inside a div named "likes".$id, so I can identify where to write the likes count after the ajax call. I was trying to use jQuery ajax function, but I couldn't set what div to write the results of the function.
$.ajax({type:'POST', url: 'likepost.php', data:$('#like').serialize(), success: function(response) {
$('#like').find('#likediv').html(response);
}});
And how would I access the data on likepost.php? I am terrible with javascript, so I hope someone could help me and explain how the jQuery function really works, because I've been copying and pasting it without really knowing what I was doing. | 0 |
11,372,241 | 07/07/2012 04:21:06 | 1,484,285 | 06/27/2012 01:08:34 | 18 | 0 | Action Helper in Ember JS not calling function | <a class="btn btn-primary" href="#" {{action "toggleStatus"}}><i class="icon-plus icon-white"></i> Add Staff</a>
This is in a view template called stafflist.handlebars. The content is as follows
<div class="page-header">
<h3>{{staff.title}} <small>List of users who has access to this application</small></h3>
</div>
<div class="commands pull-right">
sta
<a class="btn btn-primary" href="#" {{action "toggleStatus"}}><i class="icon-user icon-white"></i> {{staff.btnTitle}}</a>
</div>
<div class="pull-left">
<input type="text" class="search-query" placeholder="Search">
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>NAME</td>
<td>ID</td>
</tr>
<thead>
<tbody>
{{#each staff}}
<tr>
<td>{{this.fname}}</td>
<td>{{this.id}}</td>
</tr>
{{/each}}
</tbody>
</table>
The View file is as below
App.StaffListView = Em.View.extend({
templateName:'sellap-web/~templates/stafflist',
staffBinding:'App.staffController',
toggleStatus: function() {
alert('Hurray');
}
});
When clicking the button, the action is never calling the alert. What is going wrong here. I am using ember-skeleton to compile.
| emberjs | handlebars.js | null | null | null | null | open | Action Helper in Ember JS not calling function
===
<a class="btn btn-primary" href="#" {{action "toggleStatus"}}><i class="icon-plus icon-white"></i> Add Staff</a>
This is in a view template called stafflist.handlebars. The content is as follows
<div class="page-header">
<h3>{{staff.title}} <small>List of users who has access to this application</small></h3>
</div>
<div class="commands pull-right">
sta
<a class="btn btn-primary" href="#" {{action "toggleStatus"}}><i class="icon-user icon-white"></i> {{staff.btnTitle}}</a>
</div>
<div class="pull-left">
<input type="text" class="search-query" placeholder="Search">
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>NAME</td>
<td>ID</td>
</tr>
<thead>
<tbody>
{{#each staff}}
<tr>
<td>{{this.fname}}</td>
<td>{{this.id}}</td>
</tr>
{{/each}}
</tbody>
</table>
The View file is as below
App.StaffListView = Em.View.extend({
templateName:'sellap-web/~templates/stafflist',
staffBinding:'App.staffController',
toggleStatus: function() {
alert('Hurray');
}
});
When clicking the button, the action is never calling the alert. What is going wrong here. I am using ember-skeleton to compile.
| 0 |
11,372,282 | 07/07/2012 04:33:19 | 383,759 | 07/05/2010 14:11:42 | 4,348 | 87 | define anonymous function using values from current scope? | I am trying to create an anonymous function but need to access variables from the current scope in it's definition:
class test {
private $types = array('css' => array('folder' => 'css'));
public function __construct(){
//define our asset types
foreach($this->types as $name => $attrs){
$this->{$name} = function($file = ''){
//this line is where is falls over!
//undefined variable $attrs!
return '<link href="'.$attrs['folder'].'/'.$file.'" />';
}
}
}
}
$assets = new test();
Obviously this example is very very minimalistic but it gets across what I am trying to do.
So, my question is,
How can I access the parent scope only for the definition of the function?
(once defined I obviously don't need that context when the function is called). | php | scope | anonymous-function | null | null | null | open | define anonymous function using values from current scope?
===
I am trying to create an anonymous function but need to access variables from the current scope in it's definition:
class test {
private $types = array('css' => array('folder' => 'css'));
public function __construct(){
//define our asset types
foreach($this->types as $name => $attrs){
$this->{$name} = function($file = ''){
//this line is where is falls over!
//undefined variable $attrs!
return '<link href="'.$attrs['folder'].'/'.$file.'" />';
}
}
}
}
$assets = new test();
Obviously this example is very very minimalistic but it gets across what I am trying to do.
So, my question is,
How can I access the parent scope only for the definition of the function?
(once defined I obviously don't need that context when the function is called). | 0 |
11,372,284 | 07/07/2012 04:33:25 | 1,508,244 | 07/07/2012 04:28:22 | 1 | 0 | How to: Google Feed API entry.contentSnippet remove readmore text | I've searching but i cant find a solution for this..
Is there any way to remove the "read more" text from entry.contentSnippet?
Cheers,
Jun | google-feed-api | null | null | null | null | null | open | How to: Google Feed API entry.contentSnippet remove readmore text
===
I've searching but i cant find a solution for this..
Is there any way to remove the "read more" text from entry.contentSnippet?
Cheers,
Jun | 0 |
11,372,285 | 07/07/2012 04:33:42 | 754,004 | 05/14/2011 21:08:57 | 100 | 6 | Check to see if one year has passed | I run a web design firm, and we also sell hosting on a yearly basis to our customers. I'm writing a Ruby script to read all of the customers from a SQL database and check to see if a year has passed. If it has (or is at least close to expiring), I want it to send an Email to them.
I have all of the SQL and Emailing part down, but how would I check to see if one year has passed using the Time class, or another solution? | ruby | datetime | time | null | null | null | open | Check to see if one year has passed
===
I run a web design firm, and we also sell hosting on a yearly basis to our customers. I'm writing a Ruby script to read all of the customers from a SQL database and check to see if a year has passed. If it has (or is at least close to expiring), I want it to send an Email to them.
I have all of the SQL and Emailing part down, but how would I check to see if one year has passed using the Time class, or another solution? | 0 |
11,372,634 | 07/07/2012 05:49:20 | 1,508,290 | 07/07/2012 05:16:58 | 1 | 0 | How to retrieve recently uploaded file name in codeigniter | I am developing an website in php where user can upload csv file. after clicking 'upload' button, file is renamed and saved in the format 'upload'.time(). I need to show the contents of the uploaded file just after uploading the file.
So far I have been able to upload file correctly and I have tested with a static filename and have been able to read csv file perfectly. but when I am trying to get recently uploaded file name just after uploading I am not getting anywhere. searched through the whole site but didn't get any solution that worked for me.
I am using codeigniter 2.1.0 .
Controller file:
<?php
class Csv_ci extends CI_Controller {
function is_logged() {
$is_logged_in = $this->session->userdata('is_logged_in');
if (!isset($is_logged_in) || $is_logged_in != true)
return false;
else
return true;
}
function index() {
if ($this->is_logged() == TRUE) {
$this->load->model('Csv_model');
if ($this->input->post('upload')) {
$name = $this->Csv_model->do_upload();
//print_r($name);
if (isset($name)) {
$filePath = "localhost/map_ci/csv/" . $name;
//$filePath = './csv/bank_data.csv';
$row = 1;
if (($handle = fopen($filePath, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
$num = count($data);
$file_data[$row]['district_name'] = $data[1];
$file_data[$row]['bank_name'] = $data[2];
$file_data[$row]['area_name'] = $data[3];
$file_data[$row]['address'] = $data[4];
$row++;
}
fclose($handle);
}
$this->load->view('csvshow', array('file_data' => $file_data));
}
}
}
else $this->load->view('invalid_member');
}
}
Model file:
<?php
class Csv_model extends CI_Model {
var $gallery_path;
var $gallery_path_url;
function Csv_model() {
parent::__construct();
$this->gallery_path = realpath(APPPATH . '../csv');
$this->gallery_path_url = base_url() . 'csv/';
}
function do_upload() {
$config = array(
'upload_path' => $this->gallery_path,
'allowed_types' => 'text/csv|csv|text/x-comma-separated-values|text/comma-separated-values|application/x-csv|text/x-csv|text/csv|application/csv|',
'max_size' => '5000',
'file_name' => 'upload' . time()
);
$this->load->library('upload', $config);
if (!$this->upload->do_upload())
echo $this->upload->display_errors();
else {
$file_info = $this->upload->data();
$csvfilepath = "csv/" . $file_info['file_name'];
$this->addfromcsv($csvfilepath);
$filename = $file_info['file_name'];
// print_r($filename);
return $filename;
}
}
}
to retrieve file name I am doing ` file_info['file_name']`.
Please help my find a solution.
| php | codeigniter | null | null | null | null | open | How to retrieve recently uploaded file name in codeigniter
===
I am developing an website in php where user can upload csv file. after clicking 'upload' button, file is renamed and saved in the format 'upload'.time(). I need to show the contents of the uploaded file just after uploading the file.
So far I have been able to upload file correctly and I have tested with a static filename and have been able to read csv file perfectly. but when I am trying to get recently uploaded file name just after uploading I am not getting anywhere. searched through the whole site but didn't get any solution that worked for me.
I am using codeigniter 2.1.0 .
Controller file:
<?php
class Csv_ci extends CI_Controller {
function is_logged() {
$is_logged_in = $this->session->userdata('is_logged_in');
if (!isset($is_logged_in) || $is_logged_in != true)
return false;
else
return true;
}
function index() {
if ($this->is_logged() == TRUE) {
$this->load->model('Csv_model');
if ($this->input->post('upload')) {
$name = $this->Csv_model->do_upload();
//print_r($name);
if (isset($name)) {
$filePath = "localhost/map_ci/csv/" . $name;
//$filePath = './csv/bank_data.csv';
$row = 1;
if (($handle = fopen($filePath, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
$num = count($data);
$file_data[$row]['district_name'] = $data[1];
$file_data[$row]['bank_name'] = $data[2];
$file_data[$row]['area_name'] = $data[3];
$file_data[$row]['address'] = $data[4];
$row++;
}
fclose($handle);
}
$this->load->view('csvshow', array('file_data' => $file_data));
}
}
}
else $this->load->view('invalid_member');
}
}
Model file:
<?php
class Csv_model extends CI_Model {
var $gallery_path;
var $gallery_path_url;
function Csv_model() {
parent::__construct();
$this->gallery_path = realpath(APPPATH . '../csv');
$this->gallery_path_url = base_url() . 'csv/';
}
function do_upload() {
$config = array(
'upload_path' => $this->gallery_path,
'allowed_types' => 'text/csv|csv|text/x-comma-separated-values|text/comma-separated-values|application/x-csv|text/x-csv|text/csv|application/csv|',
'max_size' => '5000',
'file_name' => 'upload' . time()
);
$this->load->library('upload', $config);
if (!$this->upload->do_upload())
echo $this->upload->display_errors();
else {
$file_info = $this->upload->data();
$csvfilepath = "csv/" . $file_info['file_name'];
$this->addfromcsv($csvfilepath);
$filename = $file_info['file_name'];
// print_r($filename);
return $filename;
}
}
}
to retrieve file name I am doing ` file_info['file_name']`.
Please help my find a solution.
| 0 |
11,372,635 | 07/07/2012 05:49:34 | 109,618 | 05/19/2009 21:13:08 | 1,214 | 61 | How to write Minitest spec for ApplicationHelper? | I know how to write the following style of test for Minitest...
<pre>
require "minitest_helper"
class ApplicationHelperTest < ActionView::TestCase
def test_nav_element_for_current_page
self.stub(:current_page?, true) do
nav_element('Home', '#').must_equal(
'<li class="active"><a href="#">Home</a></li>')
end
end
def test_nav_element_for_non_current_page
self.stub(:current_page?, false) do
nav_element('Home', '#').must_equal(
'<li><a href="#">Home</a></li>')
end
end
end
</pre>
...but I want to write it in spec format. Here is what I have tried, but it does not work:
<pre>
require "minitest_helper"
describe ApplicationHelper do
it "nav_element for current page" do
self.stub(:current_page?, true) do
nav_element('Home', '#').must_equal(
'<li class="active"><a href="#">Home</a></li>')
end
end
it "nav_element for non-current page" do
self.stub(:current_page?, false) do
nav_element('Home', '#').must_equal(
'<li><a href="#">Home</a></li>')
end
end
end
</pre>
How do I tell Minitest that `ApplicationHelper` should automatically include `ActionView::TestCase`? I've tried several things, with no luck yet.
Just for background, `application_helper.rb` contains:
<pre>
module ApplicationHelper
def nav_element(text, path)
options = {}
options[:class] = 'active' if current_page?(path)
link_tag = content_tag(:a, text, href: path)
content_tag(:li, link_tag, options)
end
end
</pre>
I am using these bundled gems:
<pre>
* rails (3.2.6)
* minitest (3.2.0)
* minitest-rails (0.1.0.alpha.20120525143907 7733031)
</pre>
(Please note that this is the head version of `minitest_rails` (https://github.com/blowmage/minitest-rails).)
| ruby-on-rails-3 | minitest | null | null | null | null | open | How to write Minitest spec for ApplicationHelper?
===
I know how to write the following style of test for Minitest...
<pre>
require "minitest_helper"
class ApplicationHelperTest < ActionView::TestCase
def test_nav_element_for_current_page
self.stub(:current_page?, true) do
nav_element('Home', '#').must_equal(
'<li class="active"><a href="#">Home</a></li>')
end
end
def test_nav_element_for_non_current_page
self.stub(:current_page?, false) do
nav_element('Home', '#').must_equal(
'<li><a href="#">Home</a></li>')
end
end
end
</pre>
...but I want to write it in spec format. Here is what I have tried, but it does not work:
<pre>
require "minitest_helper"
describe ApplicationHelper do
it "nav_element for current page" do
self.stub(:current_page?, true) do
nav_element('Home', '#').must_equal(
'<li class="active"><a href="#">Home</a></li>')
end
end
it "nav_element for non-current page" do
self.stub(:current_page?, false) do
nav_element('Home', '#').must_equal(
'<li><a href="#">Home</a></li>')
end
end
end
</pre>
How do I tell Minitest that `ApplicationHelper` should automatically include `ActionView::TestCase`? I've tried several things, with no luck yet.
Just for background, `application_helper.rb` contains:
<pre>
module ApplicationHelper
def nav_element(text, path)
options = {}
options[:class] = 'active' if current_page?(path)
link_tag = content_tag(:a, text, href: path)
content_tag(:li, link_tag, options)
end
end
</pre>
I am using these bundled gems:
<pre>
* rails (3.2.6)
* minitest (3.2.0)
* minitest-rails (0.1.0.alpha.20120525143907 7733031)
</pre>
(Please note that this is the head version of `minitest_rails` (https://github.com/blowmage/minitest-rails).)
| 0 |
11,372,637 | 07/07/2012 05:49:43 | 1,254,709 | 03/07/2012 12:47:27 | 118 | 13 | violation of "Unique Particle Attribution" | when I want to validate my xsd file, I got this error
cos-nonambig: "my xsd file":layout and "my xsd file":layout (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.
and refers me to this tag
<xs:complexType name="pageType">
<xs:choice>
<xs:element type="main:layoutType" name="layout" minOccurs="0" maxOccurs="1"/>
<xs:group ref="main:WidgetsGroup" maxOccurs="unbounded" minOccurs="0"/>
</xs:choice>
<xs:attribute type="xs:string" name="name"/>
<xs:attribute type="xs:string" name="layout"/>
<xs:attribute type="xs:string" name="dataModel"/>
<xs:attribute type="xs:string" name="domain"/>
</xs:complexType>
what is the problem? and how could I fix it? | validation | xsd | null | null | null | null | open | violation of "Unique Particle Attribution"
===
when I want to validate my xsd file, I got this error
cos-nonambig: "my xsd file":layout and "my xsd file":layout (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.
and refers me to this tag
<xs:complexType name="pageType">
<xs:choice>
<xs:element type="main:layoutType" name="layout" minOccurs="0" maxOccurs="1"/>
<xs:group ref="main:WidgetsGroup" maxOccurs="unbounded" minOccurs="0"/>
</xs:choice>
<xs:attribute type="xs:string" name="name"/>
<xs:attribute type="xs:string" name="layout"/>
<xs:attribute type="xs:string" name="dataModel"/>
<xs:attribute type="xs:string" name="domain"/>
</xs:complexType>
what is the problem? and how could I fix it? | 0 |
11,372,638 | 07/07/2012 05:49:53 | 689,288 | 04/02/2011 21:32:20 | 47 | 2 | How to make a shell call from within a MySQL function or Trigger | I have a table that records positions (gps) and fires insert trigger, where I check if new point is inside or outside of an area, based on the result I need to notify (send email or sms).
I am able detect from trigger that i need to send the notification but will like to be able to make a shell call or http to an url to call and send the email. something like http://myserver.com/[email protected]&subject=New+Messaje&body=You+are+inside
If this is not posible how can be another / better approach.
Thanks | mysql | shell | stored-procedures | triggers | shellexecute | null | open | How to make a shell call from within a MySQL function or Trigger
===
I have a table that records positions (gps) and fires insert trigger, where I check if new point is inside or outside of an area, based on the result I need to notify (send email or sms).
I am able detect from trigger that i need to send the notification but will like to be able to make a shell call or http to an url to call and send the email. something like http://myserver.com/[email protected]&subject=New+Messaje&body=You+are+inside
If this is not posible how can be another / better approach.
Thanks | 0 |
11,372,641 | 07/07/2012 05:50:07 | 962,365 | 09/24/2011 07:03:33 | 3 | 0 | Joomla site "Not found" error | I have a Joomla 2.5 site set up but when I try to access the domain I get an **intermittent** error on the screen just saying "Not found". It sometimes happends when visiting with `www`, sometimes with `http://` and sometimes with `http://www`.
Here is the error: http://imgur.com/7f6ak
I have done a thorough look into the domain and all the DNS and records are working as expected and resolving correctly all around the world making me think it must be a Joomla error of some kind.
I have also tried to enter the sites domain into the $live_url in the configuration file but it stil happends.
Any help or ideas greatly appreciated
[1]: http://i.stack.imgur.com/LZ9os.png | joomla | error-message | http-status-code-404 | joomla2.5 | null | null | open | Joomla site "Not found" error
===
I have a Joomla 2.5 site set up but when I try to access the domain I get an **intermittent** error on the screen just saying "Not found". It sometimes happends when visiting with `www`, sometimes with `http://` and sometimes with `http://www`.
Here is the error: http://imgur.com/7f6ak
I have done a thorough look into the domain and all the DNS and records are working as expected and resolving correctly all around the world making me think it must be a Joomla error of some kind.
I have also tried to enter the sites domain into the $live_url in the configuration file but it stil happends.
Any help or ideas greatly appreciated
[1]: http://i.stack.imgur.com/LZ9os.png | 0 |
11,372,643 | 07/07/2012 05:50:12 | 1,465,351 | 06/19/2012 04:23:22 | 16 | 0 | How to set image border for Layout (RelativeLayout) in Android? | I want to use border image is below :
![enter image description here][1]
[1]: http://i.stack.imgur.com/39vG9.png
set border for Layout ...?
Should i do it ? | android | border | null | null | null | null | open | How to set image border for Layout (RelativeLayout) in Android?
===
I want to use border image is below :
![enter image description here][1]
[1]: http://i.stack.imgur.com/39vG9.png
set border for Layout ...?
Should i do it ? | 0 |
11,430,058 | 07/11/2012 09:56:36 | 403,717 | 07/27/2010 18:05:35 | 290 | 23 | UIWebView doesn't detect phone number links | I'm building an app with a UIWebView in it.
The webView should load html that includes tel: links:
<a href="tel:123456789">call me</a>
The webView doesn't make the "call me" link to be clickable.
I tried
webView.dataDetectorTypes = UIDataDetectorTypePhoneNumber
But doesn't work.
I looked in all the stackOverflow Q&A's and found no answer specific to this problem.
Thanks for your help,
Nur | iphone | uiwebview | tel | null | null | null | open | UIWebView doesn't detect phone number links
===
I'm building an app with a UIWebView in it.
The webView should load html that includes tel: links:
<a href="tel:123456789">call me</a>
The webView doesn't make the "call me" link to be clickable.
I tried
webView.dataDetectorTypes = UIDataDetectorTypePhoneNumber
But doesn't work.
I looked in all the stackOverflow Q&A's and found no answer specific to this problem.
Thanks for your help,
Nur | 0 |
11,430,059 | 07/11/2012 09:56:38 | 643,875 | 03/03/2011 23:51:56 | 64 | 3 | Parse a url as an image if it's embedded, else generate an html page | I'm working on an image hosting site much like gyazo and something has stumped me.
I want php to parse a URL as an image if it's embedded in a page ( image tag )
But, if the page is being viewed through the browser directly, then generate some html page.
Could anyone help me out with this? | php | html | image | image-processing | null | null | open | Parse a url as an image if it's embedded, else generate an html page
===
I'm working on an image hosting site much like gyazo and something has stumped me.
I want php to parse a URL as an image if it's embedded in a page ( image tag )
But, if the page is being viewed through the browser directly, then generate some html page.
Could anyone help me out with this? | 0 |
11,430,060 | 07/11/2012 09:56:38 | 406,457 | 07/30/2010 06:30:03 | 368 | 16 | How to draw graph using core graphics | using apple framework!
how to draw graph. for iphone
![enter image description here][1]
[1]: http://i.stack.imgur.com/hWWAX.png
Using coregraphics is this graph will be achieve! do i need to use any other framework!
For the graph i do not want to use any third party framework! | iphone | null | null | null | null | null | open | How to draw graph using core graphics
===
using apple framework!
how to draw graph. for iphone
![enter image description here][1]
[1]: http://i.stack.imgur.com/hWWAX.png
Using coregraphics is this graph will be achieve! do i need to use any other framework!
For the graph i do not want to use any third party framework! | 0 |
11,430,062 | 07/11/2012 09:56:45 | 108,207 | 05/16/2009 17:51:55 | 3,041 | 197 | Enabling materials and textures for OGre 3D model in jmonkeyengine? | I downloaded models from WorldForge and I can introduce the mesh of a goblin to my scene but the texture and material won't render:
![enter image description here][1]
I use eclipse and the added files look like this:
![enter image description here][2]
[1]: http://i.stack.imgur.com/SxPtp.png
[2]: http://i.stack.imgur.com/gQfHX.png
The way I add the goblin in the code is this
Spatial model3 = assetManager.loadModel("objects/creatures/goblin/goblin.mesh.xml");
model3.setLocalTranslation(-30.0f, 4.5f, 0.0f);
rootNode.attachChild(model3);
Can you help me how I improve the goblin? There are several textures and materials definition in the files but it seems like only the goblin.mesh.xml is loaded by my scene.
Any help is greatly appreciated. | 3d | textures | ogre | jmonkeyengine | material | null | open | Enabling materials and textures for OGre 3D model in jmonkeyengine?
===
I downloaded models from WorldForge and I can introduce the mesh of a goblin to my scene but the texture and material won't render:
![enter image description here][1]
I use eclipse and the added files look like this:
![enter image description here][2]
[1]: http://i.stack.imgur.com/SxPtp.png
[2]: http://i.stack.imgur.com/gQfHX.png
The way I add the goblin in the code is this
Spatial model3 = assetManager.loadModel("objects/creatures/goblin/goblin.mesh.xml");
model3.setLocalTranslation(-30.0f, 4.5f, 0.0f);
rootNode.attachChild(model3);
Can you help me how I improve the goblin? There are several textures and materials definition in the files but it seems like only the goblin.mesh.xml is loaded by my scene.
Any help is greatly appreciated. | 0 |
11,430,065 | 07/11/2012 09:56:52 | 1,414,575 | 05/24/2012 09:03:10 | 60 | 2 | Adding methods to LINQ queries | I am trying to create a simple LINQ query like this:
var query = from o in entities.Orders
select new Order
{
Firstname = o.FirstName,
Lastname = GetName()
};
Here I want FirstName to be obtained from database, and I want to supply the Lastname from another source. When I run this I get an exception: "LINQ to Entities does not recognize the method 'System.String GetName()' method, and this method cannot be translated into a store expression."
How can I add my own methods to a LINQ query?
| linq | entity-framework | null | null | null | null | open | Adding methods to LINQ queries
===
I am trying to create a simple LINQ query like this:
var query = from o in entities.Orders
select new Order
{
Firstname = o.FirstName,
Lastname = GetName()
};
Here I want FirstName to be obtained from database, and I want to supply the Lastname from another source. When I run this I get an exception: "LINQ to Entities does not recognize the method 'System.String GetName()' method, and this method cannot be translated into a store expression."
How can I add my own methods to a LINQ query?
| 0 |
11,430,067 | 07/11/2012 09:56:57 | 709,703 | 04/15/2011 11:20:17 | 10 | 4 | Update Item without touching Values | I'm using Linq to SQL to query an Object from DB.
I pass it via wcf to a Client Application, the Client App does some Changes on the Values and sends the Object back.
What I now want to do is updating the DB's Item to take the new Values.
UNfortunately it is very hard to first select the object by a query statement, modify about 100 values and then submit changes back.
Is there any smarter way to update the Record using linq-to-sql without touching the Values?
My thought was, if i still have the ready object that linq is able to insert, if there is a way to just overwrite the existing one in DB? | linq | linq-to-sql | null | null | null | null | open | Update Item without touching Values
===
I'm using Linq to SQL to query an Object from DB.
I pass it via wcf to a Client Application, the Client App does some Changes on the Values and sends the Object back.
What I now want to do is updating the DB's Item to take the new Values.
UNfortunately it is very hard to first select the object by a query statement, modify about 100 values and then submit changes back.
Is there any smarter way to update the Record using linq-to-sql without touching the Values?
My thought was, if i still have the ready object that linq is able to insert, if there is a way to just overwrite the existing one in DB? | 0 |
11,430,076 | 07/11/2012 09:57:19 | 1,254,385 | 03/07/2012 10:16:30 | 1 | 0 | Database Mail SQLServer 2008 and Outlook Sent Items folder | I have configured Database Mail for SQLServer 2008, I can send emails via our SMTP server, which use Exchange. The problem is that I want to store the sent messages in the Sent Items folder of the corresponding user, but the system is not doing that.
Thanks | sql-server | exchange | database-mail | null | null | null | open | Database Mail SQLServer 2008 and Outlook Sent Items folder
===
I have configured Database Mail for SQLServer 2008, I can send emails via our SMTP server, which use Exchange. The problem is that I want to store the sent messages in the Sent Items folder of the corresponding user, but the system is not doing that.
Thanks | 0 |
11,430,082 | 07/11/2012 09:57:40 | 508,127 | 11/15/2010 10:28:18 | 2,147 | 4 | encounter a issue regading LINQ & Lambda | according to my requirement i manage to get a linq query from this site but it is giving error when i paste the whole things in linq pad. here i am going to paste the full linq query where i am getting error message like **"The name 'grp' does not exist in the current context"**
void Main()
{
List<SearchResult> list = new List<SearchResult>() {
new SearchResult(){ID=4,Title="Wie man BBA reman erreicht"},
new SearchResult(){ID=5,Title="Ersatz Airbags, Gurtstrammer und Auto Körper Teile "},
new SearchResult(){ID=6,Title="JCB Excavator - ECU P/N: 728/35700"},
new SearchResult(){ID=2,Title="Geo Prism 1995 GEO - ABS #16213899"},
new SearchResult(){ID=3,Title="Geo Prism 1995 - ABS #16213899"},
new SearchResult(){ID=1,Title="Geo Prism 1995 GEO GEO- ABS #16213899"},
};
var to_search = new[] { "Geo", "JCB" };
var result = (from searchResult in list
let title = searchResult.Title.ToLower()
let key_string = to_search.FirstOrDefault(ts => title.Contains(ts))
orderby key_string == null ? -1 : title.Split(new[] { key_string }, StringSplitOptions.None).Length descending
group searchResult by key_string into Group
select Group).OrderByDescending(grp => grp.Count()).ThenByDescending(CountStringOccurrences(**grp.Key**, to_search));
}
public int CountStringOccurrences(string text, string[] pattern)
{
// Loop through all instances of the string 'text'.
int count = 0;
foreach (string itm in pattern)
{
int i = 0;
while ((i = text.IndexOf(itm, i)) != -1)
{
i += itm.Length;
count++;
}
}
return count;
}
public class SearchResult{
public int ID { get; set; }
public string Title { get; set; }
}
the bold area is throwing error. thanks plzz have look. | linq | lambda | linqpad | null | null | null | open | encounter a issue regading LINQ & Lambda
===
according to my requirement i manage to get a linq query from this site but it is giving error when i paste the whole things in linq pad. here i am going to paste the full linq query where i am getting error message like **"The name 'grp' does not exist in the current context"**
void Main()
{
List<SearchResult> list = new List<SearchResult>() {
new SearchResult(){ID=4,Title="Wie man BBA reman erreicht"},
new SearchResult(){ID=5,Title="Ersatz Airbags, Gurtstrammer und Auto Körper Teile "},
new SearchResult(){ID=6,Title="JCB Excavator - ECU P/N: 728/35700"},
new SearchResult(){ID=2,Title="Geo Prism 1995 GEO - ABS #16213899"},
new SearchResult(){ID=3,Title="Geo Prism 1995 - ABS #16213899"},
new SearchResult(){ID=1,Title="Geo Prism 1995 GEO GEO- ABS #16213899"},
};
var to_search = new[] { "Geo", "JCB" };
var result = (from searchResult in list
let title = searchResult.Title.ToLower()
let key_string = to_search.FirstOrDefault(ts => title.Contains(ts))
orderby key_string == null ? -1 : title.Split(new[] { key_string }, StringSplitOptions.None).Length descending
group searchResult by key_string into Group
select Group).OrderByDescending(grp => grp.Count()).ThenByDescending(CountStringOccurrences(**grp.Key**, to_search));
}
public int CountStringOccurrences(string text, string[] pattern)
{
// Loop through all instances of the string 'text'.
int count = 0;
foreach (string itm in pattern)
{
int i = 0;
while ((i = text.IndexOf(itm, i)) != -1)
{
i += itm.Length;
count++;
}
}
return count;
}
public class SearchResult{
public int ID { get; set; }
public string Title { get; set; }
}
the bold area is throwing error. thanks plzz have look. | 0 |
11,430,083 | 07/11/2012 09:57:43 | 1,155,105 | 01/18/2012 00:03:07 | 28 | 0 | Cucumber/Ruby: possible to retrieve HTTP calls, responses, parameters? | I'm starting with cucumber & ruby and wondering if the following is possible.
I'm in a page and I know that when I click one link, that's going to fire a call looking like:
http://url.com?param1=value1¶m2=value2
Is it then possible to retrieve someone that call and its parameters by using ruby and cucumber? or if not, any other idea about how to get those values through an automated test?
Many thanks!! | ruby | http | automation | cucumber | null | null | open | Cucumber/Ruby: possible to retrieve HTTP calls, responses, parameters?
===
I'm starting with cucumber & ruby and wondering if the following is possible.
I'm in a page and I know that when I click one link, that's going to fire a call looking like:
http://url.com?param1=value1¶m2=value2
Is it then possible to retrieve someone that call and its parameters by using ruby and cucumber? or if not, any other idea about how to get those values through an automated test?
Many thanks!! | 0 |
11,430,088 | 07/11/2012 09:57:53 | 1,517,346 | 07/11/2012 09:43:56 | 1 | 0 | 100% width nav across page wrapper | i have a nav inside a site-wrapper,
<div id="wrapper">
<nav>
<ul>
<li></li>
<li></li>
</ul>
</nav>
...
</div>
the wrapper has a defined width of 960px + margin: 0 auto.
I want the Nav stretch the whole 100% body width across the 960px of the wrapper, without destroying the markup.
Any ideas?
| html | css | navigation | markup | null | null | open | 100% width nav across page wrapper
===
i have a nav inside a site-wrapper,
<div id="wrapper">
<nav>
<ul>
<li></li>
<li></li>
</ul>
</nav>
...
</div>
the wrapper has a defined width of 960px + margin: 0 auto.
I want the Nav stretch the whole 100% body width across the 960px of the wrapper, without destroying the markup.
Any ideas?
| 0 |
11,430,089 | 07/11/2012 09:57:56 | 1,517,362 | 07/11/2012 09:49:59 | 1 | 0 | Query from multiple tables, AR, Yii | How to make a request to the yii using ActiveRecord?
SELECT
DISTINCT sp_order_instance.product_id, sp_product_instance.name
FROM sp_order_instance, sp_order, sp_product_instance
WHERE
sp_order.user_id IN (125, 33, 74)
AND
sp_order_instance.order_id = sp_order.id
AND
sp_order_instance.product_id = sp_product_instance.id
| php | sql | activerecord | yii | null | 07/11/2012 12:59:11 | not a real question | Query from multiple tables, AR, Yii
===
How to make a request to the yii using ActiveRecord?
SELECT
DISTINCT sp_order_instance.product_id, sp_product_instance.name
FROM sp_order_instance, sp_order, sp_product_instance
WHERE
sp_order.user_id IN (125, 33, 74)
AND
sp_order_instance.order_id = sp_order.id
AND
sp_order_instance.product_id = sp_product_instance.id
| 1 |
11,430,090 | 07/11/2012 09:58:04 | 1,511,546 | 07/09/2012 09:19:05 | 1 | 0 | Concurrent Connections from Browser To IIS | I'm running a website that is ASP.NET/JQuery and on IIS 7.0. I've created a web garden with 10 worker threads and a Out of Process (Sql Server) to handle session. I've heard many people suggest that Web Gardens only solve certain problems, being CPU Bottlenecks and the other concurrency.
The Website is one that has dynamic tabbing, and as such attempts to allow the user to multi-task.
Do Web Gardens allow multiple connections from one Browser (Single User)?
That is, if I open two tabs and issue a set of work (with server-side) code, will both requests be submitted or will there only be one connection with blocking, until the first request is completed.
Of course in real life, I am seeing "blocking", when from what I understand Web Garden are too support concurrent connections.
Thanks
| asp.net | iis | null | null | null | null | open | Concurrent Connections from Browser To IIS
===
I'm running a website that is ASP.NET/JQuery and on IIS 7.0. I've created a web garden with 10 worker threads and a Out of Process (Sql Server) to handle session. I've heard many people suggest that Web Gardens only solve certain problems, being CPU Bottlenecks and the other concurrency.
The Website is one that has dynamic tabbing, and as such attempts to allow the user to multi-task.
Do Web Gardens allow multiple connections from one Browser (Single User)?
That is, if I open two tabs and issue a set of work (with server-side) code, will both requests be submitted or will there only be one connection with blocking, until the first request is completed.
Of course in real life, I am seeing "blocking", when from what I understand Web Garden are too support concurrent connections.
Thanks
| 0 |
11,430,091 | 07/11/2012 09:58:08 | 1,059,247 | 11/22/2011 06:52:14 | 72 | 3 | i need to search Restuarants from google maps places via Intent? | how to get restuarants near by my location via calling Intents ,how to do that i did google maps via intent like,
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=&daddr="));
startActivity(intent);
similar way is there any direct http link to to get restuarants.
help me any one.. | android | google-maps | android-mapview | android-maps | null | null | open | i need to search Restuarants from google maps places via Intent?
===
how to get restuarants near by my location via calling Intents ,how to do that i did google maps via intent like,
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=&daddr="));
startActivity(intent);
similar way is there any direct http link to to get restuarants.
help me any one.. | 0 |
11,280,079 | 07/01/2012 06:41:37 | 1,492,969 | 06/30/2012 12:08:36 | 1 | 0 | how google tracks dynamic webpages? | Actually iam new to web designing or web technology
Can any one please help me?
I want to know how the google tracks the dynamic webpages.
I heared that google can track all the static pages in a website and all texts and images and videos in that pages...
But i wonder how it can track the dynamic pages.
For example if i search "FACEBOOK SAM JERUSALEM" in google , it will show search result containing my facebook page and some related pages too...
Same in the case of www.elance.com,www.freelancers.com,www.devientart.com like many sites...
We can point to Stackoverflow.com also.while we are searching for some technical issues or questions.it will show stack overflow page with that question(this is also a dynamic website)
I can't believe that for every user or for every product these sites automatically generates static pages
i googled for the answer but i can't understand what many sites are telling...and some are providing only a vague idea
How these things are working can anyone tell me please?
| search-engine | null | null | null | null | null | open | how google tracks dynamic webpages?
===
Actually iam new to web designing or web technology
Can any one please help me?
I want to know how the google tracks the dynamic webpages.
I heared that google can track all the static pages in a website and all texts and images and videos in that pages...
But i wonder how it can track the dynamic pages.
For example if i search "FACEBOOK SAM JERUSALEM" in google , it will show search result containing my facebook page and some related pages too...
Same in the case of www.elance.com,www.freelancers.com,www.devientart.com like many sites...
We can point to Stackoverflow.com also.while we are searching for some technical issues or questions.it will show stack overflow page with that question(this is also a dynamic website)
I can't believe that for every user or for every product these sites automatically generates static pages
i googled for the answer but i can't understand what many sites are telling...and some are providing only a vague idea
How these things are working can anyone tell me please?
| 0 |
11,280,081 | 07/01/2012 06:41:53 | 197,036 | 10/27/2009 03:15:27 | 2,439 | 3 | iOS status bar: how to show some text there | In top-most bar of iPhone screen, I don't know it's called status bar or not. I want to write some text on that after I finish some actions, is there any API for that or example? | iphone | ios | null | null | null | null | open | iOS status bar: how to show some text there
===
In top-most bar of iPhone screen, I don't know it's called status bar or not. I want to write some text on that after I finish some actions, is there any API for that or example? | 0 |
11,280,090 | 07/01/2012 06:45:08 | 1,404,765 | 10/16/2010 00:06:14 | 6 | 0 | iScroll: How do I hide the IOS Safari address bar | I'm trying to hide the address bar on my iPhone site. Naturally, I tried this first:
window.addEventListener("load",function() {
// Set a timeout...
setTimeout(function(){
// Hide the address bar!
window.scrollTo(0, 1);
}, 100);
});
Which worked, but...
I went with using iScroll which killed it. I guess that when the absolute positioned elements are removed from the document flow, this effects the height of the body which in turn make the above script useless.
Is there another trick to hide the address bar that is not dependent on the height of the document body?
Thanks! | iphone | hide | absolute-positioning | iscroll | addressbar | null | open | iScroll: How do I hide the IOS Safari address bar
===
I'm trying to hide the address bar on my iPhone site. Naturally, I tried this first:
window.addEventListener("load",function() {
// Set a timeout...
setTimeout(function(){
// Hide the address bar!
window.scrollTo(0, 1);
}, 100);
});
Which worked, but...
I went with using iScroll which killed it. I guess that when the absolute positioned elements are removed from the document flow, this effects the height of the body which in turn make the above script useless.
Is there another trick to hide the address bar that is not dependent on the height of the document body?
Thanks! | 0 |
11,280,091 | 07/01/2012 06:45:47 | 903,790 | 08/20/2011 14:17:50 | 154 | 7 | how to find html element by its value | i want to find an html element by its value. i tried with id, but my case is fragile:
pseudo code:
for user in users:
<li id="followed" onclick="follow($(this).text())"><a class="follow">user.name</a></li>
endfor
i want that each username will be clickable and i am saving him into db and appending "saved" to the end part of username. like this:
"username" ==> after click: "username saved"
i am doing this thru ajax.
function follow(data){
var Him = data;
alert(Him);
$.ajax({
url: "/follow",
type: "POST",
datatype: "html",
data: {Him: Him}
}).success(function(response){
$('#followed').append(response);
});
}
this code is fine, but it is appending the "saved" response only to the first username, because by the end of the loop, all usernames have id='followed'. that why, i want to find the html element by its value. e.g. "username"
is it possible?
| javascript | html | null | null | null | null | open | how to find html element by its value
===
i want to find an html element by its value. i tried with id, but my case is fragile:
pseudo code:
for user in users:
<li id="followed" onclick="follow($(this).text())"><a class="follow">user.name</a></li>
endfor
i want that each username will be clickable and i am saving him into db and appending "saved" to the end part of username. like this:
"username" ==> after click: "username saved"
i am doing this thru ajax.
function follow(data){
var Him = data;
alert(Him);
$.ajax({
url: "/follow",
type: "POST",
datatype: "html",
data: {Him: Him}
}).success(function(response){
$('#followed').append(response);
});
}
this code is fine, but it is appending the "saved" response only to the first username, because by the end of the loop, all usernames have id='followed'. that why, i want to find the html element by its value. e.g. "username"
is it possible?
| 0 |
11,280,093 | 07/01/2012 06:45:55 | 475,247 | 10/14/2010 01:45:32 | 523 | 2 | Maven integration for Eclipse cannot be installed | I tried to install Maven Integration for Eclipse from Eclipse Market Place.
I had to cancel the installation in the mid because it took a long time.
I tried the installation after restarting the Eclipse, now I cannot find the "`Install`" button, instead there is an "`Update`" button which is disabled. (see the screen shot).
I tried un-installing and re-installing, but no success.
I am using Eclipse Indigo on my Ubuntu 12.04 LTS.
![enter image description here][1]
[1]: http://i.stack.imgur.com/LKGkd.png | eclipse | maven | eclipse-plugin | m2eclipse | null | null | open | Maven integration for Eclipse cannot be installed
===
I tried to install Maven Integration for Eclipse from Eclipse Market Place.
I had to cancel the installation in the mid because it took a long time.
I tried the installation after restarting the Eclipse, now I cannot find the "`Install`" button, instead there is an "`Update`" button which is disabled. (see the screen shot).
I tried un-installing and re-installing, but no success.
I am using Eclipse Indigo on my Ubuntu 12.04 LTS.
![enter image description here][1]
[1]: http://i.stack.imgur.com/LKGkd.png | 0 |
11,280,094 | 07/01/2012 06:46:02 | 1,493,934 | 07/01/2012 06:29:46 | 1 | 0 | change dhtmlgoodies slidedown to slideup | I'm looking to change the following script from an initial slidedown action to an initial slide**up** action. I can't use Jquery, only regular JS.
At present when the content enters, it slides down. I would like it to slide up instead.
Thanks for any help!
<pre>
<script language="javascript" type="text/javascript">
var initHeight = 0;
var slidedown_direction = 1;
var slidedownContentBox = false;
var slidedownContent = false;
var slidedownActive = false;
var contentHeight = false;
var slidedownSpeed = 3; // Higher value = faster script
var slidedownTimer = 7; // Lower value = faster script
function slidedown_showHide() {
if(initHeight==0)slidedown_direction=slidedownSpeed; else slidedown_direction = slidedownSpeed*-1;
if(!slidedownContentBox) {
slidedownContentBox = document.getElementById('dhtmlgoodies_contentBox');
slidedownContent = document.getElementById('dhtmlgoodies_content');
contentHeight = document.getElementById('dhtmlgoodies_content').offsetHeight;
}
slidedownContentBox.style.visibility='visible';
slidedownActive = true;
slidedown_showHide_start();
}
function slidedown_showHide_start() {
if(!slidedownActive)return;
initHeight = initHeight/1 + slidedown_direction;
if(initHeight <= 0) {
slidedownActive = false;
slidedownContentBox.style.visibility='hidden';
initHeight = 0;
}
if(initHeight>contentHeight) {
slidedownActive = false;
}
slidedownContentBox.style.height = initHeight + 'px';
slidedownContent.style.top = initHeight - contentHeight + 'px';
setTimeout('slidedown_showHide_start()',slidedownTimer); // Choose a lower value than 10 to make the script move faster
}
function setslidedownWidth(newWidth) {
document.getElementById('dhtmlgoodies_slidedown').style.width = newWidth + 'px';
document.getElementById('dhtmlgoodies_contentBox').style.width = newWidth + 'px';
}
function setSlideDownSpeed(newSpeed) {
slidedownSpeed = newSpeed;
}
</script>
</pre> | dhtml | slidedown | slideup | null | null | null | open | change dhtmlgoodies slidedown to slideup
===
I'm looking to change the following script from an initial slidedown action to an initial slide**up** action. I can't use Jquery, only regular JS.
At present when the content enters, it slides down. I would like it to slide up instead.
Thanks for any help!
<pre>
<script language="javascript" type="text/javascript">
var initHeight = 0;
var slidedown_direction = 1;
var slidedownContentBox = false;
var slidedownContent = false;
var slidedownActive = false;
var contentHeight = false;
var slidedownSpeed = 3; // Higher value = faster script
var slidedownTimer = 7; // Lower value = faster script
function slidedown_showHide() {
if(initHeight==0)slidedown_direction=slidedownSpeed; else slidedown_direction = slidedownSpeed*-1;
if(!slidedownContentBox) {
slidedownContentBox = document.getElementById('dhtmlgoodies_contentBox');
slidedownContent = document.getElementById('dhtmlgoodies_content');
contentHeight = document.getElementById('dhtmlgoodies_content').offsetHeight;
}
slidedownContentBox.style.visibility='visible';
slidedownActive = true;
slidedown_showHide_start();
}
function slidedown_showHide_start() {
if(!slidedownActive)return;
initHeight = initHeight/1 + slidedown_direction;
if(initHeight <= 0) {
slidedownActive = false;
slidedownContentBox.style.visibility='hidden';
initHeight = 0;
}
if(initHeight>contentHeight) {
slidedownActive = false;
}
slidedownContentBox.style.height = initHeight + 'px';
slidedownContent.style.top = initHeight - contentHeight + 'px';
setTimeout('slidedown_showHide_start()',slidedownTimer); // Choose a lower value than 10 to make the script move faster
}
function setslidedownWidth(newWidth) {
document.getElementById('dhtmlgoodies_slidedown').style.width = newWidth + 'px';
document.getElementById('dhtmlgoodies_contentBox').style.width = newWidth + 'px';
}
function setSlideDownSpeed(newSpeed) {
slidedownSpeed = newSpeed;
}
</script>
</pre> | 0 |
11,261,808 | 06/29/2012 12:29:59 | 1,127,709 | 01/03/2012 11:24:22 | 296 | 0 | TCPDF ERROR: [Image] Unable to get image:? | I am getting this error:
*/opt/bitnami/apache2/htdocs/opt/bitnami/apps/magento/htdocs/abcd/media/sales/store/logo/default/logo.png*
The correct path is */opt/bitnami/apps/magento/htdocs/abcd/media/sales/store/logo/default/logo.png*, so somehow tcpdf adds */opt/bitnami/apache2/htdocs* in front, but why?
Thanks! | image | tcpdf | null | null | null | null | open | TCPDF ERROR: [Image] Unable to get image:?
===
I am getting this error:
*/opt/bitnami/apache2/htdocs/opt/bitnami/apps/magento/htdocs/abcd/media/sales/store/logo/default/logo.png*
The correct path is */opt/bitnami/apps/magento/htdocs/abcd/media/sales/store/logo/default/logo.png*, so somehow tcpdf adds */opt/bitnami/apache2/htdocs* in front, but why?
Thanks! | 0 |
11,261,740 | 06/29/2012 12:25:17 | 677,889 | 03/26/2011 09:44:38 | 219 | 10 | How to integrate js while working with google maps? | trying to integrate Google Maps to my iPhone app. And I can't found any objective-c code relative to this task except 3 lines of code which starts webView. Ok, I did it, I can see the map. Now what? How to work with it? How to change position? How to add a marker?
All I've found are only java scripts. Ok, I can see many solutions written on js but I cant figure out how to manage it, how to use it with iphone? What to do with those jss? How to work with it? I just need an example of obj-c code where those jss takes action.
For example I have a webview with a map at some point. And have a right button in navigation panel (called "test") and I want to press that button and map should show me another location. How to do it? I need not just the js but the obj-c code. I mean what exactly should I write in my onTestButtonClick method? | javascript | iphone | google-maps | google-maps-api-3 | null | null | open | How to integrate js while working with google maps?
===
trying to integrate Google Maps to my iPhone app. And I can't found any objective-c code relative to this task except 3 lines of code which starts webView. Ok, I did it, I can see the map. Now what? How to work with it? How to change position? How to add a marker?
All I've found are only java scripts. Ok, I can see many solutions written on js but I cant figure out how to manage it, how to use it with iphone? What to do with those jss? How to work with it? I just need an example of obj-c code where those jss takes action.
For example I have a webview with a map at some point. And have a right button in navigation panel (called "test") and I want to press that button and map should show me another location. How to do it? I need not just the js but the obj-c code. I mean what exactly should I write in my onTestButtonClick method? | 0 |
11,261,741 | 06/29/2012 12:25:18 | 1,491,099 | 06/29/2012 11:55:21 | 1 | 0 | Errormessage in EditText disappears on Samsung Galaxy Tab 10.1 | I am trying to set an Errormessage to an edittext with setError("error"). On focus/touch the sofkeyboard takes the space of the errormessage. In this case the errormessage normally is placed ahead of the edittext, but it shows up for short timeperiod and then disappears. The erroricon is still showing without the message.
The SoftInputType is set to:
<activity android:windowSoftInputMode="adjustPan">
I got this bug only on Samsung Galaxytab 10.1 with android 3.2.
Anyone got a solution for this issue? Thank you.
| android | error-message | edittext | galaxy-tab | null | null | open | Errormessage in EditText disappears on Samsung Galaxy Tab 10.1
===
I am trying to set an Errormessage to an edittext with setError("error"). On focus/touch the sofkeyboard takes the space of the errormessage. In this case the errormessage normally is placed ahead of the edittext, but it shows up for short timeperiod and then disappears. The erroricon is still showing without the message.
The SoftInputType is set to:
<activity android:windowSoftInputMode="adjustPan">
I got this bug only on Samsung Galaxytab 10.1 with android 3.2.
Anyone got a solution for this issue? Thank you.
| 0 |
11,261,742 | 06/29/2012 12:25:22 | 916,859 | 05/09/2011 11:03:12 | 390 | 13 | Making a table that changes its row structure depending on what time it is | I am trying to make a schedule table that would delete certain rows according to the current time.
Example;
(default table)
> 1st ride: 1.15
> 2nd ride: 1.45
> 3rd ride: 2.42
and let's say it is 1.16 so it changes into this;
(desired table)
> 2nd ride: 1.45
> 3rd ride: 2.42
How can I achieve this functionality? | html | null | null | null | null | null | open | Making a table that changes its row structure depending on what time it is
===
I am trying to make a schedule table that would delete certain rows according to the current time.
Example;
(default table)
> 1st ride: 1.15
> 2nd ride: 1.45
> 3rd ride: 2.42
and let's say it is 1.16 so it changes into this;
(desired table)
> 2nd ride: 1.45
> 3rd ride: 2.42
How can I achieve this functionality? | 0 |
11,261,813 | 06/29/2012 12:30:23 | 906 | 08/10/2008 09:40:59 | 1,048 | 25 | Getting "Reference Assemblies" path in MSBuild | I'm updating a build to be compatible with .NET 4.5, and one of the changes I need to make is [updating how I call ilmerge](http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx).
From the link above, this basically means changing:
/targetplatform:"v4,C:\windows\Microsoft.NET\Framework\v4.0.30319"
to:
/targetplatform:"v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"
In my MSBuild AfterBuild target I was generating the former using `$(MSBuildToolsPath)`, like this:
/targetplatform:v4,$(MSBuildToolsPath)
What's the best way to translate this into the required `/targetplatform:"v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"` path so that it works on x64, x86 or any unusual places it can wind up installed? | .net | msbuild | null | null | null | null | open | Getting "Reference Assemblies" path in MSBuild
===
I'm updating a build to be compatible with .NET 4.5, and one of the changes I need to make is [updating how I call ilmerge](http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx).
From the link above, this basically means changing:
/targetplatform:"v4,C:\windows\Microsoft.NET\Framework\v4.0.30319"
to:
/targetplatform:"v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"
In my MSBuild AfterBuild target I was generating the former using `$(MSBuildToolsPath)`, like this:
/targetplatform:v4,$(MSBuildToolsPath)
What's the best way to translate this into the required `/targetplatform:"v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"` path so that it works on x64, x86 or any unusual places it can wind up installed? | 0 |
11,200,726 | 06/26/2012 04:18:22 | 762,297 | 05/20/2011 07:26:08 | 366 | 28 | Text in UITextView not display correctly, invisible, but occupied spaces | There is a UITextView in the view, the view controller is showing with Modal style. In my viewDidLoad method, I set the text of this UITextView, but, the text is not showing. Image below showing the error. Text color is black.
The weird thing is , when I long tap in the text view or tap [return] in keyboard, the text become visible. One thing I noticed is this error only ***occurred when the text I set is longer than the UITextView frame width, and the last word is not broken such as a long url***.
I think the problem is ***maybe the word wrap not work correctly***.
Thanks in advance.
![enter image description here][1]
[1]: http://i.stack.imgur.com/NFFcT.png | ios | uikit | uitextview | word-wrap | null | null | open | Text in UITextView not display correctly, invisible, but occupied spaces
===
There is a UITextView in the view, the view controller is showing with Modal style. In my viewDidLoad method, I set the text of this UITextView, but, the text is not showing. Image below showing the error. Text color is black.
The weird thing is , when I long tap in the text view or tap [return] in keyboard, the text become visible. One thing I noticed is this error only ***occurred when the text I set is longer than the UITextView frame width, and the last word is not broken such as a long url***.
I think the problem is ***maybe the word wrap not work correctly***.
Thanks in advance.
![enter image description here][1]
[1]: http://i.stack.imgur.com/NFFcT.png | 0 |
11,261,723 | 06/29/2012 12:24:01 | 1,315,765 | 04/05/2012 16:11:13 | 12 | 0 | I need to click the mouse in my game before I can do anything, like movement. How can I fix this? | I have a Java problem. I'm making a graphical game and every time I wish to run it, I need to click the mouse in-game in order for all the movement to be enabled. Nothing works if I try to move without clicking the mouse first. How can I fix this. | java | click | mouse | run | null | null | open | I need to click the mouse in my game before I can do anything, like movement. How can I fix this?
===
I have a Java problem. I'm making a graphical game and every time I wish to run it, I need to click the mouse in-game in order for all the movement to be enabled. Nothing works if I try to move without clicking the mouse first. How can I fix this. | 0 |
11,261,819 | 06/29/2012 12:30:55 | 241,654 | 12/31/2009 17:56:43 | 1,700 | 16 | Include sub-module throws: Expected lib/scopes/bars.rb to define Bars | I'm trying to make some common scopes for models to be sharing, so i created this:
lib
|_ scopes
|_ scope.rb
|_ bars.rb
----------
# lib/scopes/scope.rb
module Scope
end
----------
# lib/scopes/bars.rb
module Scope
module Bars
def self.included(base)
base.class_eval{
scope :somescope, lambda{ where(:foo => :bar) }
}
end
end
end
Now when i put this in a model:
include Scope::Bars
It throws an error: **Expected c:/sites/app_name/lib/scopes/bars.rb to define Bars**
For some bizarre reason, This doesn't happen when i just use the rails console to test instead of WEBrick server.
Also it perfectly works if i don't use sub-models, Like: `include Bars` would work just fine.
Any ideas? | ruby-on-rails | null | null | null | null | null | open | Include sub-module throws: Expected lib/scopes/bars.rb to define Bars
===
I'm trying to make some common scopes for models to be sharing, so i created this:
lib
|_ scopes
|_ scope.rb
|_ bars.rb
----------
# lib/scopes/scope.rb
module Scope
end
----------
# lib/scopes/bars.rb
module Scope
module Bars
def self.included(base)
base.class_eval{
scope :somescope, lambda{ where(:foo => :bar) }
}
end
end
end
Now when i put this in a model:
include Scope::Bars
It throws an error: **Expected c:/sites/app_name/lib/scopes/bars.rb to define Bars**
For some bizarre reason, This doesn't happen when i just use the rails console to test instead of WEBrick server.
Also it perfectly works if i don't use sub-models, Like: `include Bars` would work just fine.
Any ideas? | 0 |
11,261,820 | 06/29/2012 12:31:01 | 920,041 | 08/30/2011 15:43:07 | 1,633 | 71 | Is there any notification when AirPlay is activated/deactivated? | Is there any form for notification to detect if AirPlay is activated/deactivated in Objective-C, a notification that is triggered when user taps AirPlay icon and AirPlay start/stops?
I don't need to know when an AirPlay connection is enabled, only when user activated/deactivated it.
| objective-c | ios | ios5 | ios4 | airplay | null | open | Is there any notification when AirPlay is activated/deactivated?
===
Is there any form for notification to detect if AirPlay is activated/deactivated in Objective-C, a notification that is triggered when user taps AirPlay icon and AirPlay start/stops?
I don't need to know when an AirPlay connection is enabled, only when user activated/deactivated it.
| 0 |
11,261,822 | 06/29/2012 12:31:12 | 1,360,700 | 04/27/2012 08:50:32 | 1 | 0 | How to deploy PHP web site as a package on IIS? | If my question has already taken place in other post, please excuse me.
I am coding a PHP - MySQL website and publishing it on IIS.
The way that enables me to do this is enabling CGI extension of IIS and copying the source PHP files to a folder under the "inetpub" folder.
Here is the question. If i DON'T want to copy my PHP files (which are including my codes obviously) into "inetpub" folder, is there a way to make a package file of my PHP files? For example a Tomcat server executes ".war" package files. Is there a package file type that i can put my PHP pages in it and deploy it on IIS and publish it on IIS?
If there is no way to achieve this, what can i do to prevent copyng and pasting the PHP files into "inetpub" folders?
Thank you all. | php | iis | deployment | package | null | null | open | How to deploy PHP web site as a package on IIS?
===
If my question has already taken place in other post, please excuse me.
I am coding a PHP - MySQL website and publishing it on IIS.
The way that enables me to do this is enabling CGI extension of IIS and copying the source PHP files to a folder under the "inetpub" folder.
Here is the question. If i DON'T want to copy my PHP files (which are including my codes obviously) into "inetpub" folder, is there a way to make a package file of my PHP files? For example a Tomcat server executes ".war" package files. Is there a package file type that i can put my PHP pages in it and deploy it on IIS and publish it on IIS?
If there is no way to achieve this, what can i do to prevent copyng and pasting the PHP files into "inetpub" folders?
Thank you all. | 0 |
11,261,823 | 06/29/2012 12:31:27 | 298,288 | 03/21/2010 04:18:08 | 964 | 11 | Export Matlab figure as PNG? | I need to automatically export figures from Matlab to PNG. My figure has a size of 600x200 px:
hFig = figure(1);
set(hFig, 'Color', [1 1 1]); % backgroundcolor white
set(hFig, 'Position', [500 500 600 200]) % size 600x200
I tried e.g.
print -dpng image.png
but the image.png is larger than 600x200 px. Exporting the figure manually from the Figure Window GUI using the "save" button works great, I want to do exactly this automatically / from a script. Thanks for any hint!
| matlab | graphics | png | export | null | null | open | Export Matlab figure as PNG?
===
I need to automatically export figures from Matlab to PNG. My figure has a size of 600x200 px:
hFig = figure(1);
set(hFig, 'Color', [1 1 1]); % backgroundcolor white
set(hFig, 'Position', [500 500 600 200]) % size 600x200
I tried e.g.
print -dpng image.png
but the image.png is larger than 600x200 px. Exporting the figure manually from the Figure Window GUI using the "save" button works great, I want to do exactly this automatically / from a script. Thanks for any hint!
| 0 |
11,261,526 | 06/29/2012 12:10:02 | 965,830 | 09/26/2011 20:58:21 | 1 | 0 | setOnLoadCompleteListener giving error | I am a newbie to android development and am trying to develop a simple application where a button is used to play a sound. I am trying to use SoundPool and find that every tutorial gives such a code to be added after making a soundpool object:
soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
@Override
public void onLoadComplete(SoundPool soundPool, int sampleId,
int status) {
loaded = true;
}
});
but when i try to use this code in eclipse, it says
The method onLoadComplete(SoundPool, int, int) of type new SoundPool.OnLoadCompleteListener(){} must override a superclass method.
and suggests to remove the @override notation. This should happen if there is no such method?? Why am i getting this error? | android | null | null | null | null | null | open | setOnLoadCompleteListener giving error
===
I am a newbie to android development and am trying to develop a simple application where a button is used to play a sound. I am trying to use SoundPool and find that every tutorial gives such a code to be added after making a soundpool object:
soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
@Override
public void onLoadComplete(SoundPool soundPool, int sampleId,
int status) {
loaded = true;
}
});
but when i try to use this code in eclipse, it says
The method onLoadComplete(SoundPool, int, int) of type new SoundPool.OnLoadCompleteListener(){} must override a superclass method.
and suggests to remove the @override notation. This should happen if there is no such method?? Why am i getting this error? | 0 |
11,261,825 | 06/29/2012 12:31:42 | 696,538 | 04/07/2011 09:56:18 | 45 | 5 | iphone KVO setup | Hello guyz i am new to iphone development with xcode... i have an iphone app developed with unity.. the problem is that unity doesnt have a webview.. so i need to integrate a native one... i found this tutorial [tutorial][1]
[1]: http://www.snowferno.com/2009/09/23/playhaven-unity-and-snowferno/
its main idea is setting a KVO up.. and creating a webview the open it with supplied link in the kvo handler.... i've done this tutorial and doesnt work.... i am about to learn native iphone but this project time doesnt allow me... please supply me with step by step instrucions as where to put the code and where to register the kvo.. thank you all | iphone | objective-c | xcode | cocoa | ipad | 07/20/2012 14:15:54 | not constructive | iphone KVO setup
===
Hello guyz i am new to iphone development with xcode... i have an iphone app developed with unity.. the problem is that unity doesnt have a webview.. so i need to integrate a native one... i found this tutorial [tutorial][1]
[1]: http://www.snowferno.com/2009/09/23/playhaven-unity-and-snowferno/
its main idea is setting a KVO up.. and creating a webview the open it with supplied link in the kvo handler.... i've done this tutorial and doesnt work.... i am about to learn native iphone but this project time doesnt allow me... please supply me with step by step instrucions as where to put the code and where to register the kvo.. thank you all | 4 |
11,349,195 | 07/05/2012 17:09:50 | 1,438,261 | 06/05/2012 20:07:36 | 1 | 0 | CSS Horizontal drop down adjusting borders | I would like a border around my drop down menu on hover. I want the right and left borders on the top menu to align with the border on the drop down. And I don't want to see the border underneath the text on the top menu. I'm not sure that I'm explaining things clearly so I'm including a [picture][1] of what I want.
[Here][2] is my attempt
[1]: http://i48.tinypic.com/lz1c7.jpg
[2]: http://cssdesk.com/YHtNd | css | drop-down-menu | border | null | null | null | open | CSS Horizontal drop down adjusting borders
===
I would like a border around my drop down menu on hover. I want the right and left borders on the top menu to align with the border on the drop down. And I don't want to see the border underneath the text on the top menu. I'm not sure that I'm explaining things clearly so I'm including a [picture][1] of what I want.
[Here][2] is my attempt
[1]: http://i48.tinypic.com/lz1c7.jpg
[2]: http://cssdesk.com/YHtNd | 0 |
11,349,197 | 07/05/2012 17:09:53 | 885,050 | 08/09/2011 00:45:04 | 94 | 18 | LLVM bug building synthetic compiler for nostalgic childhood game | I've been trying to compile [syn64k](https://github.com/ctm/syn68k/)--for use in [Executor](https://github.com/ctm/executor/), to run [System's Twilight](http://www.eblong.com/zarf/twilight.html) (a game I played as a kid). I'm doing this on my macbook pro (lion 10.7.4 with the latest Xcode and command line tools). I mapped `CC` to `gcc -m32` to fix a couple problems I was having, but I got the following:
Making all in native/i386
make[2]: Nothing to be done for `all'.
outgoing=;\
gcc -m32 -maccumulate-outgoing-args -c -x c /dev/null 2> /dev/null && outgoing=-maccumulate-outgoing-args; \
gcc -m32 -S -O2 -fomit-frame-pointer -Wall -static -fno-defer-pop -Wno-unused\ -I./include -I./../include -I. -I../include $outgoing syn68k.c -o ./syn68k.s
syn68k.c: In function ‘s68k_handle_opcode_0x07A3’:
syn68k.c:52968: internal compiler error: in EmitLV_DECL, at llvm-convert.cpp:7475
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[2]: *** [syn68k.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
I went to URL, and it doesn't look like a place to really put a bug report about LLVM. I the file 'syn68k.c' is about 50k lines long after the preprocessor is done with it, so I really don't thing I can make a reproducible test case to show the bug.
Turns out this [issue](https://github.com/ctm/syn68k/issues/1) is already on the github project (it is the only issue listed, ha). MaddTheSane says that this happens because clang does not support global register variables (as I verified [here](http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc)).
I don't really have much more than a basic understanding of how compilation works after you type `make`, so is there a way I can skip clang or something like that? What do you suggest? | llvm | clang | null | null | null | null | open | LLVM bug building synthetic compiler for nostalgic childhood game
===
I've been trying to compile [syn64k](https://github.com/ctm/syn68k/)--for use in [Executor](https://github.com/ctm/executor/), to run [System's Twilight](http://www.eblong.com/zarf/twilight.html) (a game I played as a kid). I'm doing this on my macbook pro (lion 10.7.4 with the latest Xcode and command line tools). I mapped `CC` to `gcc -m32` to fix a couple problems I was having, but I got the following:
Making all in native/i386
make[2]: Nothing to be done for `all'.
outgoing=;\
gcc -m32 -maccumulate-outgoing-args -c -x c /dev/null 2> /dev/null && outgoing=-maccumulate-outgoing-args; \
gcc -m32 -S -O2 -fomit-frame-pointer -Wall -static -fno-defer-pop -Wno-unused\ -I./include -I./../include -I. -I../include $outgoing syn68k.c -o ./syn68k.s
syn68k.c: In function ‘s68k_handle_opcode_0x07A3’:
syn68k.c:52968: internal compiler error: in EmitLV_DECL, at llvm-convert.cpp:7475
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[2]: *** [syn68k.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
I went to URL, and it doesn't look like a place to really put a bug report about LLVM. I the file 'syn68k.c' is about 50k lines long after the preprocessor is done with it, so I really don't thing I can make a reproducible test case to show the bug.
Turns out this [issue](https://github.com/ctm/syn68k/issues/1) is already on the github project (it is the only issue listed, ha). MaddTheSane says that this happens because clang does not support global register variables (as I verified [here](http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc)).
I don't really have much more than a basic understanding of how compilation works after you type `make`, so is there a way I can skip clang or something like that? What do you suggest? | 0 |
11,349,198 | 07/05/2012 17:10:06 | 980,917 | 10/05/2011 17:44:50 | 31 | 1 | VS Automatic Attach to .NET Remoting Process | I'm doing some maintenance on a legacy application that uses .NET Remoting. The issue I'm having is that I cannot step through remoting code unless I attach debugger to IIS process (remoting is setup in IIS on my local machine).
Once I attach I'm able to step through w/o any issues.
Is there any way to have VS automatically attach to a process upon start up? Setting up multiple Start-Up projects does not apply to this scenario since remoting is a class library. Or any other suggestions on how to step through remoting code would be welcome.
Thanks. | .net | debugging | process | remoting | attach | null | open | VS Automatic Attach to .NET Remoting Process
===
I'm doing some maintenance on a legacy application that uses .NET Remoting. The issue I'm having is that I cannot step through remoting code unless I attach debugger to IIS process (remoting is setup in IIS on my local machine).
Once I attach I'm able to step through w/o any issues.
Is there any way to have VS automatically attach to a process upon start up? Setting up multiple Start-Up projects does not apply to this scenario since remoting is a class library. Or any other suggestions on how to step through remoting code would be welcome.
Thanks. | 0 |
11,349,199 | 07/05/2012 17:10:06 | 1,394,265 | 05/14/2012 16:52:30 | 32 | 1 | How to pass php array to local powershell script | I am writing a powershell script that automates the setup of Wordpress. This script will be used by multiple people when creating their sites, and id like to add a bit of extra functionality.
I would like to have my peers access a php page which would allow for them to pick and choose themes and plugins for their page, and then pass their choices (I assumed its easiest through an array) to my powershell scripts. The reason the powershell script must handle this is because after they have picked their files, the powershell script can connect to an internal server and handle the rest.
I guess my question comes in two parts; first being is the above even possible? and if so does it seem like a logical way to handle this problem?
Second would be how to actually achieve this? Below is my php/html code to handle the download page which will hopefully be able to pass an array to my script. (The code below downloads from a 'temp' site for testing purposes and does not really meet my requirements)
<?php
$val=$_POST['theme'];
if($val == 'aa') {
header('Content-disposition: attachment; filename=all-in-one-slideshow.zip');
header('Content-type: application/zip');
$url = 'http://mypage.com/wordpressFiles/all-in-one-slideshow.zip';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $path);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);
} else if($val == 'bb') {
} else {
}
?>
<form action="download.php" method="post">
<select name="theme" id="theme" class="select-list">
<option value="\">Choose A Theme</option>
<option value="aa">All-In-One-Slideshow</br>
<option value="bb">BB</br>
</select>
<input type="submit" value="Download" />
</form>
Thank you in advance for any help.
| php | wordpress | powershell | download | null | null | open | How to pass php array to local powershell script
===
I am writing a powershell script that automates the setup of Wordpress. This script will be used by multiple people when creating their sites, and id like to add a bit of extra functionality.
I would like to have my peers access a php page which would allow for them to pick and choose themes and plugins for their page, and then pass their choices (I assumed its easiest through an array) to my powershell scripts. The reason the powershell script must handle this is because after they have picked their files, the powershell script can connect to an internal server and handle the rest.
I guess my question comes in two parts; first being is the above even possible? and if so does it seem like a logical way to handle this problem?
Second would be how to actually achieve this? Below is my php/html code to handle the download page which will hopefully be able to pass an array to my script. (The code below downloads from a 'temp' site for testing purposes and does not really meet my requirements)
<?php
$val=$_POST['theme'];
if($val == 'aa') {
header('Content-disposition: attachment; filename=all-in-one-slideshow.zip');
header('Content-type: application/zip');
$url = 'http://mypage.com/wordpressFiles/all-in-one-slideshow.zip';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $path);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);
} else if($val == 'bb') {
} else {
}
?>
<form action="download.php" method="post">
<select name="theme" id="theme" class="select-list">
<option value="\">Choose A Theme</option>
<option value="aa">All-In-One-Slideshow</br>
<option value="bb">BB</br>
</select>
<input type="submit" value="Download" />
</form>
Thank you in advance for any help.
| 0 |
11,349,200 | 07/05/2012 17:10:12 | 1,401,683 | 05/17/2012 18:13:12 | 201 | 16 | oncomplete not always execute after acion, JSF | I have the next scenario (simplified) :
My function in my docsMB managed bean:
public void saveAdvance() {
// by default, finalized is false
finalized = getFinalizedByBySlowFunction();
}
A button in my xhtml:
<a4j:commandButton value="SAVE"
action="#{docsMB.saveAdvance}"
oncomplete="verifyDocs();"
And my verifyDocs function in the same xhtml:
<script type="text/javascript">
var verifyDocs = function(){
//alert(1);
if( #{docsMB.finalized == true} ){
#{rich:component('mpConfirmar')}.show();
}
}
</script>
This make me a problem.
If I execute my app, "finalized" is always false, but I realized that if I uncomment the alert in the verifyDocs function, it works.
I think the alert gives the "necesary" time to saveAdvance to finalize itself.
What can I do to be sure that the oncomplete method excecutes after the action has finalized?
Or am I doing a mistake in other place?
Thanks a lot
| javascript | jsf | richfaces | null | null | null | open | oncomplete not always execute after acion, JSF
===
I have the next scenario (simplified) :
My function in my docsMB managed bean:
public void saveAdvance() {
// by default, finalized is false
finalized = getFinalizedByBySlowFunction();
}
A button in my xhtml:
<a4j:commandButton value="SAVE"
action="#{docsMB.saveAdvance}"
oncomplete="verifyDocs();"
And my verifyDocs function in the same xhtml:
<script type="text/javascript">
var verifyDocs = function(){
//alert(1);
if( #{docsMB.finalized == true} ){
#{rich:component('mpConfirmar')}.show();
}
}
</script>
This make me a problem.
If I execute my app, "finalized" is always false, but I realized that if I uncomment the alert in the verifyDocs function, it works.
I think the alert gives the "necesary" time to saveAdvance to finalize itself.
What can I do to be sure that the oncomplete method excecutes after the action has finalized?
Or am I doing a mistake in other place?
Thanks a lot
| 0 |
11,349,203 | 07/05/2012 17:10:25 | 1,407,311 | 05/21/2012 07:39:10 | 112 | 2 | How to expand the div to fill the width of any size in the middle column will be? | **[Demo jsFiddle][1]**
I have div color azure I want to fill the width area in the middle column no meter what size will be.
is there any solution with css3/css no jQuery ?
i need it like this picture:
![enter image description here][2]
the ststus current like this:
many Thx.
![enter image description here][3]
[Demo jsFiddle][4]
the code html:
<div id="frame">
<div id="inside_window">
<div id="Yellow"></div>
<div id="Green"></div>
<div id="Blue"></div>
<div id="Red"></div>
<div id="ver"></div>
<div id="hor"></div>
<div id="ver2"></div>
</div>
</div>
the code css:
html, body{
height:100%;
background-color: azure;
}
#frame
{
position: relative;
background-color: black;
height: 100%;
width: 100%;
margin: auto;
padding:0;
border: 1px solid black;
}
#Yellow
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: Yellow;
z-index:10;
display:table;
left:0px;
top:0;
}
#Green
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: green;
z-index:10;
right:0px;
top:0;
}
#Blue
{
position: relative;
height:100%;
min-width:65.8%;
-webkit-border-radius: 0px;
margin: 0 auto;
background-color: #62A9FF;
z-index:10;
display:table;
font-size:220%;
left:0px;
top:0px;
}
#Red
{
position: absolute;
height: 150px;
width: 100%;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: red;
z-index:10;
border: 1px solid black;
left:0px;
bottom:0px;
}
#inside_window
{
width:100%;
height:100%;
margin:0 auto;
position: relative;
border: 1px solid black;
background-color: brown;
-webkit-transform: rotate(0deg);
-webkit-transform-origin:50% 50%;
}
#ver
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
left:150px;
top:0px;
z-index:1;
}
#hor
{
position: absolute;
height: 5px;
width: 100%;
margin: 0;
background-color: white;
left:0px;
bottom:150px;
z-index:20;
}
#ver2
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
right:150px;
top:0px;
z-index:1;
}
[1]: http://jsfiddle.net/centerwow/qXKZh/29/show/
[2]: http://i.stack.imgur.com/5g2Sh.png
[3]: http://i.stack.imgur.com/8lDso.png
[4]: http://jsfiddle.net/centerwow/qXKZh/23/show/ | html | css | css3 | position | null | null | open | How to expand the div to fill the width of any size in the middle column will be?
===
**[Demo jsFiddle][1]**
I have div color azure I want to fill the width area in the middle column no meter what size will be.
is there any solution with css3/css no jQuery ?
i need it like this picture:
![enter image description here][2]
the ststus current like this:
many Thx.
![enter image description here][3]
[Demo jsFiddle][4]
the code html:
<div id="frame">
<div id="inside_window">
<div id="Yellow"></div>
<div id="Green"></div>
<div id="Blue"></div>
<div id="Red"></div>
<div id="ver"></div>
<div id="hor"></div>
<div id="ver2"></div>
</div>
</div>
the code css:
html, body{
height:100%;
background-color: azure;
}
#frame
{
position: relative;
background-color: black;
height: 100%;
width: 100%;
margin: auto;
padding:0;
border: 1px solid black;
}
#Yellow
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: Yellow;
z-index:10;
display:table;
left:0px;
top:0;
}
#Green
{
position: absolute;
height: 100%;
width: 150px;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: green;
z-index:10;
right:0px;
top:0;
}
#Blue
{
position: relative;
height:100%;
min-width:65.8%;
-webkit-border-radius: 0px;
margin: 0 auto;
background-color: #62A9FF;
z-index:10;
display:table;
font-size:220%;
left:0px;
top:0px;
}
#Red
{
position: absolute;
height: 150px;
width: 100%;
-webkit-border-radius: 0px;
margin: 0 ;
background-color: red;
z-index:10;
border: 1px solid black;
left:0px;
bottom:0px;
}
#inside_window
{
width:100%;
height:100%;
margin:0 auto;
position: relative;
border: 1px solid black;
background-color: brown;
-webkit-transform: rotate(0deg);
-webkit-transform-origin:50% 50%;
}
#ver
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
left:150px;
top:0px;
z-index:1;
}
#hor
{
position: absolute;
height: 5px;
width: 100%;
margin: 0;
background-color: white;
left:0px;
bottom:150px;
z-index:20;
}
#ver2
{
position: absolute;
height: 100%;
width: 5px;
margin: 0;
background-color: white;
right:150px;
top:0px;
z-index:1;
}
[1]: http://jsfiddle.net/centerwow/qXKZh/29/show/
[2]: http://i.stack.imgur.com/5g2Sh.png
[3]: http://i.stack.imgur.com/8lDso.png
[4]: http://jsfiddle.net/centerwow/qXKZh/23/show/ | 0 |
11,349,213 | 07/05/2012 17:11:01 | 1,374,967 | 05/04/2012 12:43:51 | 1 | 0 | httppost with cookies in android | I am new to android.I have been working on http post method.I have a login screen where i am passing username and password using http post.The service returns me a cookie.
can anyone please provide me with any sample related to this.
Any help would be highly appreciated. | android | authentication | cookies | http-post | cookiestore | null | open | httppost with cookies in android
===
I am new to android.I have been working on http post method.I have a login screen where i am passing username and password using http post.The service returns me a cookie.
can anyone please provide me with any sample related to this.
Any help would be highly appreciated. | 0 |
11,349,193 | 07/05/2012 17:09:48 | 396,949 | 05/24/2009 05:26:38 | 1,095 | 42 | BlackBerry OS 7.1 InputStream.read() return -1 after about 45 seconds | My application opens a TCP socket connection to a server. The connection is *keep-alived* and remains open until the client disconnects. I've attached the relevant code. The code works perfectly for OS 5, OS 6 and OS 7 but doesn't work as expected for **OS 7.1** (I tested it with Bold 9900 but I suspect happens on all OS 7.1 devices).
When running on OS 7.1, the blocking `read()` returns with **-1** (*end of the stream has been reached*) after about 30-45 seconds. As I already said, for OS 5/6/7 the `read()` remains blocking until the next data arrives since the connection is never closed by the server.
connInputStream = connection.openInputStream();
while (true) {
try {
retVal = connInputStream.read();
if (-1 == retVal) {
break; // end of stream has been reached
}
} catch (Exception e ) {
// do error handling
}
// data read from stream is handled here
}
I am lost here. Why the call to `read()` that supposed to blocking returns with **-1** for OS 7.1 only? | blackberry | blackberry-jde | null | null | null | null | open | BlackBerry OS 7.1 InputStream.read() return -1 after about 45 seconds
===
My application opens a TCP socket connection to a server. The connection is *keep-alived* and remains open until the client disconnects. I've attached the relevant code. The code works perfectly for OS 5, OS 6 and OS 7 but doesn't work as expected for **OS 7.1** (I tested it with Bold 9900 but I suspect happens on all OS 7.1 devices).
When running on OS 7.1, the blocking `read()` returns with **-1** (*end of the stream has been reached*) after about 30-45 seconds. As I already said, for OS 5/6/7 the `read()` remains blocking until the next data arrives since the connection is never closed by the server.
connInputStream = connection.openInputStream();
while (true) {
try {
retVal = connInputStream.read();
if (-1 == retVal) {
break; // end of stream has been reached
}
} catch (Exception e ) {
// do error handling
}
// data read from stream is handled here
}
I am lost here. Why the call to `read()` that supposed to blocking returns with **-1** for OS 7.1 only? | 0 |
11,349,217 | 07/05/2012 17:11:15 | 1,021,834 | 10/31/2011 10:59:41 | 96 | 6 | facebook connect and disconnect | im using this code to create a facebook connect button on my site:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
apiKey: 'xxxxxxxxxxxxxxxxxxxMQTQ2DshKBkNG4aAZDZD',
appId : 'xxxxxxxxxxxxxxxx', // App ID
channelUrl : '//www.xxx.net/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
function logOut(){
FB.logout();
}
</script>
<div class="fb-login-button" data-show-faces="false" data-width="200" data-max-rows="1"></div>
<a href="#" onclick="logOut();" >Logout</a>
when i hit the login button , im loggin in but when i hit the logout link
i get disconnected from facebook (not from the app itself)
and then when i do the following:
1. log in again (directly on facebook.com )
2. go to my site
3. hit the login , and it sais im alread connected to the app
what am i doing wring here ? | facebook | null | null | null | null | null | open | facebook connect and disconnect
===
im using this code to create a facebook connect button on my site:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
apiKey: 'xxxxxxxxxxxxxxxxxxxMQTQ2DshKBkNG4aAZDZD',
appId : 'xxxxxxxxxxxxxxxx', // App ID
channelUrl : '//www.xxx.net/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
function logOut(){
FB.logout();
}
</script>
<div class="fb-login-button" data-show-faces="false" data-width="200" data-max-rows="1"></div>
<a href="#" onclick="logOut();" >Logout</a>
when i hit the login button , im loggin in but when i hit the logout link
i get disconnected from facebook (not from the app itself)
and then when i do the following:
1. log in again (directly on facebook.com )
2. go to my site
3. hit the login , and it sais im alread connected to the app
what am i doing wring here ? | 0 |
11,327,093 | 07/04/2012 10:18:13 | 935,263 | 09/08/2011 16:13:48 | 11 | 0 | Using NFC Reader with Adobe AIR | I've got an ACS ACR122U NFC reader and a Smart Card. I've tried googling but can't seem to find any Native Extensions that will allow me to read/write via NFC.
Would any of you have resources I could read up on? | actionscript-3 | flash | air | adobe | nfc | null | open | Using NFC Reader with Adobe AIR
===
I've got an ACS ACR122U NFC reader and a Smart Card. I've tried googling but can't seem to find any Native Extensions that will allow me to read/write via NFC.
Would any of you have resources I could read up on? | 0 |
11,327,095 | 07/04/2012 10:18:21 | 1,461,742 | 06/17/2012 11:19:02 | 25 | 0 | Implement the swipe gesture on grid view | i want to implement the swipe gesture on **GridView** .
for example: i have 3*3 **GridView** with 9 images when i swipe my finger to the images i want to delete the images that swiped
can somebody help me if you have any idea.
Thanks | android | gridview | swipe-gesture | null | null | null | open | Implement the swipe gesture on grid view
===
i want to implement the swipe gesture on **GridView** .
for example: i have 3*3 **GridView** with 9 images when i swipe my finger to the images i want to delete the images that swiped
can somebody help me if you have any idea.
Thanks | 0 |
11,327,098 | 07/04/2012 10:18:28 | 955,237 | 09/20/2011 16:33:30 | 354 | 2 | CoreData could not fulfill a fault for retrieving data from an xml feed and using managed objects to manipulate | I have the Error - CoreDate could not fulfill a fault for retrieving data from.. The application crashes right after Item *currentItem = (Item *)[self.fetchedObjectsArray objectAtIndex:currentItemIndex] in the below code. It did however show a couple of feeds and then crashed. Also reproducing the error is tough and even if it does get reproduced it crashes after a different number of feeds have been received. Would anyone know how i would go about debugging a problem like this?
- (void)showNextFeed {
if ([self.fetchedObjectsArray count] <= 0) return;
if (feedAnimating) return;
feedAnimating = YES;
//start off the left of the screen
self.newsTitleView.center = CGPointMake(-self.newsTitleView.frame.size.width * 0.5, self.newsTitleView.center.y);
//start off the right of the screen
self.newsItemTitleLabel.center = CGPointMake(self.view.frame.size.width + self.newsItemTitleLabel.frame.size.width * 0.5, self.newsItemTitleLabel.center.y);
//update the content
currentItemIndex = (currentItemIndex + 1 < [self.fetchedObjectsArray count]) ? (currentItemIndex + 1) : 0;
Item *currentItem = (Item *)[self.fetchedObjectsArray objectAtIndex:currentItemIndex];
self.newsTitleView.backgroundColor = [UIColor colorWithHexString:currentItem.belongsTo.color];
self.newsFeedTitleLabel.text = currentItem.belongsTo.feedTitle;
self.newsItemTitleLabel.text = currentItem.itemTitle; | iphone | objective-c | ios | core-data | core-data-migration | null | open | CoreData could not fulfill a fault for retrieving data from an xml feed and using managed objects to manipulate
===
I have the Error - CoreDate could not fulfill a fault for retrieving data from.. The application crashes right after Item *currentItem = (Item *)[self.fetchedObjectsArray objectAtIndex:currentItemIndex] in the below code. It did however show a couple of feeds and then crashed. Also reproducing the error is tough and even if it does get reproduced it crashes after a different number of feeds have been received. Would anyone know how i would go about debugging a problem like this?
- (void)showNextFeed {
if ([self.fetchedObjectsArray count] <= 0) return;
if (feedAnimating) return;
feedAnimating = YES;
//start off the left of the screen
self.newsTitleView.center = CGPointMake(-self.newsTitleView.frame.size.width * 0.5, self.newsTitleView.center.y);
//start off the right of the screen
self.newsItemTitleLabel.center = CGPointMake(self.view.frame.size.width + self.newsItemTitleLabel.frame.size.width * 0.5, self.newsItemTitleLabel.center.y);
//update the content
currentItemIndex = (currentItemIndex + 1 < [self.fetchedObjectsArray count]) ? (currentItemIndex + 1) : 0;
Item *currentItem = (Item *)[self.fetchedObjectsArray objectAtIndex:currentItemIndex];
self.newsTitleView.backgroundColor = [UIColor colorWithHexString:currentItem.belongsTo.color];
self.newsFeedTitleLabel.text = currentItem.belongsTo.feedTitle;
self.newsItemTitleLabel.text = currentItem.itemTitle; | 0 |
11,327,103 | 07/04/2012 10:18:56 | 653,473 | 03/10/2011 12:00:38 | 388 | 20 | Maintaining a many-to-many relationship when Xml(De)Serializing | I have a `Model` class, which contains Lists of `Message`s and `Signal`s.
Every `Message` can contain 0, 1 or more Signals. A `Signal` can be contained by 0, 1 or more Messages at the same time. I'm having trouble maintaining the relationship between Messages and Signals when deserializing with the XmlSerializer, while also avoiding duplicate objects (in my application it is not possible to use anything other than the XmlSerializer).
<pre><code>class Model
{
private MessageCollection messages;
public MessageCollection Messages { get { return messages; } }
private SignalCollection signals;
public SignalCollection Signals { get { return signals; } }
public Model()
{
// the collection classes automatically set the Model property of any
// Messages/Signals added to its appropriate owner (this)
this.messages = new MessageCollection(this);
this.signals = new SignalCollection(this);
}
}
class Message
{
[XmlIgnore] // set by MessageCollection
public Model Model { get; set; }
public List<Signal> Signals
{
get { ??? }
}
}
class Signal
{
[XmlIgnore] // set by SignalCollection
public Model Model { get; set; }
public List<Message> Messages
{
get { return this.Model.Messages.Where(x => x.Signals.Contains(this)).ToList(); }
}
}</code></pre>
I had the idea to store a `List<uint> SignalIndices` in the `Message` class, which contains the indices of the Signals as they are in the `Model.Signals` list. However, is it safe to assume the XmlSerializer will not mess up the indices when serializing/deserializing? Also, this approach would imply that `Message.Signals` gets the `[XmlIgnore]` attribute and relies on another Linq using the `SignalIndices` list in order to achieve a similar thing as in `Signal.Messages`.
In other words, is it possible through a similar technique as used with the MessageCollection and SignalCollection classes to ensure data consistency at all times ( also during the deserialization process, in which the order of object construction is undefined), while also having a "real" list of signals (`List<Signal>`) in the Message class that does not use Linq? | c# | serialization | deserialization | null | null | null | open | Maintaining a many-to-many relationship when Xml(De)Serializing
===
I have a `Model` class, which contains Lists of `Message`s and `Signal`s.
Every `Message` can contain 0, 1 or more Signals. A `Signal` can be contained by 0, 1 or more Messages at the same time. I'm having trouble maintaining the relationship between Messages and Signals when deserializing with the XmlSerializer, while also avoiding duplicate objects (in my application it is not possible to use anything other than the XmlSerializer).
<pre><code>class Model
{
private MessageCollection messages;
public MessageCollection Messages { get { return messages; } }
private SignalCollection signals;
public SignalCollection Signals { get { return signals; } }
public Model()
{
// the collection classes automatically set the Model property of any
// Messages/Signals added to its appropriate owner (this)
this.messages = new MessageCollection(this);
this.signals = new SignalCollection(this);
}
}
class Message
{
[XmlIgnore] // set by MessageCollection
public Model Model { get; set; }
public List<Signal> Signals
{
get { ??? }
}
}
class Signal
{
[XmlIgnore] // set by SignalCollection
public Model Model { get; set; }
public List<Message> Messages
{
get { return this.Model.Messages.Where(x => x.Signals.Contains(this)).ToList(); }
}
}</code></pre>
I had the idea to store a `List<uint> SignalIndices` in the `Message` class, which contains the indices of the Signals as they are in the `Model.Signals` list. However, is it safe to assume the XmlSerializer will not mess up the indices when serializing/deserializing? Also, this approach would imply that `Message.Signals` gets the `[XmlIgnore]` attribute and relies on another Linq using the `SignalIndices` list in order to achieve a similar thing as in `Signal.Messages`.
In other words, is it possible through a similar technique as used with the MessageCollection and SignalCollection classes to ensure data consistency at all times ( also during the deserialization process, in which the order of object construction is undefined), while also having a "real" list of signals (`List<Signal>`) in the Message class that does not use Linq? | 0 |
11,327,108 | 07/04/2012 10:19:02 | 481,293 | 10/20/2010 05:41:32 | 92 | 5 | Debian Installation - Processor Architecture type | I am trying to install debian on local computer with Windows 7 OS and intel core i5 processor.
On the download page. I was asked to select my processor architecture with the following options listed
amd64
armel
kfreebsd-i386
kfreebsd-amd64
i386
ia64
mips
mipsel
powerpc
sparc
From my little research, i would say my processor architecture is not listed above as intel core i5 is a processor architecture in itself. am i right?
If so, which do I select for my debian installation? | linux | debian | processor | null | null | 07/04/2012 12:59:27 | off topic | Debian Installation - Processor Architecture type
===
I am trying to install debian on local computer with Windows 7 OS and intel core i5 processor.
On the download page. I was asked to select my processor architecture with the following options listed
amd64
armel
kfreebsd-i386
kfreebsd-amd64
i386
ia64
mips
mipsel
powerpc
sparc
From my little research, i would say my processor architecture is not listed above as intel core i5 is a processor architecture in itself. am i right?
If so, which do I select for my debian installation? | 2 |
11,327,117 | 07/04/2012 10:19:26 | 437,064 | 09/01/2010 14:43:26 | 202 | 0 | which character should i use for dateTime (for example for int we use %d) | when we want to pass sth to database like `int` we use(%d) like below
`...string.format("select * from Table where code=%d",100)...`
what should i use instead of `%d` when we want to pass `dateTime` ? | c# | null | null | null | null | null | open | which character should i use for dateTime (for example for int we use %d)
===
when we want to pass sth to database like `int` we use(%d) like below
`...string.format("select * from Table where code=%d",100)...`
what should i use instead of `%d` when we want to pass `dateTime` ? | 0 |
11,327,118 | 07/04/2012 10:19:28 | 827,992 | 07/04/2011 11:06:19 | 135 | 5 | Packing a compiled Android kernel for Odin | I have compiled my kernel, now what are the right steps to have it ready to be flashed? | android | kernel | null | null | null | null | open | Packing a compiled Android kernel for Odin
===
I have compiled my kernel, now what are the right steps to have it ready to be flashed? | 0 |
11,327,119 | 07/04/2012 10:19:31 | 896,673 | 08/16/2011 12:39:01 | 77 | 5 | dotcmis / alfresco / delete => create => search delay | I try to integrate dotcmis and alfresco into my application.
When creating my unit tests, I face this issue :
- I set up my test environment by deleting "myfolder" if any
- I create back myfolder and put a document into it
then I try to find the document :
- The first time (when myfolder does not exist before), Search returns 0 results
- Next times, when myfolder exists before and is deleted by my test setup, I get an exception :
Apache Chemistry OpenCMIS - runtime error
HTTP Status 500 - <!--exception-->runtime<!--/exception--><p><!--message-->Node does not exist: missing://missing/missing(null)<!--/message--></p><hr noshade='noshade'/><!-- stacktrace--><pre>
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Node does not exist: missing://missing/missing(null)
at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:80)
at ...
When I go to Alfresco, the document exists.
It seems that the folder and document are not yet disponible for query, but why ?
If I put in comment the test environment init, the document is found
Maybe I do something wrong but what ?
Here is my code :
[TestMethod()]
[DeploymentItem(@"Files\SearchTest_1", @"Files\SearchTest_1")]
public void SearchTest_2()
{
string myfoldername = "myfolder";
// Session creation
var p = new Dictionary<String, String>();
p[SessionParameter.User] = _userName;
p[SessionParameter.Password] = _userPassword;
p[SessionParameter.BindingType] = BindingType.AtomPub;
p[SessionParameter.AtomPubUrl] = _serverUrl;
var session = DotCMIS.Client.Impl.SessionFactory.NewInstance().GetRepositories(p)[0].CreateSession();
session.DefaultContext.CacheEnabled = false;
var operationContext = session.CreateOperationContext();
operationContext.IncludeAcls = true;
// Delete and create back folder and document
// /*
DotCMIS.Client.IFolder rootFolder = this._testSession.GetRootFolder(operationContext);
DotCMIS.Client.IFolder myFolder = null;
Dictionary<String, Object> properties = null;
// Le dossier de destination des tests existe-t-il ?
var myFolderExists = rootFolder.GetChildren(operationContext).Any(child => child.Name.Equals(myfoldername));
if (myFolderExists)
{
myFolder = (DotCMIS.Client.IFolder)session.GetObjectByPath(String.Format(@"/{0}", myfoldername), operationContext);
myFolder.DeleteTree(true, DotCMIS.Enums.UnfileObject.Delete, true);
}
properties = new Dictionary<String, Object>();
properties[PropertyIds.Name] = myfoldername;
properties[PropertyIds.ObjectTypeId] = "cmis:folder";
myFolder = rootFolder.CreateFolder(properties);
rootFolder.Refresh();
myFolder = (DotCMIS.Client.IFolder)session.GetObjectByPath(String.Format(@"/{0}", myfoldername), operationContext);
FileInfo sourceFile = new FileInfo(@"Files\SearchTest_1\SearchTest_1.pdf");
properties = new Dictionary<String, Object>();
properties[PropertyIds.ObjectTypeId] = "cmis:document";
properties[PropertyIds.Name] = sourceFile.Name;
using (var fileStream = sourceFile.OpenRead())
{
var contentStream = new DotCMIS.Data.Impl.ContentStream();
contentStream.MimeType = "application/pdf";
contentStream.Stream = fileStream;
contentStream.Length = fileStream.Length;
//this._testSession.CreateDocument(properties, this._testSession.CreateObjectId(myFolder.Id), contentStream, null);
DotCMIS.Client.IDocument createdDocument = myFolder.CreateDocument(properties, contentStream, null);
}
// */
// Recherche
string query = @"SELECT * FROM cmis:document WHERE cmis:name = 'SearchTest_1.pdf'";
var results = this._testSession.Query(query, false, operationContext).ToArray();
Assert.AreEqual(1, results.Length);
} | alfresco | cmis | null | null | null | null | open | dotcmis / alfresco / delete => create => search delay
===
I try to integrate dotcmis and alfresco into my application.
When creating my unit tests, I face this issue :
- I set up my test environment by deleting "myfolder" if any
- I create back myfolder and put a document into it
then I try to find the document :
- The first time (when myfolder does not exist before), Search returns 0 results
- Next times, when myfolder exists before and is deleted by my test setup, I get an exception :
Apache Chemistry OpenCMIS - runtime error
HTTP Status 500 - <!--exception-->runtime<!--/exception--><p><!--message-->Node does not exist: missing://missing/missing(null)<!--/message--></p><hr noshade='noshade'/><!-- stacktrace--><pre>
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Node does not exist: missing://missing/missing(null)
at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:80)
at ...
When I go to Alfresco, the document exists.
It seems that the folder and document are not yet disponible for query, but why ?
If I put in comment the test environment init, the document is found
Maybe I do something wrong but what ?
Here is my code :
[TestMethod()]
[DeploymentItem(@"Files\SearchTest_1", @"Files\SearchTest_1")]
public void SearchTest_2()
{
string myfoldername = "myfolder";
// Session creation
var p = new Dictionary<String, String>();
p[SessionParameter.User] = _userName;
p[SessionParameter.Password] = _userPassword;
p[SessionParameter.BindingType] = BindingType.AtomPub;
p[SessionParameter.AtomPubUrl] = _serverUrl;
var session = DotCMIS.Client.Impl.SessionFactory.NewInstance().GetRepositories(p)[0].CreateSession();
session.DefaultContext.CacheEnabled = false;
var operationContext = session.CreateOperationContext();
operationContext.IncludeAcls = true;
// Delete and create back folder and document
// /*
DotCMIS.Client.IFolder rootFolder = this._testSession.GetRootFolder(operationContext);
DotCMIS.Client.IFolder myFolder = null;
Dictionary<String, Object> properties = null;
// Le dossier de destination des tests existe-t-il ?
var myFolderExists = rootFolder.GetChildren(operationContext).Any(child => child.Name.Equals(myfoldername));
if (myFolderExists)
{
myFolder = (DotCMIS.Client.IFolder)session.GetObjectByPath(String.Format(@"/{0}", myfoldername), operationContext);
myFolder.DeleteTree(true, DotCMIS.Enums.UnfileObject.Delete, true);
}
properties = new Dictionary<String, Object>();
properties[PropertyIds.Name] = myfoldername;
properties[PropertyIds.ObjectTypeId] = "cmis:folder";
myFolder = rootFolder.CreateFolder(properties);
rootFolder.Refresh();
myFolder = (DotCMIS.Client.IFolder)session.GetObjectByPath(String.Format(@"/{0}", myfoldername), operationContext);
FileInfo sourceFile = new FileInfo(@"Files\SearchTest_1\SearchTest_1.pdf");
properties = new Dictionary<String, Object>();
properties[PropertyIds.ObjectTypeId] = "cmis:document";
properties[PropertyIds.Name] = sourceFile.Name;
using (var fileStream = sourceFile.OpenRead())
{
var contentStream = new DotCMIS.Data.Impl.ContentStream();
contentStream.MimeType = "application/pdf";
contentStream.Stream = fileStream;
contentStream.Length = fileStream.Length;
//this._testSession.CreateDocument(properties, this._testSession.CreateObjectId(myFolder.Id), contentStream, null);
DotCMIS.Client.IDocument createdDocument = myFolder.CreateDocument(properties, contentStream, null);
}
// */
// Recherche
string query = @"SELECT * FROM cmis:document WHERE cmis:name = 'SearchTest_1.pdf'";
var results = this._testSession.Query(query, false, operationContext).ToArray();
Assert.AreEqual(1, results.Length);
} | 0 |
11,327,125 | 07/04/2012 10:20:15 | 479,908 | 10/18/2010 23:39:14 | 319 | 2 | How to Achieve AsyncTask PublishProgress Effect in CursorLoader Android | Good day, As we all know, with AsyncTask, We get the PublishProgress() method which can be used to periodically update the main UI thread. This is particularly useful when your loading plenty images from an sdcard or anywhere and displaying them as each has finished loading.
How can you achieve the same task of periodically updating the UI with CursorLoader(with respect to loading images)?.. or is the CursorLoader so fast enough that only using a Progress dialog will suffice?
i am thinking you can use handlers but not too sure how. Thank you | android | null | null | null | null | null | open | How to Achieve AsyncTask PublishProgress Effect in CursorLoader Android
===
Good day, As we all know, with AsyncTask, We get the PublishProgress() method which can be used to periodically update the main UI thread. This is particularly useful when your loading plenty images from an sdcard or anywhere and displaying them as each has finished loading.
How can you achieve the same task of periodically updating the UI with CursorLoader(with respect to loading images)?.. or is the CursorLoader so fast enough that only using a Progress dialog will suffice?
i am thinking you can use handlers but not too sure how. Thank you | 0 |
11,410,088 | 07/10/2012 09:10:55 | 1,292,316 | 03/26/2012 06:24:45 | 82 | 1 | why my fileupload control is not working fine | I have a FileUpload control in my asp.net page that it should upload my picture in some folder on the host .I put a condition that when it has file ,it starts uploading.
this the code .
if (File2.HasFile)
{
string b = FileUpload2.FileName.ToString();
File2.PostedFile.SaveAs(path + FileUpload2.FileName);
}
but the condition never be true.I have two other FileUpload in that page .they are working fine .But this one is not working fine and the condition always is false.
what should I do?
| c# | asp.net | null | null | null | null | open | why my fileupload control is not working fine
===
I have a FileUpload control in my asp.net page that it should upload my picture in some folder on the host .I put a condition that when it has file ,it starts uploading.
this the code .
if (File2.HasFile)
{
string b = FileUpload2.FileName.ToString();
File2.PostedFile.SaveAs(path + FileUpload2.FileName);
}
but the condition never be true.I have two other FileUpload in that page .they are working fine .But this one is not working fine and the condition always is false.
what should I do?
| 0 |
11,409,952 | 07/10/2012 09:02:30 | 1,504,233 | 07/05/2012 14:02:09 | 3 | 0 | How to implement a property page to an eclipse project | Here is the deal. I create a project in eclipse rcp programmatically. Then i add some persistant properties to it. Now i want to right click on the project in the project explorer view and then click on the properties tab. There should be my property page.
Here is what i have:
<extension
point="org.eclipse.ui.propertyPages">
<page
adaptable="false"
class="bg.bulsi.rcp.first.properties.SamplePropertyPage"
id="bg.bulsi.rcp.first.properties.samplePropertyPage"
name="Sample Page"
nameFilter="*.*"
objectClass="org.eclipse.core.resources.IProject"
selectionFilter="single">
<enabledWhen>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
</enabledWhen>
</page>
</extension>
why doesnt this page show up in the properties of the project? | java | eclipse | properties | project | rcp | null | open | How to implement a property page to an eclipse project
===
Here is the deal. I create a project in eclipse rcp programmatically. Then i add some persistant properties to it. Now i want to right click on the project in the project explorer view and then click on the properties tab. There should be my property page.
Here is what i have:
<extension
point="org.eclipse.ui.propertyPages">
<page
adaptable="false"
class="bg.bulsi.rcp.first.properties.SamplePropertyPage"
id="bg.bulsi.rcp.first.properties.samplePropertyPage"
name="Sample Page"
nameFilter="*.*"
objectClass="org.eclipse.core.resources.IProject"
selectionFilter="single">
<enabledWhen>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
</enabledWhen>
</page>
</extension>
why doesnt this page show up in the properties of the project? | 0 |
11,410,092 | 07/10/2012 09:11:16 | 1,307,542 | 04/02/2012 08:21:32 | 26 | 0 | Retrieving string value from NSMutableDictionary | I want to load tableView values from a database, called for test purposes database.sqlite.
It is populated with the following:
1, January
2, February
... down to ...
12, December
As you will see I'm using FMDB. The following line compiles but crashes:
NSString *myString = [[rows objectAtIndex:myNumber] objectForKey:@"MonthName"];
I'm having problems coming to terms with the inconsistent way you deal with Ints and String in Cocoa which is part of my problem. Also, although there are NSLog debugging lines in there this approach looks convoluted. What advice can you give me?
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsPath = [paths objectAtIndex:0];
NSString *path = [docsPath stringByAppendingPathComponent:@"database.sqlite"];
FMDatabase *database = [FMDatabase databaseWithPath:path];
[database open];
NSLog(@"Open Database");
FMResultSet *results = [database executeQuery:@"SELECT * FROM monthly"];
while([results next]) {
NSString *name = [results stringForColumn:@"name"];
NSInteger age = [results intForColumn:@"age"];
// Stuff Data into Array
NSMutableArray *rows = [[NSMutableArray alloc] init];
NSMutableDictionary *firstRow = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:age], @"MonthID", [NSString stringWithFormat:@"%@", name], @"MonthName", nil];
[rows addObject:firstRow];
NSLog(@"Month: %@ - %d",name, age);
int myNumber = [[firstRow objectForKey:@"MonthID"] intValue];
// *** THE LINE BELOW IS GIVING ME PROBLEMS ***
NSString *myString = [[rows objectAtIndex:myNumber] objectForKey:@"MonthName"];
// NSLog(@"Month No: %@ - %d",myString, myNumber);
NSLog(@"***** Month No: %d", myNumber);
// [self.monthMonths myString];
}
[database close];
NSLog(@"Close Database"); | iphone | xcode | null | null | null | null | open | Retrieving string value from NSMutableDictionary
===
I want to load tableView values from a database, called for test purposes database.sqlite.
It is populated with the following:
1, January
2, February
... down to ...
12, December
As you will see I'm using FMDB. The following line compiles but crashes:
NSString *myString = [[rows objectAtIndex:myNumber] objectForKey:@"MonthName"];
I'm having problems coming to terms with the inconsistent way you deal with Ints and String in Cocoa which is part of my problem. Also, although there are NSLog debugging lines in there this approach looks convoluted. What advice can you give me?
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsPath = [paths objectAtIndex:0];
NSString *path = [docsPath stringByAppendingPathComponent:@"database.sqlite"];
FMDatabase *database = [FMDatabase databaseWithPath:path];
[database open];
NSLog(@"Open Database");
FMResultSet *results = [database executeQuery:@"SELECT * FROM monthly"];
while([results next]) {
NSString *name = [results stringForColumn:@"name"];
NSInteger age = [results intForColumn:@"age"];
// Stuff Data into Array
NSMutableArray *rows = [[NSMutableArray alloc] init];
NSMutableDictionary *firstRow = [NSMutableDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:age], @"MonthID", [NSString stringWithFormat:@"%@", name], @"MonthName", nil];
[rows addObject:firstRow];
NSLog(@"Month: %@ - %d",name, age);
int myNumber = [[firstRow objectForKey:@"MonthID"] intValue];
// *** THE LINE BELOW IS GIVING ME PROBLEMS ***
NSString *myString = [[rows objectAtIndex:myNumber] objectForKey:@"MonthName"];
// NSLog(@"Month No: %@ - %d",myString, myNumber);
NSLog(@"***** Month No: %d", myNumber);
// [self.monthMonths myString];
}
[database close];
NSLog(@"Close Database"); | 0 |
11,410,096 | 07/10/2012 09:11:29 | 1,363,169 | 04/28/2012 17:12:21 | 15 | 0 | how do i display the first page of a pdf as a thumbnail with php | Iam working on an e learning portal,
but I am finding it difficult to display the first page of the uploaded pdf as a thumbnail.
Any hints, assistance or suggestion will be appreciated
| php | pdf | null | null | null | null | open | how do i display the first page of a pdf as a thumbnail with php
===
Iam working on an e learning portal,
but I am finding it difficult to display the first page of the uploaded pdf as a thumbnail.
Any hints, assistance or suggestion will be appreciated
| 0 |
11,410,098 | 07/10/2012 09:11:41 | 1,126,148 | 01/02/2012 11:33:47 | 3 | 0 | VS2010 Project - Dll overview | I have a large amount of VS2010 solutions all containing one or more projects.
I need a tool that can generate an overview of all dll references in each project.
Maybe in a structure like this:
<project>
<name>ProjectOne</name>
<dlls>
<dll name="dllName1">
<dll name="dllName2">
<dll name="dllName3">
</dlls>
</project>
<project>
<name>ProjectTwo</name>
<dlls>
<dll name="dllName1">
</dlls>
</project>
Maybe even with a filter, to filter out the standard system dll's.
If no such tool exists, I know that I could start writing my own tool, doing some LINQ2XML in all csproj files etc. | visual-studio-2010 | dll | overview | null | null | null | open | VS2010 Project - Dll overview
===
I have a large amount of VS2010 solutions all containing one or more projects.
I need a tool that can generate an overview of all dll references in each project.
Maybe in a structure like this:
<project>
<name>ProjectOne</name>
<dlls>
<dll name="dllName1">
<dll name="dllName2">
<dll name="dllName3">
</dlls>
</project>
<project>
<name>ProjectTwo</name>
<dlls>
<dll name="dllName1">
</dlls>
</project>
Maybe even with a filter, to filter out the standard system dll's.
If no such tool exists, I know that I could start writing my own tool, doing some LINQ2XML in all csproj files etc. | 0 |
11,410,103 | 07/10/2012 09:11:55 | 1,514,262 | 07/10/2012 09:01:01 | 1 | 0 | Heroku uploading key failed | How can I uploading it in Heroku? Why failed?
[enter image description here][1]
[1]: http://i.stack.imgur.com/zB0tn.jpg | heroku | hosting | null | null | null | null | open | Heroku uploading key failed
===
How can I uploading it in Heroku? Why failed?
[enter image description here][1]
[1]: http://i.stack.imgur.com/zB0tn.jpg | 0 |
11,410,106 | 07/10/2012 09:12:04 | 1,343,981 | 04/19/2012 12:36:09 | 33 | 1 | jQuery - Trigger event on element creation | Is there an event in jQuery which fires on dom element creation? I tried load, but that won't work for example with a span. | jquery | events | null | null | null | null | open | jQuery - Trigger event on element creation
===
Is there an event in jQuery which fires on dom element creation? I tried load, but that won't work for example with a span. | 0 |
11,410,113 | 07/10/2012 09:12:17 | 1,514,274 | 07/10/2012 09:06:52 | 1 | 0 | convert to local time zone and assign it to calendar starttimezone | I have timezone name in this string "MyObj.Timezone".
I need to get the local time zone name and assign it to calendar starttimezone in Exchange 2010
How to do it?
Thanks in advance.
| c# | timezone | exchange2010 | null | null | null | open | convert to local time zone and assign it to calendar starttimezone
===
I have timezone name in this string "MyObj.Timezone".
I need to get the local time zone name and assign it to calendar starttimezone in Exchange 2010
How to do it?
Thanks in advance.
| 0 |
11,410,115 | 07/10/2012 09:12:30 | 1,019,964 | 10/29/2011 17:09:34 | 11 | 1 | Error sending object to JAX-RS using JQuery and JSON | I'm trying to send a javascript object to a JAX-RS server. I get a server-side exception when i PUT from jquery.
Here is my server code
//JAX-RS Server
@PUT
@Path("/edit/{project_key}/")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response editAssociation(@PathParam("project_key") String projectKey,
@FormParam("association") EditFieldAssociationModel association) {
//TODO
//Here i just put a debug break point
return Response.noContent().build();
}
//EditFieldAssociationModel class
@XmlRootElement(name = "EditFieldAssociationModel")
@XmlAccessorType(XmlAccessType.FIELD)
public class EditFieldAssociationModel {
@XmlElement(name = "id")
private Long id;
@XmlElement(name = "method")
private String method;
@XmlElement(name = "jiraDefaultValue")
private String jiraDefaultValue;
@XmlElement(name = "externalDefaultValue")
private String externalDefaultValue;
//and public accessors
}
And my js code :
function(){
var editasso = {id:asso_id,
method:d.find(".sync-plugin-method").find('select').val(),
jiraDefaultValue:d.find('.sync-plugin-jira-default-value').find('select').val(),
externalDefaultValue:d.find('.sync-plugin-external-default-value').find('select').val()};
AJS.$.ajax({
url: AJS.contextPath()+"/rest/a-sync-rest/1.0/association/edit/"+getProjectKey(),
type: "PUT",
//TODO
data: JSON.stringify(editasso),
beforeSend: function(x) {
if (x && x.overrideMimeType) {
//x.overrideMimeType("application/json; charset=UTF-8");
x.setRequestHeader("Content-type", "application/json; charset=UTF-8");
console.log("mime type override ok");
}else{
console.log("unable to override mime type");
}
},
dataType: "json",
success: function(msg){
dialog.remove();
location.reload();
},
error : sync_plugin_error
});
}
I tried with other values for editasso
var editasso = {association : {id:asso_id,
method:d.find(".sync-plugin-method").find('select').val(),
jiraDefaultValue:d.find('.sync-plugin-jira-default-value').find('select').val(),
externalDefaultValue:d.find('.sync-plugin-external-default-value').find('select').val()}};
The post body seems to be correct :
{"association":{"id":"350","method":"com.a.jira.synchronization.KeepLatestSyncMethod","jiraDefaultValue":"Valeur 1","externalDefaultValue":"aa"}}
The exception is
org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
Any suggestion ?
Thx | java | javascript | jquery | jquery-ajax | jax-rs | null | open | Error sending object to JAX-RS using JQuery and JSON
===
I'm trying to send a javascript object to a JAX-RS server. I get a server-side exception when i PUT from jquery.
Here is my server code
//JAX-RS Server
@PUT
@Path("/edit/{project_key}/")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public Response editAssociation(@PathParam("project_key") String projectKey,
@FormParam("association") EditFieldAssociationModel association) {
//TODO
//Here i just put a debug break point
return Response.noContent().build();
}
//EditFieldAssociationModel class
@XmlRootElement(name = "EditFieldAssociationModel")
@XmlAccessorType(XmlAccessType.FIELD)
public class EditFieldAssociationModel {
@XmlElement(name = "id")
private Long id;
@XmlElement(name = "method")
private String method;
@XmlElement(name = "jiraDefaultValue")
private String jiraDefaultValue;
@XmlElement(name = "externalDefaultValue")
private String externalDefaultValue;
//and public accessors
}
And my js code :
function(){
var editasso = {id:asso_id,
method:d.find(".sync-plugin-method").find('select').val(),
jiraDefaultValue:d.find('.sync-plugin-jira-default-value').find('select').val(),
externalDefaultValue:d.find('.sync-plugin-external-default-value').find('select').val()};
AJS.$.ajax({
url: AJS.contextPath()+"/rest/a-sync-rest/1.0/association/edit/"+getProjectKey(),
type: "PUT",
//TODO
data: JSON.stringify(editasso),
beforeSend: function(x) {
if (x && x.overrideMimeType) {
//x.overrideMimeType("application/json; charset=UTF-8");
x.setRequestHeader("Content-type", "application/json; charset=UTF-8");
console.log("mime type override ok");
}else{
console.log("unable to override mime type");
}
},
dataType: "json",
success: function(msg){
dialog.remove();
location.reload();
},
error : sync_plugin_error
});
}
I tried with other values for editasso
var editasso = {association : {id:asso_id,
method:d.find(".sync-plugin-method").find('select').val(),
jiraDefaultValue:d.find('.sync-plugin-jira-default-value').find('select').val(),
externalDefaultValue:d.find('.sync-plugin-external-default-value').find('select').val()}};
The post body seems to be correct :
{"association":{"id":"350","method":"com.a.jira.synchronization.KeepLatestSyncMethod","jiraDefaultValue":"Valeur 1","externalDefaultValue":"aa"}}
The exception is
org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
Any suggestion ?
Thx | 0 |
11,410,118 | 07/10/2012 09:12:33 | 1,501,090 | 07/04/2012 09:14:12 | 1 | 0 | Android Round Button and Spinner inside Activity Group | I have a Spinner and 2 buttons in an Activity Group. I want to apply rounded corner to the buttons. I have created shape xml resource file for round button in Android. I have assigned this resource file as background to the button while creating the button in Layout. But the change is not reflected after executing the application.
I have set the ContentView for that screen as :
setContentView(LayoutInflater.from(getParent()).inflate(R.layout.textmessage,null));
This has to be done to make spinner work in an Activity Group.
How can I make the Button as round corner in an Activity Group having Spinner?
Any help would be appreciated. Thanks in Advance.
| android | null | null | null | null | null | open | Android Round Button and Spinner inside Activity Group
===
I have a Spinner and 2 buttons in an Activity Group. I want to apply rounded corner to the buttons. I have created shape xml resource file for round button in Android. I have assigned this resource file as background to the button while creating the button in Layout. But the change is not reflected after executing the application.
I have set the ContentView for that screen as :
setContentView(LayoutInflater.from(getParent()).inflate(R.layout.textmessage,null));
This has to be done to make spinner work in an Activity Group.
How can I make the Button as round corner in an Activity Group having Spinner?
Any help would be appreciated. Thanks in Advance.
| 0 |
11,410,119 | 07/10/2012 09:12:59 | 1,514,128 | 07/10/2012 08:14:30 | 1 | 0 | How can I add dynamic item in iPhone if third party payment is not allowed? | I need to understand one point. Apple has made it compulsory to use in App purchase for virtual items or goods and no third party payment solutions are accepted. But if the items are dynamically coming from a CMS into the iPhone, then we cannot use in App purchase since In-App purchases means data has to be entered one time.
Can anyone give me a solution of how to handle this situation. | ios | null | null | null | null | null | open | How can I add dynamic item in iPhone if third party payment is not allowed?
===
I need to understand one point. Apple has made it compulsory to use in App purchase for virtual items or goods and no third party payment solutions are accepted. But if the items are dynamically coming from a CMS into the iPhone, then we cannot use in App purchase since In-App purchases means data has to be entered one time.
Can anyone give me a solution of how to handle this situation. | 0 |
11,410,121 | 07/10/2012 09:13:06 | 1,066,840 | 11/26/2011 11:50:56 | 59 | 15 | How to find an Object (Controller or View) resigned first Responder? | I would like to do some cleanup activity when a particular object resigns the FirstResponder.Is there any way to detect whether object has resigned first responder status. What methods I need to implement to know this. Any pointers for this.
I already gone through this link.But I did get much out of it.
http://stackoverflow.com/questions/5600793/nstableview-nsoutlineview-editing-on-tab-key | osx | cocoa | nsresponder | null | null | null | open | How to find an Object (Controller or View) resigned first Responder?
===
I would like to do some cleanup activity when a particular object resigns the FirstResponder.Is there any way to detect whether object has resigned first responder status. What methods I need to implement to know this. Any pointers for this.
I already gone through this link.But I did get much out of it.
http://stackoverflow.com/questions/5600793/nstableview-nsoutlineview-editing-on-tab-key | 0 |
11,571,418 | 07/20/2012 00:53:59 | 1,537,319 | 07/19/2012 08:47:25 | 1 | 0 | FormsAuthentication.SetAuthCookie stores data in which place | In the following code where the creating user accounts(userid, password) stores in?
FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);
Sameway, When LogIn, how it works?..(i.e)How the values are retrieved and compared to the data we are typing in the login page(userid, password)..Please explain the process..I am having doubt whether it is storted in ASPNETDB.MDF - > aspnet_Membership..If the values are stored here, then how application works when retrieving values from here to compare the data we typed in the form..Here the application I mean is Sample Application present in .NET4.0(Visual Studio 2010)..Pls help.. | c# | asp.net | .net-4.0 | null | null | null | open | FormsAuthentication.SetAuthCookie stores data in which place
===
In the following code where the creating user accounts(userid, password) stores in?
FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);
Sameway, When LogIn, how it works?..(i.e)How the values are retrieved and compared to the data we are typing in the login page(userid, password)..Please explain the process..I am having doubt whether it is storted in ASPNETDB.MDF - > aspnet_Membership..If the values are stored here, then how application works when retrieving values from here to compare the data we typed in the form..Here the application I mean is Sample Application present in .NET4.0(Visual Studio 2010)..Pls help.. | 0 |
11,571,420 | 07/20/2012 00:54:20 | 1,218,712 | 02/19/2012 02:51:27 | 20 | 2 | CATransform3DRotate rotate for 360 degrees | I've started using CATransform3D lately and it seems very nice. I just have 1 issue with the rotation though. I'm trying to rotate my view for 360˚ degrees to the right but if I just put pass 360 to CATransform3DRotate it doesn't work (It just doesn't move at all.)
Here's my code:
CALayer *layer = dock.layer;
CATransform3D r = CATransform3DIdentity;
r.m34 = 1.0 / -500;
r = CATransform3DRotate(r, DegreesToRadians(180.0f), 100.0f, 1.0f, 100.0f);
layer.transform = r;
Does anyone know how to fix this issue? Thanks in advance! :) | iphone | objective-c | calayer | catransform3d | quartz-core | null | open | CATransform3DRotate rotate for 360 degrees
===
I've started using CATransform3D lately and it seems very nice. I just have 1 issue with the rotation though. I'm trying to rotate my view for 360˚ degrees to the right but if I just put pass 360 to CATransform3DRotate it doesn't work (It just doesn't move at all.)
Here's my code:
CALayer *layer = dock.layer;
CATransform3D r = CATransform3DIdentity;
r.m34 = 1.0 / -500;
r = CATransform3DRotate(r, DegreesToRadians(180.0f), 100.0f, 1.0f, 100.0f);
layer.transform = r;
Does anyone know how to fix this issue? Thanks in advance! :) | 0 |
11,571,375 | 07/20/2012 00:46:42 | 1,285,444 | 03/22/2012 09:03:59 | 137 | 5 | How to save the pixels in area of the QGRaphicsItem? | Here is the thing, I have develop a manual Annotation Tool for annotating images, you know, use rectangles to mark parts of a human, head, torso, limbs, and store the information like width, height, center point, rotation. I use QT to develop this tiny tool, it's cool, but I face a problem. I want to save the pixels of the image which in a QGraphicsScene in the area of the rectangles (QGraphicsItems), so, I want to know how can I control the pixels of this area?
Thank you very much. | qt | qt4 | qgraphicsitem | null | null | null | open | How to save the pixels in area of the QGRaphicsItem?
===
Here is the thing, I have develop a manual Annotation Tool for annotating images, you know, use rectangles to mark parts of a human, head, torso, limbs, and store the information like width, height, center point, rotation. I use QT to develop this tiny tool, it's cool, but I face a problem. I want to save the pixels of the image which in a QGraphicsScene in the area of the rectangles (QGraphicsItems), so, I want to know how can I control the pixels of this area?
Thank you very much. | 0 |
11,570,909 | 07/19/2012 23:43:34 | 1,539,199 | 07/19/2012 21:36:18 | 1 | 0 | String Search and format in C | Hello all just a quick on in C i have a buffer full of data like below
unsigned long buffer[255]="CODE=12345-MODE-12453-CODE-12355"
My question is how to search through this.For example for the CODE=12345 section bare in mind the numbers change so I would like to search like this CODE=***** using wildcard or preset amount of spaces after the CODE= part.
Thanks | c | string | search | buffer | null | null | open | String Search and format in C
===
Hello all just a quick on in C i have a buffer full of data like below
unsigned long buffer[255]="CODE=12345-MODE-12453-CODE-12355"
My question is how to search through this.For example for the CODE=12345 section bare in mind the numbers change so I would like to search like this CODE=***** using wildcard or preset amount of spaces after the CODE= part.
Thanks | 0 |
11,570,910 | 07/19/2012 23:43:53 | 996,292 | 10/14/2011 23:00:10 | 186 | 10 | Which module should I import to use a PyHKEY? | I'm attempting to win32api.RegLoadKey part of the pywin32 extension, however, I am assuming I need to create a PyHKEY first. But I don't know which module PyHKEY is in. The documentation is equally useless. http://docs.activestate.com/activepython/2.4/pywin32/PyHKEY.html Note also that the documentation which is there does note that a PyHKEY is just a PyHANDLE, which is just an int, but using a int in the call causes Exception: `error: (6, 'RegLoadKey', 'The handle is invalid.')`
Any help would be greatly appreciated!
A quick update:
import win32api
handle = int()
win32api.RegLoadKey(handle, "tempKey", "C:\\Users\\Default\\NTUSER.dat")
| python | pywin32 | null | null | null | null | open | Which module should I import to use a PyHKEY?
===
I'm attempting to win32api.RegLoadKey part of the pywin32 extension, however, I am assuming I need to create a PyHKEY first. But I don't know which module PyHKEY is in. The documentation is equally useless. http://docs.activestate.com/activepython/2.4/pywin32/PyHKEY.html Note also that the documentation which is there does note that a PyHKEY is just a PyHANDLE, which is just an int, but using a int in the call causes Exception: `error: (6, 'RegLoadKey', 'The handle is invalid.')`
Any help would be greatly appreciated!
A quick update:
import win32api
handle = int()
win32api.RegLoadKey(handle, "tempKey", "C:\\Users\\Default\\NTUSER.dat")
| 0 |
11,571,399 | 07/20/2012 00:50:19 | 1,041,874 | 11/11/2011 14:37:33 | 32 | 0 | apex:commandButton inside apex:panelBar | I have a list of items that I display in a panelBar, each item has a comandButton that calls an action on the controller, the problem is that the action method gets never called!
Help?
Here's the code:
<apex:panelBar id="eventBarSeller" switchType="client" items="{!relatedEventsSeller}" var="event" rendered="true">
<apex:panelbarItem label="{!event.SUBJECT__c}">
<apex:outputText escape="false" value="{!event.BODY__c}" />
<br/>
<br/>
<apex:commandButton value="View details" action="{!showPopup}" rerender="popup" immediate="true" rendered="true"/>
</apex:panelBarItem>
</apex:panelbar>
And the popup outputPanel:
<apex:outputPanel id="popup">
<apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopup}"/>
<apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopup}">
This is where I would put whatever information I needed to show to my end user.<br/><br/><br/>
<apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="popup"/>
</apex:outputPanel>
</apex:outputPanel>
And in the controller I've the following:
public boolean displayPopup {get; set;}
public void closePopup() {
System.Debug(LoggingLevel.INFO, 'Close Popup...');
displayPopup = false;
}
public void showPopup() {
System.Debug(LoggingLevel.INFO, 'Show Popup...');
displayPopup = true;
}
The function showPopup get never called because I checked in logs, what can be happening?
Thanks in advance! | controller | action | salesforce | apex-code | visualforce | null | open | apex:commandButton inside apex:panelBar
===
I have a list of items that I display in a panelBar, each item has a comandButton that calls an action on the controller, the problem is that the action method gets never called!
Help?
Here's the code:
<apex:panelBar id="eventBarSeller" switchType="client" items="{!relatedEventsSeller}" var="event" rendered="true">
<apex:panelbarItem label="{!event.SUBJECT__c}">
<apex:outputText escape="false" value="{!event.BODY__c}" />
<br/>
<br/>
<apex:commandButton value="View details" action="{!showPopup}" rerender="popup" immediate="true" rendered="true"/>
</apex:panelBarItem>
</apex:panelbar>
And the popup outputPanel:
<apex:outputPanel id="popup">
<apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopup}"/>
<apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopup}">
This is where I would put whatever information I needed to show to my end user.<br/><br/><br/>
<apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="popup"/>
</apex:outputPanel>
</apex:outputPanel>
And in the controller I've the following:
public boolean displayPopup {get; set;}
public void closePopup() {
System.Debug(LoggingLevel.INFO, 'Close Popup...');
displayPopup = false;
}
public void showPopup() {
System.Debug(LoggingLevel.INFO, 'Show Popup...');
displayPopup = true;
}
The function showPopup get never called because I checked in logs, what can be happening?
Thanks in advance! | 0 |
11,571,421 | 07/20/2012 00:54:27 | 599,346 | 02/02/2011 01:57:34 | 1,161 | 69 | Displaying a bitmap as a background | I have an image that I want to use as a background but I first need to scale it down to prevent `OutOfMemoryExceptions`
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(getResources(), R.drawable.home_bkgrnd, options);
int imageHeight = options.outHeight;
int imageWidth = options.outWidth;
String imageType = options.outMimeType;
int sampleSize =1;
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
if(imageWidth > imageHeight){
sampleSize = Math.round((float)imageHeight/(float)height);
}else{
sampleSize = Math.round((float)imageWidth/(float)width);
}
options.inJustDecodeBounds = false;
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.home_bkgrnd, options);
rl.setBackgroundDrawable(bm);
But how do I set the background of my layout to that scaled bitmap since it does not take a bitmap as an argument? | android | bitmap | null | null | null | null | open | Displaying a bitmap as a background
===
I have an image that I want to use as a background but I first need to scale it down to prevent `OutOfMemoryExceptions`
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(getResources(), R.drawable.home_bkgrnd, options);
int imageHeight = options.outHeight;
int imageWidth = options.outWidth;
String imageType = options.outMimeType;
int sampleSize =1;
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
if(imageWidth > imageHeight){
sampleSize = Math.round((float)imageHeight/(float)height);
}else{
sampleSize = Math.round((float)imageWidth/(float)width);
}
options.inJustDecodeBounds = false;
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.home_bkgrnd, options);
rl.setBackgroundDrawable(bm);
But how do I set the background of my layout to that scaled bitmap since it does not take a bitmap as an argument? | 0 |
11,571,426 | 07/20/2012 00:55:02 | 1,096,484 | 12/13/2011 19:30:55 | 45 | 2 | PHP Paging in Mysql_Query | So basically, this is how my paging query looks like at the moment:
$limit = mysql_escape_string($_GET['pagenumber']);
if (empty($limit)){
$limit = "1";
}
$page = $limit * 10;
$flim1 = $page / 10;
$flim = $page - 10;
At the end of my query, I have this:
... LIMIT $flim, $page
Which should be from 1, 10 if the pagenumber is 1 and 10, 20 if the page number is 2. It works on the first page perfectly, but when I get to the second, there were 20 results, although when I echoed $flim and $page, they were 10 and 20. I cannot understand why!
I've heard about some double-query for paging. If you know a simple way to do this that is kind of like this one, please post a link. Will my method work? | php | mysql | query | page | paging | null | open | PHP Paging in Mysql_Query
===
So basically, this is how my paging query looks like at the moment:
$limit = mysql_escape_string($_GET['pagenumber']);
if (empty($limit)){
$limit = "1";
}
$page = $limit * 10;
$flim1 = $page / 10;
$flim = $page - 10;
At the end of my query, I have this:
... LIMIT $flim, $page
Which should be from 1, 10 if the pagenumber is 1 and 10, 20 if the page number is 2. It works on the first page perfectly, but when I get to the second, there were 20 results, although when I echoed $flim and $page, they were 10 and 20. I cannot understand why!
I've heard about some double-query for paging. If you know a simple way to do this that is kind of like this one, please post a link. Will my method work? | 0 |
11,226,142 | 06/27/2012 12:25:05 | 1,437,242 | 06/05/2012 11:35:19 | 15 | 0 | Fault in Ajax php search | In the following Ajax based search box, if the character is at position 0 then the respective name in the array is not returning but for characters at other positions everything works well. Please fix this...
PHP
$query = $_GET['query'];
$names = array('abc', 'hello', 'cool', 'fun', 'demo', 'test');
foreach($names as $name)
{
$str = strpos($name, $query);
if(!empty($str))
{
echo "$name ";
}
}
HTML
<form name='myForm'>
Name: <input type='text' onblur="ajaxFunction(this.value);" name='username' /> <br />
Time: <input type='text' disabled="disabled" name='time' />
</form>
AJAX
function ajaxFunction(val) {
var ajaxRequest;
try {
//Opera, Safari and Firefox xml object
ajaxRequest = new XMLHttpRequest();
} catch(e) {
try {
//Internet Explorer xml object
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
//Old browser's xml object
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
return false;
}
}
}
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.myForm.time.value = ajaxRequest.responseText;
} else {
//do nothing
}
}
ajaxRequest.open("GET", "names.php?query="+val, true);
ajaxRequest.send(null);
}
| php | ajax | null | null | null | null | open | Fault in Ajax php search
===
In the following Ajax based search box, if the character is at position 0 then the respective name in the array is not returning but for characters at other positions everything works well. Please fix this...
PHP
$query = $_GET['query'];
$names = array('abc', 'hello', 'cool', 'fun', 'demo', 'test');
foreach($names as $name)
{
$str = strpos($name, $query);
if(!empty($str))
{
echo "$name ";
}
}
HTML
<form name='myForm'>
Name: <input type='text' onblur="ajaxFunction(this.value);" name='username' /> <br />
Time: <input type='text' disabled="disabled" name='time' />
</form>
AJAX
function ajaxFunction(val) {
var ajaxRequest;
try {
//Opera, Safari and Firefox xml object
ajaxRequest = new XMLHttpRequest();
} catch(e) {
try {
//Internet Explorer xml object
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
//Old browser's xml object
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
return false;
}
}
}
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.myForm.time.value = ajaxRequest.responseText;
} else {
//do nothing
}
}
ajaxRequest.open("GET", "names.php?query="+val, true);
ajaxRequest.send(null);
}
| 0 |
11,226,143 | 06/27/2012 12:25:07 | 611,301 | 02/10/2011 11:48:16 | 61 | 0 | formatting output in c++ | In a c++ code I have a matrix of double variables which I print out. However because all of them different number of digits, the output format is destroyed. One solution is to do
cout.precision(5) but I want different columns have to different precision. Also, because there are negative values in some cases, the presence of the - sign also causes problems. How to get around this and produce a a properly formatted output? | c++ | output-formatting | null | null | null | null | open | formatting output in c++
===
In a c++ code I have a matrix of double variables which I print out. However because all of them different number of digits, the output format is destroyed. One solution is to do
cout.precision(5) but I want different columns have to different precision. Also, because there are negative values in some cases, the presence of the - sign also causes problems. How to get around this and produce a a properly formatted output? | 0 |
11,226,145 | 06/27/2012 12:25:10 | 1,479,628 | 06/25/2012 10:06:01 | 6 | 0 | How can I set the stylesheet of a certain element of Qmessagebox | I have made a QMessageBox in the following way:
msgBox.setText("Are you sure?");
msgBox.setStandardButtons(QMessageBox::Yes| QMessageBox::No);
msgBox.setStyleSheet("background-image: url(image)");
msgBox.exec();
Unfortunately using setStyleSheet on the messagebox sets the background for the buttons, the textbox and the actual msgbox. This is not wat I want. I want only the msgbox to have a background not the other components of the messagebox. I found out that using:
msgBox.button(QMessageBox::Yes)->setStyleSheet(...)
can be used to set the background on just the buttons. Is there a command with which I can set just the background of the msgBox, without adding a background to the buttons and the textbox? | qt | stylesheet | messagebox | null | null | null | open | How can I set the stylesheet of a certain element of Qmessagebox
===
I have made a QMessageBox in the following way:
msgBox.setText("Are you sure?");
msgBox.setStandardButtons(QMessageBox::Yes| QMessageBox::No);
msgBox.setStyleSheet("background-image: url(image)");
msgBox.exec();
Unfortunately using setStyleSheet on the messagebox sets the background for the buttons, the textbox and the actual msgbox. This is not wat I want. I want only the msgbox to have a background not the other components of the messagebox. I found out that using:
msgBox.button(QMessageBox::Yes)->setStyleSheet(...)
can be used to set the background on just the buttons. Is there a command with which I can set just the background of the msgBox, without adding a background to the buttons and the textbox? | 0 |
11,226,149 | 06/27/2012 12:25:13 | 1,330,984 | 04/13/2012 07:40:05 | 187 | 1 | JQuery Dialog Show Hide effects | I am trying to do this:
$('#mypopup').dialog({
modal: true,
autoOpen: true,
resizable: false,
show: {effect:'slide',duration:250},
hide: {effect:'slide',duration:250}
});
then to open it ...
function showPopup() {
if ($('#mypopup').length == 0) {
$('#mypopup-div').load('mypopupurl/show.php');
} else {
//reopen the login dialog previously rendered, don't load again
$('#mypopup').dialog('open');
}
}
then to close it ...
$('#mypopup').dialog('close');
My problem is, the show slide effect in the code above only works the first time, when it actually loads from .load('mypopupurl/show.php'); When I close it and re-open the popup dialog, it hits the else statement with the .dialog('open'); code, this time the slide effect does not happen. (not error, just pops up as normal, but no effect)
Is this a glitch in JQuery? Or is it by design? How do I make the effect work when it hits dialog('open')?
| jquery | jquery-ui | null | null | null | null | open | JQuery Dialog Show Hide effects
===
I am trying to do this:
$('#mypopup').dialog({
modal: true,
autoOpen: true,
resizable: false,
show: {effect:'slide',duration:250},
hide: {effect:'slide',duration:250}
});
then to open it ...
function showPopup() {
if ($('#mypopup').length == 0) {
$('#mypopup-div').load('mypopupurl/show.php');
} else {
//reopen the login dialog previously rendered, don't load again
$('#mypopup').dialog('open');
}
}
then to close it ...
$('#mypopup').dialog('close');
My problem is, the show slide effect in the code above only works the first time, when it actually loads from .load('mypopupurl/show.php'); When I close it and re-open the popup dialog, it hits the else statement with the .dialog('open'); code, this time the slide effect does not happen. (not error, just pops up as normal, but no effect)
Is this a glitch in JQuery? Or is it by design? How do I make the effect work when it hits dialog('open')?
| 0 |
11,226,151 | 06/27/2012 12:25:37 | 815,443 | 06/25/2011 15:17:28 | 728 | 5 | YAML as failsafe file dump format (using pyyaml)? | I'd like to dump structured data (mostly tabular with some additional meta data) to a file as input for another program. However, some data fields can be arbitrary unicode data. Do you know if PyYaml is a failsafe solution (which for example escapes all problem cases) or which other simple file based solution would you suggest? I'm afraid that special characters break the format or the parser. | python | yaml | null | null | null | null | open | YAML as failsafe file dump format (using pyyaml)?
===
I'd like to dump structured data (mostly tabular with some additional meta data) to a file as input for another program. However, some data fields can be arbitrary unicode data. Do you know if PyYaml is a failsafe solution (which for example escapes all problem cases) or which other simple file based solution would you suggest? I'm afraid that special characters break the format or the parser. | 0 |
11,224,163 | 06/27/2012 10:29:03 | 868,278 | 07/28/2011 20:32:02 | 314 | 6 | Select the theme from a telerik combobox MVC/ASP | I want to implement a feature similar to the telerik theme feature available on their demo site. (I have a fully licenced copy of their controls), but I cant find any info on how to do this.
I have an MVC application, and in the _Layout.cshtml (which has no controller that I know of (i hope I am wrong)) I am trying to add a combo box populated with a list of available styles like this:
<section id="Login">
@if (Request.IsAuthenticated)
{
<section id="loginImage">
<img src="../../Content/Images/BlankPerson.jpg" />
</section>
<section id="loginText">
[ @Html.ActionLink("Log Off", "LogOff", "Account") ]
<br />
@User.Identity.Name!
@(
/* TELERIK COMBOBOX */
Html.Telerik().ComboBox()
.Name("cbxTheme")
.Placeholder("Select Theme...")
.SelectedIndex(0)
.ClientEvents(events => events.OnChange("cbxTheme_onChange"))
//.BindTo((IEnumerable<DropDownItem>)ViewData["Files"])
.Items(item =>
{
item.Add().Text("black");
item.Add().Text("common");
item.Add().Text("default");
item.Add().Text("forest");
item.Add().Text("hay");
item.Add().Text("metro");
item.Add().Text("office2007");
item.Add().Text("office2010black");
item.Add().Text("office2010blue");
item.Add().Text("office2010silver");
item.Add().Text("outlook");
item.Add().Text("rtl");
item.Add().Text("simple");
item.Add().Text("sitefinity");
item.Add().Text("sunset");
item.Add().Text("telerik");
item.Add().Text("transparent");
item.Add().Text("vista");
item.Add().Text("web20");
item.Add().Text("webblue");
item.Add().Text("windows7");
})
)
</section>
}
</section>
As directed by Telerik. We must include the following lines at the start and end of our view as follows:
<head>
@(
Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group
.Add("telerik.common.css")
.Add("telerik.black.css").Combined(true).Compress(true)
.Add("telerik." + + ".css", ).Combined(true).Compress(true)
//.Add("telerik." + Html.GetCurrentTheme() + ".css").Combined(true).Compress(true)
//"javascript:cbxTheme_onChange()"
))
</head>
.
.
.
.
<body>
@(Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)))
</body>
Also I have a little bit of JQuery which works but I cant access it the way I need to and this is where my problem is:
<script>
function cbxTheme_onChange()
{
var selectedItemText = $("#cbxTheme").data("tComboBox").text();
var selectedItemValue = $("#cbxTheme").data("tComboBox").value();
alert(selectedItemValue);
return selectedItemText;
}
</script>
The function above actually does work and pops a message up with the selected item. No problem there.
The problem I am having is with this line of code in the head section as shown above:
@(
Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group
.Add("telerik.common.css")
.Add("telerik.black.css").Combined(true).Compress(true)
.Add("telerik." + "SELECTED ITEM FROM COMBOBOX.TEXT HERE" + ".css", ).Combined(true).Compress(true)
//.Add("telerik." + Html.GetCurrentTheme() + ".css").Combined(true).Compress(true)
//"javascript:cbxTheme_onChange()"
))
Where it says "Selected Item from combobox.text here" the javascript function should be placing a string (which contains the name of the telerik style sheet to use. It should be working but it is not.
I even tried to address the combo box directly by saying:
.Add("telerik." + cbxTheme.SelectedItem.text + ".css", ).Combined(true).Compress(true)
which is how it is done on their site. But again it doesnt work.
Any help with this would be much appreicated. Thanks in advance.
| asp.net-mvc | asp.net-mvc-3 | razor | telerik | telerik-mvc | null | open | Select the theme from a telerik combobox MVC/ASP
===
I want to implement a feature similar to the telerik theme feature available on their demo site. (I have a fully licenced copy of their controls), but I cant find any info on how to do this.
I have an MVC application, and in the _Layout.cshtml (which has no controller that I know of (i hope I am wrong)) I am trying to add a combo box populated with a list of available styles like this:
<section id="Login">
@if (Request.IsAuthenticated)
{
<section id="loginImage">
<img src="../../Content/Images/BlankPerson.jpg" />
</section>
<section id="loginText">
[ @Html.ActionLink("Log Off", "LogOff", "Account") ]
<br />
@User.Identity.Name!
@(
/* TELERIK COMBOBOX */
Html.Telerik().ComboBox()
.Name("cbxTheme")
.Placeholder("Select Theme...")
.SelectedIndex(0)
.ClientEvents(events => events.OnChange("cbxTheme_onChange"))
//.BindTo((IEnumerable<DropDownItem>)ViewData["Files"])
.Items(item =>
{
item.Add().Text("black");
item.Add().Text("common");
item.Add().Text("default");
item.Add().Text("forest");
item.Add().Text("hay");
item.Add().Text("metro");
item.Add().Text("office2007");
item.Add().Text("office2010black");
item.Add().Text("office2010blue");
item.Add().Text("office2010silver");
item.Add().Text("outlook");
item.Add().Text("rtl");
item.Add().Text("simple");
item.Add().Text("sitefinity");
item.Add().Text("sunset");
item.Add().Text("telerik");
item.Add().Text("transparent");
item.Add().Text("vista");
item.Add().Text("web20");
item.Add().Text("webblue");
item.Add().Text("windows7");
})
)
</section>
}
</section>
As directed by Telerik. We must include the following lines at the start and end of our view as follows:
<head>
@(
Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group
.Add("telerik.common.css")
.Add("telerik.black.css").Combined(true).Compress(true)
.Add("telerik." + + ".css", ).Combined(true).Compress(true)
//.Add("telerik." + Html.GetCurrentTheme() + ".css").Combined(true).Compress(true)
//"javascript:cbxTheme_onChange()"
))
</head>
.
.
.
.
<body>
@(Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)))
</body>
Also I have a little bit of JQuery which works but I cant access it the way I need to and this is where my problem is:
<script>
function cbxTheme_onChange()
{
var selectedItemText = $("#cbxTheme").data("tComboBox").text();
var selectedItemValue = $("#cbxTheme").data("tComboBox").value();
alert(selectedItemValue);
return selectedItemText;
}
</script>
The function above actually does work and pops a message up with the selected item. No problem there.
The problem I am having is with this line of code in the head section as shown above:
@(
Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group
.Add("telerik.common.css")
.Add("telerik.black.css").Combined(true).Compress(true)
.Add("telerik." + "SELECTED ITEM FROM COMBOBOX.TEXT HERE" + ".css", ).Combined(true).Compress(true)
//.Add("telerik." + Html.GetCurrentTheme() + ".css").Combined(true).Compress(true)
//"javascript:cbxTheme_onChange()"
))
Where it says "Selected Item from combobox.text here" the javascript function should be placing a string (which contains the name of the telerik style sheet to use. It should be working but it is not.
I even tried to address the combo box directly by saying:
.Add("telerik." + cbxTheme.SelectedItem.text + ".css", ).Combined(true).Compress(true)
which is how it is done on their site. But again it doesnt work.
Any help with this would be much appreicated. Thanks in advance.
| 0 |
11,224,164 | 06/27/2012 10:29:07 | 559,861 | 01/01/2011 17:03:30 | 173 | 2 | Matlab - set specific color for value in pcolor | I've created a pcolor whose caxis ranges from -3 to 3. However, within the data I've got lots of points whose value are exactly 1000. What I'd like to do is keep the colouring the same for all the other points, but set the colour for any point whose value is 1000 to black. Does anyone have any ideas how I could do this..?
Thanks a lot in advance,
Adam | matlab | colors | overlay | null | null | null | open | Matlab - set specific color for value in pcolor
===
I've created a pcolor whose caxis ranges from -3 to 3. However, within the data I've got lots of points whose value are exactly 1000. What I'd like to do is keep the colouring the same for all the other points, but set the colour for any point whose value is 1000 to black. Does anyone have any ideas how I could do this..?
Thanks a lot in advance,
Adam | 0 |
11,226,153 | 06/27/2012 12:25:47 | 297,267 | 03/19/2010 10:15:17 | 498 | 68 | SQL SERVER - ROWNUM, I need you | In Oracle PL/SQL I was used to write:
SELECT * FROM MY_TABLE WHERE ROWNUM <= 100;
in order to fetch only the first 100 records of the table named MY_TABLE.
What could be the equivalent SELECT statement in SQL SERVER?
| sql | server | null | null | null | null | open | SQL SERVER - ROWNUM, I need you
===
In Oracle PL/SQL I was used to write:
SELECT * FROM MY_TABLE WHERE ROWNUM <= 100;
in order to fetch only the first 100 records of the table named MY_TABLE.
What could be the equivalent SELECT statement in SQL SERVER?
| 0 |
11,226,154 | 06/27/2012 12:25:51 | 1,479,644 | 06/25/2012 10:14:04 | 1 | 0 | Grid View from XML data | I have data in xml format as follows
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Row>
Sales_Doc>OR/Sales_Doc>
Sales_Org>0001/Sales_Org>
Dist_Ch>01/Dist_Ch>
Division>01/Division>
Sold_to_Party>SCEM_02/Sold_to_Party>
MatNo/>
Net_Weight>PC/Net_Weight>
<Net_Weight_Item>590000/Net_Weight_Item>
Weight_Unit>KG/Weight_Unit>
Sales_Unit>PC/Sales_Unit>
/Row>
I need to convert this into table or grid format using jsp or java language.
Please share ur ideas
Regards
Joy | java | xml | jsp | null | null | null | open | Grid View from XML data
===
I have data in xml format as follows
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Row>
Sales_Doc>OR/Sales_Doc>
Sales_Org>0001/Sales_Org>
Dist_Ch>01/Dist_Ch>
Division>01/Division>
Sold_to_Party>SCEM_02/Sold_to_Party>
MatNo/>
Net_Weight>PC/Net_Weight>
<Net_Weight_Item>590000/Net_Weight_Item>
Weight_Unit>KG/Weight_Unit>
Sales_Unit>PC/Sales_Unit>
/Row>
I need to convert this into table or grid format using jsp or java language.
Please share ur ideas
Regards
Joy | 0 |
11,226,155 | 06/27/2012 12:25:58 | 172,892 | 09/14/2009 01:22:59 | 1,426 | 24 | Rails convert date format | I have a form input in my application that accepts dates in the format DD/MM/YYYY eg 02/05/2012 is 2nd May 2012.
What is the best way for me to convert this into a suitable format to be added to the database through ActiveRecord?
Is there a simply way of converting 02/05/2012 to 05/02/2012 before adding to the database?
| ruby-on-rails | date | null | null | null | null | open | Rails convert date format
===
I have a form input in my application that accepts dates in the format DD/MM/YYYY eg 02/05/2012 is 2nd May 2012.
What is the best way for me to convert this into a suitable format to be added to the database through ActiveRecord?
Is there a simply way of converting 02/05/2012 to 05/02/2012 before adding to the database?
| 0 |
11,226,159 | 06/27/2012 12:26:07 | 1,157,823 | 12/22/2011 06:59:17 | 1,500 | 41 | add integer to NSMUtableArray | I am a new iPad developer.
I am implementing UIPopover on button click, and popover contains integer value,
when i trying to fill my array with integers it shows me, `SIGABRT`: **index 3 beyond bounds** i am unable to see my log, app crashes.
here is my code snippet:
-(void)btnClick:(id)sender {
for (int i=3; i<=31; i++) {
[remindarray addObject:[NSNumber numberWithInteger:i]];
NSLog(@"no=%@",[remindarray objectAtIndex:i]);
}
UIViewController* popoverContent = [[UIViewController alloc]init];
UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(110, 0, 500, 4)];
popoverTable = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 250, 665) style:UITableViewStylePlain];
[popoverTable setDelegate:(id<UITableViewDelegate>)self];
[popoverTable setDataSource:(id<UITableViewDataSource>)self];
[self.view addSubview:popoverTable];
[popoverTable release];
[popoverView addSubview:popoverTable];
popoverContent.view = popoverView;
popoverContent.contentSizeForViewInPopover = CGSizeMake(250, 600);
self.popoverController = [[UIPopoverController alloc]
initWithContentViewController:popoverContent];
[self.popoverController presentPopoverFromRect:CGRectMake(100,0, 535, 35)
inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
[popoverView release];
[popoverContent release];
}
and finally `remind array` i am passing to `cellForRowAtIndexPath`
code:
...
cell.textLabel.text=[remindarray objectAtIndex:indexPath.row];
... | iphone | ipad | nsmutablearray | integer | uipopovercontroller | null | open | add integer to NSMUtableArray
===
I am a new iPad developer.
I am implementing UIPopover on button click, and popover contains integer value,
when i trying to fill my array with integers it shows me, `SIGABRT`: **index 3 beyond bounds** i am unable to see my log, app crashes.
here is my code snippet:
-(void)btnClick:(id)sender {
for (int i=3; i<=31; i++) {
[remindarray addObject:[NSNumber numberWithInteger:i]];
NSLog(@"no=%@",[remindarray objectAtIndex:i]);
}
UIViewController* popoverContent = [[UIViewController alloc]init];
UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(110, 0, 500, 4)];
popoverTable = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 250, 665) style:UITableViewStylePlain];
[popoverTable setDelegate:(id<UITableViewDelegate>)self];
[popoverTable setDataSource:(id<UITableViewDataSource>)self];
[self.view addSubview:popoverTable];
[popoverTable release];
[popoverView addSubview:popoverTable];
popoverContent.view = popoverView;
popoverContent.contentSizeForViewInPopover = CGSizeMake(250, 600);
self.popoverController = [[UIPopoverController alloc]
initWithContentViewController:popoverContent];
[self.popoverController presentPopoverFromRect:CGRectMake(100,0, 535, 35)
inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
[popoverView release];
[popoverContent release];
}
and finally `remind array` i am passing to `cellForRowAtIndexPath`
code:
...
cell.textLabel.text=[remindarray objectAtIndex:indexPath.row];
... | 0 |
11,728,029 | 07/30/2012 19:11:01 | 1,456,319 | 06/14/2012 13:19:55 | 3 | 0 | CSS3 transition | I have this page here (work in progress) [http://kimwilddesigns.com/index_new.htm][1]
In this section, I want to be able to hover on the li, have the background image fade out and the h2 to fade in. Is this possible with transitions? I might not be setting it up correctly but I wanted to see if this kind of effect is even possible.
<div id="categories-wrapper">
<ul>
<li class="fine-art"><a href="#"><img src="pics/hp_icon_fine-art.jpg" alt="fine art" width="290" height="240" border="0"></a>
<h2>fine art work</h2>
</li>
<li class="gd">graphic design work</li>
<li class="students">my students' work</li>
</ul>
</div>
[1]: http://kimwilddesigns.com/index_new.htm
Thanks! | css3 | transition | null | null | null | null | open | CSS3 transition
===
I have this page here (work in progress) [http://kimwilddesigns.com/index_new.htm][1]
In this section, I want to be able to hover on the li, have the background image fade out and the h2 to fade in. Is this possible with transitions? I might not be setting it up correctly but I wanted to see if this kind of effect is even possible.
<div id="categories-wrapper">
<ul>
<li class="fine-art"><a href="#"><img src="pics/hp_icon_fine-art.jpg" alt="fine art" width="290" height="240" border="0"></a>
<h2>fine art work</h2>
</li>
<li class="gd">graphic design work</li>
<li class="students">my students' work</li>
</ul>
</div>
[1]: http://kimwilddesigns.com/index_new.htm
Thanks! | 0 |
11,728,032 | 07/30/2012 19:11:30 | 1,435,712 | 06/04/2012 17:47:21 | 474 | 13 | My application fails with nothing shown in LogCat | I am writing a very simple application following the guidelines in this [tutorial](http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/).
I try to run my application and it fails while opening, and there is nothing shown in the LogCat. The C code written has compiled using `ndk-build`.
Here is the Java Code :
package com.example.ndktest;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.support.v4.app.NavUtils;
public class MainActivity extends Activity {
private Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i( "MainActivity", "beginning of onCreate()" );
setContentView(R.layout.activity_main);
button = (Button) findViewById( R.id.button1 );
button.setOnClickListener( new OnClickListener( ) {
public void onClick(View arg0) {
// TODO Auto-generated method stub
helloLog( "This will log to LogCat" );
}
});
}
private native void helloLog( String logThis );
static {
System.loadLibrary( "ndk1" );
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
Here is the C code :
#include <jni.h>
#include <string.h>
#include <android/log.h>
#define DEBUG_TAG "NDK_AndroidNDK1SampleActivity"
void Java_com_example_ndktest_MainActivity_helloLog( JNIEnv * env, jobject this, jstring logThis )
{
jboolean isCopy;
const char * szLogThis = (*env)->GetStringUTFChars( env, logThis, &isCopy );
__android_log_print( ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK:LC: [%s]", szLogThis );
(*env)->ReleaseStringUTFChars( env, logThis, szLogThis );
}
Here is the MakeFile:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := ndk1
LOCAL_SRC_FILES := native.c
include $(BUILD_SHARED_LIBRARY)
Here is the XML file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".MainActivity" />
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:text="Click Here to Log" />
</RelativeLayout>
Here is the AndroidManifest :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ndktest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Here is a picture of my environment in Eclipse :
![enter image description here][1]
[1]: http://i.stack.imgur.com/xelKA.png | android | android-ndk | null | null | null | null | open | My application fails with nothing shown in LogCat
===
I am writing a very simple application following the guidelines in this [tutorial](http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/).
I try to run my application and it fails while opening, and there is nothing shown in the LogCat. The C code written has compiled using `ndk-build`.
Here is the Java Code :
package com.example.ndktest;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.support.v4.app.NavUtils;
public class MainActivity extends Activity {
private Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i( "MainActivity", "beginning of onCreate()" );
setContentView(R.layout.activity_main);
button = (Button) findViewById( R.id.button1 );
button.setOnClickListener( new OnClickListener( ) {
public void onClick(View arg0) {
// TODO Auto-generated method stub
helloLog( "This will log to LogCat" );
}
});
}
private native void helloLog( String logThis );
static {
System.loadLibrary( "ndk1" );
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
Here is the C code :
#include <jni.h>
#include <string.h>
#include <android/log.h>
#define DEBUG_TAG "NDK_AndroidNDK1SampleActivity"
void Java_com_example_ndktest_MainActivity_helloLog( JNIEnv * env, jobject this, jstring logThis )
{
jboolean isCopy;
const char * szLogThis = (*env)->GetStringUTFChars( env, logThis, &isCopy );
__android_log_print( ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK:LC: [%s]", szLogThis );
(*env)->ReleaseStringUTFChars( env, logThis, szLogThis );
}
Here is the MakeFile:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := ndk1
LOCAL_SRC_FILES := native.c
include $(BUILD_SHARED_LIBRARY)
Here is the XML file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".MainActivity" />
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:text="Click Here to Log" />
</RelativeLayout>
Here is the AndroidManifest :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ndktest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Here is a picture of my environment in Eclipse :
![enter image description here][1]
[1]: http://i.stack.imgur.com/xelKA.png | 0 |
11,728,061 | 07/30/2012 19:13:54 | 1,554,860 | 07/26/2012 13:32:43 | 3 | 0 | Shadowbox and jQuery Conflict for photo gallery | Let me begin with a few qualifiers. I am a beginner when it comes to Javascript/jQuery, so all of this is a great learning experience and I've found the Stack Overflow community to be nothing less than EXTREMELY helpful.
I have done a fair amount of research via Google and Stack Overflow's search feature.
The issue at hand is that I have a working jQuery script (the radio button "switcher" designed by a member of Stack Overflow) and then I tried to implement a Shadowbox script to enlarge the images in the gallery...but the two don't seem to like each other when put together.
I believe this has something to do with conflicting rel tags. Both scripts for the most part seem to be running fine (no errors to be found), the only issue is that my images aren't showing up when clicked on. There is only a black box where the image would normally be (and the size seems to be correct, although the image is missing).
All images/js files are in the correct directory, so I have ruled that out. If anyone has any suggestions as to why the images aren't showing up, I'd be greatly appreciative. Thanks!
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css">
<script type="text/javascript" src="shadowbox/shadowbox.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>
<script type="text/javascript">
jQuery.noConflict();
(function(jQuery){jQuery(function(){
jQuery('.chkbox-container :radio').on('change', function(){
var me = jQuery(this);
jQuery.each(jQuery('.img-container img'), function(i,v){
var theShow = jQuery(v).attr('rel');
theShow = theShow.split(' ');
if(jQuery.inArray(me.val(), theShow)){
jQuery(v).show();
}else{
jQuery(v).hide();
}
});
});
}); })(jQuery);
</script>
<style type="text/css">
.chkbox-container{
float:left;
width:95px;
}
.img-container{
float:left;
width:300px;
}
img{
display:inline-block;
width:90px;
height:75px;
padding:2px;
border:1px solid black;
display:none;
}
</style>
</head>
<body>
<div class="chkbox-container">
<input type="radio" name="THEfilter[]" value="all" checked="checked" /> All<br/>
<input type="radio" name="THEfilter[]" value="category1" /> Category 1<br/>
<input type="radio" name="THEfilter[]" value="category2" /> Category 2<br/>
<input type="radio" name="THEfilter[]" value="category3" /> Category 3<br/>
</div>
<div class="img-container">
<a href="images/rufus.jpg" rel="shadowbox[gallery]" title="June 15th - Dr. Hanna's Office"> <img src="images/rufus-small.jpg" rel="category1" />
<a href="images/york.jpg" rel="shadowbox[gallery]" title="June 20th - Jim's House"> <img src="images/york-small.jpg" rel="category2" />
<a href="images/rufus2.jpg" rel="shadowbox[gallery]" title="June 3rd - Steve's Ranch"> <img src="images/rufus2-small.jpg" rel="category3" />
</div>
</body>
</html> | javascript | jquery | html | shadowbox | rel | null | open | Shadowbox and jQuery Conflict for photo gallery
===
Let me begin with a few qualifiers. I am a beginner when it comes to Javascript/jQuery, so all of this is a great learning experience and I've found the Stack Overflow community to be nothing less than EXTREMELY helpful.
I have done a fair amount of research via Google and Stack Overflow's search feature.
The issue at hand is that I have a working jQuery script (the radio button "switcher" designed by a member of Stack Overflow) and then I tried to implement a Shadowbox script to enlarge the images in the gallery...but the two don't seem to like each other when put together.
I believe this has something to do with conflicting rel tags. Both scripts for the most part seem to be running fine (no errors to be found), the only issue is that my images aren't showing up when clicked on. There is only a black box where the image would normally be (and the size seems to be correct, although the image is missing).
All images/js files are in the correct directory, so I have ruled that out. If anyone has any suggestions as to why the images aren't showing up, I'd be greatly appreciative. Thanks!
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="shadowbox/shadowbox.css">
<script type="text/javascript" src="shadowbox/shadowbox.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>
<script type="text/javascript">
jQuery.noConflict();
(function(jQuery){jQuery(function(){
jQuery('.chkbox-container :radio').on('change', function(){
var me = jQuery(this);
jQuery.each(jQuery('.img-container img'), function(i,v){
var theShow = jQuery(v).attr('rel');
theShow = theShow.split(' ');
if(jQuery.inArray(me.val(), theShow)){
jQuery(v).show();
}else{
jQuery(v).hide();
}
});
});
}); })(jQuery);
</script>
<style type="text/css">
.chkbox-container{
float:left;
width:95px;
}
.img-container{
float:left;
width:300px;
}
img{
display:inline-block;
width:90px;
height:75px;
padding:2px;
border:1px solid black;
display:none;
}
</style>
</head>
<body>
<div class="chkbox-container">
<input type="radio" name="THEfilter[]" value="all" checked="checked" /> All<br/>
<input type="radio" name="THEfilter[]" value="category1" /> Category 1<br/>
<input type="radio" name="THEfilter[]" value="category2" /> Category 2<br/>
<input type="radio" name="THEfilter[]" value="category3" /> Category 3<br/>
</div>
<div class="img-container">
<a href="images/rufus.jpg" rel="shadowbox[gallery]" title="June 15th - Dr. Hanna's Office"> <img src="images/rufus-small.jpg" rel="category1" />
<a href="images/york.jpg" rel="shadowbox[gallery]" title="June 20th - Jim's House"> <img src="images/york-small.jpg" rel="category2" />
<a href="images/rufus2.jpg" rel="shadowbox[gallery]" title="June 3rd - Steve's Ranch"> <img src="images/rufus2-small.jpg" rel="category3" />
</div>
</body>
</html> | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.