please help me to prove this exercise in modern algebra
Suppose $W$ be a free R-module with basis $X=\{x_1,...,x_n\}$ . If $\phi:
W \rightarrow W$ is an R-module endomorphism with matrix $A$ relative to
$X$ , then the determinant of the endomorphism $\phi$ is defined to be the
determinant $|A| \in R$ and is denoted $|\phi |$. How to show $|\phi |$ is
independent of the choice of $X$?
thanks in advanced..
Monday, 30 September 2013
IBM System X M4 Series Servers Oracle Linux Support
IBM System X M4 Series Servers Oracle Linux Support
Is Oracle Linux runnable/compatible with the M4 Series of the IBM System X
Servers?
In their compatibility website, most compatible machines listed are those
from Dell and HP..there are IBM system x..but all are of older models..
(This is the link of the tested configurations/compatible machines for
Oracle Linux:
http://linux.oracle.com/pls/apex/f?p=102:1:2850003747338068:pg_R_27262430945134281:NO&pg_min_row=1&pg_max_rows=20&pg_rows_fetched=20)
We currently have no machines to test the Oracle Linux if it will work...
If you guys could confirm for me if it will work on IBM System x M4 series
that would be great and appreciated :)
This is for one of our clients who would like to run Oracle Linux on one
of their machines that they will purchase from us.
Is Oracle Linux runnable/compatible with the M4 Series of the IBM System X
Servers?
In their compatibility website, most compatible machines listed are those
from Dell and HP..there are IBM system x..but all are of older models..
(This is the link of the tested configurations/compatible machines for
Oracle Linux:
http://linux.oracle.com/pls/apex/f?p=102:1:2850003747338068:pg_R_27262430945134281:NO&pg_min_row=1&pg_max_rows=20&pg_rows_fetched=20)
We currently have no machines to test the Oracle Linux if it will work...
If you guys could confirm for me if it will work on IBM System x M4 series
that would be great and appreciated :)
This is for one of our clients who would like to run Oracle Linux on one
of their machines that they will purchase from us.
Fibonacci Rabbits with life span 2.999
Fibonacci Rabbits with life span 2.999
I need the recurrence relation for Fabonacci with Life Span = 2.999
I think it will be
f(n) = 1 where n%2 = 0 & n > 2 and f(n) = 2 where n%2 = 1 $ n > 2
Thanks
I need the recurrence relation for Fabonacci with Life Span = 2.999
I think it will be
f(n) = 1 where n%2 = 0 & n > 2 and f(n) = 2 where n%2 = 1 $ n > 2
Thanks
Redirect after persist Symfony2 form and Doctrine
Redirect after persist Symfony2 form and Doctrine
on an web application based on Symfony2 I'm developing a page in which I
can insert a new record on my DB. The Insert operation works properly,
anyway actually after the confirmation the datas are correctly inserted
but the web application return me on the same form that I used to insert
the data. How can I redirect the page to another route, for example to the
page that show me new inserted data?
Here the action in my Controller used to create the new record:
public function newAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$form = $this->createForm(new AnagraficaType(), new
Anagrafiche() );
if ($request->isMethod('POST')) {
$form->bind($request);
if ($form->isValid()) {
$anagrafica = $form->getData();
$em->persist($anagrafica);
$em->flush();
}
}
return $this->render('AcmeMyBundle:Anagrafica:new.html.twig',
array('form' => $form->createView()));
}
Here the part of routing.yml used for the page to create the new record:
AcmeMyBundle_newAnag:
pattern: /anagrafica/new
defaults: { _controller: AcmeMyBundle:Anagrafica:new}
Here the part of routing.yml for the page that permit me to show detailed
a single record of my 'anagrafica' objects in DB:
AcmeMyBundle_showAnag:
pattern: /anagrafica/{id}
defaults: { _controller: AcmeMyBundle:Anagrafica:show }
requirements:
_method: GET
id: \d+
Here the action in my controller that manage the page to show detailed a
single record of my 'anagrafica' objects in DB:
public function showAction($id)
{
$em = $this->getDoctrine()->getEntityManager();
$anagrafica = $em->getRepository('AcmeMyBundle:Anagrafiche')->find($id);
if (!$anagrafica) {
throw $this->createNotFoundException('Unable to find anagrafica
post.');
}
return $this->render('AcmeMyBundle:Anagrafica:show.html.twig', array(
'anagrafica' => $anagrafica,
));
}
This is the view new.html.twig:
{% extends 'AcmeMyBundle::layout.html.twig' %}
{% block title %}{% endblock %}
{% block body %}
{{ form(form) }}
{% endblock %}
This is the Form Type:
<?php
namespace Acme\MyBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class AnagraficaType extends AbstractType
{
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Acme\MyBundle\Entity\Anagrafiche',
'cascade_validation' => true,
));
}
public function buildForm(FormBuilderInterface $builder, array
$options)
{
// Create the form
$builder->add('nome', 'text', array('label' => 'Nome: ',
'required' => false));
$builder->add('cognome', 'text', array('label' => 'Cognome: ',
'required' => false));
$builder->add('data_nascita', 'date', array('label' => 'Data
nascita: ', 'required' => false));
$builder->add('luogo_nascita', 'text', array('label' => 'Luogo
Nascita: ', 'required' => false));
$builder->add('indirizzo', 'text', array('label' =>
'Indirizzo: ', 'required' => false));
$builder->add('telefono', 'text', array('label' => 'Telefono:
', 'required' => false));
$builder->add('email', 'text', array('label' => 'Email: ',
'required' => false));
$builder->add('save', 'submit');
}
public function getName()
{
return 'anagrafica';
}
}
I need to extract the id of the new persisted record, and automatically
redirect to the /anagrafica/$id route (AcmeMyBundle_showAnag) after the
confirmation of the form.
Suggestion? Thanks.
on an web application based on Symfony2 I'm developing a page in which I
can insert a new record on my DB. The Insert operation works properly,
anyway actually after the confirmation the datas are correctly inserted
but the web application return me on the same form that I used to insert
the data. How can I redirect the page to another route, for example to the
page that show me new inserted data?
Here the action in my Controller used to create the new record:
public function newAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$form = $this->createForm(new AnagraficaType(), new
Anagrafiche() );
if ($request->isMethod('POST')) {
$form->bind($request);
if ($form->isValid()) {
$anagrafica = $form->getData();
$em->persist($anagrafica);
$em->flush();
}
}
return $this->render('AcmeMyBundle:Anagrafica:new.html.twig',
array('form' => $form->createView()));
}
Here the part of routing.yml used for the page to create the new record:
AcmeMyBundle_newAnag:
pattern: /anagrafica/new
defaults: { _controller: AcmeMyBundle:Anagrafica:new}
Here the part of routing.yml for the page that permit me to show detailed
a single record of my 'anagrafica' objects in DB:
AcmeMyBundle_showAnag:
pattern: /anagrafica/{id}
defaults: { _controller: AcmeMyBundle:Anagrafica:show }
requirements:
_method: GET
id: \d+
Here the action in my controller that manage the page to show detailed a
single record of my 'anagrafica' objects in DB:
public function showAction($id)
{
$em = $this->getDoctrine()->getEntityManager();
$anagrafica = $em->getRepository('AcmeMyBundle:Anagrafiche')->find($id);
if (!$anagrafica) {
throw $this->createNotFoundException('Unable to find anagrafica
post.');
}
return $this->render('AcmeMyBundle:Anagrafica:show.html.twig', array(
'anagrafica' => $anagrafica,
));
}
This is the view new.html.twig:
{% extends 'AcmeMyBundle::layout.html.twig' %}
{% block title %}{% endblock %}
{% block body %}
{{ form(form) }}
{% endblock %}
This is the Form Type:
<?php
namespace Acme\MyBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class AnagraficaType extends AbstractType
{
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Acme\MyBundle\Entity\Anagrafiche',
'cascade_validation' => true,
));
}
public function buildForm(FormBuilderInterface $builder, array
$options)
{
// Create the form
$builder->add('nome', 'text', array('label' => 'Nome: ',
'required' => false));
$builder->add('cognome', 'text', array('label' => 'Cognome: ',
'required' => false));
$builder->add('data_nascita', 'date', array('label' => 'Data
nascita: ', 'required' => false));
$builder->add('luogo_nascita', 'text', array('label' => 'Luogo
Nascita: ', 'required' => false));
$builder->add('indirizzo', 'text', array('label' =>
'Indirizzo: ', 'required' => false));
$builder->add('telefono', 'text', array('label' => 'Telefono:
', 'required' => false));
$builder->add('email', 'text', array('label' => 'Email: ',
'required' => false));
$builder->add('save', 'submit');
}
public function getName()
{
return 'anagrafica';
}
}
I need to extract the id of the new persisted record, and automatically
redirect to the /anagrafica/$id route (AcmeMyBundle_showAnag) after the
confirmation of the form.
Suggestion? Thanks.
Sunday, 29 September 2013
How to embed the latest vine videos automatically?
How to embed the latest vine videos automatically?
How do I embed the latest vine videos automatically? I know you can embed
each video alone but I want to automatically embed it so that it is not so
inconvenient to have to copy and paste the code to my website everytime. I
found a website vinalwidget.com that lets you display the latest vine
video THUMBNAILS, but not videos, using an iframe code generated from that
site. Its kind of neat and convenient but like I said, it is only
thumbnails that links to a video page. If this can be achieved, then is it
possible to do it using videos instead??
How do I embed the latest vine videos automatically? I know you can embed
each video alone but I want to automatically embed it so that it is not so
inconvenient to have to copy and paste the code to my website everytime. I
found a website vinalwidget.com that lets you display the latest vine
video THUMBNAILS, but not videos, using an iframe code generated from that
site. Its kind of neat and convenient but like I said, it is only
thumbnails that links to a video page. If this can be achieved, then is it
possible to do it using videos instead??
wpf textbox errortemplates in a Managed Addin Framework Addin
wpf textbox errortemplates in a Managed Addin Framework Addin
I've created a textbox style to contain a validation.errortemplate for use
in a UserControl class. If the UserControl is loaded in the normal,
non-MAF way, I can see the validation rule kicking in and getting visual
feedback (thick red border, a circular bang to the right of the textbox,
and an error message-in-a-tooltip) -- everything works the way I expect it
to.
However... if I load that same UserControl in as an AddIn, I lose the
visuals. (I do see the error tooltip behaving correctly, so I know my
validation rule is firing; I just don't see the border and bang symbol.
My AddIn, by the way, is based on MSDN's example for an
'addin-which-provides-a-usercontrol.'
I know a few of the limitations of an AddIn (e.g., video won't play in an
AddIn UserControl); is this another limitation, or am I screwing up?
Thanks in advance!
I've created a textbox style to contain a validation.errortemplate for use
in a UserControl class. If the UserControl is loaded in the normal,
non-MAF way, I can see the validation rule kicking in and getting visual
feedback (thick red border, a circular bang to the right of the textbox,
and an error message-in-a-tooltip) -- everything works the way I expect it
to.
However... if I load that same UserControl in as an AddIn, I lose the
visuals. (I do see the error tooltip behaving correctly, so I know my
validation rule is firing; I just don't see the border and bang symbol.
My AddIn, by the way, is based on MSDN's example for an
'addin-which-provides-a-usercontrol.'
I know a few of the limitations of an AddIn (e.g., video won't play in an
AddIn UserControl); is this another limitation, or am I screwing up?
Thanks in advance!
Visual Studio 2012 Update 3 - initializer list & variadic templates
Visual Studio 2012 Update 3 - initializer list & variadic templates
Recently I have installed Visual Studio 2012. After the installation I
updated my IDE with update 3 to guarantee functionality of my programs on
Windows XP.
Everything is working well, but I still can not use initializer list and
variadic templates! Do I need any extra updates to get this working with
Visual Studio 2012?
Recently I have installed Visual Studio 2012. After the installation I
updated my IDE with update 3 to guarantee functionality of my programs on
Windows XP.
Everything is working well, but I still can not use initializer list and
variadic templates! Do I need any extra updates to get this working with
Visual Studio 2012?
Saturday, 28 September 2013
difference between mult, multu simulating in c
difference between mult, multu simulating in c
I'm writing a c program and decodes mips 32 bit instructions and simulates
their functionality minus the bitwise part. I don't know how I should be
differentiating between signed and unsigned operations here.
For instance, given registers rd and rs, i need to multiply and put the
result in in rd.
for the mult instructions, it's as simple as this:
reg[rd] = reg[rs] * reg[rt];
What should the multu instruction be? Do I need to be doing bitwise
operations on the contents of the registers first?
I also need to do:
-add, addu, -div, divu -sub, subu
Is it the same distinction in functionality for all of them?
I'm writing a c program and decodes mips 32 bit instructions and simulates
their functionality minus the bitwise part. I don't know how I should be
differentiating between signed and unsigned operations here.
For instance, given registers rd and rs, i need to multiply and put the
result in in rd.
for the mult instructions, it's as simple as this:
reg[rd] = reg[rs] * reg[rt];
What should the multu instruction be? Do I need to be doing bitwise
operations on the contents of the registers first?
I also need to do:
-add, addu, -div, divu -sub, subu
Is it the same distinction in functionality for all of them?
ThrowCards in python
ThrowCards in python
Given is an ordered deck of n cards numbered 1 to n with card 1 at the top
and card n at the bottom.
The following operation is performed as long as there are at least two
cards in the deck:
Throw away the top card and move the card that is now on the top of the
deck to the bottom of the deck.
My task is to find the sequence of the last k discarded cards and the last
remaining card.
Each line of input contains two non-negative numbers
n, where n ¡Ü 5000
k, where k < n
For each input line produce two lines of output.
The sequence of k discarded cards
The last remaining card.
See the sample for the expected format.
Sample input
7 2
19 4
10 5
6 3
4000 7
Output for sample input
Last 2 cards discarded: [4, 2]
Remaining card: 6
Last 4 cards discarded: [2, 10, 18, 14]
Remaining card: 6
Last 5 cards discarded: [9, 2, 6, 10, 8]
Remaining card: 4
Last 3 cards discarded: [5, 2, 6]
Remaining card: 4
Last 7 cards discarded: [320, 1344, 2368, 3392, 832, 2880, 1856]
Remaining card: 3904
My code will keep printing out the exact answers but with None on the
following line.
I am so confused why it will print None after each output.
Here is my code:
def throw_card(n,k):
lst=[]
bst=[]
for i in range(1,n+1):
lst.append(i)
while lst[0]!=lst[1] and len(lst)>1 and n<=5000 and k<n:
bst.append(lst.pop(0))
if len(lst)==1:
break
else:
lst.append(lst[0])
lst.remove(lst[0])
print('Last',k,'cards discarded: ',bst[n-(k+1):])
print('Remaining card: ',lst.pop())
print(throw_card(7,2))
print(throw_card(19,4))
print(throw_card(10,5))
print(throw_card(6,3))
print(throw_card(4000,7))
my output:
Last 2 cards discarded: [4, 2]
Remaining card: 6
None
Last 4 cards discarded: [2, 10, 18, 14]
Remaining card: 6
None
Last 5 cards discarded: [9, 2, 6, 10, 8]
Remaining card: 4
None
Last 3 cards discarded: [5, 2, 6]
Remaining card: 4
None
Last 7 cards discarded: [320, 1344, 2368, 3392, 832, 2880, 1856]
Remaining card: 3904
None
Given is an ordered deck of n cards numbered 1 to n with card 1 at the top
and card n at the bottom.
The following operation is performed as long as there are at least two
cards in the deck:
Throw away the top card and move the card that is now on the top of the
deck to the bottom of the deck.
My task is to find the sequence of the last k discarded cards and the last
remaining card.
Each line of input contains two non-negative numbers
n, where n ¡Ü 5000
k, where k < n
For each input line produce two lines of output.
The sequence of k discarded cards
The last remaining card.
See the sample for the expected format.
Sample input
7 2
19 4
10 5
6 3
4000 7
Output for sample input
Last 2 cards discarded: [4, 2]
Remaining card: 6
Last 4 cards discarded: [2, 10, 18, 14]
Remaining card: 6
Last 5 cards discarded: [9, 2, 6, 10, 8]
Remaining card: 4
Last 3 cards discarded: [5, 2, 6]
Remaining card: 4
Last 7 cards discarded: [320, 1344, 2368, 3392, 832, 2880, 1856]
Remaining card: 3904
My code will keep printing out the exact answers but with None on the
following line.
I am so confused why it will print None after each output.
Here is my code:
def throw_card(n,k):
lst=[]
bst=[]
for i in range(1,n+1):
lst.append(i)
while lst[0]!=lst[1] and len(lst)>1 and n<=5000 and k<n:
bst.append(lst.pop(0))
if len(lst)==1:
break
else:
lst.append(lst[0])
lst.remove(lst[0])
print('Last',k,'cards discarded: ',bst[n-(k+1):])
print('Remaining card: ',lst.pop())
print(throw_card(7,2))
print(throw_card(19,4))
print(throw_card(10,5))
print(throw_card(6,3))
print(throw_card(4000,7))
my output:
Last 2 cards discarded: [4, 2]
Remaining card: 6
None
Last 4 cards discarded: [2, 10, 18, 14]
Remaining card: 6
None
Last 5 cards discarded: [9, 2, 6, 10, 8]
Remaining card: 4
None
Last 3 cards discarded: [5, 2, 6]
Remaining card: 4
None
Last 7 cards discarded: [320, 1344, 2368, 3392, 832, 2880, 1856]
Remaining card: 3904
None
store value in char array pointed by char pointer
store value in char array pointed by char pointer
i have a char pointer.
char *ch;
char arr[100];
now i want to store the value of the char array ch is pointing to in
another array arr. I want to store the value pointed to by ch permanently
, so that any other operation performed on ch will not modify the original
value of array. can anyone tell me how to do this?
i have a char pointer.
char *ch;
char arr[100];
now i want to store the value of the char array ch is pointing to in
another array arr. I want to store the value pointed to by ch permanently
, so that any other operation performed on ch will not modify the original
value of array. can anyone tell me how to do this?
Missing one column when using Google chart API
Missing one column when using Google chart API
I did compare my code to the example code from Google and I couldn't find
anything different. I have no idea why my chart only display 2 data
columns instead of 3. Is it because of my browser (I'm using Chrome) ? I
tried with IE and had the same problem.
Google's example code:Example
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Chart</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">google.load('visualization', '1',
{packages: ['corechart']});</script>
<script type="text/javascript">
function drawVisualization2() {
var data = google.visualization.arrayToDataTable([
['Day', 'V5161.198', 'V5161.200', 'V5161.202'],
['27/09/2013', 4.0, 9.0, 4.0],
['29/09/2013', 5.0, 8.0, 4.0]
]);
var options = {title : 'Daily usage of heaters',
vAxis: {title: "Minutes"},
hAxis: {title: "day"},
seriesType: "bars",
series: {2: {type: "line"}} // This is not the root of the problem. If I
change it to 3, the chart can be displayed normally but it will not have
the average line anymore.
};
var chart = new
google.visualization.ComboChart(document.getElementById('chart2_div'));chart.draw(data,
options);}google.setOnLoadCallback(drawVisualization2);
</script>
</head>
<body>
<div id="chart2_div" style="width: 1100px; height: 500px;"></div>
</body>
</html>
Can anyone give me an advise ?
Thank you very much.
I did compare my code to the example code from Google and I couldn't find
anything different. I have no idea why my chart only display 2 data
columns instead of 3. Is it because of my browser (I'm using Chrome) ? I
tried with IE and had the same problem.
Google's example code:Example
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Chart</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">google.load('visualization', '1',
{packages: ['corechart']});</script>
<script type="text/javascript">
function drawVisualization2() {
var data = google.visualization.arrayToDataTable([
['Day', 'V5161.198', 'V5161.200', 'V5161.202'],
['27/09/2013', 4.0, 9.0, 4.0],
['29/09/2013', 5.0, 8.0, 4.0]
]);
var options = {title : 'Daily usage of heaters',
vAxis: {title: "Minutes"},
hAxis: {title: "day"},
seriesType: "bars",
series: {2: {type: "line"}} // This is not the root of the problem. If I
change it to 3, the chart can be displayed normally but it will not have
the average line anymore.
};
var chart = new
google.visualization.ComboChart(document.getElementById('chart2_div'));chart.draw(data,
options);}google.setOnLoadCallback(drawVisualization2);
</script>
</head>
<body>
<div id="chart2_div" style="width: 1100px; height: 500px;"></div>
</body>
</html>
Can anyone give me an advise ?
Thank you very much.
Friday, 27 September 2013
What needs to be escaped in java regular expressions
What needs to be escaped in java regular expressions
I have the following line of code
Matcher matcher = Pattern.compile("CREATE TABLE ([^ ]*)
\\(").matcher("CREATE TABLE DeliveryPointAddress (");
And the resulting Matcher does not contain a match (or more importantly)
the table name.
What do I need to change to get a match and "DeliveryPointAddress" in
group 1.
I have the following line of code
Matcher matcher = Pattern.compile("CREATE TABLE ([^ ]*)
\\(").matcher("CREATE TABLE DeliveryPointAddress (");
And the resulting Matcher does not contain a match (or more importantly)
the table name.
What do I need to change to get a match and "DeliveryPointAddress" in
group 1.
What are some Ruby IDE's?
What are some Ruby IDE's?
Does anyone have statistics on the most downloaded Ruby Integrated
Development Environments? Any help would be greatly appreciated.
Does anyone have statistics on the most downloaded Ruby Integrated
Development Environments? Any help would be greatly appreciated.
Receiving Illegal start of expression error
Receiving Illegal start of expression error
Can someone help me with this error? when i remove the () i have 100
errors... cannot response on my own post need to wait 7hours ...
long TimeTNL = ()(Skills.getXPToNextLevel("Mining") * 3600000.0D / XPH);
^
1 error
this.runTime = System.currentTimeMillis();
timeRan = this.runTime - this.startTime;
int XPH = (int)(this.gainedXP * 3600000.0D / timeRan);
long TimeTNL = ()(Skills.getXPToNextLevel("Mining") * 3600000.0D / XPH);
if (XPH > 0) {
this.TNLhours = (TimeTNL / 3600000L);
TimeTNL -= this.TNLhours * 3600000L;
this.TNLminutes = (TimeTNL / 60000L);
TimeTNL -= this.TNLminutes * 60000L;
this.TNLseconds = (TimeTNL / 1000L);
TimeTNL -= this.TNLseconds * 1000L;
}
Can someone help me with this error? when i remove the () i have 100
errors... cannot response on my own post need to wait 7hours ...
long TimeTNL = ()(Skills.getXPToNextLevel("Mining") * 3600000.0D / XPH);
^
1 error
this.runTime = System.currentTimeMillis();
timeRan = this.runTime - this.startTime;
int XPH = (int)(this.gainedXP * 3600000.0D / timeRan);
long TimeTNL = ()(Skills.getXPToNextLevel("Mining") * 3600000.0D / XPH);
if (XPH > 0) {
this.TNLhours = (TimeTNL / 3600000L);
TimeTNL -= this.TNLhours * 3600000L;
this.TNLminutes = (TimeTNL / 60000L);
TimeTNL -= this.TNLminutes * 60000L;
this.TNLseconds = (TimeTNL / 1000L);
TimeTNL -= this.TNLseconds * 1000L;
}
Getting Variables Passed In URL Laravel
Getting Variables Passed In URL Laravel
Probably a basic question but I can't seem to get it.
I am wanting to grab the variable in my url to my controller.
// index view
@foreach ($paymentInfos as $p)
<tr>
<td><a href="{{ URL::action('AdminController@getPackingSlip',
array('order_id' => $p->order_id)) }}"> {{ $p->order_id
}}</a></td>
<td>{{ $p->lastname }} {{ $p->firstname }}</td>
<td>{{ $p->buyer_email }}</td>
</tr>
@endforeach
// route
Route::get('printpackingslip', 'AdminController@getPackingSlip');
// Controller
class AdminController extends BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function getPackingSlip()
{
$rules = array('order_id' => 'order_id');
return View::make('admin.packingslip')->with($rules);
}
}
When you click on the link it goes to
www.domain.com/printpackingslip?order_id=3
I do not know how to grab the order_id=3 in my controller.
Also would I be better off using the :(num) to generate a URI of
/printpackingslip/3 or does it not matter?
For example:
// in my first view have:
<td><a href="{{ URL::to('printpackingslip', array('order_id' =>
$p->order_id)) }}"> {{ $p->order_id }}</a></td>
// then my route:
Route::get('printpackingslip/(:num)', 'AdminController@getPackingSlip');
Thanks!
Probably a basic question but I can't seem to get it.
I am wanting to grab the variable in my url to my controller.
// index view
@foreach ($paymentInfos as $p)
<tr>
<td><a href="{{ URL::action('AdminController@getPackingSlip',
array('order_id' => $p->order_id)) }}"> {{ $p->order_id
}}</a></td>
<td>{{ $p->lastname }} {{ $p->firstname }}</td>
<td>{{ $p->buyer_email }}</td>
</tr>
@endforeach
// route
Route::get('printpackingslip', 'AdminController@getPackingSlip');
// Controller
class AdminController extends BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function getPackingSlip()
{
$rules = array('order_id' => 'order_id');
return View::make('admin.packingslip')->with($rules);
}
}
When you click on the link it goes to
www.domain.com/printpackingslip?order_id=3
I do not know how to grab the order_id=3 in my controller.
Also would I be better off using the :(num) to generate a URI of
/printpackingslip/3 or does it not matter?
For example:
// in my first view have:
<td><a href="{{ URL::to('printpackingslip', array('order_id' =>
$p->order_id)) }}"> {{ $p->order_id }}</a></td>
// then my route:
Route::get('printpackingslip/(:num)', 'AdminController@getPackingSlip');
Thanks!
Java anonymous override doesn't work
Java anonymous override doesn't work
I am currently experiencing a weird issue with anonymous method override
and inherits. It's difficult to explain clearly, so to begin with here is
a representation of my code :
public abstract class A {
public void draw() {
someAction();
}
}
public class B {
// Other methods
}
ArrayList< A > listA = new ArrayList< A >();
B objectB = new B() {
@Override
public void draw() {
someActionOverriden();
}
}
listA.add( objectB );
for( A item : listA ) {
item.draw();
}
The thing is : the draw() method that is override anonymously is never
called. I presume this may be because "item" is of class A, and so it
never goes to the anonymous method, but is there a way to implement this
kind of design?
I am currently experiencing a weird issue with anonymous method override
and inherits. It's difficult to explain clearly, so to begin with here is
a representation of my code :
public abstract class A {
public void draw() {
someAction();
}
}
public class B {
// Other methods
}
ArrayList< A > listA = new ArrayList< A >();
B objectB = new B() {
@Override
public void draw() {
someActionOverriden();
}
}
listA.add( objectB );
for( A item : listA ) {
item.draw();
}
The thing is : the draw() method that is override anonymously is never
called. I presume this may be because "item" is of class A, and so it
never goes to the anonymous method, but is there a way to implement this
kind of design?
Make image follow a selected div
Make image follow a selected div
I'm trying to write a lil navigation the example page here
now I'm trying to let the lil arrow follow the selected div. It works
until i scroll down the list of options. as soon as i start doing that the
arrow doesn't end up where it should end up.
I put it in jsfiddle but I can't seem to share the link here.
I'm trying to write a lil navigation the example page here
now I'm trying to let the lil arrow follow the selected div. It works
until i scroll down the list of options. as soon as i start doing that the
arrow doesn't end up where it should end up.
I put it in jsfiddle but I can't seem to share the link here.
Thursday, 26 September 2013
text field appears when click on radiobutton
text field appears when click on radiobutton
when i click on any radio button the text field appears and when i click
on on other radio button the respective text field occurs .and previous
text field dissapears
<input name="radioButton" type="radio" value="Circuit_Reference" />
Circuit Reference
<input id="circuit_reference" type="text" style="display:none "/>
<input name="radioButton" type="radio" value="USID" /> USID
<input id="usid" type="text" style="display:none "/>
<input name="radioButton" type="radio" value="Router_Name" />
Router Name
<input id="router_name" type="text" style="display:none "/>
<input name="radioButton" type="radio" value="Euclid" /> Euclid
<input id="euclid" type="text" style="display:none "/>
when i click on any radio button the text field appears and when i click
on on other radio button the respective text field occurs .and previous
text field dissapears
<input name="radioButton" type="radio" value="Circuit_Reference" />
Circuit Reference
<input id="circuit_reference" type="text" style="display:none "/>
<input name="radioButton" type="radio" value="USID" /> USID
<input id="usid" type="text" style="display:none "/>
<input name="radioButton" type="radio" value="Router_Name" />
Router Name
<input id="router_name" type="text" style="display:none "/>
<input name="radioButton" type="radio" value="Euclid" /> Euclid
<input id="euclid" type="text" style="display:none "/>
Wednesday, 25 September 2013
How to apply styles on input type=file button
How to apply styles on input type=file button
I want to apply styles on input type=file's upload button to make it
attractive as like bootstrap buttons. Is there any way to apply styles on
this button. Is there any support for it in bootstrap ?
I want to apply styles on input type=file's upload button to make it
attractive as like bootstrap buttons. Is there any way to apply styles on
this button. Is there any support for it in bootstrap ?
Thursday, 19 September 2013
Multi Dimensional array, display certain values from array index
Multi Dimensional array, display certain values from array index
Array ( [0] => Array ( [Name] => [0] => [ConditionValue] => 1 [1] => 1 )
[1] => Array ( [Name] => [0] => [ConditionValue] => 2 [1] => 2 )
[2] => Array ( [Name] => [0] => [ConditionValue] => 4 [1] => 4 )
[3] => Array ( [Name] => [0] => [ConditionValue] => 8 [1] => 8 )
[4] => Array ( [Name] => [0] => [ConditionValue] => 16 [1] => 16 )
[5] => Array ( [Name] => [0] => [ConditionValue] => 32 [1] => 32 )
[6] => Array ( [Name] => [0] => [ConditionValue] => 64 [1] => 64 )
[7] => Array ( [Name] => [0] => [ConditionValue] => 128 [1] => 128 )
[8] => Array ( [Name] => Exterior Hoist [0] => Exterior Hoist
[ConditionValue] => 256 [1] => 256 )
[9] => Array ( [Name] => [0] => [ConditionValue] => 512 [1] => 512 )
[10] => Array ( [Name] => [0] => [ConditionValue] => 1024 [1] => 1024 )
[11] => Array ( [Name] => [0] => [ConditionValue] => 2048 [1] => 2048 )
[12] => Array ( [Name] => [0] => [ConditionValue] => 4096 [1] => 4096 )
[13] => Array ( [Name] => [0] => [ConditionValue] => 8192 [1] => 8192 )
[14] => Array ( [Name] => [0] => [ConditionValue] => 16384 [1] => 16384 )
[15] => Array ( [Name] => [0] => [ConditionValue] => 32768 [1] => 32768 )
[16] => Array ( [Name] => Parcel [0] => Parcel [ConditionValue] =>
65536 [1] => 65536 )
[17] => Array ( [Name] => Cheques [0] => Cheques [ConditionValue] =>
131072 [1] => 131072 )
[18] => Array ( [Name] => OuterArea [0] => OuterArea [ConditionValue]
=> 262144 [1] => 262144 )
[19] => Array ( [Name] => [0] => [ConditionValue] => 524288 [1] =>
524288 )
[20] => Array ( [Name] => [0] => [ConditionValue] => 1048576 [1] =>
1048576 )
[21] => Array ( [Name] => V [0] => V [ConditionValue] => 2097152 [1]
=> 2097152 )
[22] => Array ( [Name] => Wheelchair [0] => Wheelchair
[ConditionValue] => 4194304 [1] => 4194304 )
[23] => Array ( [Name] => M50 [0] => M50 [ConditionValue] => 8388608
[1] => 8388608 )
[24] => Array ( [Name] => Executive Car (Silver) [0] => Executive Car
(Silver) [ConditionValue] => 16777216 [1] => 16777216 )
[25] => Array ( [Name] => Two M50s [0] => Two M50s [ConditionValue] =>
33554432 [1] => 33554432 )
[26] => Array ( [Name] => Special [0] => Special [ConditionValue] =>
67108864 [1] => 67108864 )
[27] => Array ( [Name] => Animal [0] => Animal [ConditionValue] =>
134217728 [1] => 134217728 )
[28] => Array ( [Name] => COD Parcel [0] => COD Parcel
[ConditionValue] => 268435456 [1] => 268435456 )
[29] => Array ( [Name] => 9 seater [0] => 9 seater [ConditionValue] =>
536870912 [1] => 536870912 )
[30] => Array ( [Name] => 6 seater [0] => 6 seater [ConditionValue] =>
1073741824 [1] => 1073741824 )
[31] => Array ( [Name] => 7 seater [0] => 7 seater [ConditionValue] =>
2147483648 [1] => 2147483648 )
[32] => Array ( [Name] => Wagon [0] => Wagon [ConditionValue] =>
4294967296 [1] => 4294967296 )
[33] => Array ( [Name] => Maxi10str [0] => Maxi10str [ConditionValue]
=> 8589934592 [1] => 8589934592 )
[34] => Array ( [Name] => Bike [0] => Bike [ConditionValue] =>
17179869184 [1] => 17179869184 )
[35] => Array ( [Name] => NonMaxi [0] => NonMaxi [ConditionValue] =>
34359738368 [1] => 34359738368 )
[36] => Array ( [Name] => NonMaxiOrMulti [0] => NonMaxiOrMulti
[ConditionValue] => 68719476736 [1] => 68719476736 )
[37] => Array ( [Name] => [0] => [ConditionValue] => 137438953472 [1]
=> 137438953472 )
[38] => Array ( [Name] => Towbar [0] => Towbar [ConditionValue] =>
274877906944 [1] => 274877906944 )
[39] => Array ( [Name] => NO DISPATCH [0] => NO DISPATCH
[ConditionValue] => 549755813888 [1] => 549755813888 ) )
I have a reasonably simple multi dimensional array, that i want to display
the "name" of a certain array index...
for example say i have the value 22, i want to be able to display
"wheelchair".
i get a little lost when it comes to the second dimension.
thus far i have tried..
$result is the multidimensional array above.
$resulting_bits is this array (it is built dynamically and could have up
to 40 values):
Array ( [0] => 23 [1] => 26 [2] => 33 )
this is the code i have at the moment
foreach($resulting_bits as $val) {
echo $val;
echo "<br>";
$answer = ($result[$val]);
foreach($answer as $conditionname) {
print_r ($conditionname);
echo "<br>";
echo $conditionname[Name];
}
this gives me
Array ( [0] => 23 [1] => 26 [2] => 33 )
23
M50
MM50
M8388608
88388608
826
Special
SSpecial
S67108864
667108864
633
Maxi10str
MMaxi10str
M8589934592
88589934592
8
which seems odd to me... how do i just display the "name"??
Array ( [0] => Array ( [Name] => [0] => [ConditionValue] => 1 [1] => 1 )
[1] => Array ( [Name] => [0] => [ConditionValue] => 2 [1] => 2 )
[2] => Array ( [Name] => [0] => [ConditionValue] => 4 [1] => 4 )
[3] => Array ( [Name] => [0] => [ConditionValue] => 8 [1] => 8 )
[4] => Array ( [Name] => [0] => [ConditionValue] => 16 [1] => 16 )
[5] => Array ( [Name] => [0] => [ConditionValue] => 32 [1] => 32 )
[6] => Array ( [Name] => [0] => [ConditionValue] => 64 [1] => 64 )
[7] => Array ( [Name] => [0] => [ConditionValue] => 128 [1] => 128 )
[8] => Array ( [Name] => Exterior Hoist [0] => Exterior Hoist
[ConditionValue] => 256 [1] => 256 )
[9] => Array ( [Name] => [0] => [ConditionValue] => 512 [1] => 512 )
[10] => Array ( [Name] => [0] => [ConditionValue] => 1024 [1] => 1024 )
[11] => Array ( [Name] => [0] => [ConditionValue] => 2048 [1] => 2048 )
[12] => Array ( [Name] => [0] => [ConditionValue] => 4096 [1] => 4096 )
[13] => Array ( [Name] => [0] => [ConditionValue] => 8192 [1] => 8192 )
[14] => Array ( [Name] => [0] => [ConditionValue] => 16384 [1] => 16384 )
[15] => Array ( [Name] => [0] => [ConditionValue] => 32768 [1] => 32768 )
[16] => Array ( [Name] => Parcel [0] => Parcel [ConditionValue] =>
65536 [1] => 65536 )
[17] => Array ( [Name] => Cheques [0] => Cheques [ConditionValue] =>
131072 [1] => 131072 )
[18] => Array ( [Name] => OuterArea [0] => OuterArea [ConditionValue]
=> 262144 [1] => 262144 )
[19] => Array ( [Name] => [0] => [ConditionValue] => 524288 [1] =>
524288 )
[20] => Array ( [Name] => [0] => [ConditionValue] => 1048576 [1] =>
1048576 )
[21] => Array ( [Name] => V [0] => V [ConditionValue] => 2097152 [1]
=> 2097152 )
[22] => Array ( [Name] => Wheelchair [0] => Wheelchair
[ConditionValue] => 4194304 [1] => 4194304 )
[23] => Array ( [Name] => M50 [0] => M50 [ConditionValue] => 8388608
[1] => 8388608 )
[24] => Array ( [Name] => Executive Car (Silver) [0] => Executive Car
(Silver) [ConditionValue] => 16777216 [1] => 16777216 )
[25] => Array ( [Name] => Two M50s [0] => Two M50s [ConditionValue] =>
33554432 [1] => 33554432 )
[26] => Array ( [Name] => Special [0] => Special [ConditionValue] =>
67108864 [1] => 67108864 )
[27] => Array ( [Name] => Animal [0] => Animal [ConditionValue] =>
134217728 [1] => 134217728 )
[28] => Array ( [Name] => COD Parcel [0] => COD Parcel
[ConditionValue] => 268435456 [1] => 268435456 )
[29] => Array ( [Name] => 9 seater [0] => 9 seater [ConditionValue] =>
536870912 [1] => 536870912 )
[30] => Array ( [Name] => 6 seater [0] => 6 seater [ConditionValue] =>
1073741824 [1] => 1073741824 )
[31] => Array ( [Name] => 7 seater [0] => 7 seater [ConditionValue] =>
2147483648 [1] => 2147483648 )
[32] => Array ( [Name] => Wagon [0] => Wagon [ConditionValue] =>
4294967296 [1] => 4294967296 )
[33] => Array ( [Name] => Maxi10str [0] => Maxi10str [ConditionValue]
=> 8589934592 [1] => 8589934592 )
[34] => Array ( [Name] => Bike [0] => Bike [ConditionValue] =>
17179869184 [1] => 17179869184 )
[35] => Array ( [Name] => NonMaxi [0] => NonMaxi [ConditionValue] =>
34359738368 [1] => 34359738368 )
[36] => Array ( [Name] => NonMaxiOrMulti [0] => NonMaxiOrMulti
[ConditionValue] => 68719476736 [1] => 68719476736 )
[37] => Array ( [Name] => [0] => [ConditionValue] => 137438953472 [1]
=> 137438953472 )
[38] => Array ( [Name] => Towbar [0] => Towbar [ConditionValue] =>
274877906944 [1] => 274877906944 )
[39] => Array ( [Name] => NO DISPATCH [0] => NO DISPATCH
[ConditionValue] => 549755813888 [1] => 549755813888 ) )
I have a reasonably simple multi dimensional array, that i want to display
the "name" of a certain array index...
for example say i have the value 22, i want to be able to display
"wheelchair".
i get a little lost when it comes to the second dimension.
thus far i have tried..
$result is the multidimensional array above.
$resulting_bits is this array (it is built dynamically and could have up
to 40 values):
Array ( [0] => 23 [1] => 26 [2] => 33 )
this is the code i have at the moment
foreach($resulting_bits as $val) {
echo $val;
echo "<br>";
$answer = ($result[$val]);
foreach($answer as $conditionname) {
print_r ($conditionname);
echo "<br>";
echo $conditionname[Name];
}
this gives me
Array ( [0] => 23 [1] => 26 [2] => 33 )
23
M50
MM50
M8388608
88388608
826
Special
SSpecial
S67108864
667108864
633
Maxi10str
MMaxi10str
M8589934592
88589934592
8
which seems odd to me... how do i just display the "name"??
Using jquery handler in Angular
Using jquery handler in Angular
I have been using Angular for a bit and really find myself much more
efficient and produce many few lines of code than I did in Backbone and
jquery. However, I work with other developers that are primary creating in
Backbon/jquery components/controls we all share. Since these are complex
components/controls that I cannot rewrite in Angular I need to find a way
to use them from within Angular.
In the specific case I am dealing with a control that create a dialog that
lets users created entries in a series of help request systems or log
bugs. This code is working in a number of applications. Here is a simple
example :
<div class="foo">Help</div>
And then the handler.
$(".foo").ShowHelp({project:"myproject", app:"MyApp"});
Note "foo" is used to position the dialog.
In Angular I tried to create add an ng-click directive and in my
controller handle the click, but ShowHelp is not invoked. This is the
angular code:
<div class="foo" ng-click="doShowHelp()">Help</div>
In the controller I have
$scope.doShowHelp = function() {
console.log("in doShowHelp");
$(".foo").ShowHelp({project:"myproject", app:"MyApp"});
};
I see the log message in the console, but nothing seems to happen. Any
ideas on what I am doing wrong.
Thanks in advance
I have been using Angular for a bit and really find myself much more
efficient and produce many few lines of code than I did in Backbone and
jquery. However, I work with other developers that are primary creating in
Backbon/jquery components/controls we all share. Since these are complex
components/controls that I cannot rewrite in Angular I need to find a way
to use them from within Angular.
In the specific case I am dealing with a control that create a dialog that
lets users created entries in a series of help request systems or log
bugs. This code is working in a number of applications. Here is a simple
example :
<div class="foo">Help</div>
And then the handler.
$(".foo").ShowHelp({project:"myproject", app:"MyApp"});
Note "foo" is used to position the dialog.
In Angular I tried to create add an ng-click directive and in my
controller handle the click, but ShowHelp is not invoked. This is the
angular code:
<div class="foo" ng-click="doShowHelp()">Help</div>
In the controller I have
$scope.doShowHelp = function() {
console.log("in doShowHelp");
$(".foo").ShowHelp({project:"myproject", app:"MyApp"});
};
I see the log message in the console, but nothing seems to happen. Any
ideas on what I am doing wrong.
Thanks in advance
Workflow approval on enterprise portal suddenly stopped working on production
Workflow approval on enterprise portal suddenly stopped working on production
Workflow approval functionality we have implanted for enterprise portal of
dynamics ax 2009. This functionality was working fine on production
environment then suddenly it has started behave abnormally, sometime
approver is able to approve the submitted work item but sometime system
don't take any action even though approver clicks on 'approve' button . It
would be great help if anybody can provide some pointer to identify root
cause of this problem.
Workflow approval functionality we have implanted for enterprise portal of
dynamics ax 2009. This functionality was working fine on production
environment then suddenly it has started behave abnormally, sometime
approver is able to approve the submitted work item but sometime system
don't take any action even though approver clicks on 'approve' button . It
would be great help if anybody can provide some pointer to identify root
cause of this problem.
How do I find out the value of these dwFlags constants?
How do I find out the value of these dwFlags constants?
I'm looking at the MSDN documentation for ChangeDisplaySettings. For the
dwFlags option, you can pass in 0 or one of the other listed flags.
However, I can't figure out how to reference those flags directly, nor
figure out what their actual long value is to use in their stead.
I'm making these calls from a C# application using this:
[DllImport("User32.dll")]
public static extern long ChangeDisplaySettings(ref DeviceMode lpDevMode,
int dwflags);
Is there a way I can reference the flags directly, or, barring that, find
out what their actual values are?
I'm looking at the MSDN documentation for ChangeDisplaySettings. For the
dwFlags option, you can pass in 0 or one of the other listed flags.
However, I can't figure out how to reference those flags directly, nor
figure out what their actual long value is to use in their stead.
I'm making these calls from a C# application using this:
[DllImport("User32.dll")]
public static extern long ChangeDisplaySettings(ref DeviceMode lpDevMode,
int dwflags);
Is there a way I can reference the flags directly, or, barring that, find
out what their actual values are?
ImeAction Search is changed to Done after tapping
ImeAction Search is changed to Done after tapping
I have an Edittext for searching on Listview. I have set imeOption to
'IME_ACTION_SEARCH' so that softkeyboard will show search key on it. The
problem is when I tap on search key on keyboard if edittext contains no
text in it, the search key changes to 'Done' instead of dismissing the
keyboard. If the Edittext contains some text in it the search key works
well.
I have an Edittext for searching on Listview. I have set imeOption to
'IME_ACTION_SEARCH' so that softkeyboard will show search key on it. The
problem is when I tap on search key on keyboard if edittext contains no
text in it, the search key changes to 'Done' instead of dismissing the
keyboard. If the Edittext contains some text in it the search key works
well.
Tomcat Server permission issue
Tomcat Server permission issue
I'm trying to deploy a simple Spring MVC app on a tomcat-hosting site. The
problem is that when I try to start the application I get the following
error:
19-set-2013 11.44.55 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet dispatcher
java.security.AccessControlException: access denied
(java.util.PropertyPermission * read,write)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1252)
at java.lang.System.getProperties(System.java:580)
at
org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:467)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:427)
at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:341)
at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:270)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:302)
at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:163)
at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:117)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1200)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at it.ilz.hostingjava.valves.AccessLogValve.invoke(AccessLogValve.java:531)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
it.ilz.hostingjava.valves.StartContextValve.invoke(StartContextValve.java:163)
at it.ilz.hostingjava.valves.DBLogValve.invoke(DBLogValve.java:84)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:448)
at
org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:399)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
at java.lang.Thread.run(Thread.java:662)
I know it's due to the policy restrictions imposed by the hosting service,
but I don't know how to solve this, how to modify the application (it's a
sample Spring MVC app you can download here) to work correctly.
Here are the permissions granted by the hosting file. Tomcat version is 6.
grant codebase "file:/home/hostingjava.it/" {
permission java.util.PropertyPermission "*", "read";
permission java.lang.RuntimePermission "getAttribute";
permission java.io.FilePermission "/home/hostingjava.it//-",
"read,write,delete";
permission java.lang.RuntimePermission
"accessClassInPackage.org.apache.tomcat.util.*";
}
Any idea?
I'm trying to deploy a simple Spring MVC app on a tomcat-hosting site. The
problem is that when I try to start the application I get the following
error:
19-set-2013 11.44.55 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet dispatcher
java.security.AccessControlException: access denied
(java.util.PropertyPermission * read,write)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1252)
at java.lang.System.getProperties(System.java:580)
at
org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:467)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:427)
at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:341)
at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:270)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:302)
at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:163)
at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:117)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1200)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at it.ilz.hostingjava.valves.AccessLogValve.invoke(AccessLogValve.java:531)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
com.googlecode.psiprobe.Tomcat60AgentValve.invoke(Tomcat60AgentValve.java:30)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
it.ilz.hostingjava.valves.StartContextValve.invoke(StartContextValve.java:163)
at it.ilz.hostingjava.valves.DBLogValve.invoke(DBLogValve.java:84)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:448)
at
org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:399)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
at java.lang.Thread.run(Thread.java:662)
I know it's due to the policy restrictions imposed by the hosting service,
but I don't know how to solve this, how to modify the application (it's a
sample Spring MVC app you can download here) to work correctly.
Here are the permissions granted by the hosting file. Tomcat version is 6.
grant codebase "file:/home/hostingjava.it/" {
permission java.util.PropertyPermission "*", "read";
permission java.lang.RuntimePermission "getAttribute";
permission java.io.FilePermission "/home/hostingjava.it//-",
"read,write,delete";
permission java.lang.RuntimePermission
"accessClassInPackage.org.apache.tomcat.util.*";
}
Any idea?
Unique Key constraints for multiple columns EF
Unique Key constraints for multiple columns EF
public class Entity
{
public string EntityId { get; set;}
public int FirstColumn { get; set;}
public int SecondColumn { get; set;}
}
I want to make the combination between FirstColumn and SecondColumn as
unique.
Example:
Id FirstColumn SecondColumn
1 1 1 = OK
2 2 1 = OK
3 3 3 = OK
5 3 1 = THIS OK
4 3 3 = GRRRRR! HERE ERROR
Is anyway to do that. Thanks!
public class Entity
{
public string EntityId { get; set;}
public int FirstColumn { get; set;}
public int SecondColumn { get; set;}
}
I want to make the combination between FirstColumn and SecondColumn as
unique.
Example:
Id FirstColumn SecondColumn
1 1 1 = OK
2 2 1 = OK
3 3 3 = OK
5 3 1 = THIS OK
4 3 3 = GRRRRR! HERE ERROR
Is anyway to do that. Thanks!
Wednesday, 18 September 2013
Semantic-ui vs Bootstrap
Semantic-ui vs Bootstrap
which is the best one to use and if possible please provide the difference
and advantages of these two.
Semantic-ui vs Bootstrap I am trying to build my ui and really confused as
what to use.
Please suggest me the best one and if possible with examples...
thanks
which is the best one to use and if possible please provide the difference
and advantages of these two.
Semantic-ui vs Bootstrap I am trying to build my ui and really confused as
what to use.
Please suggest me the best one and if possible with examples...
thanks
no space between navbar and items after in the new bootstrap?
no space between navbar and items after in the new bootstrap?
So i'm messing around with the new bootstrap V3, and there is absolutely
one thing that is driving me insane. There is no space btween a fixed top
navbar and the item that follows it. I've tried changing the padding on
the item(whether it be jumbotron or carousel) and the padding on the
navbar to no avail. Its literally driving me insane. any fixes?
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<a href="index.html" class="navbar-brand">Gaming</a>
<button class="navbar-toggle" data-toggle="collapse" data-target=
".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="index.html">Home</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Videos</a></li>
<li><a href="#">Shows</a></li>
<li><a href="#">Cheats</a></li>
<li class="dropdown"><a href="#"
class="dropdown-toggle" data-
toggle="dropdown">Forums<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">General</a></li>
<li><a href="#">Help</a></li>
<li><a href="#">Games</a></li>
</ul>
</li>
<li><a href="#">eSports</a></li>
</ul>
</div>
</div>
</div>
<div class="divider"></div>
<div class="container">
<div id="myCarousel" class="carousel slide">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="img/banner.jpg">
<div class="container">
<div class="carousel-caption">
<h1>Bootstrap 3 Carousel Layout</h1>
<p>This is an example layout with carousel that uses the Bootstrap 3
styles.
<a title="Bootstrap 3" href="http://getbootstrap.com"
class="">Bootstrap 3 RC 1
is now available!</a></p>
<p><a class="btn btn-large btn-primary" href="#">Sign up today</a>
</p></div>
</div>
</div>
<div class="item">
<img src="img/banner.jpg">
<div class="container">
<div class="carousel-caption">
<h1>Changes to the Grid</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS
class names
have completely changed.</p>
<p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
</div>
</div>
</div>
<div class="item">
<img src="img/banner.jpg">
<div class="container">
<div class="carousel-caption">
<h1>Percentage-based sizing</h1>
<p>With "mobile-first" there is now only one percentage-based grid.</p>
<p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
</div>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
</div>
So i'm messing around with the new bootstrap V3, and there is absolutely
one thing that is driving me insane. There is no space btween a fixed top
navbar and the item that follows it. I've tried changing the padding on
the item(whether it be jumbotron or carousel) and the padding on the
navbar to no avail. Its literally driving me insane. any fixes?
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<a href="index.html" class="navbar-brand">Gaming</a>
<button class="navbar-toggle" data-toggle="collapse" data-target=
".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="index.html">Home</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Videos</a></li>
<li><a href="#">Shows</a></li>
<li><a href="#">Cheats</a></li>
<li class="dropdown"><a href="#"
class="dropdown-toggle" data-
toggle="dropdown">Forums<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">General</a></li>
<li><a href="#">Help</a></li>
<li><a href="#">Games</a></li>
</ul>
</li>
<li><a href="#">eSports</a></li>
</ul>
</div>
</div>
</div>
<div class="divider"></div>
<div class="container">
<div id="myCarousel" class="carousel slide">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="img/banner.jpg">
<div class="container">
<div class="carousel-caption">
<h1>Bootstrap 3 Carousel Layout</h1>
<p>This is an example layout with carousel that uses the Bootstrap 3
styles.
<a title="Bootstrap 3" href="http://getbootstrap.com"
class="">Bootstrap 3 RC 1
is now available!</a></p>
<p><a class="btn btn-large btn-primary" href="#">Sign up today</a>
</p></div>
</div>
</div>
<div class="item">
<img src="img/banner.jpg">
<div class="container">
<div class="carousel-caption">
<h1>Changes to the Grid</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS
class names
have completely changed.</p>
<p><a class="btn btn-large btn-primary" href="#">Learn more</a></p>
</div>
</div>
</div>
<div class="item">
<img src="img/banner.jpg">
<div class="container">
<div class="carousel-caption">
<h1>Percentage-based sizing</h1>
<p>With "mobile-first" there is now only one percentage-based grid.</p>
<p><a class="btn btn-large btn-primary" href="#">Browse gallery</a></p>
</div>
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
</div>
Python if statement troubleshooting
Python if statement troubleshooting
Python Version : 2.7
Just wondering what is wrong with the following code :
def bmi_cat(bmi):
if bmi < 18.5:
return "underweight"
elif (bmi >=18.5 or bmi < 25):
return "normal"
elif (bmi >=25 or bmi < 30):
return "overweight"
else:
return "obese"
Basically if i enter 17 it gives me the correct answer, but it gives me
normal for anything above 18.5 (3000 gives normal instead of obese,etc...)
Python Version : 2.7
Just wondering what is wrong with the following code :
def bmi_cat(bmi):
if bmi < 18.5:
return "underweight"
elif (bmi >=18.5 or bmi < 25):
return "normal"
elif (bmi >=25 or bmi < 30):
return "overweight"
else:
return "obese"
Basically if i enter 17 it gives me the correct answer, but it gives me
normal for anything above 18.5 (3000 gives normal instead of obese,etc...)
Reduce space between two rows in an HTML table
Reduce space between two rows in an HTML table
I have a table with multiple rows, for example five rows. I need to reduce
the gap between the third and fourth rows.
Below is my code:
<table>
<tr>
<td> First Row </td>
<td> 1 </td>
</tr>
<tr>
<td> Second Row </td>
<td> 2 </td>
</tr>
<tr>
<td> Third Row </td>
<td> 3 </td>
</tr>
<tr>
<td> Fourth Row </td>
<td> 4 </td>
</tr>
The result is
First 1
Second 2
Third 3
Fourth 4
I want to remove the gap between the third and fourth rows as below:
First 1
Second 2
Third 3
Fourth 4
I have a table with multiple rows, for example five rows. I need to reduce
the gap between the third and fourth rows.
Below is my code:
<table>
<tr>
<td> First Row </td>
<td> 1 </td>
</tr>
<tr>
<td> Second Row </td>
<td> 2 </td>
</tr>
<tr>
<td> Third Row </td>
<td> 3 </td>
</tr>
<tr>
<td> Fourth Row </td>
<td> 4 </td>
</tr>
The result is
First 1
Second 2
Third 3
Fourth 4
I want to remove the gap between the third and fourth rows as below:
First 1
Second 2
Third 3
Fourth 4
CSS clear:both not working for table cell with a background image?
CSS clear:both not working for table cell with a background image?
I'm developing an email and would like an image to show up only on a
mobile device.... SO I created an empty with a span inside, and styled the
span to have a background image.
The problem is, I'd like the image to take up a whole row, instead of
being right next to the headline. I tried clear:both and display:block but
I'm not sure why it's not working. I also tried setting the width to 100%
but that just throws everything off... any suggestions?
http://jsfiddle.net/pEDSn/
<table id="headline_body_copy_top" width="532" border="0" cellspacing="0"
cellpadding="0">
Ficaborio vellandebis arum inus es ema gimus, quibus vent.
.test {
width: 41px;
height: 41px;
background-image: url('http://placehold.it/41x41');
background-repeat: no-repeat;
background-size: 41px 41px;
display: block;
clear: both !important;
}
I'm developing an email and would like an image to show up only on a
mobile device.... SO I created an empty with a span inside, and styled the
span to have a background image.
The problem is, I'd like the image to take up a whole row, instead of
being right next to the headline. I tried clear:both and display:block but
I'm not sure why it's not working. I also tried setting the width to 100%
but that just throws everything off... any suggestions?
http://jsfiddle.net/pEDSn/
<table id="headline_body_copy_top" width="532" border="0" cellspacing="0"
cellpadding="0">
Ficaborio vellandebis arum inus es ema gimus, quibus vent.
.test {
width: 41px;
height: 41px;
background-image: url('http://placehold.it/41x41');
background-repeat: no-repeat;
background-size: 41px 41px;
display: block;
clear: both !important;
}
C# DateTime.ParseExact with backslashes in format
C# DateTime.ParseExact with backslashes in format
I've got some sub directories that are named with dates like so:
C:\SomeDirectory\201309\01
C:\SomeDirectory\201309\02
C:\SomeDirectory\201309\03
C:\SomeDirectory\201309\04
C:\SomeDirectory\201309\05
etc.
What I'm trying to do is get the directory listing and then use Linq to
limit my results based on a date range.
I've got it working like so:
string path = @"C:\SomeDirectory";
DateTime f = new DateTime(2013, 9, 1);
DateTime t = new DateTime(2013, 9, 3);
DateTime dt;
var dirs =
Directory.GetDirectories(path, "*.*", SearchOption.AllDirectories)
.Where(d => DateTime.TryParseExact(
d.Substring(Math.Max(0, d.Length - 9)).Replace("\\", null),
"yyyyMMdd",
CultureInfo.Invarient,
DateTimeStyles.None,
out dt)
&& f <= dt
&& dt <= t);
I would, however, like to change the TryParseExact portion so that I don't
have to replace the backslash - like so:
DateTime.TryParseExact(
d.Substring(Math.Max(0, d.Length - 9)),
@"yyyyMM\dd",
CultureInfo.Invarient,
DateTimeStyles.None,
out dt)
But, it seems TryParseExact does not like that format. I was thinking this
may have something to do with the CultureInfo - but I was unable to track
down a possible solution to help me with the backslash.
Any assistance would be greatly appreciated!
I've got some sub directories that are named with dates like so:
C:\SomeDirectory\201309\01
C:\SomeDirectory\201309\02
C:\SomeDirectory\201309\03
C:\SomeDirectory\201309\04
C:\SomeDirectory\201309\05
etc.
What I'm trying to do is get the directory listing and then use Linq to
limit my results based on a date range.
I've got it working like so:
string path = @"C:\SomeDirectory";
DateTime f = new DateTime(2013, 9, 1);
DateTime t = new DateTime(2013, 9, 3);
DateTime dt;
var dirs =
Directory.GetDirectories(path, "*.*", SearchOption.AllDirectories)
.Where(d => DateTime.TryParseExact(
d.Substring(Math.Max(0, d.Length - 9)).Replace("\\", null),
"yyyyMMdd",
CultureInfo.Invarient,
DateTimeStyles.None,
out dt)
&& f <= dt
&& dt <= t);
I would, however, like to change the TryParseExact portion so that I don't
have to replace the backslash - like so:
DateTime.TryParseExact(
d.Substring(Math.Max(0, d.Length - 9)),
@"yyyyMM\dd",
CultureInfo.Invarient,
DateTimeStyles.None,
out dt)
But, it seems TryParseExact does not like that format. I was thinking this
may have something to do with the CultureInfo - but I was unable to track
down a possible solution to help me with the backslash.
Any assistance would be greatly appreciated!
Java - explicit conversion to char/short
Java - explicit conversion to char/short
can anyone tell me why this explicit conversion gives different results,
even if size of short/char is both 16bits?
package jh;
public class Main {
public static void main(String[] args) {
byte b = (byte)255;
System.out.println("Size of short: " + Short.SIZE);
System.out.println("Size of char: " + Character.SIZE);
System.out.println((int)((short)b));
System.out.println((int)((char)b));
}
}
Output:
Size of short: 16
Size of char: 16
-1
65535
can anyone tell me why this explicit conversion gives different results,
even if size of short/char is both 16bits?
package jh;
public class Main {
public static void main(String[] args) {
byte b = (byte)255;
System.out.println("Size of short: " + Short.SIZE);
System.out.println("Size of char: " + Character.SIZE);
System.out.println((int)((short)b));
System.out.println((int)((char)b));
}
}
Output:
Size of short: 16
Size of char: 16
-1
65535
Tuesday, 17 September 2013
How to check a method executed in the unit test context?
How to check a method executed in the unit test context?
I am trying to add some features to the legacy libraries and plan to make
it testable.
I want to limit some methods allowed call in the testing context, like
change the global system configurations. Because some changes are
dangerous for production, to limit the accessablitiy is important.
I use the junit4 to test my project, any suggestions for it?
I am trying to add some features to the legacy libraries and plan to make
it testable.
I want to limit some methods allowed call in the testing context, like
change the global system configurations. Because some changes are
dangerous for production, to limit the accessablitiy is important.
I use the junit4 to test my project, any suggestions for it?
How to read in multiple lines into one array until the next line fits certain criteria in Perl?
How to read in multiple lines into one array until the next line fits
certain criteria in Perl?
If I want to read multiple lines with same elements into one array until
reaching the next line with a different element. These elements have
already been sorted so they are in the lines next to each other. For
example:
1_1111 1234
1_1111 2234
1_1111 3234
1_1112 4234
1_1112 5234
1_1112 6234
1_1112 7234
1_1113 8234
1_1113 9234
I want to read the first three lines with same element 1_1111 into one
array, process it, then read the next few lines with the same element
1_1112
certain criteria in Perl?
If I want to read multiple lines with same elements into one array until
reaching the next line with a different element. These elements have
already been sorted so they are in the lines next to each other. For
example:
1_1111 1234
1_1111 2234
1_1111 3234
1_1112 4234
1_1112 5234
1_1112 6234
1_1112 7234
1_1113 8234
1_1113 9234
I want to read the first three lines with same element 1_1111 into one
array, process it, then read the next few lines with the same element
1_1112
how to create a wrapper for jquery?
how to create a wrapper for jquery?
I've been to this thread but not found my answer. How to create a Wrapper
My question is how can I create a wrapper for jquery functions like jquery
ajax and how does it work.
I would appreciate if someone can give a fiddle or a very simple example
wrapping jquery ajax.
Thank you.
I've been to this thread but not found my answer. How to create a Wrapper
My question is how can I create a wrapper for jquery functions like jquery
ajax and how does it work.
I would appreciate if someone can give a fiddle or a very simple example
wrapping jquery ajax.
Thank you.
Display hidden css classes
Display hidden css classes
How to display hidden css classes on hover
<a>Show the first</a>
<a>Show the second</a>
<div>The first</div>
<div>The second</div>
I think it's clear
thanks!
How to display hidden css classes on hover
<a>Show the first</a>
<a>Show the second</a>
<div>The first</div>
<div>The second</div>
I think it's clear
thanks!
understanding the concept of a global variable [duplicate]
understanding the concept of a global variable [duplicate]
This question already has an answer here:
How can I access a shadowed global variable in C? 7 answers
If we have a variable "x" which is defined globally and another variable
with the same name "x" inside a function. when we print the value of "x"
why we always get the value which is assigned inside the function? Is
there any way we can print the global variable value.
int x=8;
void testCode()
{
int x=2;
printf("%d",x); //prints 2
}
This question already has an answer here:
How can I access a shadowed global variable in C? 7 answers
If we have a variable "x" which is defined globally and another variable
with the same name "x" inside a function. when we print the value of "x"
why we always get the value which is assigned inside the function? Is
there any way we can print the global variable value.
int x=8;
void testCode()
{
int x=2;
printf("%d",x); //prints 2
}
development tool to identify missed opportunity for "const"
development tool to identify missed opportunity for "const"
Since C++ compilers can (usually) detect violations of constness, are
there any tools that will identify missed opportunities for declaring
something as const?
Since C++ compilers can (usually) detect violations of constness, are
there any tools that will identify missed opportunities for declaring
something as const?
Sunday, 15 September 2013
C# TCPClient - Data Mismatch
C# TCPClient - Data Mismatch
I need some help. I have a simple server-client application using C#
TCPClient
The problem that I am having is that when a client sends a message to
server, the server returns a 4 bytes response containing an number.
But, every 3 or 4 responses the bytes are in the same wrong place.
For example:
server response with a byte array containing an integer 243:
byte[0] => 243 byte[1] => 0 byte[2] => 0 byte[3] => 0
The client receives the 4 bytes as follows:
byte[0] => 0 byte[1] => 0 byte[2] => 243 byte[3] => 0
This is an integer number of 15925248 not 243.
Here's the snippet of server code. the code executes when client sends a
message:
byte[4] resp = new byte[4]; Buffer.BlockCopy(BitConverter.GetBytes(243),
0, resp, 0, 4); clientStream.Write(resp, 0, resp.Length);
clientStream.Flush();
Here's the snippet of client code to receive:
Byte[] rec = new Byte[4] {0xx0, 0x00, 0x00, 0x00}; if (netStream.CanRead)
{ int numberOfBytesRead = 0; do { numberOfBytesRead = netStream.Read(rec,
0, rec.Length); } while (netStream.DataAvailable); }
I have done the following: - verified that the server indeed is sending
the byte array correctly.
I don't know what am I doing wrong here. Or is there a bug in my code or not.
Please help me.
I need some help. I have a simple server-client application using C#
TCPClient
The problem that I am having is that when a client sends a message to
server, the server returns a 4 bytes response containing an number.
But, every 3 or 4 responses the bytes are in the same wrong place.
For example:
server response with a byte array containing an integer 243:
byte[0] => 243 byte[1] => 0 byte[2] => 0 byte[3] => 0
The client receives the 4 bytes as follows:
byte[0] => 0 byte[1] => 0 byte[2] => 243 byte[3] => 0
This is an integer number of 15925248 not 243.
Here's the snippet of server code. the code executes when client sends a
message:
byte[4] resp = new byte[4]; Buffer.BlockCopy(BitConverter.GetBytes(243),
0, resp, 0, 4); clientStream.Write(resp, 0, resp.Length);
clientStream.Flush();
Here's the snippet of client code to receive:
Byte[] rec = new Byte[4] {0xx0, 0x00, 0x00, 0x00}; if (netStream.CanRead)
{ int numberOfBytesRead = 0; do { numberOfBytesRead = netStream.Read(rec,
0, rec.Length); } while (netStream.DataAvailable); }
I have done the following: - verified that the server indeed is sending
the byte array correctly.
I don't know what am I doing wrong here. Or is there a bug in my code or not.
Please help me.
Find duplicate lists where element order is insignificant but repeat list elements are significant
Find duplicate lists where element order is insignificant but repeat list
elements are significant
I've got an odd problem where I need to find duplicate collections of
items where the order doesn't matter but the presence of duplicate values
within a collection does matter. For example, say I have the following
list of lists:
lol = [
['red'],
['blue', 'orange'],
['orange', 'red'],
['red', 'orange'],
['red', 'red'],
['blue', 'orange', 'red'],
['red', 'orange', 'blue']
]
In my case, the unique collection would be:
unique_lol = [
['red'],
['blue', 'orange'],
['orange', 'red'],
['red', 'red'],
['blue', 'orange', 'red']
]
And the information I'm looking to obtain are the duplicate lists:
dup_lol = [
['orange', 'red'],
['blue', 'orange', 'red']
]
I don't care which duplicate is reported as the duplicate, i.e. ['orange',
'red'] vs ['red', 'orange'], just that the duplicate combination is
reported. I first tried to use a set of frozensets:
sofs = {frozenset(x) for x in lol}
However, this approach gets tripped up by the ['red', 'red'] list, which
gets converted to ['red']:
set([frozenset(['red']),
frozenset(['orange', 'red']),
frozenset(['blue', 'orange', 'red']),
frozenset(['blue', 'orange'])])
Plus, this doesn't give me the duplicates, just the unique ones, and I
cannot run difference against the list of lists anyway.
I'm sure I can iterate over the parent lists brute force style, but I feel
like I'm missing something simple. I almost need a dictionary where the
key is the ordered list, and the value is the number of times that
combination appears, but that lists cannot be dictionary keys and that
just sounds odd anyway.
elements are significant
I've got an odd problem where I need to find duplicate collections of
items where the order doesn't matter but the presence of duplicate values
within a collection does matter. For example, say I have the following
list of lists:
lol = [
['red'],
['blue', 'orange'],
['orange', 'red'],
['red', 'orange'],
['red', 'red'],
['blue', 'orange', 'red'],
['red', 'orange', 'blue']
]
In my case, the unique collection would be:
unique_lol = [
['red'],
['blue', 'orange'],
['orange', 'red'],
['red', 'red'],
['blue', 'orange', 'red']
]
And the information I'm looking to obtain are the duplicate lists:
dup_lol = [
['orange', 'red'],
['blue', 'orange', 'red']
]
I don't care which duplicate is reported as the duplicate, i.e. ['orange',
'red'] vs ['red', 'orange'], just that the duplicate combination is
reported. I first tried to use a set of frozensets:
sofs = {frozenset(x) for x in lol}
However, this approach gets tripped up by the ['red', 'red'] list, which
gets converted to ['red']:
set([frozenset(['red']),
frozenset(['orange', 'red']),
frozenset(['blue', 'orange', 'red']),
frozenset(['blue', 'orange'])])
Plus, this doesn't give me the duplicates, just the unique ones, and I
cannot run difference against the list of lists anyway.
I'm sure I can iterate over the parent lists brute force style, but I feel
like I'm missing something simple. I almost need a dictionary where the
key is the ordered list, and the value is the number of times that
combination appears, but that lists cannot be dictionary keys and that
just sounds odd anyway.
How is it possible to write CSS in Angular js?
How is it possible to write CSS in Angular js?
How is this Angular JS implementation of Bootsrap:
http://angular-ui.github.io/bootstrap/ doing all the magic of using
javascript for CSS implementation? What is happening behind the scenes for
this to be accomplished?
How is this Angular JS implementation of Bootsrap:
http://angular-ui.github.io/bootstrap/ doing all the magic of using
javascript for CSS implementation? What is happening behind the scenes for
this to be accomplished?
where condition from a comma seperated varchar in mysql and codeigniter
where condition from a comma seperated varchar in mysql and codeigniter
i have two tables called musical_types and musical_albums in which
musical_types consists of type_name and an auto increment id, where as in
the musical_albums table contains auto increment id , name , types which
is a varchar which stores the id of musical_types as comma seperated
values like 1,2,3,4 etc. So could anyone please help me in getting all the
albums of type x from musical_albums table.
I tried mysql like but it is not correct. so please help me in writing
this query..
iam using codeigniter, is it possible to write the above mentioned query
in codeigniters active record class.
Thanks in advance.
i have two tables called musical_types and musical_albums in which
musical_types consists of type_name and an auto increment id, where as in
the musical_albums table contains auto increment id , name , types which
is a varchar which stores the id of musical_types as comma seperated
values like 1,2,3,4 etc. So could anyone please help me in getting all the
albums of type x from musical_albums table.
I tried mysql like but it is not correct. so please help me in writing
this query..
iam using codeigniter, is it possible to write the above mentioned query
in codeigniters active record class.
Thanks in advance.
PHP- Domains validation separated by comma
PHP- Domains validation separated by comma
How can i validate domains separated by comma, like
site.com,site2.com,sub.site3.com which are coming from a textarea return
true or alse in PHP. thanks
if($_POST['domains'] != '')
{
//validation here
}
else
{
$check ="1";
echo "Error, You didnt enter a domain name!";
}
How can i validate domains separated by comma, like
site.com,site2.com,sub.site3.com which are coming from a textarea return
true or alse in PHP. thanks
if($_POST['domains'] != '')
{
//validation here
}
else
{
$check ="1";
echo "Error, You didnt enter a domain name!";
}
Adding multiple elements to one row c#
Adding multiple elements to one row c#
How can I add multiple element to one row of listview? I'm trying to put
gridview to my main Listview but it doesn't work.
<GridView x:Name="lvMain" ItemsSource="{Binding WallItems}">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Width="300" Height="300" Background="Transparent">
<StackPanel Margin="10,0,0,0">
<GridView x:Name="lvMain3">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Height="50" Width="50"
Background="Red">
<StackPanel Margin="10,0,0,0">
<TextBlock Text="{Binding
Src}"/>
</StackPanel>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
How can I add multiple element to one row of listview? I'm trying to put
gridview to my main Listview but it doesn't work.
<GridView x:Name="lvMain" ItemsSource="{Binding WallItems}">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Width="300" Height="300" Background="Transparent">
<StackPanel Margin="10,0,0,0">
<GridView x:Name="lvMain3">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Height="50" Width="50"
Background="Red">
<StackPanel Margin="10,0,0,0">
<TextBlock Text="{Binding
Src}"/>
</StackPanel>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
Code-Test-Code cycle in Amazong Cloud (AWS)
Code-Test-Code cycle in Amazong Cloud (AWS)
I new to Amazon AWS and want to create a cloud-based REST API in Node.js.
Usually I develop the program along with testing it. It means I write some
tests, and then write the code that makes those tests run successfully. So
in a typical programming session, I may run the tests or the app tens of
times.
When I do this locally it is easy and quick. But what if I want to do the
whole process on Amazon cloud? How does this code-test-code cycle look
like? Should I upload my code to AWS every time I make a change? And then
run it against some server address?
I read somewhere in the documentation that when I run a task for a few
minutes (for example 15min), Amazon rounds it up to 1hour. So if in a
typical development session I run my program 100 times in an hour, do I
end up paying for 100 hours? If yes, then what will be the solution to
avoid these huge costs?
I new to Amazon AWS and want to create a cloud-based REST API in Node.js.
Usually I develop the program along with testing it. It means I write some
tests, and then write the code that makes those tests run successfully. So
in a typical programming session, I may run the tests or the app tens of
times.
When I do this locally it is easy and quick. But what if I want to do the
whole process on Amazon cloud? How does this code-test-code cycle look
like? Should I upload my code to AWS every time I make a change? And then
run it against some server address?
I read somewhere in the documentation that when I run a task for a few
minutes (for example 15min), Amazon rounds it up to 1hour. So if in a
typical development session I run my program 100 times in an hour, do I
end up paying for 100 hours? If yes, then what will be the solution to
avoid these huge costs?
Saturday, 14 September 2013
C++ CreateProcess - System Error #2 can't find file - what is wrong with my file path?
C++ CreateProcess - System Error #2 can't find file - what is wrong with
my file path?
I am trying to open a pdf via firefox with CreateProcess(), I am a
beginner and know nothing about using CreateProcess, but in my last
question someone pointed out the MSDN on it... it shows that:
To run a batch file, you must start the command interpreter;
set lpApplicationName to cmd.exe and set lpCommandLine to the
following arguments: /c plus the name of the batch file.
Therefore I created a batch file that runs perfectly fine with the
system() command, there are no problems with the batch file.
I can't figure out why the system can't find the file and I don't know if
its the batch file, the exe in the batch file, the pdf doc in the batch
file or the location of cmd.exe... Any help is greatly appreciated...
void openPDF(char scansQueue[][MAX_NAME], int index)
{
// build batch file
char openPath[300];
char procCommand[MAX_NAME]="C:\\firefox";
char cmdEXE[MAX_NAME]="C:\\Windows\\System32\\cmd.exe";
fstream outfile;
outfile.open("C:\\firefox.bat");
copyCString(openPath,"\"C:\\Program Files (x86)\\Mozilla
Firefox\\firefox.exe\"");
outfile << openPath;
outfile << ' ';
copyCString(openPath,"\"C:\\Scans\\");
catArray(openPath,scansQueue[index]);
catArray(openPath,"\"");
STARTUPINFOW si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
cout<<"PROCESS ATTEMPT"<<endl;
if(!CreateProcess((LPCTSTR)cmdEXE ,(LPWSTR)procCommand, NULL, NULL, false,
0, NULL, NULL, &si, &pi))cout << GetLastError();cout<<"PROCESS FAILED TO
EXECUTE!!!";
}
my file path?
I am trying to open a pdf via firefox with CreateProcess(), I am a
beginner and know nothing about using CreateProcess, but in my last
question someone pointed out the MSDN on it... it shows that:
To run a batch file, you must start the command interpreter;
set lpApplicationName to cmd.exe and set lpCommandLine to the
following arguments: /c plus the name of the batch file.
Therefore I created a batch file that runs perfectly fine with the
system() command, there are no problems with the batch file.
I can't figure out why the system can't find the file and I don't know if
its the batch file, the exe in the batch file, the pdf doc in the batch
file or the location of cmd.exe... Any help is greatly appreciated...
void openPDF(char scansQueue[][MAX_NAME], int index)
{
// build batch file
char openPath[300];
char procCommand[MAX_NAME]="C:\\firefox";
char cmdEXE[MAX_NAME]="C:\\Windows\\System32\\cmd.exe";
fstream outfile;
outfile.open("C:\\firefox.bat");
copyCString(openPath,"\"C:\\Program Files (x86)\\Mozilla
Firefox\\firefox.exe\"");
outfile << openPath;
outfile << ' ';
copyCString(openPath,"\"C:\\Scans\\");
catArray(openPath,scansQueue[index]);
catArray(openPath,"\"");
STARTUPINFOW si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
cout<<"PROCESS ATTEMPT"<<endl;
if(!CreateProcess((LPCTSTR)cmdEXE ,(LPWSTR)procCommand, NULL, NULL, false,
0, NULL, NULL, &si, &pi))cout << GetLastError();cout<<"PROCESS FAILED TO
EXECUTE!!!";
}
Hide within a If Function
Hide within a If Function
I would like to use the hide function depending upon the selection made in
another cell, such as actual and forecast result, in a If Function, can
this be done in Excel 2010.
I would like to use the hide function depending upon the selection made in
another cell, such as actual and forecast result, in a If Function, can
this be done in Excel 2010.
Can't seem to add button to another tabpage
Can't seem to add button to another tabpage
I have a TabControl with three TabPages. On tabPage2 there is one button.
I want to click on tabPage3 and see this button. I've searched around and
the code below is susposed to work but when I click on tabPage3 from
tabPage2, I don't see the button.
I must be missing something else?
Thanks for any help...
private void tabPage3_Click(object sender, EventArgs e)
{
this.tabPage3.Controls.Add(this.button1);
}
I have a TabControl with three TabPages. On tabPage2 there is one button.
I want to click on tabPage3 and see this button. I've searched around and
the code below is susposed to work but when I click on tabPage3 from
tabPage2, I don't see the button.
I must be missing something else?
Thanks for any help...
private void tabPage3_Click(object sender, EventArgs e)
{
this.tabPage3.Controls.Add(this.button1);
}
Two output from neural network and one target
Two output from neural network and one target
Is supervised training of a neural network with 2 unknown outputs possible
where there is a relation such as y=a.x^b between known parameters (y,x)
and unknowns (a,b). here (a,b) are the outputs of network!!!
Is supervised training of a neural network with 2 unknown outputs possible
where there is a relation such as y=a.x^b between known parameters (y,x)
and unknowns (a,b). here (a,b) are the outputs of network!!!
Trying to understand foreign key syntax
Trying to understand foreign key syntax
Just starting out with SQL. I understand the idea of foreign keys just
fine, but I'm trying to learn the syntax of how to implement them and
reading the sqlite page just gives me more questions than answers. Is
there any difference in the following two lines?
CREATE TABLE child(x REFERENCES parent(id));
CREATE TABLE child(FOREIGN KEY x REFERENCES parent(id));
Also, from my understanding, columns are specified by the "table.column"
format, so I'd want to type "parent.id" above, but it seems all the
reading I've done says "parent(id)". What's the difference between the two
and why use parent.id sometimes and parent(id) others?
Are we not supposed to bind any kind of affinity (I think I'm using the
terminology correctly) to the foreign keys because it should just use
whatever the parent key uses?
I have more questions, but this is a good start. Thanks in advance for any
help!
Just starting out with SQL. I understand the idea of foreign keys just
fine, but I'm trying to learn the syntax of how to implement them and
reading the sqlite page just gives me more questions than answers. Is
there any difference in the following two lines?
CREATE TABLE child(x REFERENCES parent(id));
CREATE TABLE child(FOREIGN KEY x REFERENCES parent(id));
Also, from my understanding, columns are specified by the "table.column"
format, so I'd want to type "parent.id" above, but it seems all the
reading I've done says "parent(id)". What's the difference between the two
and why use parent.id sometimes and parent(id) others?
Are we not supposed to bind any kind of affinity (I think I'm using the
terminology correctly) to the foreign keys because it should just use
whatever the parent key uses?
I have more questions, but this is a good start. Thanks in advance for any
help!
Android screen capture delay due to writing data in the file
Android screen capture delay due to writing data in the file
I have a rooted device and i successfully capture the screenshot of
current screen.and use the below code
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new
DataOutputStream(process.getOutputStream());
os.writeBytes("/system/bin/screencap -p " + path + "; \n");`
but in the command i provide the path where i want to save the file and
system take time to write the image in the file. so I want to know can we
directly take the image data from process in the form of bytes because I
want to send the current image to the server immediately.
I have a rooted device and i successfully capture the screenshot of
current screen.and use the below code
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new
DataOutputStream(process.getOutputStream());
os.writeBytes("/system/bin/screencap -p " + path + "; \n");`
but in the command i provide the path where i want to save the file and
system take time to write the image in the file. so I want to know can we
directly take the image data from process in the form of bytes because I
want to send the current image to the server immediately.
Dynamic Array in C
Dynamic Array in C
Array by definition is a chunk of contagious memory locations. What i
understand from Dynamic is that we can allocate memory at run time. So for
Dynamic Array lets say we allocate 100 memory spaces at run time. Now we
perform some other operation and allocate few memory spaces for other
variables. Since the array we created was meant to be Dynamic so i suppose
we can add more elements t it occupying more memory spaces. But what i
fail to understand is how this is going to be contagious because the next
memory addresses are per-occupied and Arrays by definition are supposed to
be Contagious???
Array by definition is a chunk of contagious memory locations. What i
understand from Dynamic is that we can allocate memory at run time. So for
Dynamic Array lets say we allocate 100 memory spaces at run time. Now we
perform some other operation and allocate few memory spaces for other
variables. Since the array we created was meant to be Dynamic so i suppose
we can add more elements t it occupying more memory spaces. But what i
fail to understand is how this is going to be contagious because the next
memory addresses are per-occupied and Arrays by definition are supposed to
be Contagious???
Friday, 13 September 2013
Blink upon incoming call android
Blink upon incoming call android
I am developing an android app, where I want make the home screen blink
upon incoming call. I tried calling the below startblinking() method
within a activity and the screen blinks fine.
But, when I try to call the same method within the Ring state of a
phonelistener(inside a Service class), I get the following error, since
the service class doesnt have a window.
The method getWindow() is undefined for the type PhoneListener
..
private void startblinking()
{
Log.e("inside","blink MEthod");
timerforblinking.scheduleAtFixedRate(new TimerTask()
{
@Override
public void run()
{
runOnUiThread(new Runnable()
{
public void run()
{
time = (float) (time + 0.5);
if(time == 0.5 || time == 1.5 || time == 2.5 || time
== 3.5 || time == 4.5 || time == 5.5)
{
Log.e("time","OFF - time = "+time);
layoutParams.screenBrightness = (float) 30 / 255;
getWindow().setAttributes(layoutParams);
}
if(time == 1.0 || time == 2.0 ||time == 3.0 ||time ==
4.0 ||time == 5.0 )
{
Log.e("time","ON - time = "+time);
layoutParams.screenBrightness = (float)255 / 255;
getWindow().setAttributes(layoutParams);
}
if(time >= 6.0)
{
layoutParams.screenBrightness = (float)255 / 255;
getWindow().setAttributes(layoutParams);
timerforblinking.purge();
timerforblinking.cancel();
}
}
});
}
}, 0, 500);
Is there a possible workaround to achieve the screen blinking upon
incoming calls.
Please help.Thanks!
I am developing an android app, where I want make the home screen blink
upon incoming call. I tried calling the below startblinking() method
within a activity and the screen blinks fine.
But, when I try to call the same method within the Ring state of a
phonelistener(inside a Service class), I get the following error, since
the service class doesnt have a window.
The method getWindow() is undefined for the type PhoneListener
..
private void startblinking()
{
Log.e("inside","blink MEthod");
timerforblinking.scheduleAtFixedRate(new TimerTask()
{
@Override
public void run()
{
runOnUiThread(new Runnable()
{
public void run()
{
time = (float) (time + 0.5);
if(time == 0.5 || time == 1.5 || time == 2.5 || time
== 3.5 || time == 4.5 || time == 5.5)
{
Log.e("time","OFF - time = "+time);
layoutParams.screenBrightness = (float) 30 / 255;
getWindow().setAttributes(layoutParams);
}
if(time == 1.0 || time == 2.0 ||time == 3.0 ||time ==
4.0 ||time == 5.0 )
{
Log.e("time","ON - time = "+time);
layoutParams.screenBrightness = (float)255 / 255;
getWindow().setAttributes(layoutParams);
}
if(time >= 6.0)
{
layoutParams.screenBrightness = (float)255 / 255;
getWindow().setAttributes(layoutParams);
timerforblinking.purge();
timerforblinking.cancel();
}
}
});
}
}, 0, 500);
Is there a possible workaround to achieve the screen blinking upon
incoming calls.
Please help.Thanks!
Extract content of Zip file after reading Zip file from Exchange server through JavaMail
Extract content of Zip file after reading Zip file from Exchange server
through JavaMail
Here is the program which reads the content of a ZIP file.
http://www.java2s.com/Code/Java/File-Input-Output/ReadingtheContentsofaZIPFile.htm
But my problem here is this line : ZipFile zf = new
ZipFile("C:/ReadZip.zip");
In above ZipFile constructor it is passing path of the ZIP file.
In my case I don't have that ZIP file stored anywhere. In my case I am
first reading that ZIP file from the exchange email account through
JavaMail API and then I need to read the content of that ZIP file.
Through JavaMail I am able to connect to exchange and read the email and
extract the attachment and then see if that attachment is a zip file - all
that is working - now I have the zip file - how I dynamically pass to
ZipFile constructor ZipFile zf = new ZipFile("C:/ReadZip.zip");
Really appreciate your help in this. I need to get this done over the
weekend.
Thank you.
through JavaMail
Here is the program which reads the content of a ZIP file.
http://www.java2s.com/Code/Java/File-Input-Output/ReadingtheContentsofaZIPFile.htm
But my problem here is this line : ZipFile zf = new
ZipFile("C:/ReadZip.zip");
In above ZipFile constructor it is passing path of the ZIP file.
In my case I don't have that ZIP file stored anywhere. In my case I am
first reading that ZIP file from the exchange email account through
JavaMail API and then I need to read the content of that ZIP file.
Through JavaMail I am able to connect to exchange and read the email and
extract the attachment and then see if that attachment is a zip file - all
that is working - now I have the zip file - how I dynamically pass to
ZipFile constructor ZipFile zf = new ZipFile("C:/ReadZip.zip");
Really appreciate your help in this. I need to get this done over the
weekend.
Thank you.
Applescript - creating a folder if it doesn't exist
Applescript - creating a folder if it doesn't exist
Can someone please point out why this bit of Applescript isn't working?
Thanks!
on open droppedItems
tell application "Finder"
set inputFolder to (container of first item of droppedItems) as
Unicode text
if (exists folder ("converted") of inputFolder) then
set outputFolder to (inputFolder & "/converted/") as text
else
make new folder at inputFolder with properties {name:"converted"}
set outputFolder to the result as text
end if
end tell
Can someone please point out why this bit of Applescript isn't working?
Thanks!
on open droppedItems
tell application "Finder"
set inputFolder to (container of first item of droppedItems) as
Unicode text
if (exists folder ("converted") of inputFolder) then
set outputFolder to (inputFolder & "/converted/") as text
else
make new folder at inputFolder with properties {name:"converted"}
set outputFolder to the result as text
end if
end tell
Parser HTML 5 for JLabel
Parser HTML 5 for JLabel
Do you know a html version changer for JLabel or good HTML parser for
Java? I throw to make border-radius by css in JLabel, but it isn't
supported.
Do you know a html version changer for JLabel or good HTML parser for
Java? I throw to make border-radius by css in JLabel, but it isn't
supported.
Regular Expression breaking Due to line break character (\n)
Regular Expression breaking Due to line break character (\n)
I have a regex that is using a "'''.*?'''|'.*?'" pattern to look for text
between tripple quotes (''') and single quotes ('). When carriage returns
are added to the input String the regex pattern fails to read to the end
of the triple quote. Any idea how to change the regex to read to the end
of the triple tick and not break on the \n?
Works:
'''<html><head></head></html>'''
Fails:
User Entered Value:
'''<html>
<head></head>
</html>'''
Java Representation:
'''<html>\n<head></head>\n</html>'''
Parsing Logic:
public static final Pattern QUOTE_PATTERN =
Pattern.compile("'''.*?'''|'.*?'");
Matcher quoteMatcher = ContentCommonConstants.QUOTE_PATTERN.matcher(value);
int normalPos = 0, length = value.length();
while (normalPos < length && quoteMatcher.find()) {
int quotePos = quoteMatcher.start(), quoteEnd = quoteMatcher.end();
if (normalPos < quotePos) {
copyBuilder.append(stripHTML(value.substring(normalPos,
quotePos)));
}
//quoteEnd fails to read to the end due to \n
copyBuilder.append(value.substring(quotePos, quoteEnd));
normalPos = quoteEnd;
}
if (normalPos < length)
copyBuilder.append(stripHTML(value.substring(normalPos)));
I have a regex that is using a "'''.*?'''|'.*?'" pattern to look for text
between tripple quotes (''') and single quotes ('). When carriage returns
are added to the input String the regex pattern fails to read to the end
of the triple quote. Any idea how to change the regex to read to the end
of the triple tick and not break on the \n?
Works:
'''<html><head></head></html>'''
Fails:
User Entered Value:
'''<html>
<head></head>
</html>'''
Java Representation:
'''<html>\n<head></head>\n</html>'''
Parsing Logic:
public static final Pattern QUOTE_PATTERN =
Pattern.compile("'''.*?'''|'.*?'");
Matcher quoteMatcher = ContentCommonConstants.QUOTE_PATTERN.matcher(value);
int normalPos = 0, length = value.length();
while (normalPos < length && quoteMatcher.find()) {
int quotePos = quoteMatcher.start(), quoteEnd = quoteMatcher.end();
if (normalPos < quotePos) {
copyBuilder.append(stripHTML(value.substring(normalPos,
quotePos)));
}
//quoteEnd fails to read to the end due to \n
copyBuilder.append(value.substring(quotePos, quoteEnd));
normalPos = quoteEnd;
}
if (normalPos < length)
copyBuilder.append(stripHTML(value.substring(normalPos)));
Transition to a Navigation View Controller
Transition to a Navigation View Controller
I have the following code:
- (IBAction)buttonPressed:(UIButton *)sender
{
//sentder.titleLabel
NSString *label = [(UIButton *)sender currentTitle];
if ([label isEqualToString:@"Register"])
{
[sender setTitle:@"Registers" forState:UIControlStateNormal];
RegisterViewController *viewCon = [[RegisterViewController alloc]
init];
RegisterNavigationController *navigation =
[[RegisterNavigationController alloc] init];
[navigation pushViewController:viewCon animated:YES];
//self performSegueWithIdentifier:@"MySequeIdentifier" sender:];
}
....
I have a startController with the following button code that gets called
correctly. I created a brand new default registerViewController
(UIViewController) and a registerNavigationContoller
(UINavigationController class). How do I get my button click to animate to
the registerViewController and have that view controller have a bar with a
back button?
Am I doing this wrong, is the startViewController supposed to be a
UINavigationController as it's just a UIViewController? If so how do I get
rid of the top bar on this page?
I have the following code:
- (IBAction)buttonPressed:(UIButton *)sender
{
//sentder.titleLabel
NSString *label = [(UIButton *)sender currentTitle];
if ([label isEqualToString:@"Register"])
{
[sender setTitle:@"Registers" forState:UIControlStateNormal];
RegisterViewController *viewCon = [[RegisterViewController alloc]
init];
RegisterNavigationController *navigation =
[[RegisterNavigationController alloc] init];
[navigation pushViewController:viewCon animated:YES];
//self performSegueWithIdentifier:@"MySequeIdentifier" sender:];
}
....
I have a startController with the following button code that gets called
correctly. I created a brand new default registerViewController
(UIViewController) and a registerNavigationContoller
(UINavigationController class). How do I get my button click to animate to
the registerViewController and have that view controller have a bar with a
back button?
Am I doing this wrong, is the startViewController supposed to be a
UINavigationController as it's just a UIViewController? If so how do I get
rid of the top bar on this page?
Thursday, 12 September 2013
Returning a response in Flask
Returning a response in Flask
I have a code like this
def find_user(user_id):
if not users.lookup(user_id):
return jsonify(success=False, reason="not found")
else:
return users.lookup(user_id)
@app.route(...)
def view1(...):
user = find_user(...)
if user:
do_something
return jsonify(success=True, ....)
The point is I have a helper function and if condition is met I want to
return the response right away. In this case if user is not found, I want
to return a request stating the request failed and give a reason.
The problem is because the function can also return some other values (say
a user object) .
Ideally this is the longer code
def view(...)
user = users.lookup(user_id)
if not user:
return jsonify(success=False....)
# if user is true, do something else
The whole point of the helper function find_user is to extract out common
code and then reuse in a few other similar apis.
Is there a way to return the response directly? It seems like this is a
deadend... unless I change how the code is written (how values are
returned...)
I have a code like this
def find_user(user_id):
if not users.lookup(user_id):
return jsonify(success=False, reason="not found")
else:
return users.lookup(user_id)
@app.route(...)
def view1(...):
user = find_user(...)
if user:
do_something
return jsonify(success=True, ....)
The point is I have a helper function and if condition is met I want to
return the response right away. In this case if user is not found, I want
to return a request stating the request failed and give a reason.
The problem is because the function can also return some other values (say
a user object) .
Ideally this is the longer code
def view(...)
user = users.lookup(user_id)
if not user:
return jsonify(success=False....)
# if user is true, do something else
The whole point of the helper function find_user is to extract out common
code and then reuse in a few other similar apis.
Is there a way to return the response directly? It seems like this is a
deadend... unless I change how the code is written (how values are
returned...)
NoClassDefFoundError, jar is present
NoClassDefFoundError, jar is present
I am attempting to use the com.integralblue.HttpResponseCache
compatibility library with my Android application. I have copied its jar
file together with its dependency, com.jakewharton.disklrucache, into the
"libs" folder of my project.
When running the program, any call on HttpResponseCache causes the program
to fail with a NoClassDefFoundError on com.jakewharton.disklrucache. Both
JARs are present in the libs folder and can be imported. Google search
turns up absolutely nothing.
How do I solve a NoClassDefFoundError when all required JARs are present?
I am attempting to use the com.integralblue.HttpResponseCache
compatibility library with my Android application. I have copied its jar
file together with its dependency, com.jakewharton.disklrucache, into the
"libs" folder of my project.
When running the program, any call on HttpResponseCache causes the program
to fail with a NoClassDefFoundError on com.jakewharton.disklrucache. Both
JARs are present in the libs folder and can be imported. Google search
turns up absolutely nothing.
How do I solve a NoClassDefFoundError when all required JARs are present?
How do I add/edit CSS attributes in IE8 running on a VM?
How do I add/edit CSS attributes in IE8 running on a VM?
If I go into the dev tools, I can see the CSS but I can't seem to be able
to add any or edit the current CSS like I can in Chrome or Firebug. Any
suggestions?
If I go into the dev tools, I can see the CSS but I can't seem to be able
to add any or edit the current CSS like I can in Chrome or Firebug. Any
suggestions?
JavaScript How to make an image to change color onmouseover?
JavaScript How to make an image to change color onmouseover?
I have a button and an image and want them to change color onmouseover.
The button changes color fine:
<script>
function secondColor(x) {
x.style.color="#000000";
}
function firstColor(x) {
x.style.color="#ffaacc";
}
</script>
<input onmouseover="secondColor(this)" onmouseout="firstColor(this)"
type="submit"><br>
How can I do the same thing with the image? Is there any way:
<img src="..." ......
Or do I have to have a second image to replace the first one onmouseover
and this is the only way?
I have a button and an image and want them to change color onmouseover.
The button changes color fine:
<script>
function secondColor(x) {
x.style.color="#000000";
}
function firstColor(x) {
x.style.color="#ffaacc";
}
</script>
<input onmouseover="secondColor(this)" onmouseout="firstColor(this)"
type="submit"><br>
How can I do the same thing with the image? Is there any way:
<img src="..." ......
Or do I have to have a second image to replace the first one onmouseover
and this is the only way?
Alter python descriptor
Alter python descriptor
I've this python descriptor:
# Date Descriptor
class DateAttribute():
def __init__(self, value=None):
self.value = value
def __get__(self, instance, value):
return self.value
def __set__(self, instance, value):
if type(value) is not datetime.date:
raise TypeError('A date value is expected')
self.value = value
and a class D that use this descriptor:
class D:
thisdate = DateAttribute
I use this class as: x = D() x.thisdate = datetime.date(2012, 9, 12)
I wish to extend the descriptor to give me formatted results in some ways.
Es.
x.thisdate.format1
>>> '2012 9 12'
x.thisdate.format2
>>> '2012___9___12'
x.thisdate.format3
>>> '2012####9####12'
.....
I could do this ?
Thanks
I've this python descriptor:
# Date Descriptor
class DateAttribute():
def __init__(self, value=None):
self.value = value
def __get__(self, instance, value):
return self.value
def __set__(self, instance, value):
if type(value) is not datetime.date:
raise TypeError('A date value is expected')
self.value = value
and a class D that use this descriptor:
class D:
thisdate = DateAttribute
I use this class as: x = D() x.thisdate = datetime.date(2012, 9, 12)
I wish to extend the descriptor to give me formatted results in some ways.
Es.
x.thisdate.format1
>>> '2012 9 12'
x.thisdate.format2
>>> '2012___9___12'
x.thisdate.format3
>>> '2012####9####12'
.....
I could do this ?
Thanks
Using ASPxGridView1_DataBinding
Using ASPxGridView1_DataBinding
I want to use ASPxGridView1_DataBinding
protected void ASPxGridView1_DataBinding(object sender, EventArgs e) {
// in this event I want to reach LabelText and modify it as "text
=Server.HtmlDecode(text);" }
Bu I can not reach LabelText. I tried to find a solution but never found.
Please help me. I am stuck ....
<dx:GridViewDataColumn VisibleIndex="0" Width="100%"
CellStyle-HorizontalAlign="Left" CellStyle-VerticalAlign="Middle"
Caption=" "> <EditFormSettings Visible="False" /> <DataItemTemplate>
<table class="table_white"> <tr> <td style="text-align:left">
<asp:Label ID="LabelName" runat="server" Text='<%#Eval("name")
%>'></asp:Label>
</td> </tr> <tr> <td style="text-align:left"> <asp:Label ID="LabelText"
runat="server" Text='<%#Eval("text") %>'></asp:Label>
</td> </tr> <tr> <td style="text-align:left">
<hr style="border: 1px solid #CCCCCC" />
</td> </tr> </table> </DataItemTemplate>
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
</dx:GridViewDataColumn>
I want to use ASPxGridView1_DataBinding
protected void ASPxGridView1_DataBinding(object sender, EventArgs e) {
// in this event I want to reach LabelText and modify it as "text
=Server.HtmlDecode(text);" }
Bu I can not reach LabelText. I tried to find a solution but never found.
Please help me. I am stuck ....
<dx:GridViewDataColumn VisibleIndex="0" Width="100%"
CellStyle-HorizontalAlign="Left" CellStyle-VerticalAlign="Middle"
Caption=" "> <EditFormSettings Visible="False" /> <DataItemTemplate>
<table class="table_white"> <tr> <td style="text-align:left">
<asp:Label ID="LabelName" runat="server" Text='<%#Eval("name")
%>'></asp:Label>
</td> </tr> <tr> <td style="text-align:left"> <asp:Label ID="LabelText"
runat="server" Text='<%#Eval("text") %>'></asp:Label>
</td> </tr> <tr> <td style="text-align:left">
<hr style="border: 1px solid #CCCCCC" />
</td> </tr> </table> </DataItemTemplate>
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
</dx:GridViewDataColumn>
regex to check email ids
regex to check email ids
I am new to regex. I am checking email ids using regex.
Following is my code to match <xyz@xyz.com> with xyz@xyz.com
Pattern p = Pattern.compile("\\<(.*?)\\>");
Matcher m = p.matcher("<xyz@xyz.com>");
And its working fine. Now I want to match either <xyz@xyz.com> or
[xyz@xyz.com] with xyz@xyz.com.
Any suggestion will be appreciated.
I am new to regex. I am checking email ids using regex.
Following is my code to match <xyz@xyz.com> with xyz@xyz.com
Pattern p = Pattern.compile("\\<(.*?)\\>");
Matcher m = p.matcher("<xyz@xyz.com>");
And its working fine. Now I want to match either <xyz@xyz.com> or
[xyz@xyz.com] with xyz@xyz.com.
Any suggestion will be appreciated.
how to code for checkbox to get pattern output explain below
how to code for checkbox to get pattern output explain below
In my c# project i need one thing
I have 12 check boxes for 12 items from that user can check random any no.
of checkboxes.
now suppose i have checked chk boxes 3,4,5,6,8,10,11,12.
then it wolud be show me like
you have selected items 3-6,8,10-12.
it means when the group of item is 3 or more than 3 than it has to written
like above example shown.
In my c# project i need one thing
I have 12 check boxes for 12 items from that user can check random any no.
of checkboxes.
now suppose i have checked chk boxes 3,4,5,6,8,10,11,12.
then it wolud be show me like
you have selected items 3-6,8,10-12.
it means when the group of item is 3 or more than 3 than it has to written
like above example shown.
Wednesday, 11 September 2013
Decipher - Excessive wake lock
Decipher - Excessive wake lock
I am getting message in log as below and then app is dying:
Excessive wake lock in domain.mobile.app.MusicPlayer pid zzz held xxxx
during yyyy
My application is a music player. I didn't obtain any wake lock in initial
version and player kept playing for hours without any stop. Then I decide
to make things clever and added the wake lock. So far so good, player
didn't change playing pattern if I play big music fragment for example CD
image with duration of 74 minutes. However if I split the images on tracks
and release and obtain lock for every separate track, I am getting a
message as in subject approximately after 30 minutes playiback and my
application gets ejected. As work around I can simply return to my
original idea to do not use the lock. However I obtained a curiosity why
it behaves in this way and what numbers in error message mean, perhaps it
will give me some clue. more details : I am obtaining PARTIAL_WAKE_LOCK
once and then play with acquire and release during track changing.
Interesting that some gentleman was complaining about stopping app doing
network communication here Application running in background getting
closed due to Excessive Wake lock error I have a solution for him, since
in my cases phone can keep connection in active state for hours, but
unfortunately I am black out from answering questions.
Attention experts moderators of the system, I highly respect your
experience and unbelievable brain power but be even smarter and do not try
to point me to some other questions and tell it is duplicate, ok?
I am getting message in log as below and then app is dying:
Excessive wake lock in domain.mobile.app.MusicPlayer pid zzz held xxxx
during yyyy
My application is a music player. I didn't obtain any wake lock in initial
version and player kept playing for hours without any stop. Then I decide
to make things clever and added the wake lock. So far so good, player
didn't change playing pattern if I play big music fragment for example CD
image with duration of 74 minutes. However if I split the images on tracks
and release and obtain lock for every separate track, I am getting a
message as in subject approximately after 30 minutes playiback and my
application gets ejected. As work around I can simply return to my
original idea to do not use the lock. However I obtained a curiosity why
it behaves in this way and what numbers in error message mean, perhaps it
will give me some clue. more details : I am obtaining PARTIAL_WAKE_LOCK
once and then play with acquire and release during track changing.
Interesting that some gentleman was complaining about stopping app doing
network communication here Application running in background getting
closed due to Excessive Wake lock error I have a solution for him, since
in my cases phone can keep connection in active state for hours, but
unfortunately I am black out from answering questions.
Attention experts moderators of the system, I highly respect your
experience and unbelievable brain power but be even smarter and do not try
to point me to some other questions and tell it is duplicate, ok?
Android imageview cut off on phone
Android imageview cut off on phone
in the xml graphic layout everything looks fine but on the phone a peace
gets cut-off anyone know why, been at it for hours?
graphic layout: http://i.imgur.com/YDLBkdN.png
on phone: http://i.imgur.com/w7EXjSB.png
This is my xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<EditText
android:id="@id/klacht"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/send"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@id/email"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="@id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/naam"
android:layout_alignBottom="@id/naam"
android:layout_alignLeft="@id/textView2"
android:layout_marginRight="5.0dip"
android:text="Naam: " />
<TextView
android:id="@id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/email"
android:layout_alignBottom="@id/email"
android:layout_alignLeft="@id/klacht"
android:text="Email: " />
<ImageView
android:id="@id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/tflogo" />
<TextView
android:id="@id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageView2"
android:layout_marginTop="10.0dip"
android:gravity="center"
android:text="Je bent niet verplicht je naam in te vullen als je
anoniem wilt blijven. Vergeet niet je e-mail te vermelden als je een
terugkoppeling wilt." />
<Button
android:id="@id/send"
android:layout_width="150.0dip"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Verstuur" />
<EditText
android:id="@id/email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/naam"
android:layout_alignRight="@id/klacht"
android:layout_below="@id/naam"
android:ems="10"
android:hint="Als je terugkoppeling wilt"
android:inputType="textEmailAddress" />
<EditText
android:id="@id/naam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/textView2"
android:layout_below="@id/textView2"
android:layout_marginTop="18.0dip"
android:layout_toRightOf="@id/textView1"
android:ems="10"
android:hint="Niet verplicht"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<ImageView
android:id="@id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/imageView1"
android:layout_below="@id/imageView1"
android:layout_marginTop="2.0dip"
android:src="@drawable/tflogosub" />
in the xml graphic layout everything looks fine but on the phone a peace
gets cut-off anyone know why, been at it for hours?
graphic layout: http://i.imgur.com/YDLBkdN.png
on phone: http://i.imgur.com/w7EXjSB.png
This is my xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<EditText
android:id="@id/klacht"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/send"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@id/email"
android:ems="10"
android:inputType="textMultiLine" />
<TextView
android:id="@id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/naam"
android:layout_alignBottom="@id/naam"
android:layout_alignLeft="@id/textView2"
android:layout_marginRight="5.0dip"
android:text="Naam: " />
<TextView
android:id="@id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/email"
android:layout_alignBottom="@id/email"
android:layout_alignLeft="@id/klacht"
android:text="Email: " />
<ImageView
android:id="@id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/tflogo" />
<TextView
android:id="@id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageView2"
android:layout_marginTop="10.0dip"
android:gravity="center"
android:text="Je bent niet verplicht je naam in te vullen als je
anoniem wilt blijven. Vergeet niet je e-mail te vermelden als je een
terugkoppeling wilt." />
<Button
android:id="@id/send"
android:layout_width="150.0dip"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Verstuur" />
<EditText
android:id="@id/email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/naam"
android:layout_alignRight="@id/klacht"
android:layout_below="@id/naam"
android:ems="10"
android:hint="Als je terugkoppeling wilt"
android:inputType="textEmailAddress" />
<EditText
android:id="@id/naam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/textView2"
android:layout_below="@id/textView2"
android:layout_marginTop="18.0dip"
android:layout_toRightOf="@id/textView1"
android:ems="10"
android:hint="Niet verplicht"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<ImageView
android:id="@id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/imageView1"
android:layout_below="@id/imageView1"
android:layout_marginTop="2.0dip"
android:src="@drawable/tflogosub" />
radio button "Checked" option not working
radio button "Checked" option not working
Could you please help me why my checked option in the following code is
not working?
<div class="span1">
<h7> Sex</h7>
<label class="radio">
<input id="pccf_sexMF" name="pccf_sexMF" value="M" type="radio"
checked class="span1" > M
</label>
<label class="radio">
<input id="sexMF" name="pccf_sexMF" value="F" type="radio"
class="span1"> F
</label>
</div>
Thanks
Could you please help me why my checked option in the following code is
not working?
<div class="span1">
<h7> Sex</h7>
<label class="radio">
<input id="pccf_sexMF" name="pccf_sexMF" value="M" type="radio"
checked class="span1" > M
</label>
<label class="radio">
<input id="sexMF" name="pccf_sexMF" value="F" type="radio"
class="span1"> F
</label>
</div>
Thanks
Pros and Cons between centralized and distributed team for version control
Pros and Cons between centralized and distributed team for version control
I am trying to implement a version control (most likely using Apache SVN)
for my team (me and about 3 others). We would be working on the same
network (even from home because we would VPN in) and was wondering which
kind of deployment would be the best: centralized or distributed
deployment? ANy pros and cons for this? feedback? thanks!
I am trying to implement a version control (most likely using Apache SVN)
for my team (me and about 3 others). We would be working on the same
network (even from home because we would VPN in) and was wondering which
kind of deployment would be the best: centralized or distributed
deployment? ANy pros and cons for this? feedback? thanks!
I want to delete a worksheet when I delete a row in another worksheet (EXCEL 2007)
I want to delete a worksheet when I delete a row in another worksheet
(EXCEL 2007)
In my workbook, I have a worksheet that contains a list of form-names,
with each form-name in a separate row. For each of these rows, there is a
separate worksheet with that form-name containing information about that
form.
I would like to include this functionality:
When the user deletes a row from the first worksheet, the corresponding
worksheet is also deleted.
My initial approach tried using the Worksheet_Change event to trigger code
to capture the form-name from the row deleted, and then to delete the
worksheet with that name, but I cannot capture that data since the row is
already deleted.
Is this functionality possible? Thanks.
(EXCEL 2007)
In my workbook, I have a worksheet that contains a list of form-names,
with each form-name in a separate row. For each of these rows, there is a
separate worksheet with that form-name containing information about that
form.
I would like to include this functionality:
When the user deletes a row from the first worksheet, the corresponding
worksheet is also deleted.
My initial approach tried using the Worksheet_Change event to trigger code
to capture the form-name from the row deleted, and then to delete the
worksheet with that name, but I cannot capture that data since the row is
already deleted.
Is this functionality possible? Thanks.
How to run Unit Tests in Angular with dependency on a global
How to run Unit Tests in Angular with dependency on a global
I'm trying to use a i18n module called lingua in a new angular project
(based on ng-boiletplate). You can find this module and a short
instruction on github
I think it's a great approach bringing gettext style i18n to angular. The
integration as mentioned on the github readme did work flawlessly.
But with the integration as it is, based on a manual bootstrap of angular
I'm not able to run my tests.
angular.element(document).ready(function() {
Lingua.init(document, function() {
angular.bootstrap(document, ['modulename']);
});
});
My project is at the moment based on the angular phonecat tutorial. Ang
when running the tests I get this error because of the global i18n which
should be declared in the "Lingua.init" method before the bootstrap of
angular.
ReferenceError: i18n is not defined in /path/to/lingua/lingua.js (line 54)
Is there a possibility to run that custom bootstrap before the tests get
executed? Or is there a way to mock the global?
I'm pretty new to angular, but i realy like the gettext style compared to
other i18n modules for angular out there.
I'm in hope someone can give me a hint, because this problem is annoying
me for days now ;-(
I'm trying to use a i18n module called lingua in a new angular project
(based on ng-boiletplate). You can find this module and a short
instruction on github
I think it's a great approach bringing gettext style i18n to angular. The
integration as mentioned on the github readme did work flawlessly.
But with the integration as it is, based on a manual bootstrap of angular
I'm not able to run my tests.
angular.element(document).ready(function() {
Lingua.init(document, function() {
angular.bootstrap(document, ['modulename']);
});
});
My project is at the moment based on the angular phonecat tutorial. Ang
when running the tests I get this error because of the global i18n which
should be declared in the "Lingua.init" method before the bootstrap of
angular.
ReferenceError: i18n is not defined in /path/to/lingua/lingua.js (line 54)
Is there a possibility to run that custom bootstrap before the tests get
executed? Or is there a way to mock the global?
I'm pretty new to angular, but i realy like the gettext style compared to
other i18n modules for angular out there.
I'm in hope someone can give me a hint, because this problem is annoying
me for days now ;-(
Perl Old Number of Element in Hash Assignment Error
Perl Old Number of Element in Hash Assignment Error
I was learning Perl Objects. I wrote a simple constructor in a module file
my_module.pm:
#!/usr/bin/perl -w
#
package my_module;
use strict;
use warnings;
use diagnostics;
sub new {
my $class = shift;
my %params = @_;
my $self=bless{
_para1=>$params{'mypara1'},
_para2=>$params{'mypara2'}
},$class;
return $self;
}
1;
and I am creating an object in a main file main.pl:
#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use lib::my_module;
sub _start(){
print "Main Function Started\n";
create_schedules::new(
'mypara1' => 'This is mypara1',
'mypara2' => 'This is mypara2',
);
}
_start();
As soon as I run main.pl, I got following error:
Main Function Started
Odd number of elements in hash assignment at lib/create_schedules.pm line
9 (#1)
(W misc) You specified an odd number of elements to initialize a hash,
which is odd, because hashes come in key/value pairs.
I was learning Perl Objects. I wrote a simple constructor in a module file
my_module.pm:
#!/usr/bin/perl -w
#
package my_module;
use strict;
use warnings;
use diagnostics;
sub new {
my $class = shift;
my %params = @_;
my $self=bless{
_para1=>$params{'mypara1'},
_para2=>$params{'mypara2'}
},$class;
return $self;
}
1;
and I am creating an object in a main file main.pl:
#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use lib::my_module;
sub _start(){
print "Main Function Started\n";
create_schedules::new(
'mypara1' => 'This is mypara1',
'mypara2' => 'This is mypara2',
);
}
_start();
As soon as I run main.pl, I got following error:
Main Function Started
Odd number of elements in hash assignment at lib/create_schedules.pm line
9 (#1)
(W misc) You specified an odd number of elements to initialize a hash,
which is odd, because hashes come in key/value pairs.
Unique device identification
Unique device identification
We are developing in-house web-based application for viewing data reports
while targeting on smartphones and tablets. Our customer asked us for
possibility that only certain devices could access the content. Hence we
use technologies based on javascript/HTML5 we are no capable of reading
unique ID like IMEI or device uuid. The idea is to be able to automaticly
create time-independent fingreprint of device with abovementioned
technologies.
The question is are we able to create unique device fingerprint with
javascript/HTML5?
The clue might be information available or known by browser (e.g.
http://browserspy.dk/)
We are developing in-house web-based application for viewing data reports
while targeting on smartphones and tablets. Our customer asked us for
possibility that only certain devices could access the content. Hence we
use technologies based on javascript/HTML5 we are no capable of reading
unique ID like IMEI or device uuid. The idea is to be able to automaticly
create time-independent fingreprint of device with abovementioned
technologies.
The question is are we able to create unique device fingerprint with
javascript/HTML5?
The clue might be information available or known by browser (e.g.
http://browserspy.dk/)
Datepicker for dynamically generated text boxes
Datepicker for dynamically generated text boxes
I have a scenario like this,
for( int i=0; i < 5; i++)
{
<input type="text" id="t"+i val=""/>
}
I want date picker for all the text boxes...How..?
I have a scenario like this,
for( int i=0; i < 5; i++)
{
<input type="text" id="t"+i val=""/>
}
I want date picker for all the text boxes...How..?
Tuesday, 10 September 2013
xdocument parsing C# specific fields
xdocument parsing C# specific fields
hey guys im trying to parse a xml document . i have attached the xml
schema for that
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="ArrayOfCourse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Course">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="codeField" type="xsd:string" />
<xsd:element name="semesterField" type="xsd:string" />
<xsd:element name="titleField" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
im trying to choose the course name, course id, and the semester taught
im lost on how to using choose specific fields for every course
do i loop through every elements and store those into strings?
hey guys im trying to parse a xml document . i have attached the xml
schema for that
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="ArrayOfCourse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Course">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="codeField" type="xsd:string" />
<xsd:element name="semesterField" type="xsd:string" />
<xsd:element name="titleField" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
im trying to choose the course name, course id, and the semester taught
im lost on how to using choose specific fields for every course
do i loop through every elements and store those into strings?
Visual Studio 2012 & ODP.NET
Visual Studio 2012 & ODP.NET
I'm trying to create an ASP.NET application to connect to an Oracle DB. I
have installed Oracle Client & ODAC, but when I try to add a new
connection (Via 'Add Connection' in VS) I do not see an option for
ODP.NET.
Any suggestions? I have also been having some real difficulty with my
Oracle OUI becoming invisible when I try to start it, so I have to run
'setup.exe' via command line with a -jreLoc pointer. Pain.
I'm trying to create an ASP.NET application to connect to an Oracle DB. I
have installed Oracle Client & ODAC, but when I try to add a new
connection (Via 'Add Connection' in VS) I do not see an option for
ODP.NET.
Any suggestions? I have also been having some real difficulty with my
Oracle OUI becoming invisible when I try to start it, so I have to run
'setup.exe' via command line with a -jreLoc pointer. Pain.
jQuery ajax returning unexpected data type
jQuery ajax returning unexpected data type
attempting to implement some server side error checking for input in the
very useful "handsontable" jscript library.
the following call works great:
jQuery.ajax({
url: "index.php?option=com_catalogscontroller=batchsave",
data: {"formData": querydata.getData().splice( 0, 1 ) },
dataType: 'JSON',
type: 'POST',
success: function ( response ) {
if( response.success ) {
} else {
querydata.loadData( response.data );
}
}
});
I thought the most effective way to do error checking is on the server
(PHP) side, to create a multidimensional array to track any errors
discovered by the server and then return that array with the form data in
the same ajax call. So I modified the server code to return both the form
data and the error array back to the javascript ajax call. i.e.:
if( !empty( $errors ) ) // $errors is an multi dimensional array same size
as the form data
$result['success'] = false;
$result['msg'] = 'There were errors detected';
$result['data']['form'] = $formData;
$result['data']['errors'] = $errors;
}
echo json_encode( $result );
and then on the client side, the javascript routine above has been
modified to:
jQuery.ajax({
url: "index.php?option=com_catalogscontroller=batchsave",
data: {"formData": querydata.getData().splice( 0, 1 ) },
dataType: 'JSON',
type: 'POST',
success: function ( response ) {
if( response.success ) {
} else {
formErrors = response.data.errors; // formErrors is a global
querydata.loadData( response.data.form );
}
}
});
The original function of the form is preserved (the form data is retrieved
and properly inserted in the html), but formErrors returns with a result
to me that is baffling. An alert immediately after the assignment 'alert(
formErrors )' shows something like a list:
true,true,false,true,true
and I can also alert on a specific index without problem e.g. alert(
formErrors[0][2] ); would display 'false'. But outside of the ajax call,
the array seems to be inaccessible, giving 'undefined' errors. And both in
the ajax call, and in routines outside of the ajax call alert( typeof
formErrors ) displays 'object' and alert( formErrors) gives the same comma
list as above, but I don't want an object, I am expecting an array OR i'd
be happy with an object as long as i could access it by indices. What am I
missing here?
attempting to implement some server side error checking for input in the
very useful "handsontable" jscript library.
the following call works great:
jQuery.ajax({
url: "index.php?option=com_catalogscontroller=batchsave",
data: {"formData": querydata.getData().splice( 0, 1 ) },
dataType: 'JSON',
type: 'POST',
success: function ( response ) {
if( response.success ) {
} else {
querydata.loadData( response.data );
}
}
});
I thought the most effective way to do error checking is on the server
(PHP) side, to create a multidimensional array to track any errors
discovered by the server and then return that array with the form data in
the same ajax call. So I modified the server code to return both the form
data and the error array back to the javascript ajax call. i.e.:
if( !empty( $errors ) ) // $errors is an multi dimensional array same size
as the form data
$result['success'] = false;
$result['msg'] = 'There were errors detected';
$result['data']['form'] = $formData;
$result['data']['errors'] = $errors;
}
echo json_encode( $result );
and then on the client side, the javascript routine above has been
modified to:
jQuery.ajax({
url: "index.php?option=com_catalogscontroller=batchsave",
data: {"formData": querydata.getData().splice( 0, 1 ) },
dataType: 'JSON',
type: 'POST',
success: function ( response ) {
if( response.success ) {
} else {
formErrors = response.data.errors; // formErrors is a global
querydata.loadData( response.data.form );
}
}
});
The original function of the form is preserved (the form data is retrieved
and properly inserted in the html), but formErrors returns with a result
to me that is baffling. An alert immediately after the assignment 'alert(
formErrors )' shows something like a list:
true,true,false,true,true
and I can also alert on a specific index without problem e.g. alert(
formErrors[0][2] ); would display 'false'. But outside of the ajax call,
the array seems to be inaccessible, giving 'undefined' errors. And both in
the ajax call, and in routines outside of the ajax call alert( typeof
formErrors ) displays 'object' and alert( formErrors) gives the same comma
list as above, but I don't want an object, I am expecting an array OR i'd
be happy with an object as long as i could access it by indices. What am I
missing here?
Java script : How to find setInterval function is now running or timedout?
Java script : How to find setInterval function is now running or timedout?
In my project I use two setInterval functions, One function is running all
time. The second function is start and stop dynamically according to
keyboard input. How to find state(Running or Timeout) of setInterval
funcion?
In my project I use two setInterval functions, One function is running all
time. The second function is start and stop dynamically according to
keyboard input. How to find state(Running or Timeout) of setInterval
funcion?
more then one jquery calculate on same page
more then one jquery calculate on same page
I need some help running two jquery.calculation on the same page, in my
example only the 2nd table is working, I have added the script 2x and have
renamed all the elements but it's not working.
When I remove the 2nd script the 1st one is working. When I add the 2nd
script the first one stops.
I understand that somehow these 2 scripts need to be combine but I really
do not know how.
Thank you.
Here is an example: jsfiddle example
<script>
$(document).ready(function() {
$("#idPluginVersion").text($.Calculation.version);
$("[name^=qty_]").bind("change keyup", recalc);
$("[name^=aantal_]").bind("change keyup", recalc);
$("[name^=price_]").bind("change keyup", recalc);
$("[name^=bedrag_]").bind("change keyup", recalc);
recalc();
});
function recalc() {
$("[id^=total_item]").calc(
"((qty * price) + (aantal * bedrag))",
{
qty: $("[name^=qty_]"),
aantal: $("[name^=aantal_]"),
price: $("[id^=price_]"),
bedrag: $("[id^=bedrag_]")
},
function (s) {
return s.toFixed(2);
},
function ($this) {
var sum = $this.sum();
$("#subTotal").val( sum.toFixed(2) );
}
);
}
</script>
<script>
$(document).ready(function() {
$("#idPluginVersion").text($.Calculation.version);
$("[name^=qty2_]").bind("change keyup", recalc);
$("[name^=aantal2_]").bind("change keyup", recalc);
$("[name^=price2_]").bind("change keyup", recalc);
$("[name^=bedrag2_]").bind("change keyup", recalc);
recalc();
});
function recalc() {
$("[id^=total2_item]").calc(
"((qty2 * price2) + (aantal2 * bedrag2))",
{
qty2: $("[name^=qty2_]"),
aantal2: $("[name^=aantal2_]"),
price2: $("[id^=price2_]"),
bedrag2: $("[id^=bedrag2_]")
},
function (s) {
return s.toFixed(2);
},
);
}
</script>
I need some help running two jquery.calculation on the same page, in my
example only the 2nd table is working, I have added the script 2x and have
renamed all the elements but it's not working.
When I remove the 2nd script the 1st one is working. When I add the 2nd
script the first one stops.
I understand that somehow these 2 scripts need to be combine but I really
do not know how.
Thank you.
Here is an example: jsfiddle example
<script>
$(document).ready(function() {
$("#idPluginVersion").text($.Calculation.version);
$("[name^=qty_]").bind("change keyup", recalc);
$("[name^=aantal_]").bind("change keyup", recalc);
$("[name^=price_]").bind("change keyup", recalc);
$("[name^=bedrag_]").bind("change keyup", recalc);
recalc();
});
function recalc() {
$("[id^=total_item]").calc(
"((qty * price) + (aantal * bedrag))",
{
qty: $("[name^=qty_]"),
aantal: $("[name^=aantal_]"),
price: $("[id^=price_]"),
bedrag: $("[id^=bedrag_]")
},
function (s) {
return s.toFixed(2);
},
function ($this) {
var sum = $this.sum();
$("#subTotal").val( sum.toFixed(2) );
}
);
}
</script>
<script>
$(document).ready(function() {
$("#idPluginVersion").text($.Calculation.version);
$("[name^=qty2_]").bind("change keyup", recalc);
$("[name^=aantal2_]").bind("change keyup", recalc);
$("[name^=price2_]").bind("change keyup", recalc);
$("[name^=bedrag2_]").bind("change keyup", recalc);
recalc();
});
function recalc() {
$("[id^=total2_item]").calc(
"((qty2 * price2) + (aantal2 * bedrag2))",
{
qty2: $("[name^=qty2_]"),
aantal2: $("[name^=aantal2_]"),
price2: $("[id^=price2_]"),
bedrag2: $("[id^=bedrag2_]")
},
function (s) {
return s.toFixed(2);
},
);
}
</script>
How to Bind points on to the wpf Area chart using generic list databinding in wpf
How to Bind points on to the wpf Area chart using generic list databinding
in wpf
I am working on WPF using c#. I am trying to display WPF Area chart with
values using WPF Toolkit. I have followed the CodeProject's KB Article and
write it like,
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" x:Class="WpfChart.MainWindow"
Title="MainWindow" Height="621.053" Width="873.684">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto" Margin="0,-28,0,28">
<Grid Height="921">
<DVC:Chart x:Name="areaChart" Title="Chart Title"
VerticalAlignment="Top" Margin="33,73,24,0" Height="582"
Background="White" >
<DVC:AreaSeries DependentValuePath="Value"
IndependentValuePath="Key" ItemsSource="{Binding}"
IsSelectionEnabled="True" Title="Weeks of
Gestation"></DVC:AreaSeries>
<DVC:Chart.Palette>
<DV:ResourceDictionaryCollection>
<ResourceDictionary>
<Style x:Key="DataPointStyle"
TargetType="Control">
<Setter Property="Background"
Value="Firebrick" />
<Setter Property="BorderBrush"
Value="Black" />
</Style>
</ResourceDictionary>
</DV:ResourceDictionaryCollection>
</DVC:Chart.Palette>
<DVC:Chart.Axes>
<!-- Add Horizontal and Vertical Axes-->
<DVC:LinearAxis ShowGridLines="True"
Orientation="Y"
Title="Y Axis Title"
Interval="5" Maximum="45" Minimum="-5"
Foreground="Black"
FontFamily="Arial Black"
FontSize="16"
FontWeight="Bold"
/>
<DVC:LinearAxis ShowGridLines="True"
Orientation="X"
Title="X-Axis Title"
Interval="4" Minimum="0" Maximum="40"
Foreground="Black"
FontFamily="Arial Black"
FontSize="16"
FontWeight="Bold"
/>
</DVC:Chart.Axes>
</DVC:Chart>
</Grid>
</ScrollViewer>
</Window>
and i write code for initialization chart data like,
private void LoadAreaChartData()
{
((AreaSeries)areaChart.Series[0]).ItemsSource =
new KeyValuePair<string, int>[]{
new KeyValuePair<string, int>("3", 5)
};
}
But it does not map the points on to the chart. I need to map the point on
to the chart like,
(X,Y)--(3,5) its need to mark at the intersection of point 3 on x-axis and
point 5 on y-axis. How can i achieve this please guide me if i went in the
wrong way. Thanks in advance.
in wpf
I am working on WPF using c#. I am trying to display WPF Area chart with
values using WPF Toolkit. I have followed the CodeProject's KB Article and
write it like,
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" x:Class="WpfChart.MainWindow"
Title="MainWindow" Height="621.053" Width="873.684">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto" Margin="0,-28,0,28">
<Grid Height="921">
<DVC:Chart x:Name="areaChart" Title="Chart Title"
VerticalAlignment="Top" Margin="33,73,24,0" Height="582"
Background="White" >
<DVC:AreaSeries DependentValuePath="Value"
IndependentValuePath="Key" ItemsSource="{Binding}"
IsSelectionEnabled="True" Title="Weeks of
Gestation"></DVC:AreaSeries>
<DVC:Chart.Palette>
<DV:ResourceDictionaryCollection>
<ResourceDictionary>
<Style x:Key="DataPointStyle"
TargetType="Control">
<Setter Property="Background"
Value="Firebrick" />
<Setter Property="BorderBrush"
Value="Black" />
</Style>
</ResourceDictionary>
</DV:ResourceDictionaryCollection>
</DVC:Chart.Palette>
<DVC:Chart.Axes>
<!-- Add Horizontal and Vertical Axes-->
<DVC:LinearAxis ShowGridLines="True"
Orientation="Y"
Title="Y Axis Title"
Interval="5" Maximum="45" Minimum="-5"
Foreground="Black"
FontFamily="Arial Black"
FontSize="16"
FontWeight="Bold"
/>
<DVC:LinearAxis ShowGridLines="True"
Orientation="X"
Title="X-Axis Title"
Interval="4" Minimum="0" Maximum="40"
Foreground="Black"
FontFamily="Arial Black"
FontSize="16"
FontWeight="Bold"
/>
</DVC:Chart.Axes>
</DVC:Chart>
</Grid>
</ScrollViewer>
</Window>
and i write code for initialization chart data like,
private void LoadAreaChartData()
{
((AreaSeries)areaChart.Series[0]).ItemsSource =
new KeyValuePair<string, int>[]{
new KeyValuePair<string, int>("3", 5)
};
}
But it does not map the points on to the chart. I need to map the point on
to the chart like,
(X,Y)--(3,5) its need to mark at the intersection of point 3 on x-axis and
point 5 on y-axis. How can i achieve this please guide me if i went in the
wrong way. Thanks in advance.
How do I make jQuery change the DOM on another webpage in my domain?
How do I make jQuery change the DOM on another webpage in my domain?
I can't figure out how to use jQuery on the webpage I'm on to make changes
to another webpage's html in my domain. Suppose I want to change the
following at mydomain.com/changedom.html:
<body>
<p id="changehere">This is the text I want to bold.</p>
</body>
and I'm in mydomain.com/index.html and I want to run jQuery to change the
previous page as below:
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
$('http://www.mydomain.com/changedom.html p#changehere').html(<b>This is
the text I want to bold.</b>');
});
</script>
doesn't work for me. Help!
I can't figure out how to use jQuery on the webpage I'm on to make changes
to another webpage's html in my domain. Suppose I want to change the
following at mydomain.com/changedom.html:
<body>
<p id="changehere">This is the text I want to bold.</p>
</body>
and I'm in mydomain.com/index.html and I want to run jQuery to change the
previous page as below:
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
$('http://www.mydomain.com/changedom.html p#changehere').html(<b>This is
the text I want to bold.</b>');
});
</script>
doesn't work for me. Help!
How to create folder in distributed cache in hadoop?
How to create folder in distributed cache in hadoop?
Is it possible to create directory inside preexisting distributed cache
and copy files from the previous directory to new directory i have
created?
Is it possible to create directory inside preexisting distributed cache
and copy files from the previous directory to new directory i have
created?
Subscribe to:
Comments (Atom)